Palacios Public Git Repository

To checkout Palacios execute

  git clone http://v3vee.org/palacios/palacios.web/palacios.git
This will give you the master branch. You probably want the devel branch or one of the release branches. To switch to the devel branch, simply execute
  cd palacios
  git checkout --track -b devel origin/devel
The other branches are similar.


Merge branch 'devel'
[palacios.git] / kitten / arch / x86_64 / kernel / syscall.c
1 #include <lwk/kernel.h>
2 #include <lwk/linkage.h>
3 #include <lwk/cache.h>
4 #include <lwk/errno.h>
5 #include <arch/asm-offsets.h>
6
7 /**
8  * This generate prototypes for all system call handlers.
9  */
10 #define __SYSCALL(nr, sym) extern long sym(void);
11 #undef _ARCH_X86_64_UNISTD_H
12 #include <arch/unistd.h>
13
14 /**
15  * Setup for the include of <arch/unistd.h> in the sys_call_table[]
16  * definition below.
17  */
18 #undef __SYSCALL
19 #define __SYSCALL(nr, sym) [ nr ] = sym, 
20 #undef _ARCH_X86_64_UNISTD_H
21
22 /**
23  * Prototype for system call handler functions.
24  */
25 typedef long (*syscall_ptr_t)(void); 
26
27 /**
28  * Dummy handler for unimplemented system calls.
29  */
30 long syscall_not_implemented(void)
31 {
32         unsigned long syscall_number;
33
34         /* On entry to function, syscall # is in %rax register */
35         asm volatile("mov %%rax, %0" : "=r"(syscall_number)::"%rax");
36
37         printk(KERN_DEBUG "System call not implemented! "
38                           "(syscall_number=%lu)\n", syscall_number);
39 //      return -ENOSYS;
40         return 0;
41 }
42
43 /**
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.
47  */
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>
51 };
52