Generate NRs for ARM-specific syscalls (#254)

This commit is contained in:
Yan
2017-05-15 15:11:54 -04:00
committed by GitHub
parent 42955387a5
commit 2202b0a27d
2 changed files with 20 additions and 1 deletions

View File

@@ -2,7 +2,7 @@
#
# AUTOGENERATED, DO NOT EDIT
#
# From version: 4.11.0
# From version: 4.11
#
i386 = {
@@ -1089,4 +1089,9 @@ armv7 = {
395: "sys_pkey_alloc",
396: "sys_pkey_free",
397: "sys_statx",
983041: "sys_ARM_NR_breakpoint",
983042: "sys_ARM_NR_cacheflush",
983043: "sys_ARM_NR_usr26",
983044: "sys_ARM_NR_usr32",
983045: "sys_ARM_NR_set_tls",
}

View File

@@ -25,6 +25,18 @@ arch_tables = {
'amd64': 'arch/x86/entry/syscalls/syscall_64.tbl',
}
__ARM_NR_BASE = 0xf0000
additional_syscalls = {
'armv7': [
('sys_ARM_NR_breakpoint', __ARM_NR_BASE + 1),
('sys_ARM_NR_cacheflush', __ARM_NR_BASE + 2),
('sys_ARM_NR_usr26', __ARM_NR_BASE + 3),
('sys_ARM_NR_usr32', __ARM_NR_BASE + 4),
('sys_ARM_NR_set_tls', __ARM_NR_BASE + 5),
]
}
if __name__=='__main__':
parser = argparse.ArgumentParser(description='Generate syscall tables')
@@ -55,6 +67,8 @@ if __name__=='__main__':
continue
num, abi, name, entry = columns[:4]
output.write(' {}: "{}",\n'.format(num, entry))
for entry, num in additional_syscalls.get(arch, {}):
output.write(' {}: "{}",\n'.format(num, entry))
output.write('}\n')