1 # Copyright (C) 2013-2014 Free Software Foundation, Inc.
3 # Copying and distribution of this file, with or without modification,
4 # are permitted in any medium without royalty provided the copyright
5 # notice and this notice are preserved. This file is offered as-is,
6 # without any warranty.
17 <!-- Copyright (C) 2009-%s Free Software Foundation, Inc.
19 Copying and distribution of this file, with or without modification,
20 are permitted in any medium without royalty provided the copyright
21 notice and this notice are preserved. This file is offered as-is,
22 without any warranty. -->
24 <!DOCTYPE feature SYSTEM "gdb-syscalls.dtd">
26 <!-- This file was generated using the following file:
30 The file mentioned above belongs to the Linux Kernel.
31 Some small hand-edits were made. -->
33 <syscalls_info>""" % (time.strftime("%Y"), infname))
35 def record(name, number, comment=None):
36 #nm = 'name="%s"' % name
37 #s = ' <syscall %-30s number="%d"/>' % (nm, number)
38 s = ' <syscall name="%s" number="%d"/>' % (name, number)
40 s += ' <!-- %s -->' % comment
44 m = re.match(r'^#define __NR_(\w+)\s+\(__NR_SYSCALL_BASE\+\s*(\d+)\)',
47 record(m.group(1), int(m.group(2)))
50 m = re.match(r'^\s+/\* (\d+) was sys_(\w+) \*/$', line)
52 record(m.group(2), int(m.group(1)), 'removed')
54 m = re.match(r'^#define __ARM_NR_(\w+)\s+\(__ARM_NR_BASE\+\s*(\d+)\)',
57 record('ARM_'+m.group(1), 0x0f0000+int(m.group(2)))
60 print('</syscalls_info>')