[PATCH] x86_64: Eliminate IA32_NR_syscalls define
authorAndi Kleen <ak@suse.de>
Fri, 7 Apr 2006 17:50:31 +0000 (19:50 +0200)
committerLinus Torvalds <torvalds@g5.osdl.org>
Sun, 9 Apr 2006 18:53:53 +0000 (11:53 -0700)
Or rather compute it based on the table length automatically.

This also has the intended side effect of not warning for new system calls
anymore.

Signed-off-by: Andi Kleen <ak@suse.de>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
arch/x86_64/ia32/ia32entry.S
include/asm-x86_64/ia32_unistd.h

index 35b2fac..393dc83 100644 (file)
@@ -15,6 +15,8 @@
 #include <asm/vsyscall32.h>
 #include <linux/linkage.h>
 
+#define IA32_NR_syscalls ((ia32_syscall_end - ia32_sys_call_table)/8)
+
        .macro IA32_ARG_FIXUP noebp=0
        movl    %edi,%r8d
        .if \noebp
@@ -109,8 +111,8 @@ ENTRY(ia32_sysenter_target)
        CFI_REMEMBER_STATE
        jnz  sysenter_tracesys
 sysenter_do_call:      
-       cmpl    $(IA32_NR_syscalls),%eax
-       jae     ia32_badsys
+       cmpl    $(IA32_NR_syscalls-1),%eax
+       ja      ia32_badsys
        IA32_ARG_FIXUP 1
        call    *ia32_sys_call_table(,%rax,8)
        movq    %rax,RAX-ARGOFFSET(%rsp)
@@ -210,8 +212,8 @@ ENTRY(ia32_cstar_target)
        CFI_REMEMBER_STATE
        jnz   cstar_tracesys
 cstar_do_call: 
-       cmpl $IA32_NR_syscalls,%eax
-       jae  ia32_badsys
+       cmpl $IA32_NR_syscalls-1,%eax
+       ja  ia32_badsys
        IA32_ARG_FIXUP 1
        call *ia32_sys_call_table(,%rax,8)
        movq %rax,RAX-ARGOFFSET(%rsp)
@@ -296,8 +298,8 @@ ENTRY(ia32_syscall)
        testl $(_TIF_SYSCALL_TRACE|_TIF_SYSCALL_AUDIT|_TIF_SECCOMP),threadinfo_flags(%r10)
        jnz ia32_tracesys
 ia32_do_syscall:       
-       cmpl $(IA32_NR_syscalls),%eax
-       jae  ia32_badsys
+       cmpl $(IA32_NR_syscalls-1),%eax
+       ja  ia32_badsys
        IA32_ARG_FIXUP
        call *ia32_sys_call_table(,%rax,8) # xxx: rip relative
 ia32_sysret:
@@ -691,6 +693,3 @@ ia32_sys_call_table:
        .quad compat_sys_set_robust_list
        .quad compat_sys_get_robust_list
 ia32_syscall_end:              
-       .rept IA32_NR_syscalls-(ia32_syscall_end-ia32_sys_call_table)/8
-               .quad ni_syscall
-       .endr
index 34ad297..b4f4b17 100644 (file)
 #define __NR_ia32_ppoll                        309
 #define __NR_ia32_unshare              310
 
-#define IA32_NR_syscalls 311   /* must be > than biggest syscall! */
-
 #endif /* _ASM_X86_64_IA32_UNISTD_H_ */