aboutsummaryrefslogtreecommitdiff
path: root/sysdeps/linux-gnu/mksyscallent_s390
blob: 73416d9b88b6ebd757a06902a615e805f4a26f7c (plain)
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
#!/usr/bin/perl
#
# Generate syscall table for s390/s390x
#
# Use this on arch/s390/kernel/syscall.s after removing the first few
# nonsyscall lines.
#
# cat syscall.s | mksyscallent_s390 > syscalls31.h
# cat syscall.s | mksyscallent_s390 -x > syscalls64.h
#

use Getopt::Std;
use integer;
getopts('x');
$i = 0;
$s390x = 0;
$opt_x and $s390x = 1;

while (<>) {
	chomp;

	if ($s390x==1) {
		   s/^SYSCALL\([^,]*,//;
	} else {
	           s/^SYSCALL\(//;
	}

	s/,.*//;
	s/^sys_//;
	s/^s390[x]*_//;
	s/_glue$//;
	s/^ni_syscall.*/$i/i;
	$len = 32 - length();
	$tab = $len / 8;
	$space = $len % 8;
	print "    \"$_\"," ," " x $space , "\t" x $tab, " \/* $i \*\/\n";
	$i++;
}