1G pages support for CPU
[bochs-mirror.git] / bx_debug / make-syscalls-linux.pl
blob2ffc63ac7576ff8789399f6184355c98af5f1c00
1 #!/usr/bin/perl
3 # tested with linux 2.2.14
4 # reads <asm/unistd.h>, outputs syscalls-linux.h
6 $date = `date`;
7 print <<EOF;
8 //////////////////////////////////////////////////////////////////////////////
9 // Linux system call table
10 //////////////////////////////////////////////////////////////////////////////
12 // Format for each entry:
13 // DEF_LINUX_SYSCALL(syscall_number, "syscall_name")
14 // This file can be regenerated with the following command:
16 // ./make-syscalls-linux.pl < /usr/include/asm/unistd.h > syscalls-linux.h
18 EOF
20 $max = 0;
21 while (<STDIN>) {
22 $line = $_;
23 next unless /#define __NR_[a-z]/;
24 s/.*NR_//;
25 undef $number;
26 ($name, $number) = split (/[\s]+/);
27 if ((length $number) < 1) {
28 die "bad line: $line";
30 if ($number > $max) { $max = $number; }
31 print "DEF_SYSCALL($number, \"$name\")\n";
34 print "#define N_SYSCALLS $max\n";