diff options
author | Andi Kleen <ak@suse.de> | 2007-05-02 19:27:18 +0200 |
---|---|---|
committer | Andi Kleen <andi@basil.nowhere.org> | 2007-05-02 19:27:18 +0200 |
commit | 57a4f91ae5571edd7c0428285d8df16bb8bf5f40 (patch) | |
tree | 9e0ec8bf06c8ec44b4fb6f6219f1cfeb8f605156 /arch | |
parent | [PATCH] i386: check capability (diff) | |
download | linux-57a4f91ae5571edd7c0428285d8df16bb8bf5f40.tar.xz linux-57a4f91ae5571edd7c0428285d8df16bb8bf5f40.zip |
[PATCH] x86-64: Auto compute __NR_syscall_max at compile time
No need to maintain it anymore
Signed-off-by: Andi Kleen <ak@suse.de>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/x86_64/kernel/asm-offsets.c | 10 | ||||
-rw-r--r-- | arch/x86_64/kernel/syscall.c | 1 |
2 files changed, 11 insertions, 0 deletions
diff --git a/arch/x86_64/kernel/asm-offsets.c b/arch/x86_64/kernel/asm-offsets.c index 96687e2beb2c..778953bc636c 100644 --- a/arch/x86_64/kernel/asm-offsets.c +++ b/arch/x86_64/kernel/asm-offsets.c @@ -21,6 +21,14 @@ #define BLANK() asm volatile("\n->" : : ) +#define __NO_STUBS 1 +#undef __SYSCALL +#undef _ASM_X86_64_UNISTD_H_ +#define __SYSCALL(nr, sym) [nr] = 1, +static char syscalls[] = { +#include <asm/unistd.h> +}; + int main(void) { #define ENTRY(entry) DEFINE(tsk_ ## entry, offsetof(struct task_struct, entry)) @@ -71,5 +79,7 @@ int main(void) DEFINE(TSS_ist, offsetof(struct tss_struct, ist)); BLANK(); DEFINE(crypto_tfm_ctx_offset, offsetof(struct crypto_tfm, __crt_ctx)); + BLANK(); + DEFINE(__NR_syscall_max, sizeof(syscalls) - 1); return 0; } diff --git a/arch/x86_64/kernel/syscall.c b/arch/x86_64/kernel/syscall.c index 213fd6ab789d..63d592c276cc 100644 --- a/arch/x86_64/kernel/syscall.c +++ b/arch/x86_64/kernel/syscall.c @@ -3,6 +3,7 @@ #include <linux/linkage.h> #include <linux/sys.h> #include <linux/cache.h> +#include <asm/asm-offsets.h> #define __NO_STUBS |