forked from hrw/syscalls-table
-
Notifications
You must be signed in to change notification settings - Fork 4
/
do_all_tables.sh
executable file
·73 lines (65 loc) · 1.47 KB
/
do_all_tables.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
#!/bin/bash
KERNELSRC=$1
export_headers()
{
make -s -C ${KERNELSRC} ARCH=${arch} O=${PWD}/headers headers_install
}
generate_table()
{
echo $arch
gcc list-syscalls.c -U__LP64__ -U__ILP32__ -U__i386__ -D${arch^^} \
-D__${arch}__ ${extraflags} -I headers/usr/include/ -o list-syscalls
./list-syscalls > "tables/syscalls-$arch"
}
for archdir in $KERNELSRC/arch/*
do
arch=`basename $archdir`
case ${arch} in
Kconfig)
continue;
;;
um)
continue;
;;
esac
export_headers
case ${arch} in
arm)
arch=armoabi extraflags= generate_table
arch=arm extraflags=-D__ARM_EABI__ generate_table
;;
mips)
arch=mipso32 extraflags=-D_MIPS_SIM=_MIPS_SIM_ABI32 generate_table
arch=mips64n32 extraflags=-D_MIPS_SIM=_MIPS_SIM_NABI32 generate_table
arch=mips64 extraflags=-D_MIPS_SIM=_MIPS_SIM_ABI64 generate_table
;;
tile)
generate_table
arch=tile64 extraflags="-D__LP64__ -D__tilegx__" generate_table
;;
x86)
arch=i386 generate_table
arch=x32 extraflags=-D__ILP32__ generate_table
arch=x86_64 extraflags=-D__LP64__ generate_table
;;
powerpc)
generate_table
arch=powerpc64 generate_table
;;
s390)
generate_table
arch=s390x generate_table
;;
sparc)
extraflags=-D__32bit_syscall_numbers__ generate_table
arch=sparc64 extraflags=-D__arch64__ generate_table
;;
sh)
generate_table
arch=sh64 extraflags=-D__SH5__ generate_table
;;
*)
generate_table
;;
esac
done