diff options
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/checksyscalls.sh | 118 |
1 files changed, 118 insertions, 0 deletions
diff --git a/scripts/checksyscalls.sh b/scripts/checksyscalls.sh new file mode 100755 index 000000000000..f98171f5a3df --- /dev/null +++ b/scripts/checksyscalls.sh | |||
@@ -0,0 +1,118 @@ | |||
1 | #!/bin/sh | ||
2 | # | ||
3 | # Check if current architecture are missing any function calls compared | ||
4 | # to i386. | ||
5 | # i386 define a number of legacy system calls that are i386 specific | ||
6 | # and listed below so they are ignored. | ||
7 | # | ||
8 | # Usage: | ||
9 | # syscallchk gcc gcc-options | ||
10 | # | ||
11 | |||
12 | ignore_list() { | ||
13 | cat << EOF | ||
14 | #include <asm/types.h> | ||
15 | #include <asm/unistd.h> | ||
16 | |||
17 | /* System calls for 32-bit kernels only */ | ||
18 | #if BITS_PER_LONG == 64 | ||
19 | #define __IGNORE_sendfile64 | ||
20 | #define __IGNORE_ftruncate64 | ||
21 | #define __IGNORE_truncate64 | ||
22 | #define __IGNORE_stat64 | ||
23 | #define __IGNORE_lstat64 | ||
24 | #define __IGNORE_fstat64 | ||
25 | #define __IGNORE_fcntl64 | ||
26 | #define __IGNORE_fadvise64_64 | ||
27 | #define __IGNORE_fstatat64 | ||
28 | #define __IGNORE_fstatfs64 | ||
29 | #define __IGNORE_statfs64 | ||
30 | #endif | ||
31 | |||
32 | /* i386-specific or historical system calls */ | ||
33 | #define __IGNORE_break | ||
34 | #define __IGNORE_stty | ||
35 | #define __IGNORE_gtty | ||
36 | #define __IGNORE_ftime | ||
37 | #define __IGNORE_prof | ||
38 | #define __IGNORE_lock | ||
39 | #define __IGNORE_mpx | ||
40 | #define __IGNORE_ulimit | ||
41 | #define __IGNORE_profil | ||
42 | #define __IGNORE_ioperm | ||
43 | #define __IGNORE_iopl | ||
44 | #define __IGNORE_idle | ||
45 | #define __IGNORE_modify_ldt | ||
46 | #define __IGNORE_ugetrlimit | ||
47 | #define __IGNORE_mmap2 | ||
48 | #define __IGNORE_vm86 | ||
49 | #define __IGNORE_vm86old | ||
50 | #define __IGNORE_set_thread_area | ||
51 | #define __IGNORE_get_thread_area | ||
52 | #define __IGNORE_madvise1 | ||
53 | #define __IGNORE_oldstat | ||
54 | #define __IGNORE_oldfstat | ||
55 | #define __IGNORE_oldlstat | ||
56 | #define __IGNORE_oldolduname | ||
57 | #define __IGNORE_olduname | ||
58 | #define __IGNORE_umount2 | ||
59 | #define __IGNORE_umount | ||
60 | #define __IGNORE_waitpid | ||
61 | #define __IGNORE_stime | ||
62 | #define __IGNORE_nice | ||
63 | #define __IGNORE_signal | ||
64 | #define __IGNORE_sigaction | ||
65 | #define __IGNORE_sgetmask | ||
66 | #define __IGNORE_sigsuspend | ||
67 | #define __IGNORE_sigpending | ||
68 | #define __IGNORE_ssetmask | ||
69 | #define __IGNORE_readdir | ||
70 | #define __IGNORE_socketcall | ||
71 | #define __IGNORE_ipc | ||
72 | #define __IGNORE_sigreturn | ||
73 | #define __IGNORE_sigprocmask | ||
74 | #define __IGNORE_bdflush | ||
75 | #define __IGNORE__llseek | ||
76 | #define __IGNORE__newselect | ||
77 | #define __IGNORE_create_module | ||
78 | #define __IGNORE_delete_module | ||
79 | #define __IGNORE_query_module | ||
80 | #define __IGNORE_get_kernel_syms | ||
81 | /* ... including the "new" 32-bit uid syscalls */ | ||
82 | #define __IGNORE_lchown32 | ||
83 | #define __IGNORE_getuid32 | ||
84 | #define __IGNORE_getgid32 | ||
85 | #define __IGNORE_geteuid32 | ||
86 | #define __IGNORE_getegid32 | ||
87 | #define __IGNORE_setreuid32 | ||
88 | #define __IGNORE_setregid32 | ||
89 | #define __IGNORE_getgroups32 | ||
90 | #define __IGNORE_setgroups32 | ||
91 | #define __IGNORE_fchown32 | ||
92 | #define __IGNORE_setresuid32 | ||
93 | #define __IGNORE_getresuid32 | ||
94 | #define __IGNORE_setresgid32 | ||
95 | #define __IGNORE_getresgid32 | ||
96 | #define __IGNORE_chown32 | ||
97 | #define __IGNORE_setuid32 | ||
98 | #define __IGNORE_setgid32 | ||
99 | #define __IGNORE_setfsuid32 | ||
100 | #define __IGNORE_setfsgid32 | ||
101 | |||
102 | /* Unmerged syscalls for AFS, STREAMS, etc. */ | ||
103 | #define __IGNORE_afs_syscall | ||
104 | #define __IGNORE_getpmsg | ||
105 | #define __IGNORE_putpmsg | ||
106 | #define __IGNORE_vserver | ||
107 | EOF | ||
108 | } | ||
109 | |||
110 | syscall_list() { | ||
111 | sed -n -e '/^\#define/ { s/[^_]*__NR_\([^[:space:]]*\).*/\ | ||
112 | \#if !defined \(__NR_\1\) \&\& !defined \(__IGNORE_\1\)\ | ||
113 | \#warning syscall \1 not implemented\ | ||
114 | \#endif/p }' $1 | ||
115 | } | ||
116 | |||
117 | (ignore_list && syscall_list ${srctree}/include/asm-i386/unistd.h) | \ | ||
118 | $* -E -x c - > /dev/null | ||