1 #include <lwk/kernel.h>
2 #include <lwk/linkage.h>
5 #include <arch/asm-offsets.h>
8 * This generate prototypes for all system call handlers.
10 #define __SYSCALL(nr, sym) extern long sym(void);
11 #undef _ARCH_X86_64_UNISTD_H
12 #include <arch/unistd.h>
15 * Setup for the include of <arch/unistd.h> in the sys_call_table[]
19 #define __SYSCALL(nr, sym) [ nr ] = sym,
20 #undef _ARCH_X86_64_UNISTD_H
23 * Prototype for system call handler functions.
25 typedef long (*syscall_ptr_t)(void);
28 * Dummy handler for unimplemented system calls.
30 long syscall_not_implemented(void)
32 unsigned long syscall_number;
34 /* On entry to function, syscall # is in %rax register */
35 asm volatile("mov %%rax, %0" : "=r"(syscall_number)::"%rax");
37 printk(KERN_DEBUG "System call not implemented! "
38 "(syscall_number=%lu)\n", syscall_number);
44 * This is the system call table. The system_call() function in entry.S
45 * uses this table to determine the handler function to call for each
46 * system call. The table is indexed by system call number.
48 const syscall_ptr_t sys_call_table[__NR_syscall_max+1] = {
49 [0 ... __NR_syscall_max] = syscall_not_implemented,
50 #include <arch/unistd.h>