[LV] [PATCH] Interpret the syscall argument count as for CALLS
The number of function arguments as pushed on the stack by the CALLS instruction is defined by the architecture to be the least significant byte of the longword pointed to by %AP after the call has been made. Make the syscall argument count be interpreted the same way so that trivial library syscall wrappers may simply execute CHMK reusing the argument area of their callers with no need for the overhead to make a local copy. This also provides for special handling of values outside the defined <255:0> range. Signed-off-by: Maciej W. Rozycki <macro@linux-mips.org> --- Please apply. Maciej patch-mips-2.6.25-20080422-vax-scall-args-2 diff -up --recursive --new-file linux-mips-2.6.25-20080422.macro/arch/vax/kernel/syscall.c linux-mips-2.6.25-20080422/arch/vax/kernel/syscall.c --- linux-mips-2.6.25-20080422.macro/arch/vax/kernel/syscall.c 2008-05-01 00:00:00.000000000 +0000 +++ linux-mips-2.6.25-20080422/arch/vax/kernel/syscall.c 2009-05-01 17:15:30.000000000 +0000 @@ -313,6 +313,7 @@ void syscall_handler(struct pt_regs *reg regs->r0 = -EFAULT; return; } + nr_args &= 0xff; /* * The SP value in the pt_regs structure should really @@ -323,7 +324,7 @@ void syscall_handler(struct pt_regs *reg /* * Kernel Mode Syscall Handling - no need to check access to arguments. */ - nr_args = *user_ap; + nr_args = *user_ap & 0xff; } #ifdef CONFIG_DEBUG_VAX_CHECK_CHMx_ARGS _______________________________________________ Linux-Vax mailing list Linux-Vax@mail.pergamentum.com http://mail.pergamentum.com/mailman/listinfo/linux-vax
Teilnehmer (1)
-
Maciej W. Rozycki