diff options
author | Elliott Hughes <enh@google.com> | 2014-02-11 20:01:11 -0800 |
---|---|---|
committer | Elliott Hughes <enh@google.com> | 2014-02-11 22:16:04 -0800 |
commit | 199346a2abd8b6ba282e1fe291cc3766fa921f40 (patch) | |
tree | 9ee2feb4ffcb2be771e2b733b1338c8755bd306a /libc/kernel/tools | |
parent | 022885e2fad5ef9643e05d80c6f50a2a90bf3431 (diff) | |
download | bionic-199346a2abd8b6ba282e1fe291cc3766fa921f40.zip bionic-199346a2abd8b6ba282e1fe291cc3766fa921f40.tar.gz bionic-199346a2abd8b6ba282e1fe291cc3766fa921f40.tar.bz2 |
Fix NSIG.
Our sigset_t definition hasn't been tied to our NSIG definition since we
switched to uapi headers, so we can now fix it without breaking the LP32 ABI.
The kernel uapi headers define and use _NSIG, so we need to have our scripts
rename the kernel's definitions out of the way, then we can define _NSIG
and NSIG in terms of the kernel's off-by-one value.
Bug: 12938442
Change-Id: Ic7c86fd5be5ad1d822f7b2b1d88c8a0d70a1ac0f
Diffstat (limited to 'libc/kernel/tools')
-rw-r--r-- | libc/kernel/tools/cpp.py | 2 | ||||
-rw-r--r-- | libc/kernel/tools/defaults.py | 7 |
2 files changed, 7 insertions, 2 deletions
diff --git a/libc/kernel/tools/cpp.py b/libc/kernel/tools/cpp.py index 04e4256..2c40d7c 100644 --- a/libc/kernel/tools/cpp.py +++ b/libc/kernel/tools/cpp.py @@ -1521,7 +1521,7 @@ class BlockList: """replace tokens according to the given dict """ for b in self.blocks: - if not b.isDirective(): + if (not b.isDirective()) or b.isDefine(): for tok in b.tokens: if tok.id == tokIDENT: if tok.value in replacements: diff --git a/libc/kernel/tools/defaults.py b/libc/kernel/tools/defaults.py index f235803..09556c9 100644 --- a/libc/kernel/tools/defaults.py +++ b/libc/kernel/tools/defaults.py @@ -57,10 +57,15 @@ kernel_arch_token_replacements = { "mips": {"off_t":"__kernel_off_t"}, "x86": {}, } + # Replace tokens in the output according to this mapping kernel_token_replacements = { "asm": "__asm__", - "__unused": "__linux_unused", # The kernel usage of __unused conflicts with the macro defined in sys/cdefs.h + # The kernel usage of __unused for unused struct fields conflicts with the macro defined in <sys/cdefs.h>. + "__unused": "__linux_unused", + # The kernel's _NSIG/NSIG are one less than the userspace value, so we need to move them aside. + "_NSIG": "_KERNEL__NSIG", + "NSIG": "_KERNEL_NSIG", } # this is the set of known static inline functions that we want to keep |