Commit graph

74 commits

Author SHA1 Message Date
Christopher Ferris
038ef23f62 Use the ion.h from the kernel headers.
All code that needs to use the frozen version of ion.h header should
have a copy, so move to the version as parsed from the real headers.

Test: Compiled and boots.
Change-Id: If9feae9c163ca64c4862045e86611fd3cf1fc18e
2018-02-22 20:22:14 +00:00
Christopher Ferris
934ec94955 Update to v4.15 kernel headers.
Test: Compiles, boots bullhead/hikey960.
Change-Id: I118beb8b6cac0881b1270f9bf6981959297a41a8
2018-02-01 10:51:01 -08:00
Elliott Hughes
64f355ffbd Use in_addr in ip_mreq_source and ip_msfilter.
This adds a new mechanism to say "replace struct S with #include <bits/S.h>".

Also switch epoll_event over to the new mechanism.

Also use the kernel's struct sockaddr_storage directly rather than behind
an unnecessary #define.

This patch also removes some dead code in the header scrubber. This code
still needs rewriting completely. I learned that a "block" isn't necessarily
a single struct definition, say; it might be a run of them. It seems like
a block is a run of preprocessor directives or a run of regular code.

Bug: https://issuetracker.google.com/36987220
Test: new test
Change-Id: Ic6a5c09559766a4babe3cd4c3ea538b885e07308
2017-12-14 10:07:27 -08:00
Elliott Hughes
8c75675ec6 Merge "Change ARG_MAX/_SC_ARG_MAX back to a constant." 2017-11-16 21:46:49 +00:00
Elliott Hughes
baed51ee3a Change ARG_MAX/_SC_ARG_MAX back to a constant.
As per the lkml thread https://lkml.org/lkml/2017/11/1/946.

Bug: http://b/65818597
Test: ran tests
Change-Id: I7a0610e6903e6761f2b31416e2f5017bd7a60659
2017-11-15 15:14:35 -08:00
Christopher Ferris
1308ad3ab3 Update to kernel headers v4.14.
Remove the hiding of the kernel structure binder_fd_array_object. This
structure now matches the structure used in the binder code.

Load the libclang_android.so shared library directly for parsing.
This file changed name in a recent update to the prebuilts.

Test: Compiles arm/arm64/x86/x86_64.
Test: Boots on hikey and boots on a sailfish.
Test: Ran bionic unit tests on hikey and sailfish.
Change-Id: I141a4b93ac3511cd58f4d12bb3c0d4efaa4c2742
2017-11-15 12:23:56 -08:00
Christopher Ferris
02ce96835b Revert "Revert "Move back to the previous version of ion.h.""
This reverts commit 89d6c321f8.

Reason for revert: Still a bunch of branches/builds depending on this incorrectly.

Change-Id: I8de678848b0e5445837c02c0942f7388d27dbfd7
2017-08-03 18:55:45 +00:00
Christopher Ferris
89d6c321f8 Revert "Move back to the previous version of ion.h."
This reverts commit 1a0344d65d.

Reason for revert: Fixed the original problem.

Change-Id: Ibf4ba05160048a3216e0cc49cc88519f73d00fa4
2017-08-01 19:32:14 +00:00
Christopher Ferris
1a0344d65d Move back to the previous version of ion.h.
The new kernel headers changed this and lots of parts of the tree
want the old definition, so restore the previous version.

Test: Builds.
Change-Id: I725e56bb7c51c9fcd23ebc4b67eac33d66e196e7
2017-07-29 13:45:07 -07:00
Christopher Ferris
525ce914ed Update to kernel headers v4.12.3.
Test: Built angler.
Change-Id: Icbcf4fac2334de8409b049ed7a3b4c24b4e98ce9
2017-07-27 16:01:39 -07:00
Elliott Hughes
96c1db7b9d Remove the repetitive warnings from the uapi headers.
Having

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

every four lines made the headers harder to read, made the diffs much worse
each time we upgraded, and wasn't really providing any benefit. Before the
next uapi update, let's just stop doing this.

Bug: N/A
Test: builds, manually inspected files look right
Change-Id: Id7088cf750894c9d24950f3d53587fe3156c4f7d
2017-05-25 13:48:01 -07:00
Elliott Hughes
497ad30d7d Make union semun usable.
This is a bit bogus because it's been removed from glibc (though not
thoroughly) and is never useful on Android (because the system calls
in question are compiled out of Android kernels, and SELinux would
disallow them even if you weren't running an Android kernel). This
also means that on glibc you need to include <linux/sem.h> for this
and on bionic you need <sys/sem.h> (and for either if you #include
the other file, you won't get this union).

Bug: https://github.com/android-ndk/ndk/issues/400
Test: added new test
Change-Id: I47f721da77515531f616d6ad8479bfbc9b60ee47
2017-05-18 15:05:26 -07:00
Christopher Ferris
ee1e0a34ae Update static functions/macro definitions.
Fix the list of static functions coming from swab.h to match the
ones exported by glibc.

Force the definition of __HAVE_BUILTIN_BSWAP{16,32,64}__ so the headers
use the builtin.

Add a unit test to guarantee that kernel header updates do not break this.

Test: Built and booted angler.
Test: Built the bionic unit tests for arm, arm64, mips, x86, x86_64.
Test: Ran the new test on angler and glibc.

Change-Id: I4ce229e3f198c204186d72bf22dd97b5cdf239e4
2017-04-21 20:59:53 -07:00
Christopher Ferris
5f41ce25c6 Merge "Update to kernel headers v4.10." 2017-02-27 20:09:54 +00:00
Elliott Hughes
893fd97cdc Use <linux/eventpoll.h> to implement <sys/epoll.h>.
Bug: https://github.com/android-ndk/ndk/issues/302
Test: builds
Change-Id: Ia3074326a128c38f2488e342c028cc030801cfd9
2017-02-23 17:26:24 -08:00
Christopher Ferris
48af7cb2e2 Update to kernel headers v4.10.
Test: Built angler, booted on angler, ran bionic unit tests.
Change-Id: Ia24511e74106116ea84b44ab724865ec492de8f9
2017-02-21 14:42:34 -08:00
Christopher Ferris
351a796d2d Update to kernel headers v4.9.6.
Test: Built arm/arm64/x86/x86_64 targets.
Change-Id: Id4d2711aaa96fe537f3726a0a89f2959e9cca34a
2017-01-27 10:49:48 -08:00
Christopher Ferris
6a9755d20a Update to kernel headers v4.9.3.
Test: Built arm, arm64, x86, x86_64 targets.
Test: Booted on angler, and ran bionic unit tests (32 bit and 64 bit).

Change-Id: I14a8dcbea11b41f83431eabed6590cd25af07b1d
2017-01-25 16:23:56 -08:00
Christopher Ferris
49f525c47b Update to kernel headers v4.8.14.
Test: Built mips/arm/arm64/x86/x86_64. Built and booted angler.
Change-Id: Icedb035769d8a41a170a6f1ecd707113e332d8dd
2016-12-12 19:08:01 -08:00
Christopher Ferris
106b3a8a7d Update to kernel headers v4.7.2.
Modify the kernel header update script to rename C++ keyword
struct members to something else. This fixes problems when including
these kernel files in C++ code.

Also, make a manual change to linux/fib_rules.h and comment out the
value FRA_PAD since it conflicts with a special android kernel value
FRA_UID_START that has not been upstreamed yet.

Test: Built aosp_angler, aosp_x86_64, aosp_mips (bionic only)
Test: Booted on angler and ran bionic unit tests
Test: Built these changes in internal master

Change-Id: Ia22b7e3ca409404696dba76311f49157f4a9ceed
2016-08-29 12:07:13 -07:00
Elliott Hughes
7c59f3f6f3 Flesh out <sys/msg.h>, <sys/sem.h>, <sys/shm.h>.
Also fix <sys/ipc.h>.

Not useful except to systems/bringup folks for testing. Trivial tests
added, and double-checked under strace to see that things look right.

x86 -- which works differently to everything else -- tested on the host.

Bug: http://b/27952303
Change-Id: I328534e994ae9e90755f545478fba03038c0bb94
2016-08-18 15:23:38 -07:00
Elliott Hughes
38dba2e7e1 Fix sysconf(_SC_ARG_MAX).
ARG_MAX hasn't been a constant since Linux 2.6.23.

Bug: http://lists.landley.net/pipermail/toybox-landley.net/2016-August/008592.html
Change-Id: I1eddb562751604c75b89fa610d79be0655c53693
Test: ran the bionic tests on device and against glibc
2016-08-10 15:51:06 -07:00
Christopher Ferris
d6e8b8ca56 Move/remove android only kernel uapi headers.
Move all of the uapi kernel headers that are only found in the android
kernel, and are still used by the tree into their own directory.

Delete all of these files that are not used.

Also, delete binder.h from the linux directory since it already exists
in the linux/android directory.

Bug: 30072483
Change-Id: I879f16e366f7670b8be3546b0a9cf9567fce6526
2016-07-19 12:43:56 -07:00
Christopher Ferris
82ef6a19cb Updated to v4.4.11 kernel headers.
Change-Id: I6b55a921670d32d7bfff3c304d8001058409d3f7
2016-05-19 17:03:14 -07:00
Christopher Ferris
05d08e9716 Updated to v4.4.1 kernel headers.
Small modifications needed to allow compilation with the new headers:

- Manually modify bionic/libc/kernel/uapi/asm-mips/asm/siginfo.h to
  remove the uapi from the include.
- PR_XXX defines are now available for mips, so remove the definition
  from linker_mips.cpp.

Bug: 23789423
Change-Id: I6dc8a03b012426d3a937db15cb24d3a50fab5a8c
2016-02-05 16:03:55 -08:00
Elliott Hughes
f8a2243ebe <netinet/udp.h> should include <linux/udp.h>.
The comment about "other stuff" referred to pre-uapi headers. Everything
in the current <linux/udp.h> should be exposed to userspace. The only
problem is that BSD and Linux use different names for the members of
struct udphdr. We can move the Linux udphdr out of the way and use an
anonymous union to get the best of both worlds. (Though unfortunately
this means that code that includes <linux/udp.h> directly instead of
using <netinet/udp.h> now won't have any definition of struct udphdr.
We've taken the stance in the past that you shouldn't include a linux/
header if there's a standard equivalent --- you should rely on us
transitively including it for you.)

Change-Id: Ie625892441b0edd8df3b76d3fcf2cbe299077bc4
2015-09-22 12:34:13 -07:00
Christopher Ferris
915bf813ad Update to v3.18.21 kernel headers.
Change-Id: I4ade68d62981c7f6f361750cc811e8d84be9d5b9
2015-09-02 17:23:31 -07:00
Christopher Ferris
dda4fd4644 Update to v3.18.18 kernel headers.
Change-Id: I0a0f423bda89500ad8e13a80582f05ec8bc756ea
2015-07-13 17:21:18 -07:00
Christopher Ferris
e01d32f802 Upgrade kernel headers to 3.18.10.
Change-Id: Iff1f1c830780585990856a5114b559c61282dcd6
2015-03-31 14:57:48 -07:00
Yabin Cui
2d8f9b5aea Define MAXHOSTNAMELEN explicitly in source files.
Bug: 19093777
Bug: 19092844
Change-Id: I0778507ca2d5c008abb9a6d6315d0909263a8817
2015-02-09 19:56:47 -08:00
Tao Bao
d7db594b8d Switch kernel header parsing to python libclang
Replace the tokenizer in cpp.py with libclang.

Bug: 18937958
Change-Id: I27630904c6d2849418cd5ca3d3c612ec3078686d
2015-02-06 14:48:41 -08:00
Christopher Ferris
82d7504cd7 Update kernel headers to v3.18.3.
Bug: 19127803
Change-Id: I67fa0832322ddd0032d909476047578be052bcf2
2015-01-26 10:57:07 -08:00
Christopher Ferris
cbf33a9988 am d5e1c583: Merge "Move to v3.16.3 kernel headers."
* commit 'd5e1c583a66a821c7d7e8f43e1238a4569981b90':
  Move to v3.16.3 kernel headers.
2014-09-18 21:48:49 +00:00
Christopher Ferris
653676dde8 Move to v3.16.3 kernel headers.
Change-Id: Ife491bd7630b853a78532dd74e4644438256a3a1
2014-09-18 13:14:58 -07:00
Christopher Ferris
aac37784df am 0bd28a43: Merge "Update kernel uapi headers to v3.16.1."
* commit '0bd28a43dae87c808f6af61ad3dba042b35be7e7':
  Update kernel uapi headers to v3.16.1.
2014-09-18 00:41:24 +00:00
Christopher Ferris
ba8d4f460b Update kernel uapi headers to v3.16.1.
Other changes to support the new headers:

- Remove the flock64 structure it is defined in the new headers.
- Update the syscalls to correspond with the headers.

Change-Id: I49a6b07e8b2bfffb67be71b07b58e4e6848fcc09
2014-09-17 17:05:17 -07:00
Christopher Ferris
e2d86feb7b Pull input.h from v3.16.1 kernel headers.
(cherry-pick of 027d2717d067c3706f22bf84dc1226ede7c1566d.)

Bug: 17407564
Change-Id: Idcfc40a7254605280e3d5474c61ae1ab7b2b7b51
2014-09-17 15:18:21 -07:00
Christopher Ferris
027d2717d0 Pull input.h from v3.16.1 kernel headers.
Bug: 17407564
Change-Id: Idcfc40a7254605280e3d5474c61ae1ab7b2b7b51
2014-09-14 12:08:37 -07:00
Christopher Ferris
18a25078f0 am c6bc0017: Merge "Update kernel headers to v3.14."
* commit 'c6bc001776931fd1c8583df2b8948dcb8bf61007':
  Update kernel headers to v3.14.
2014-07-12 01:41:50 +00:00
Christopher Ferris
38062f954c Update kernel headers to v3.14.
Other changes:
- Modify update_all.py to skip ion header files when importing into aosp.
- Fix generate_uapi_headers.sh to handle imports from a linux-stable kernel.

Change-Id: I1ad81b9ccb063c21740f9875f2cc1238052cd4b3
2014-07-10 13:32:32 -07:00
Christopher Ferris
92f979725f am 6131798e: am ac86f994: Merge "[MIPS64] Regenerate mips kernel headers with fixed tool"
* commit '6131798e574d85200053d93bc2673ab5a0f715fe':
  [MIPS64] Regenerate mips kernel headers with fixed tool
2014-06-21 01:06:58 +00:00
Duane Sand
2300332596 [MIPS64] Regenerate mips kernel headers with fixed tool
Change-Id: I530891123cba78edbea4aa8af88390213711ab16
2014-06-20 11:08:49 -07:00
Elliott Hughes
c571c26820 am 9eb2d38d: am b9fdad77: am ec81b4a3: Merge "Scrub uapi headers slightly harder."
* commit '9eb2d38d53b2d00a9b5bd189a34f51afb7c385bf':
  Scrub uapi headers slightly harder.
2014-05-15 23:12:23 +00:00
Elliott Hughes
8ed7a23309 Scrub uapi headers slightly harder.
There's no point having always-false tests. It just makes the headers
harder to read.

Bug: 11560081
Change-Id: I6187755e1514ca9ff5642b3c1b0489f22edddaf5
2014-05-15 12:01:11 -07:00
Elliott Hughes
834c136cec am 0d443726: am d2623501: am 8979cfe1: Merge "Keep the kernel header scrubber\'s data structures in sync."
* commit '0d4437263e65b7acc4546753ac79577b94ccc6ba':
  Keep the kernel header scrubber's data structures in sync.
2014-05-01 17:36:06 +00:00
Elliott Hughes
fddbafdc0a 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
2014-05-01 10:27:49 -07:00
Elliott Hughes
fc4d9263a3 am 01dc4152: am 4a41581a: am 9fb53dd4: Merge "Make SIGRTMIN hide the real-time signals we use internally."
* commit '01dc4152b736c822a11cbbff3240eec7143659e3':
  Make SIGRTMIN hide the real-time signals we use internally.
2014-04-30 18:48:56 +00:00
Elliott Hughes
0990d4fda8 Make SIGRTMIN hide the real-time signals we use internally.
__SIGRTMIN will continue to tell the truth. This matches glibc's
behavior (as evidenced by the fact that we don't need a special case
in the strsignal test now).

Change-Id: I1abe1681d516577afa8cd39c837ef12467f68dd2
2014-04-30 10:06:09 -07:00
Ruchi Kandoi
eba6501c20 am 88920300: am aa3d46a4: Merge "prctl: Adds the PR_SET_TIMERSLACK_PID option"
* commit '889203005b62f0c2124a7fcae12f9824cbc78868':
  prctl: Adds the PR_SET_TIMERSLACK_PID option
2014-04-23 19:29:32 +00:00
Ruchi Kandoi
b84926b95c prctl: Adds the PR_SET_TIMERSLACK_PID option
Allows software to set timer clack for other thread.

Change-Id: Ifa9d2cc7844ec581356bce15434609242fd898a8
Signed-off-by: Ruchi Kandoi <kandoiruchi@google.com>
2014-04-23 19:13:15 +00:00