3 # hack expression to generate arch/syscallent.h from <asm/unistd.h>
4 # It reads from stdin and writes to stdout
5 # Currently (linux-2.2.3), it works OK on i386,m68k,arm
6 # It does NOT work in mips
7 # It is untested in other architectures
15 # printf("/%s/%s/%s/%s/\n", $1, $2, $3, $4);
16 if (($1 ~ /^#define$/) && ($2 ~ /^__NR_/)) {
17 if (($3>=0) && ($3<=1000)) {
18 SYSCALL[$3]=substr($2,6);
22 } else if (($3 ~ /^__NR_SYSCALL_BASE$/) && ($4>=0) && ($4<=1000)) {
23 SYSCALL[$4]=substr($2,6);
32 for(i=0; i<=max; i++) {
36 pad = 32 - length(SYSCALL[i]);
40 printf("\t\"%s\",%*s/* %d */\n", SYSCALL[i], pad, "", i);