mirror of
https://github.com/rwinkhart/sys.git
synced 2026-08-31 22:36:44 -04:00
unix: update generation scripts for arm64/ppc64
This applies the following CLs from the syscall package: http://golang.org/cl/9962 http://golang.org/cl/9966 http://golang.org/cl/9924 It also adds arm64/ppc64 support to mkall.sh and mksysnum_linux.pl. Change-Id: I84fbfde2a2876dbf6d16c6159e847195c274b396 Reviewed-on: https://go-review.googlesource.com/10037 Reviewed-by: Rob Pike <r@golang.org>
This commit is contained in:
+15
-2
@@ -18,13 +18,26 @@ EOF
|
||||
|
||||
sub fmt {
|
||||
my ($name, $num) = @_;
|
||||
if($num > 999){
|
||||
# ignore deprecated syscalls that are no longer implemented
|
||||
# https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/tree/include/uapi/asm-generic/unistd.h?id=refs/heads/master#n716
|
||||
return;
|
||||
}
|
||||
$name =~ y/a-z/A-Z/;
|
||||
print " SYS_$name = $num;\n";
|
||||
}
|
||||
|
||||
my $prev;
|
||||
while(<>){
|
||||
if(/^#define __NR_(\w+)\s+([0-9]+)/){
|
||||
open(GCC, "gcc -E -dD $ARGV[0] |") || die "can't run gcc";
|
||||
while(<GCC>){
|
||||
if(/^#define __NR_syscalls\s+/) {
|
||||
# ignore redefinitions of __NR_syscalls
|
||||
}
|
||||
elsif(/^#define __NR_(\w+)\s+([0-9]+)/){
|
||||
$prev = $2;
|
||||
fmt($1, $2);
|
||||
}
|
||||
elsif(/^#define __NR3264_(\w+)\s+([0-9]+)/){
|
||||
$prev = $2;
|
||||
fmt($1, $2);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user