mksyscallent_s390 revision dcbfb8ee67323014098df9fb5a535d1099e2e2ec
1#!/usr/bin/perl
2#
3# Generate syscall table for s390/s390x
4#
5# Use this on arch/s390/kernel/syscall.s after removing the first few
6# nonsyscall lines.
7#
8# cat syscall.s | mksyscallent_s390 > syscalls31.h
9# cat syscall.s | mksyscallent_s390 -x > syscalls64.h
10#
11
12use Getopt::Std;
13use integer;
14getopts('x');
15$i = 0;
16$s390x = 0;
17$opt_x and $s390x = 1;
18
19while (<>) {
20	chomp;
21
22	if ($s390x==1) {
23		   s/^SYSCALL\([^,]*,//;
24	} else {
25	           s/^SYSCALL\(//;
26	}
27
28	s/,.*//;
29	s/^sys_//;
30	s/^s390[x]*_//;
31	s/_glue$//;
32	s/^ni_syscall.*/$i/i;
33	$len = 32 - length();
34	$tab = $len / 8;
35	$space = $len % 8;
36	print "    \"$_\"," ," " x $space , "\t" x $tab, " \/* $i \*\/\n";
37	$i++;
38}
39