From 750be4218a36aa7e64eec92fdada3169d866b5fd Mon Sep 17 00:00:00 2001 From: Cyrill Gorcunov Date: Wed, 19 Oct 2011 13:09:01 +0400 Subject: [PATCH] Move syscall codes into separate file Signed-off-by: Cyrill Gorcunov --- include/syscall-codes.h | 27 +++++++++++++++++++++++++++ include/syscall.h | 21 +-------------------- 2 files changed, 28 insertions(+), 20 deletions(-) create mode 100644 include/syscall-codes.h diff --git a/include/syscall-codes.h b/include/syscall-codes.h new file mode 100644 index 000000000..fc7578011 --- /dev/null +++ b/include/syscall-codes.h @@ -0,0 +1,27 @@ +#ifndef CR_SYSCALL_CODES_H_ +#define CR_SYSCALL_CODES_H_ + +#ifdef CONFIG_X86_64 + +#define __NR_read 0 +#define __NR_write 1 +#define __NR_open 2 +#define __NR_close 3 +#define __NR_lseek 8 +#define __NR_mmap 9 +#define __NR_mprotect 10 +#define __NR_munmap 11 +#define __NR_brk 12 +#define __NR_mincore 27 +#define __NR_dup 32 +#define __NR_dup2 33 +#define __NR_pause 34 +#define __NR_nanosleep 35 +#define __NR_getpid 39 +#define __NR_exit 60 + +#else /* CONFIG_X86_64 */ +# error x86-32 bit mode not yet implemented +#endif /* CONFIG_X86_64 */ + +#endif /* CR_SYSCALL_CODES_H_ */ diff --git a/include/syscall.h b/include/syscall.h index 9d7bf9ec8..8f4cae812 100644 --- a/include/syscall.h +++ b/include/syscall.h @@ -4,6 +4,7 @@ #include #include "compiler.h" +#include "syscall-codes.h" #ifdef CONFIG_X86_64 @@ -98,26 +99,6 @@ static long syscall6(int nr, unsigned long arg0, unsigned long arg1, return ret; } -/* - * syscall codes - */ -#define __NR_read 0 -#define __NR_write 1 -#define __NR_open 2 -#define __NR_close 3 -#define __NR_lseek 8 -#define __NR_mmap 9 -#define __NR_mprotect 10 -#define __NR_munmap 11 -#define __NR_brk 12 -#define __NR_mincore 27 -#define __NR_dup 32 -#define __NR_dup2 33 -#define __NR_pause 34 -#define __NR_nanosleep 35 -#define __NR_getpid 39 -#define __NR_exit 60 - static unsigned long sys_pause(void) { return syscall0(__NR_pause);