History log of /bionic/libc/kernel/tools/cpp.py
Revision Date Author Comments
fddbafdc0a63a1b4c5e9252719a913197a4eecfa 01-May-2014 Elliott Hughes <enh@google.com> Keep the kernel header scrubber's data structures in sync.

If you rewrite the tokens of a #if you need to rewrite the expression to match
because either might be used later. This was showing up as SIGRTMAX being
rewritten in a #define but not in the #ifndef that guarded it, for which case
I've added a unit test.

Change-Id: I6929675461a1afe272edd667594529fd84a3dc4d
199346a2abd8b6ba282e1fe291cc3766fa921f40 12-Feb-2014 Elliott Hughes <enh@google.com> 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
1198fd38645ff94bf48daae10f8b74903444badc 21-Nov-2013 Elliott Hughes <enh@google.com> Add support for the ternary operator to the header scrubber.

Used in various uapi headers.

Change-Id: Id0f862d2adc7ddc9727e8a29160d5435f8d547c3
40596aa0054bcfa76148f55321bf4b979e2242be 05-Nov-2013 Elliott Hughes <enh@google.com> Make cpp.py less braindead.

The old code ignored operator precedence (!), despite having two tables
of operator precedence. The code's still pretty awful, but I've cleaned
it up enough to fix this, the most important bug.

This patch lets us correctly clean the uapi unistd.h, stat.h, and swab.h files,
and also fixes the mess we were already making of various old kernel
header files. I've added a bunch more tests, fixed the existing tests that
the existing script was already failing (!), and changed the script so that
the tests are run every time the script is run.

We can probably remove some of the old kernel header files that we were
parsing incorrectly, but we can worry about that later.

Bug: 11253477
Change-Id: Ie66c65b3a7ae13b4e98ed8038a6a534f06eae0e5
d3e64a3f403918abf2cc3f9f0f9a2204a420ec96 01-Oct-2013 Elliott Hughes <enh@google.com> Add x86_64 to the bionic headers.

Manual changes:

cpp.py: cope with macros that refer to other macros.

defaults.py: x86 no longer always implies __i386__; use __i386__ to replace
the kernel CONFIG_X86_32 flag.

asm/page.h: the upstream page.h isn't a uapi header and no longer includes
the stuff we were using it for. Let's just have our own static file, since
it's the same for all our architectures (both 32- and 64-bit).

sys/select.h: we used to use the various FD_SET-related macros from the
kernel header files, but they've gone. Adjust by adding trivial equivalent
definitions.

Automated changes:

libc/kernel/arch-x86, libc/kernel/common: regenerated from
external/kernel-headers.

Change-Id: I84fc0ed52dc742e043b4ae300fd3b58ee99b7fcd
c95eb57405d3d2f0e6cfab313aa74b1bad280452 30-Jan-2013 Elliott Hughes <enh@google.com> Clean up trailing whitespace in the kernel headers.

And fix the scripts so they stop letting trailing whitespace through.

Change-Id: Ie109fbe1f63321e565ba0fa60fee8e9cf3a61cfc
fc2693110ee8a2ba22a445ad9855fbe9e118d439 11-Oct-2010 David 'Digit' Turner <digit@google.com> libc: Update auto-gen scripts

Make the scripts use external/kernel-headers/original by default.

clean_header.py: Document -k<path>, add -d<path>
find_headers.py: Make kernel config files optional
update_all.py: Allow setting the path to kernel headers on the command-line
update_all.py: Better formatting of output on ttys
update_all.py: Automatically perform "git add/rm" on affected files.
SYSCALLS.TXT: Fix typo in __socketcall definition.
checksyscalls.py: Add support for superH architecture in the checks.
gensyscalls.py: Automatically perform "git add/rm" on affected files.
cpp.py: Fixed a bug that prevented certain type definitions to
be kept in the generated clean header (e.g.
struct ethtool_drvinfo in <linux/ethtool.h>)

All scripts will use the content of external/kernel-headers/original by default now.

The generated code removes all empty lines and trailing whitespace. This is useful
to ensure a unified output even if we change the parser again in the future.

The top-level disclaimer has been edited with update instructions to regenerate
the headers when needed.

Also, a warning is now inserted every 8th line in the final output:

/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */

Changes under kernel/arch-arm and kernel/arch-x86 should correspond to whitespace
differences and additionnal struct definitions that were missed by the previous
parser implementation.

Change-Id: Icd1c056bacd766759f3e9b7bb5d63a246f3d656a

WARNING: If you run these script, do not submit the result to gerrit for now.
It seems there are discrepancies between the content of original headers
and those currently commited under bionic/libc/kernel/.

(This problem is the main motivation to insert the warning repeatedly).

Current list of issues:

- Missing SuperH headers (i.e. external/kernel-headers/original/asm-sh)
d32c8052fc2b2d3c5da344eb673df35d4a5bc052 08-Dec-2010 Martin Storsjo <martin@martin.st> Add a method for replacing tokens in the preprocessed headers

Change-Id: I14cf6337945560b012732ae0fe7a247074810678
1dc9e472e19acfe6dc7f41e429236e7eef7ceda1 04-Mar-2009 The Android Open Source Project <initial-contribution@android.com> auto import from //depot/cupcake/@135843
1767f908af327fa388b1c66883760ad851267013 04-Mar-2009 The Android Open Source Project <initial-contribution@android.com> auto import from //depot/cupcake/@135843
6d6c82c7a0a6b9a89f61b61c66f9b90d9c7177dc 10-Jan-2009 The Android Open Source Project <initial-contribution@android.com> auto import from //branches/cupcake/...@125939
4e468ed2eb86a2406e14f1eca82072ee501d05fd 18-Dec-2008 The Android Open Source Project <initial-contribution@android.com> Code drop from //branches/cupcake/...@124589
a27d2baa0c1a2ec70f47ea9199b1dd6762c8a349 21-Oct-2008 The Android Open Source Project <initial-contribution@android.com> Initial Contribution