aboutsummaryrefslogtreecommitdiff
path: root/sysdeps/linux-gnu/mksyscallent_s390
blob: 1964d1491c34f6261f2477bfcac8d6e0692c0adf (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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
#!/usr/bin/perl
# This file is part of ltrace.
# Copyright (C) 2006 Heiko Carstens, IBM Corporation
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
# published by the Free Software Foundation; either version 2 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
# General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
# 02110-1301 USA

#
# 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++;
}