Skip to content
This repository was archived by the owner on Feb 9, 2023. It is now read-only.

Commit de25c71

Browse files
committed
Broken, but working, ptregs system call conversion for x86-64
Not-yet-signed-off-by: Linus Torvalds <[email protected]>
1 parent 3621644 commit de25c71

14 files changed

Lines changed: 820 additions & 757 deletions

File tree

arch/x86/entry/common.c

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -284,9 +284,7 @@ __visible void do_syscall_64(unsigned long nr, struct pt_regs *regs)
284284
nr &= __SYSCALL_MASK;
285285
if (likely(nr < NR_syscalls)) {
286286
nr = array_index_nospec(nr, NR_syscalls);
287-
regs->ax = sys_call_table[nr](
288-
regs->di, regs->si, regs->dx,
289-
regs->r10, regs->r8, regs->r9);
287+
regs->ax = sys_call_table[nr](regs);
290288
}
291289

292290
syscall_return_slowpath(regs);
@@ -327,10 +325,7 @@ static __always_inline void do_syscall_32_irqs_on(struct pt_regs *regs)
327325
* the high bits are zero. Make sure we zero-extend all
328326
* of the args.
329327
*/
330-
regs->ax = ia32_sys_call_table[nr](
331-
(unsigned int)regs->bx, (unsigned int)regs->cx,
332-
(unsigned int)regs->dx, (unsigned int)regs->si,
333-
(unsigned int)regs->di, (unsigned int)regs->bp);
328+
regs->ax = ia32_sys_call_table[nr](regs);
334329
}
335330

336331
syscall_return_slowpath(regs);

arch/x86/entry/syscall_32.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,13 @@
77
#include <asm/asm-offsets.h>
88
#include <asm/syscall.h>
99

10-
#define __SYSCALL_I386(nr, sym, qual) extern asmlinkage long sym(unsigned long, unsigned long, unsigned long, unsigned long, unsigned long, unsigned long) ;
10+
#define __SYSCALL_I386(nr, sym, qual) extern asmlinkage long sym(struct pt_regs *);
1111
#include <asm/syscalls_32.h>
1212
#undef __SYSCALL_I386
1313

1414
#define __SYSCALL_I386(nr, sym, qual) [nr] = sym,
1515

16-
extern asmlinkage long sys_ni_syscall(unsigned long, unsigned long, unsigned long, unsigned long, unsigned long, unsigned long);
16+
extern asmlinkage long sys_ni_syscall(struct pt_regs *);
1717

1818
__visible const sys_call_ptr_t ia32_sys_call_table[__NR_syscall_compat_max+1] = {
1919
/*

arch/x86/entry/syscall_64.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,13 @@
77
#include <asm/asm-offsets.h>
88
#include <asm/syscall.h>
99

10-
#define __SYSCALL_64(nr, sym, qual) extern asmlinkage long sym(unsigned long, unsigned long, unsigned long, unsigned long, unsigned long, unsigned long);
10+
#define __SYSCALL_64(nr, sym, qual) extern asmlinkage long sym(struct pt_regs *);
1111
#include <asm/syscalls_64.h>
1212
#undef __SYSCALL_64
1313

1414
#define __SYSCALL_64(nr, sym, qual) [nr] = sym,
1515

16-
extern long sys_ni_syscall(unsigned long, unsigned long, unsigned long, unsigned long, unsigned long, unsigned long);
16+
extern long sys_ni_syscall(struct pt_regs *);
1717

1818
asmlinkage const sys_call_ptr_t sys_call_table[__NR_syscall_max+1] = {
1919
/*

0 commit comments

Comments
 (0)