diff options
author | Elliott Hughes <enh@google.com> | 2013-09-24 00:30:25 -0700 |
---|---|---|
committer | Elliott Hughes <enh@google.com> | 2013-09-24 00:35:31 -0700 |
commit | 5e52279256e9faa25378edf2ed40c18983ed6015 (patch) | |
tree | 11619887c13c2d73da74d0b545321f03dfb69d90 /libc/tools/bionic_utils.py | |
parent | 43e5baddbcaf571c1a74149c53d1e70a5a2c9de3 (diff) | |
download | bionic-5e52279256e9faa25378edf2ed40c18983ed6015.zip bionic-5e52279256e9faa25378edf2ed40c18983ed6015.tar.gz bionic-5e52279256e9faa25378edf2ed40c18983ed6015.tar.bz2 |
Simplify the SYSCALLS.TXT format.
This will make addition of new architectures less unpleasant.
Change-Id: I77c866a63b686e8e70709d08fcf52e8a2d37310a
Diffstat (limited to 'libc/tools/bionic_utils.py')
-rw-r--r-- | libc/tools/bionic_utils.py | 47 |
1 files changed, 20 insertions, 27 deletions
diff --git a/libc/tools/bionic_utils.py b/libc/tools/bionic_utils.py index dccf9e3..baa41be 100644 --- a/libc/tools/bionic_utils.py +++ b/libc/tools/bionic_utils.py @@ -51,7 +51,7 @@ class SysCallsTxtParser: """ parse a syscall spec line. line processing, format is - return type func_name[:syscall_name[:call_id]] ( [paramlist] ) (syscall_number[,syscall_number_x86])|stub + return type func_name[:syscall_name[:call_id]] ( [paramlist] ) architecture_list """ pos_lparen = line.find('(') E = self.E @@ -102,34 +102,27 @@ class SysCallsTxtParser: syscall_params = [] params = "void" - number = line[pos_rparen+1:].strip() - if number == "stub": - syscall_common = -1 - syscall_arm = -1 - syscall_x86 = -1 - syscall_mips = -1 + # Parse the architecture list. + syscall_common = -1 + syscall_arm = -1 + syscall_x86 = -1 + syscall_mips = -1 + arch_list = line[pos_rparen+1:].strip() + if arch_list == "custom": + pass + elif arch_list == "all": + syscall_common = 1 else: - try: - if number[0] == '#': - number = number[1:].strip() - numbers = string.split(number,',') - if len(numbers) == 1: - syscall_common = int(numbers[0]) - syscall_arm = -1 - syscall_x86 = -1 - syscall_mips = -1 + for arch in string.split(arch_list, ','): + if arch == "arm": + syscall_arm = 1 + elif arch == "x86": + syscall_x86 = 1 + elif arch == "mips": + syscall_mips = 1 else: - if len(numbers) == 3: - syscall_common = -1 - syscall_arm = int(numbers[0]) - syscall_x86 = int(numbers[1]) - syscall_mips = int(numbers[2]) - else: - E("invalid syscall number format in '%s'" % line) - return - except: - E("invalid syscall number in '%s'" % line) - return + E("invalid syscall architecture list in '%s'" % line) + return global verbose if verbose >= 2: |