X-Git-Url: https://git.openpandora.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=arch%2Fum%2Fkernel%2Fskas%2Fsyscall.c;h=f5173e1ec3ac0b7f7bf7ccfe86a2d5a63b60e3b8;hb=a6f039869ff87e0a8d621e31d14bbb120c1dfa93;hp=8582c1331048a00fb8024c39c31bf5bbcdaf4083;hpb=ba180fd437156f7fd8cfb2fdd021d949eeef08d6;p=pandora-kernel.git diff --git a/arch/um/kernel/skas/syscall.c b/arch/um/kernel/skas/syscall.c index 8582c1331048..f5173e1ec3ac 100644 --- a/arch/um/kernel/skas/syscall.c +++ b/arch/um/kernel/skas/syscall.c @@ -9,6 +9,9 @@ #include "sysdep/ptrace.h" #include "sysdep/syscalls.h" +extern int syscall_table_size; +#define NR_SYSCALLS (syscall_table_size / sizeof(void *)) + void handle_syscall(struct uml_pt_regs *r) { struct pt_regs *regs = container_of(r, struct pt_regs, regs); @@ -17,9 +20,6 @@ void handle_syscall(struct uml_pt_regs *r) syscall_trace(r, 0); - current->thread.nsyscalls++; - nsyscalls++; - /* * This should go in the declaration of syscall, but when I do that, * strace -f -c bash -c 'ls ; ls' breaks, sometimes not tracing @@ -30,11 +30,11 @@ void handle_syscall(struct uml_pt_regs *r) * in case it's a compiler bug. */ syscall = UPT_SYSCALL_NR(r); - if ((syscall >= NR_syscalls) || (syscall < 0)) + if ((syscall >= NR_SYSCALLS) || (syscall < 0)) result = -ENOSYS; else result = EXECUTE_SYSCALL(syscall, regs); - REGS_SET_SYSCALL_RETURN(r->regs, result); + REGS_SET_SYSCALL_RETURN(r->gp, result); syscall_trace(r, 1); }