Commit Graph

3860 Commits

Author SHA1 Message Date
Elliott Hughes
d36126ddc3 am fb12b9a7: am ea7c0ea6: am d29c75f0: Merge "Fix x86 user_regs_struct."
* commit 'fb12b9a7a3f6b0d91a201d4f39134edddc93c07c':
  Fix x86 user_regs_struct.
2014-01-10 00:23:14 +00:00
Elliott Hughes
f39f8f4414 am 2a25c30e: am c63fe9fa: am 6114ffb3: Merge "Add the glibc-compatible d_fileno."
* commit '2a25c30e33ecf2170709f5ff89588c81480dd23d':
  Add the glibc-compatible d_fileno.
2014-01-10 00:07:22 +00:00
Elliott Hughes
33c3e8d3b2 Merge "Add NT_PRSTATUS to <elf.h>." 2014-01-09 23:53:58 +00:00
Elliott Hughes
1272dbd1d7 Add NT_PRSTATUS to <elf.h>.
Needed by aarch64.

Bug: 12476126
Change-Id: I7764664459a06cf4f2a60e707bd968d321a78430
2014-01-09 15:45:07 -08:00
Elliott Hughes
8e6bf35a16 Merge "Add <sgidefs.h>." 2014-01-09 22:24:34 +00:00
Elliott Hughes
f8b2b3c81e Fix x86 user_regs_struct.
I fixed x86-64 yesterday, but didn't fix x86 at the same time.

Change-Id: I5c081f5956dfedb9389af303369b841dd0fc1953
2014-01-09 14:01:18 -08:00
Elliott Hughes
1c2cf23a0c Add <sgidefs.h>.
Change-Id: I543d502a81dcb8d5969f814b8a9a9c819bc4fa2c
2014-01-09 13:54:49 -08:00
Elliott Hughes
a8a3178445 Add the glibc-compatible d_fileno.
d_ino is the POSIX name, but glibc also offers d_fileno, and
that's what strace is using.

Change-Id: I3fadbe7a64700b42e78c7f4631620e864d43147b
2014-01-09 12:37:12 -08:00
Elliott Hughes
2a02502c77 am b1955cc4: am 56d790fc: am c65cbf97: Merge "Fix <sys/resource.h>."
* commit 'b1955cc44776dc272eece253e72b567ce32aa185':
  Fix <sys/resource.h>.
2014-01-09 19:21:56 +00:00
Elliott Hughes
0f461e35f6 Fix <sys/resource.h>.
The situation here is a bit confusing. On 64-bit, rlimit and rlimit64 are
the same, and so getrlimit/getrlimit64, setrlimit/setrlimit64,
and prlimit/prlimit64 are all the same. On 32-bit, rlimit and rlimit64 are
different. 32-bit architectures other than MIPS go one step further by having
an even more limited getrlimit system call, so arm and x86 need to use
ugetrlimit instead of getrlimit. Worse, the 32-bit architectures don't have
64-bit getrlimit- and setrlimit-equivalent system calls, and you have to use
prlimit64 instead. There's no 32-bit prlimit system call, so there's no
easy implementation of that --- what should we do if the result of prlimit64
won't fit in a struct rlimit? Since 32-bit survived without prlimit/prlimit64
for this long, I'm not going to bother implementing prlimit for 32-bit.

We need the rlimit64 functions to be able to build strace 4.8 out of the box.

Change-Id: I1903d913b23016a2fc3b9f452885ac730d71e001
2014-01-09 11:00:04 -08:00
Elliott Hughes
cf6090561b am e5af4430: am 8c6c9801: am 8276d287: Merge "Our dirent is a dirent64."
* commit 'e5af4430477b3fb8a6faaa5348a6dda4574fcea6':
  Our dirent is a dirent64.
2014-01-09 01:31:07 +00:00
Elliott Hughes
90e61a3039 am 49fd7864: am 2ab8dd30: am 66f473ef: Merge "Add <sys/reg.h>."
* commit '49fd7864cd997f78ac683c8c54dd009020c3d0e5':
  Add <sys/reg.h>.
2014-01-09 01:31:07 +00:00
Elliott Hughes
8276d2875f Merge "Our dirent is a dirent64." 2014-01-09 01:15:27 +00:00
Elliott Hughes
72dee4e4aa am d0a17beb: am 548eddab: am 8a6eec38: Merge "Fix x86_64 register names in <sys/user.h>."
* commit 'd0a17beb73c851babf18736773645dbca206f69b':
  Fix x86_64 register names in <sys/user.h>.
2014-01-09 00:37:52 +00:00
Elliott Hughes
16b28da0df am 36a3f941: am 60ff1387: am 5d5cc227: Merge "We shouldn\'t have a <sys/dirent.h> that\'s a subset of <dirent.h>."
* commit '36a3f941d07ad58b7df1152b1cfb6041604eb666':
  We shouldn't have a <sys/dirent.h> that's a subset of <dirent.h>.
2014-01-09 00:37:51 +00:00
Elliott Hughes
38f0ef3ff7 Our dirent is a dirent64.
Change-Id: Idc9ebfd900fddd4f7c7ac95bc9b74401ebc801a3
2014-01-08 16:31:36 -08:00
Elliott Hughes
5b17e4da39 Add <sys/reg.h>.
This describes the offsets into ptrace's returned arrays of registers
for x86 and x86-64.

Change-Id: I044f03e286673999a298b73a813d4ad366625845
2014-01-08 16:29:22 -08:00
Elliott Hughes
8a6eec38eb Merge "Fix x86_64 register names in <sys/user.h>." 2014-01-09 00:24:55 +00:00
Elliott Hughes
eddc8ece3d Fix x86_64 register names in <sys/user.h>.
Change-Id: Ieb327247a41f6195589716170e324d1cd1251b96
2014-01-08 15:54:19 -08:00
Elliott Hughes
155b076420 We shouldn't have a <sys/dirent.h> that's a subset of <dirent.h>.
glibc has no <sys/dirent.h>. If we do have to bring this back, we
should probably just have one file #include the other.

Change-Id: I5c0bf9c03769daf3b23f69778e9f01f81c3de9ec
2014-01-08 15:51:13 -08:00
Elliott Hughes
398aadbf6d am e4f4ef04: am eac00eb7: am 4c8caf0a: Merge "<sched.h> should offer both __sched_priority and sched_priority."
* commit 'e4f4ef047c7240d5603ad4e65007f4b79a2fefa3':
  <sched.h> should offer both __sched_priority and sched_priority.
2014-01-08 02:53:05 +00:00
Elliott Hughes
f89abab0cb am fccb66b3: am 4458a5a7: am 4faf76ca: Merge "<fcntl.h> should get you the POSIX_FADV_* constants."
* commit 'fccb66b3ab3f6e5672a46d4730d545859308dc8c':
  <fcntl.h> should get you the POSIX_FADV_* constants.
2014-01-08 02:53:04 +00:00
Elliott Hughes
e0d647701e am ec93120e: am 82bbaf7e: am bc4e135a: Merge "Add SWAP_FLAG_* constants to <sys/swap.h>."
* commit 'ec93120e63b44e88ee4665820b7b29c0757852f7':
  Add SWAP_FLAG_* constants to <sys/swap.h>.
2014-01-08 02:43:02 +00:00
Elliott Hughes
4c8caf0ad3 Merge "<sched.h> should offer both __sched_priority and sched_priority." 2014-01-08 02:41:04 +00:00
Elliott Hughes
4faf76ca11 Merge "<fcntl.h> should get you the POSIX_FADV_* constants." 2014-01-08 02:40:44 +00:00
Elliott Hughes
bc4e135a8e Merge "Add SWAP_FLAG_* constants to <sys/swap.h>." 2014-01-08 02:31:55 +00:00
Elliott Hughes
91a7e423a4 am 24ed782f: am d2fe982b: am 1c1b8354: Merge "Define fsid_t as well as __fsid_t."
* commit '24ed782faaf2f373c9c89a8c403bc3ec2e56bab8':
  Define fsid_t as well as __fsid_t.
2014-01-08 02:24:31 +00:00
Elliott Hughes
65c6f3099e Add SWAP_FLAG_* constants to <sys/swap.h>.
Bug: 9336527
Change-Id: I679be4d8425ba177dd782e714f465caf9daa976c
2014-01-08 02:23:06 +00:00
Elliott Hughes
bbb34f9536 <sched.h> should offer both __sched_priority and sched_priority.
If glibc hadn't already done things this way round, I'd have
called the field sched_priority and the macro __sched_priority
since that would seem less likely to cause trouble, but glibc
source compatibility is probably more important.

Change-Id: I8a8a477f2aa87cae641069c5c84b4fcab3152a82
2014-01-07 17:48:30 -08:00
Elliott Hughes
01e505ac9c <fcntl.h> should get you the POSIX_FADV_* constants.
Change-Id: I9de8b840570b228308c12d72b7617b8758237fb8
2014-01-07 17:47:20 -08:00
Elliott Hughes
abfc88fed7 Define fsid_t as well as __fsid_t.
Change-Id: Ib8efbd913a0e6bfe27b88c1342bd5cec926dd74e
2014-01-07 17:44:51 -08:00
Elliott Hughes
6f32b90ea4 am 0d668937: am 654a26b8: am 27a4bb31: Merge "Regenerate the NOTICE files."
* commit '0d66893771259bb82458ba303ff5f58fd9f9f74e':
  Regenerate the NOTICE files.
2014-01-07 22:00:58 +00:00
Elliott Hughes
54a7494f17 Regenerate the NOTICE files.
Also standardize the orthography in a few places to reduce near-duplicates
in the NOTICE files.

Change-Id: I347c75e817be61ec1b9c5b4b96226feedc8d09ab
2014-01-07 13:46:11 -08:00
Christopher Ferris
a515fdfe15 am 4beb09a0: am 292f4473: am 10cd709f: Merge "Add cfi directives to x86 syscalls."
* commit '4beb09a0730ccd254a0f7683425911d7c90a1431':
  Add cfi directives to x86 syscalls.
2014-01-07 01:46:15 +00:00
Christopher Ferris
10cd709ff9 Merge "Add cfi directives to x86 syscalls." 2014-01-07 01:36:44 +00:00
Christopher Ferris
e4bc756121 Add cfi directives to x86 syscalls.
Modify the syscalls script to generate the cfi directives for x86
syscalls.

Update the x86 syscalls.

Change-Id: Ia1993dc714a7e79f917087fff8200e9a02c52603
2014-01-06 16:39:10 -08:00
Elliott Hughes
9555fa7ec0 am 30ef1f3e: am ca63af9e: am b235f8c8: Merge "Fix dev_t (for LP64)."
* commit '30ef1f3e35e8c473b56cefa85617b660fa3a15fb':
  Fix dev_t (for LP64).
2014-01-06 20:56:51 +00:00
Elliott Hughes
6d3183bc40 am 8a6c497f: am 7a0e89b6: am 8c8852f1: Merge "Add TCPOPT_* constants."
* commit '8a6c497fb727e30d88a594f8ebfec9098595ae84':
  Add TCPOPT_* constants.
2014-01-06 20:56:50 +00:00
Elliott Hughes
b235f8c877 Merge "Fix dev_t (for LP64)." 2014-01-06 20:37:03 +00:00
Elliott Hughes
338e6102a6 Add TCPOPT_* constants.
Adds the TCPOPT_* constants from NetBSD. Note that the BSDs also have
TCPOPT_SIGNATURE, but Linux calls that TCPOPT_MD5SIG and glibc doesn't
have any corresponding constant yet, so let's wait until we see which name
wins out.

Change-Id: If53cdada5595285d9a7e7248ef74cd7502d804c0
2014-01-03 15:58:40 -08:00
Elliott Hughes
a3ae611097 am dd18a8df: am 3fcc90c6: am c1c3f7d4: Merge "Remove as many hard-coded constants from the MIPS vfork.S as possible."
* commit 'dd18a8dfd03884ea6e6d71fdd013b2ebe6ebb999':
  Remove as many hard-coded constants from the MIPS vfork.S as possible.
2014-01-03 23:19:42 +00:00
Elliott Hughes
894f8cb139 Fix dev_t (for LP64).
32-bit Android's dev_t was wrong too. We can't fix that without ABI breakage,
but we can at least fix 64-bit Android. And add tests.

Bug: https://code.google.com/p/android/issues/detail?id=54966
Change-Id: Ie2e42cc042b78b669a1a44e55f959dbd9c52c5c9
2014-01-03 14:49:37 -08:00
Elliott Hughes
c1c3f7d446 Merge "Remove as many hard-coded constants from the MIPS vfork.S as possible." 2014-01-03 22:36:53 +00:00
Elliott Hughes
c5bf703c4c Remove as many hard-coded constants from the MIPS vfork.S as possible.
We could do better, but not without MIPS cleaning up their kernel headers.

Change-Id: Ib4d4ce5d720ce8ca27a3f9a1ae07a9a277675af9
2014-01-03 14:27:17 -08:00
Elliott Hughes
83783d4c2d am c2162cc5: am b8f2df91: am 3b36564b: Merge "Use the MAX_ERRNO constant."
* commit 'c2162cc58fd7d68eb64cc787e741770f7f502343':
  Use the MAX_ERRNO constant.
2014-01-03 00:38:52 +00:00
Elliott Hughes
a85aaf11fa Use the MAX_ERRNO constant.
If you're going to hardcode a constant, you could at least try to
get the constant right...

Change-Id: I886a2593357d1c4dfd6c42649c63e8a35c15a441
2014-01-02 16:23:24 -08:00
Elliott Hughes
8b73b46948 am 0db8180f: am a4c979e3: am 66d16619: Merge "Remove a hardcoded constant from aarch64\'s vfork."
* commit '0db8180f9720c1b844d4e6c126e98d6bb78c0946':
  Remove a hardcoded constant from aarch64's vfork.
2014-01-02 22:28:16 +00:00
Elliott Hughes
b0a2efc6f2 Remove a hardcoded constant from aarch64's vfork.
Change-Id: Ifc09ca066c32988b8cc9db9e808b9ef4c4d2bfcb
2014-01-02 14:17:30 -08:00
Elliott Hughes
8bea13ddcb am 9d0600e1: am 741d4023: am 7b0c23f1: Merge "Clean up <sched.h>."
* commit '9d0600e16169a326a68543992e428d78d4f67398':
  Clean up <sched.h>.
2014-01-02 21:57:07 +00:00
Elliott Hughes
887e1140fe Clean up <sched.h>.
This patch switches to using the uapi constants. It also adds the missing
setns system call, fixes sched_getcpu's error behavior, and fixes the
gensyscalls script now ARM is uapi-only too.

Change-Id: I8e16b1693d6d32cd9b8499e46b5d8b0a50bc4f1d
2014-01-02 12:05:50 -08:00
Elliott Hughes
1c1a001deb am 19705a6e: am bb184de2: am 17c9fe7d: Merge "Fix MIPS build."
* commit '19705a6e350d3faedfcb69da117f18770528fe4a':
  Fix MIPS build.
2013-12-22 20:14:41 +00:00
Elliott Hughes
5063791535 Fix MIPS build.
Change-Id: I175f427e355fca9a5a3f4e4379d7fcd1f7f6a22d
2013-12-22 12:02:32 -08:00
Elliott Hughes
14a9c3f516 am 75ed8899: am 2f6f6c0b: am 47033433: Merge "Remove the bogus exit status from _exit_with_stack_teardown."
* commit '75ed8899ac02bf952dd42987f867372a8b56219f':
  Remove the bogus exit status from _exit_with_stack_teardown.
2013-12-22 19:45:47 +00:00
Elliott Hughes
2aace21a19 Remove the bogus exit status from _exit_with_stack_teardown.
It should always be 0, and there's no reason to pass a constant in as
an argument.

Change-Id: I92ac59b718a18e298bd7c52821af447f9181ca2a
2013-12-21 15:30:49 -08:00
Elliott Hughes
b12dc8e6c8 am 7b9f6ab8: am 57c6a969: am 6d929061: Merge "Fix MIPS build."
* commit '7b9f6ab83459eea7f4070e93b0a4efbb70a38e2c':
  Fix MIPS build.
2013-12-21 02:59:01 +00:00
Elliott Hughes
6d929061c3 Merge "Fix MIPS build." 2013-12-21 02:47:01 +00:00
Elliott Hughes
5b395ce071 Fix MIPS build.
Change-Id: Idd3bcda1803fd16b728a352d325bb070aed8fd94
2013-12-20 18:46:14 -08:00
Elliott Hughes
bb6bf6417a am e4aaceb3: am 191c7e3e: am 3fdb7355: Merge "Avoid sign extension in 32-bit mmap."
* commit 'e4aaceb302a846cf862d9e8a6d96bf85b07d8123':
  Avoid sign extension in 32-bit mmap.
2013-12-21 02:38:20 +00:00
Elliott Hughes
a255bce6d2 am 5ff62cbe: am 51166a7e: am 434f97f6: Merge "Remove some old kernel header cruft not needed with uapi."
* commit '5ff62cbe9df50eb9d1bac01180ca7f40c1e2c6e2':
  Remove some old kernel header cruft not needed with uapi.
2013-12-21 02:34:51 +00:00
Elliott Hughes
3fdb735590 Merge "Avoid sign extension in 32-bit mmap." 2013-12-21 02:23:35 +00:00
Elliott Hughes
99868904fe Avoid sign extension in 32-bit mmap.
Change-Id: I2a77925f62f381a0b34648c3db8154a55dd80c46
2013-12-20 18:17:34 -08:00
Elliott Hughes
6ae8ab2896 am 9306d2a2: am bc86e156: am 22323f91: Merge "Fix aarch64 futex assembly routines."
* commit '9306d2a21f281b505582cd8710546decc92bf497':
  Fix aarch64 futex assembly routines.
2013-12-21 01:37:04 +00:00
Elliott Hughes
68d89c7d65 Remove some old kernel header cruft not needed with uapi.
Change-Id: If543b056ae40f0eb660be4a0629ad22f4c4cb92f
2013-12-20 17:26:30 -08:00
Elliott Hughes
5eccb9646d Fix aarch64 futex assembly routines.
Also make the other architectures more similar to one another,
use NULL instead of 0 in calling code, and remove an unused #define.

Change-Id: I52b874afb6a351c802f201a0625e484df6d093bb
2013-12-20 16:58:06 -08:00
Elliott Hughes
fb5222ebef am c2b4de4d: am 9f65022f: am 026b6ab6: Merge "Allocate additional space on stack for indirect syscall"
* commit 'c2b4de4dca45cf8bea64e69563f8efde13539a0f':
  Allocate additional space on stack for indirect syscall
2013-12-20 23:50:41 +00:00
Chris Dearman
766c7efe28 Allocate additional space on stack for indirect syscall
The caller is only required to allocate 16 bytes on the
stack for a0-a3. syscall is handling up to 6 arguments so
additional space is needed on the stack to avoid corrupting the
callers frame.

Change-Id: I054b31696decc3e17d9c70af18cd278b852235d1
2013-12-20 15:36:00 -08:00
Greg Hackmann
218c50fcc3 am 8d4d6d55: am 70898677: am 5e26221a: Merge "Fix backwards compatible system property structure"
* commit '8d4d6d5536e138260f826f67175fb89b79c41c8c':
  Fix backwards compatible system property structure
2013-12-20 22:51:34 +00:00
Greg Hackmann
5e26221a1d Merge "Fix backwards compatible system property structure" 2013-12-20 21:54:38 +00:00
Elliott Hughes
ac0c7d599e am 55ac19cf: am 7b0964b1: am 21955e54: Merge "Upgrade to tzdata2013i."
* commit '55ac19cf547b59cc1efce4562655b517f926f72d':
  Upgrade to tzdata2013i.
2013-12-20 19:46:41 +00:00
Elliott Hughes
498295ca2b Upgrade to tzdata2013i.
From the release notes:

  Changes affecting near-future time stamps:

    Jordan switches back to standard time at 00:00 on December 20, 2013.
    The 2006-2011 transition schedule is planned to resume in 2014.
    (Thanks to Steffen Thorsen.)

  Changes affecting past time stamps:

    In 2004, Cuba began DST on March 28, not April 4.
    (Thanks to Steffen Thorsen.)

Change-Id: I8f26cc50f6b571804a18ff2113b4a47a22bc56dd
2013-12-20 11:26:19 -08:00
Elliott Hughes
ab27c70dd0 am aefb8b35: am ddeca583: am aa267685: Merge "Allow GCC-built fortified code to run on a clang-built bionic."
* commit 'aefb8b3599056465e8281bd1062c558c8554113f':
  Allow GCC-built fortified code to run on a clang-built bionic.
2013-12-20 05:50:50 +00:00
Elliott Hughes
aa267685c9 Merge "Allow GCC-built fortified code to run on a clang-built bionic." 2013-12-20 02:54:56 +00:00
Elliott Hughes
4889dc1658 am 576fba08: am c7295d73: am a19a41b6: Merge "Fix struct stat for aarch64."
* commit '576fba08dc1cf289a1160d2c8e6678f6155a0814':
  Fix struct stat for aarch64.
2013-12-20 02:02:13 +00:00
Elliott Hughes
8491fd501a am d7a47858: am b37569e3: am f85b9ac3: Merge "Don\'t force O_LARGEFILE on LP64."
* commit 'd7a478589fdfde8fb4d7d1c9c4c294498f5009b8':
  Don't force O_LARGEFILE on LP64.
2013-12-20 01:57:29 +00:00
Elliott Hughes
a19a41b6b5 Merge "Fix struct stat for aarch64." 2013-12-20 01:45:33 +00:00
Elliott Hughes
f85b9ac3ec Merge "Don't force O_LARGEFILE on LP64." 2013-12-20 01:44:24 +00:00
Ben Cheng
c77395b341 am 88568a4b: am 6517824f: am f576472a: Merge "Add __popcountsi2 to the function compat list."
* commit '88568a4b89f52f37001866680ff1ce07e592f75c':
  Add __popcountsi2 to the function compat list.
2013-12-20 00:58:01 +00:00
Elliott Hughes
b8fa5b1ca9 Fix struct stat for aarch64.
Another kernel, another struct stat.

Change-Id: Ia5ee553d4a2ffc878d2fed82a763ff64c02b12e8
2013-12-19 16:50:22 -08:00
Elliott Hughes
17cabe15d5 Don't force O_LARGEFILE on LP64.
aarch64's strace is confused by this, and it isn't necessary anyway.

Change-Id: Ib07b649eb1c38ff0296003874f73af78c47bc276
2013-12-19 16:48:56 -08:00
Ben Cheng
e3fb66dd01 Add __popcountsi2 to the function compat list.
This is needed if we use Clang to compile Bionic, which won't include
__popcountsi2 anymore as Clang generates inline instructions. However
prebuilt binary blobs still depend on libc.so to resolve __popcountsi2.

Change-Id: I9001a3884c4be250c0ceebcd79922783fae1a0b7
2013-12-19 16:26:40 -08:00
Elliott Hughes
cd0609f4fc Allow GCC-built fortified code to run on a clang-built bionic.
Even though code built with clang won't be fully fortified
and won't contain calls to our various helpers, binaries built
with GCC will.

Change-Id: I389b2f1e22a3e89b22aadedc46397bf704f9ca79
2013-12-19 14:20:22 -08:00
Elliott Hughes
1223248ba1 am 01e8d487: am 61f02065: am cf7a4a4f: Merge "Revert "Add C linkage for __open_2 and __openat_2.""
* commit '01e8d48761e64ce63bb4928ea9ce57f140027213':
  Revert "Add C linkage for __open_2 and __openat_2."
2013-12-19 20:15:24 +00:00
Elliott Hughes
cf7a4a4fda Merge "Revert "Add C linkage for __open_2 and __openat_2."" 2013-12-19 20:02:28 +00:00
Elliott Hughes
9a42eef8b1 Revert "Add C linkage for __open_2 and __openat_2."
This reverts commit c13d89b829.

Change-Id: I40a3c6b926e920b65dd054353a2db8d314d5b300
2013-12-19 20:02:16 +00:00
Elliott Hughes
d149305258 am b0ad47e2: am d520c95e: am bb4f6dc2: Merge "ARM: Change dmb domain for bionic_atomic_barrier()"
* commit 'b0ad47e20d0f9c5c5c498638cc9b5cd341b304bc':
  ARM: Change dmb domain for bionic_atomic_barrier()
2013-12-19 19:53:19 +00:00
Elliott Hughes
c06eaa3e12 am f850700c: am 2520a94e: am 1afb375d: Merge "Fix aarch64 custom assembler now non-uapi is gone."
* commit 'f850700c67f8a5f9641c91c53269f9a5a14d3399':
  Fix aarch64 custom assembler now non-uapi is gone.
2013-12-19 19:49:46 +00:00
Serban Constantinescu
845c778fa6 ARM: Change dmb domain for bionic_atomic_barrier()
This patch changes the domain that the memory barrier operates on. Assumes
that the scope of bionic_atomic_barrier() does not include device memory,
memory shared with the GPU or any other memory external to the processor
cluster.

Change-Id: I291e741c98a64c86f3a3cf99811bbf1e714ac9aa
Signed-off-by: Serban Constantinescu <serban.constantinescu@arm.com>
2013-12-19 11:39:01 -08:00
Elliott Hughes
da9775509b Fix aarch64 custom assembler now non-uapi is gone.
Change-Id: I9c8ad17d9bae2de9d793444d87d4ee133728e900
2013-12-19 11:32:42 -08:00
Ben Cheng
0c45d8568d am 08af3aae: am e884a039: am dcc18ea4: Merge "Add C linkage for __open_2 and __openat_2."
* commit '08af3aae104611d269d942354791e5bcb693ceee':
  Add C linkage for __open_2 and __openat_2.
2013-12-19 19:13:00 +00:00
Ben Cheng
c13d89b829 Add C linkage for __open_2 and __openat_2.
Otherwise Clang mangle them with C++ names.

Change-Id: I844e28d834df8b0752b32d2aadd2013fc8804a43
2013-12-19 10:49:20 -08:00
Serban Constantinescu
bf3ec9ad52 AArch64: Use LDXR/STXR instead of LDAXR/STLXR for bionic_atomic_cmpxchg()
The bionic_atomic_cmpxchg() API states that the cmpxchg() will be done without
explicit memory barriers. LDAXR/STLXR semantics involve half barriers for
load/store.

This patch optimises cmpxchg() by using LDXR/STXR and avoiding unnecessary half
bariers. It also fixes the clobber list for all the bionic_atomic_*() functions.

Change-Id: Iae9468965785cfeeec791d52f1e8cbc524adb682
Signed-off-by: Serban Constantinescu <serban.constantinescu@arm.com>
2013-12-19 18:32:53 +00:00
Christopher Ferris
f36c3ea8ff resolved conflicts for merge of 85e0dd89 to master
Change-Id: I21f7ffb9a582681877e2dbad54185ee37d18410e
2013-12-18 23:43:36 -08:00
Christopher Ferris
81ddd14381 Merge "Remove the non-uapi kernel headers." 2013-12-19 06:58:53 +00:00
Nick Kralevich
f9c4078ab7 am c92f7f57: am c1624712: am 25447aec: Merge "Clean up more recursive FORTIFY_SOURCE calls"
* commit 'c92f7f57cf0b3a72f1447a0de99a18727d89d933':
  Clean up more recursive FORTIFY_SOURCE calls
2013-12-19 05:57:53 +00:00
Nick Kralevich
e4c6b08c4e Clean up more recursive FORTIFY_SOURCE calls
Don't use FORTIFY_SOURCE on functions which implement
FORTIFY_SOURCE, to avoid infinite recursion problems.

The previous patch only addressed one of the problems.

Bug: 12216860
Change-Id: I6f30ae7cb5b481be9942add18182ea4839d348a6
2013-12-18 19:17:14 -08:00
Nick Kralevich
2e437261e3 am feceab73: am 58a2429b: am 4063bb61: Merge "__strnlen_chk: avoid recursive strlen calls"
* commit 'feceab7366c03b792c7679b8969bc573dc579ad2':
  __strnlen_chk: avoid recursive strlen calls
2013-12-19 03:06:16 +00:00
Nick Kralevich
ddea383433 __strnlen_chk: avoid recursive strlen calls
Don't use FORTIFY_SOURCE on functions which implement
FORTIFY_SOURCE.

Bug: 12216860
Change-Id: I61db1b47ccdd6bdcf41eab3303f4806494016199
2013-12-18 18:17:52 -08:00
Elliott Hughes
2abef87f7d am 9baf4839: am 3761f453: am f5897dcb: Merge "Fix linking of aarch64 static binaries."
* commit '9baf483936ef238d3961c281c6bc7280aec7069c':
  Fix linking of aarch64 static binaries.
2013-12-18 23:42:20 +00:00
Elliott Hughes
28d4b9bbcb Fix linking of aarch64 static binaries.
Change-Id: If1fa8b560074058b8f7ef32db21a7ca3c53d1fd7
2013-12-18 15:22:08 -08:00
Elliott Hughes
106e82ea29 am e567b596: am 512ff272: am 0b61567f: Merge "Fix the x86-64 int64_t/uint64_t."
* commit 'e567b596fe9a25584264ecf4a19ba4407d81d0ed':
  Fix the x86-64 int64_t/uint64_t.
2013-12-18 22:49:09 +00:00
Elliott Hughes
5c7795da84 am 85434881: am dce31dac: am 717ad649: Merge "Don\'t use __kernel_ulong_t."
* commit '85434881d33e8cb527c942c11e7d4c81ff3b56ca':
  Don't use __kernel_ulong_t.
2013-12-18 22:49:01 +00:00
Elliott Hughes
ba9fee97cf Fix the x86-64 int64_t/uint64_t.
This now matches aarch64, which was already correct.

Bug: 12213562
Change-Id: I5da19f0af98347992fea2a62938472f86427740f
2013-12-18 14:00:14 -08:00
Elliott Hughes
ad8842f5c6 Don't use __kernel_ulong_t.
Change-Id: Ifdfbac0ac6da647276a84bd64bb342bb5a07ad61
2013-12-18 12:22:33 -08:00
Elliott Hughes
72b430b5cc am 72f5da94: am 67c42d1d: am 7649766b: Merge "Remove <machine/kernel.h>."
* commit '72f5da943cd2ab5660753c7284e24433c3bb9efa':
  Remove <machine/kernel.h>.
2013-12-18 19:42:06 +00:00
Elliott Hughes
2b333ea31e Remove <machine/kernel.h>.
Bug: 12175484
Change-Id: I127f7f91f36bd879109d653e0c56ec56e2529d4d
2013-12-18 11:21:55 -08:00
Christopher Ferris
be5231442b Remove the non-uapi kernel headers.
Bug: 11559337
Change-Id: Id1ee4dadbd673cf35b9c79bc87f9a6fb7b2253c6
2013-12-18 10:34:18 -08:00
Elliott Hughes
a0c2cc7009 am 42513bf8: am 78ce7cbf: am d2bcbf0d: Merge "Small style cleanup."
* commit '42513bf8482fdb896f72d0d882973ebc4ade9aa2':
  Small style cleanup.
2013-12-18 18:22:00 +00:00
Elliott Hughes
67a5d0a429 am 03335d91: am 136e7f2b: am 611b903c: Merge "Properly detect timeout in pthread_mutex_lock_timeout_np_impl"
* commit '03335d91248aaf4c70a126fbf80481a924c4588b':
  Properly detect timeout in pthread_mutex_lock_timeout_np_impl
2013-12-18 18:09:26 +00:00
Elliott Hughes
977d4e0dc6 am 93e05879: am debc37b4: am e00f4890: Merge "Move bionic over to GCC\'s \'warning\' attribute."
* commit '93e058796760763f414e3403dca6d7f7781f73b8':
  Move bionic over to GCC's 'warning' attribute.
2013-12-18 18:05:58 +00:00
Elliott Hughes
9e79af3b61 Small style cleanup.
Change-Id: Ib45a4a2296232968296f9bd7cc3592ba46fd412d
2013-12-18 10:05:42 -08:00
Elliott Hughes
31d0542bcd am 0652fc66: am 63d56a00: am 62e6fe58: Merge "Fix compilation of crtbegin.c and pthread_debug.cpp."
* commit '0652fc667d86a646dc0011e9529bc59145e4bef4':
  Fix compilation of crtbegin.c and pthread_debug.cpp.
2013-12-18 18:02:35 +00:00
Elliott Hughes
611b903ca7 Merge "Properly detect timeout in pthread_mutex_lock_timeout_np_impl" 2013-12-18 17:56:22 +00:00
Elliott Hughes
e00f4890c7 Merge "Move bionic over to GCC's 'warning' attribute." 2013-12-18 17:52:18 +00:00
Elliott Hughes
e7c59f9e20 Fix compilation of crtbegin.c and pthread_debug.cpp.
Because there was no default := for the aarch64 libc_crt_target_cflags,
the += was causing libc_crt_target_cflags to be recursively-defined
variable, which meant that when we were compiling crtbegin.c LOCAL_PATH
would be bionic/tests/ and we'd have -Ibionic/tests/include/ and find
none of our include files.

Also fix linking of pthread_debug.cpp, at least in the disabled mode.
The enabled mode was already broken for all architectures, and continues
to be broken after this change. It's been broken for long enough that
we might want to just remove it...

(aarch64 is using the FSF linker where arm uses the gold linker.)

Change-Id: I7db2e386694f6933db043138e6e97e5ae54d4174
2013-12-18 09:47:44 -08:00
Elliott Hughes
c13fb75cea Move bionic over to GCC's 'warning' attribute.
This is a better solution than the old __warn_references because it's
a compile-time rather than link-time warning, it doesn't rely on something
that doesn't appear to be supported by gold (which is why you only used
to see these warnings on mips builds), and the errors refer to the exact
call site(s) rather than just telling you which object file contains a
reference to the bad function.

This is primarily so we can build bionic for aarch64; building libc.so
caused these warnings to fire (because link time is the wrong time) and
warnings are errors.

Change-Id: I5df9281b2a9d98b164a9b11807ea9472c6faa9e3
2013-12-17 20:43:30 -08:00
Elliott Hughes
a414f53e84 am 949295bb: am 22013ac4: am f293b157: Merge "AArch64: Linker64 support for AArch64"
* commit '949295bb87ea710e4c2c5353e39e52eafa0e1d05':
  AArch64: Linker64 support for AArch64
2013-12-17 23:22:40 +00:00
Marcus Oakland
e365f9d654 AArch64: Linker64 support for AArch64
Addition of support for AArch64 in the linker64 target.

Change-Id: I8dfd9711278f6706063e91f626b6007ea7a3dd6e
Signed-off-by: Marcus Oakland <marcus.oakland@arm.com>
2013-12-17 15:02:43 -08:00
Ken Mixter
4fae14f333 Properly detect timeout in pthread_mutex_lock_timeout_np_impl
Previously we were checking against a positive errno which
would not be returned from a system call.

Change-Id: I8e3a36f6fbf5ccc2191a152a1def37e2d6f93124
2013-12-17 14:26:01 -08:00
Elliott Hughes
47fb66a50b am fc61a873: am 1a92f739: am c858b567: Merge "AArch64: Add initial support for AArch64"
* commit 'fc61a87345c5d2e8d156aa9e38aab2f65d3c5670':
  AArch64: Add initial support for AArch64
2013-12-17 01:14:12 +00:00
Serban Constantinescu
e210488e0d AArch64: Add initial support for AArch64
This is the first patch out of a series of patches that add support for
AArch64, the new 64bit execution state of the ARMv8 Architecture. The
patches add support for LP64 programming model.

The patch adds:
* "arch-aarch64" to the architecture directories.
* "arch-aarch64/include" - headers used by libc
* "arch-aarch64/bionic":
    - crtbegin, crtend support;
    - aarch64 specific syscall stubs;
    - setjmp, clone, vfork assembly files.

Change-Id: If72b859f81928d03ad05d4ccfcb54c2f5dbf99a5
Signed-off-by: Serban Constantinescu <serban.constantinescu@arm.com>
2013-12-16 17:00:22 -08:00
Elliott Hughes
601aef388c am bf5d3929: am fa604740: am db718023: Merge "AArch64: Add support for AArch64 atomic operations"
* commit 'bf5d39296fca2a389f838d5b85fbfc7f19b76df3':
  AArch64: Add support for AArch64 atomic operations
2013-12-16 23:27:46 +00:00
Elliott Hughes
43f135abeb am 334e83e6: am 07fa38da: am 3937d415: Merge "Fix typo."
* commit '334e83e6b47ef4e0f36d4cd99a2269c3c4ae4f76':
  Fix typo.
2013-12-16 23:27:45 +00:00
Serban Constantinescu
1924a5c92e AArch64: Add support for AArch64 atomic operations
This patch adds support for AArch64 atomic operations. Some
of the stubs use the lightweight store/load exclusive.

Change-Id: Iaf704d048b2dc15bf08cf8e4f0c3ea9f2052fe13
Signed-off-by: Serban Constantinescu <serban.constantinescu@arm.com>
2013-12-16 13:09:33 -08:00
Elliott Hughes
4c186ffb83 Fix typo.
Change-Id: I85157a6b2056b6c17cae193200960b8cae3cb3b3
2013-12-16 13:02:49 -08:00
Elliott Hughes
087333c1cc am b31b775d: am e8101372: am 341b55a1: Merge "Clean up the pthread-only atomic stuff a little."
* commit 'b31b775dfee3730703ec58fcbbbaafae480399ff':
  Clean up the pthread-only atomic stuff a little.
2013-12-16 18:34:47 +00:00
Elliott Hughes
2b333b97a2 Clean up the pthread-only atomic stuff a little.
It looks like we can probably just use the generic GCC stuff instead;
the generated code looks pretty similar. We should come back to that.

These routines are only used by the pthread implementation, and
__bionic_atomic_inc isn't used, so we can remove it.

Change-Id: I8b5b8cb30a1b159f0e85c3675aee06ddef39b429
2013-12-16 10:18:11 -08:00
Elliott Hughes
5bcf426ab1 am 56f7c97e: am 6d4e8c1e: am 003be710: Merge "Clean up some ARMv4/ARMv5 cruft."
* commit '56f7c97e07d1b12a3fd5b22bfadec33afa254caa':
  Clean up some ARMv4/ARMv5 cruft.
2013-12-14 00:02:22 +00:00
Elliott Hughes
c54ca40aef Clean up some ARMv4/ARMv5 cruft.
Change-Id: I29e836fea4b53901e29f96c6888869c35f6726be
2013-12-13 14:02:30 -08:00
Joshua J. Drake
063a572e6b Fix backwards compatible system property structure
The original structure included four reserved 32-bit values. This
change adds these back into the structure so that the
__system_property_find_compat function will (again) process the system
properties correctly.
2013-12-13 13:56:39 -06:00
Elliott Hughes
f1e05aa736 am b77ef8dc: am 664b1d46: am 8623bf7b: Merge "Make <sys/param.h> more glibc-like."
* commit 'b77ef8dc811c146c3e9b5b9488ea0f0f91b72d1d':
  Make <sys/param.h> more glibc-like.
2013-12-12 23:58:39 +00:00
Christopher Ferris
9bed351f79 am 64edf779: am 7dfd8ae1: am 513d2770: Merge "Add ioprio.h."
* commit '64edf779d79fd81a39ee5e0327f585b37cd828f2':
  Add ioprio.h.
2013-12-12 23:51:17 +00:00
Elliott Hughes
8623bf7b4d Merge "Make <sys/param.h> more glibc-like." 2013-12-12 23:38:25 +00:00
Elliott Hughes
c2f082f655 Make <sys/param.h> more glibc-like.
In particular, add MAX and MIN, needed by elfutils.

Bug: 11864683
Change-Id: I1b876732cdf68cdf5b930319e5ef5b5647586718
2013-12-12 15:31:35 -08:00
Christopher Ferris
802a0a7285 Add ioprio.h.
Change-Id: I153d05c5b6e9d640e319d65acb48b9cb12b6dafb
2013-12-12 15:23:22 -08:00
Elliott Hughes
7b6d74f1a9 am 8d290516: am 2894204d: am 5aad083f: Merge "PTHREAD_KEYS_MAX cleanup."
* commit '8d290516620b6ccd9c86fa5d4ad76049e7ea2c04':
  PTHREAD_KEYS_MAX cleanup.
2013-12-12 21:08:02 +00:00
Elliott Hughes
1887621de8 PTHREAD_KEYS_MAX cleanup.
I fixed this bug a while back, but didn't remove it from the list,
could have added a better test, and could have written clearer code
that didn't require a comment.

Change-Id: Iebdf0f9a54537a7d5cbca254a5967b1543061f3d
2013-12-12 12:51:08 -08:00
Elliott Hughes
e2d10b2a32 am 19e845ec: am 1336cd6d: am 38fcbbb3: Merge "AArch64: Fix mmap64() definition for AArch64, X86_64"
* commit '19e845ec73dc2cdb4f2ca11cd6dd56a0c6c0284a':
  AArch64: Fix mmap64() definition for AArch64, X86_64
2013-12-12 19:12:16 +00:00
Serban Constantinescu
ed76a9361c AArch64: Fix mmap64() definition for AArch64, X86_64
For 64bit Architectures mmap() is equivalent to mmap64(). This patch
maps mmap64() to mmap() in a similar way to other syscalls that differ
based on the size of off_t and off64_t

Change-Id: If21b21ef71120bad23d9a608d02d4a7de5220a87
Signed-off-by: Serban Constantinescu <serban.constantinescu@arm.com>
2013-12-12 10:41:52 -08:00
Elliott Hughes
034c084e81 am 7105f406: am 5362e8d2: am 7bd08153: Merge "Remove harmful attempts to be helpful in pthread_mutex functions."
* commit '7105f40649310177ceef1028a39e428d7cf7a71a':
  Remove harmful attempts to be helpful in pthread_mutex functions.
2013-12-11 23:59:42 +00:00
Elliott Hughes
1a6aea8a05 am fcee65c4: am 200fcb26: am 73ef27cd: Merge "Clarify a comment."
* commit 'fcee65c4c46481eb953bb3b3502a85a369c29fb4':
  Clarify a comment.
2013-12-11 23:05:01 +00:00
Elliott Hughes
dff7203ee9 Remove harmful attempts to be helpful in pthread_mutex functions.
Most callers won't check for EINVAL, so it's best to fail early.
GCC takes the nonnull attribute as a guarantee that an argument
won't be NULL, so these hacks were already ineffective, which is
how we found that at least one commercial game was using NULL
as if it's a mutex, but actually getting no-op behavior.

Bug: 11971278
Change-Id: I89646e043d931778805a8b692e07a34d076ee6bf
2013-12-11 14:54:00 -08:00
Robert Greenwalt
feb8dbf3c2 am 7c2ada7f: am f2e4f8fd: am 2e359155: Merge "Fix dns search domain use in gethostbyname."
* commit '7c2ada7f98ef640e4adeb7e03062bb2de0a96dd9':
  Fix dns search domain use in gethostbyname.
2013-12-11 22:21:07 +00:00
Elliott Hughes
960ee37f2a Clarify a comment.
Change-Id: Iad2e33fb059170f808023ce3d17e9b8c13191f42
2013-12-11 12:41:54 -08:00
Robert Greenwalt
2e3591557f Merge "Fix dns search domain use in gethostbyname." 2013-12-11 19:32:37 +00:00
Robert Greenwalt
c11f6f0f39 Fix dns search domain use in gethostbyname.
Need to load search domain data before we attempt to use it.
bug:6799630

Change-Id: Ib228f4ca260339f71a2e28d5930c0a722bd43c92
2013-12-11 11:30:09 -08:00
Christopher Ferris
a0a8bb060c am 381bf3f0: am b3959928: Merge "Do not clear tids on detached threads."
* commit '381bf3f06acef22fd90ac6aced8f0a25ee51f78b':
  Do not clear tids on detached threads.
2013-12-09 18:34:28 +00:00
Christopher Ferris
101fb7d963 Do not clear tids on detached threads.
Make sure that the kernel isn't going to try and clear the tid of
freed memory.

Bug: 11963327
Change-Id: I95d02340bfbe92f56036d2cc58dbf0e3079eb7c3
2013-12-06 23:00:44 -08:00
Christopher Ferris
9d5f2d72c9 am df4e7ad8: am 0b4246b5: Merge "Add cfi directives to all arm assembly."
* commit 'df4e7ad88fd3578fc12016f44c754298f5fbd8e8':
  Add cfi directives to all arm assembly.
2013-12-03 20:42:00 +00:00
Christopher Ferris
ed45970ac5 Add cfi directives to all arm assembly.
Since the ENTRY/END macros now have .cfi_startproc/.cfi_endproc, most of the
custom arm assembly has no unwind information. Adding the proper cfi directives
for these and removing the arm directives.

Update the gensyscalls.py script to add these cfi directives for the generated
assembly. Also fix the references to non-uapi headers to the proper uapi
header.

In addition, remove the kill.S, tkill.S, tgkill.S for arm since they are not
needed at all. The unwinder (libunwind) is able to properly unwind using the
normal abort.

After this change, I can unwind through the system calls again.

Bug: 11559337
Bug: 11825869
Bug: 11321283

Change-Id: I18b48089ef2d000a67913ce6febc6544bbe934a3
2013-12-02 19:13:12 -08:00
Elliott Hughes
d1214a7ec5 am c566f35a: am ab0b0cdf: Merge "Finish <sys/user.h>."
* commit 'c566f35af462de45d119fb3b024e3db56d76927a':
  Finish <sys/user.h>.
2013-11-27 16:55:35 +00:00
Elliott Hughes
867e25105d am 3b9aba55: am 98c910fb: Merge "Fix the order of arguments to sys_clone for x86."
* commit '3b9aba55490ad4bc97c17c4a4e9acd51de1d8958':
  Fix the order of arguments to sys_clone for x86.
2013-11-27 16:55:34 +00:00
Elliott Hughes
bef09fac15 am cb88d966: am 6ae2f22d: Merge "Work around CLONE_SETTLS being weird on x86."
* commit 'cb88d966b0b4c643ddd8c108f75478db7aa4f5f9':
  Work around CLONE_SETTLS being weird on x86.
2013-11-27 16:55:34 +00:00
Elliott Hughes
15a7a13ecf am a1d1a46e: am 1c057607: Merge "Fix _exit_with_stack_teardown for x86."
* commit 'a1d1a46ef635e559bbc4a4548ae28c84102d6f0b':
  Fix _exit_with_stack_teardown for x86.
2013-11-27 16:55:34 +00:00
Elliott Hughes
ab797cb4fd Finish <sys/user.h>.
Change-Id: I1d97d7fa3d5be2ff4728571ed5376705a27091ec
2013-11-26 17:57:31 -08:00
Elliott Hughes
99c393dff3 Fix the order of arguments to sys_clone for x86.
Unlike x86-64, x86's arguments are just like every other
architecture's.

Change-Id: Ic6da23f2a70599683b68e7e12ab9ba061e0b349c
2013-11-26 16:20:50 -08:00
Elliott Hughes
80906141f7 Work around CLONE_SETTLS being weird on x86.
Unlike other architectures, on x86 (but not x86-64), CLONE_SETTLS
takes a pointer to a struct user_desc instead of a pointer to the
TLS itself. Rather than have to deal with this here, let's just use
the old __set_tls mechanism we used to use (and still use for the
main thread on all architectures, so it's not going away any time
soon).

Bug: 11826724
Change-Id: I02a27939a73ae6cea1134a3f4c1dd7eafea479da
2013-11-26 13:57:21 -08:00
Elliott Hughes
9dec707bd6 Fix _exit_with_stack_teardown for x86.
Change-Id: Ife8f9c538c86f7c0017143015d5ee849a99b625b
2013-11-26 13:48:24 -08:00
Elliott Hughes
ca80f099a2 Merge "Regenerate the bionic headers to match external/kernel-headers." 2013-11-25 22:19:23 +00:00
Elliott Hughes
1c9d30540e am 6fcdba7a: am a98fff25: Merge "Make <sys/timerfd.h> standalone."
* commit '6fcdba7a12eb1fdca200d725d09d27a69ee7b78a':
  Make <sys/timerfd.h> standalone.
2013-11-25 14:09:32 -08:00
Elliott Hughes
356a4e4a32 Regenerate the bionic headers to match external/kernel-headers.
(This undoes the AOSP-only ion.h hack.)

Bug: 11859767
Change-Id: Id863c70d63b2716ae22cafd7ddb1163bbc7a3d11
2013-11-25 14:09:12 -08:00
Elliott Hughes
ee6b6f167a am aee38bc0: am 5a52bd34: Merge "Regenerate the bionic kernel headers to match external/kernel-headers."
* commit 'aee38bc05ff0cd1294d079909c27732249507abd':
  Regenerate the bionic kernel headers to match external/kernel-headers.
2013-11-25 14:05:10 -08:00
Elliott Hughes
e96d4bffe5 Make <sys/timerfd.h> standalone.
There's no uapi timerfd.h.

Bug: 11559337
Change-Id: I77a4b1365fdcf2c9f18673b11341a165e54b4bbd
2013-11-25 13:58:38 -08:00
Elliott Hughes
c43d16a458 Regenerate the bionic kernel headers to match external/kernel-headers.
Bug: 11859767
Change-Id: I3d746188a1c4bdf8db1358521438435d3e63dbac
2013-11-25 13:50:55 -08:00
Christopher Ferris
2884789cfa am cf8500fd: am cda0c61d: am 14d6be45: Merge "Delete non-uapi headers."
* commit 'cf8500fd4359bd026829bdfd0dc4968ed07cc842':
  Delete non-uapi headers.
2013-11-24 00:27:51 -08:00
Christopher Ferris
cda0c61dc7 am 14d6be45: Merge "Delete non-uapi headers."
* commit '14d6be45b960f8fbb039bd946e22ce406e8b65c3':
  Delete non-uapi headers.
2013-11-24 00:20:23 -08:00
Christopher Ferris
7b29d586bb am 76115fe9: am dd1d4f1c: am 985c3fbb: Merge "Move arm user.h definitions to sys/user.h."
* commit '76115fe9a0a8a2a7f57abcc3fea4e2be079cb2e6':
  Move arm user.h definitions to sys/user.h.
2013-11-23 12:41:04 -08:00
Christopher Ferris
59a6012367 am 30aebed9: am 038919d3: am 507f95e2: Merge "Update script to copy in extra generated files."
* commit '30aebed98ab66329d62e0884209fd9d04a8b056f':
  Update script to copy in extra generated files.
2013-11-23 12:41:04 -08:00
Christopher Ferris
dd1d4f1cfd am 985c3fbb: Merge "Move arm user.h definitions to sys/user.h."
* commit '985c3fbb3b1dabfa799e2a8c102867349bcb5a76':
  Move arm user.h definitions to sys/user.h.
2013-11-23 08:02:04 -08:00
Christopher Ferris
e5a9200534 Delete non-uapi headers.
Update headers and delete non-uapi headers that have been removed from
external/kernel-headers project.

Change-Id: I9ed9632a941095fe1bf3b207bafe1151f00de033
2013-11-23 08:01:25 -08:00
Christopher Ferris
985c3fbb3b Merge "Move arm user.h definitions to sys/user.h." 2013-11-23 15:59:57 +00:00
Christopher Ferris
363390eaff Move arm user.h definitions to sys/user.h.
There is no uapi user.h file for arm, it was included by accident.
Move the user struct definition into the file to follow the pattern
used by the other architectures.

Change-Id: Ib9cea0deca551c9268382ddd6de9202fd32ef941
2013-11-22 18:00:09 -08:00
Christopher Ferris
038919d37c am 507f95e2: Merge "Update script to copy in extra generated files."
* commit '507f95e22b39fb58b9ffbba38ab593475b926af5':
  Update script to copy in extra generated files.
2013-11-22 17:22:10 -08:00
Christopher Ferris
b4091e69f1 Update script to copy in extra generated files.
There are files in generated/asm that simply include asm-generic files. The
script now copies any file in generated/asm that also exists in asm-generic.

Change-Id: I075161c68624e9e9e81797224831988ce02220eb
2013-11-22 17:04:34 -08:00
The Android Open Source Project
f00c938c7f Merge commit '811b0cdb2d6e4a697dbc63a678712759dd0db242' into HEAD
Change-Id: I786944f80fb1a2d502fed51dc2c391ed5db66761
2013-11-22 13:38:33 -08:00
Christopher Ferris
bbbf505c1d am e3bc2254: am a626e4d8: am 26f0e54a: Merge "Script to grab uapi headers from android kernel."
* commit 'e3bc2254138e92d1b4746709ec355a5bd43bbccd':
  Script to grab uapi headers from android kernel.
2013-11-21 23:00:03 -08:00
Elliott Hughes
6211255a6b am 68a4187c: am 50f6b836: am fa7b48bf: Merge "Regenerate uapi header files."
* commit '68a4187c4a88a885b36412607797e7ca65662968':
  Regenerate uapi header files.
2013-11-21 23:00:02 -08:00
Elliott Hughes
3eba84eee0 am 81768e18: am 5e818b33: am 880d0e6c: Merge "Remove hidden __reboot from header"
* commit '81768e18bb2e7c29917e1f4c188285c64498f61d':
  Remove hidden __reboot from header
2013-11-21 23:00:01 -08:00
Elliott Hughes
6bc95b6906 am 8acd5dd2: am 84336795: am eec57b37: Merge "Add support for the ternary operator to the header scrubber."
* commit '8acd5dd2f82ecbf57c275528d5f2e5db0ef60a34':
  Add support for the ternary operator to the header scrubber.
2013-11-21 23:00:01 -08:00
Elliott Hughes
5d352e6acd am 5a2526ac: am cb478f23: am d4143c8e: Merge "Fix useconds_t for LP64."
* commit '5a2526ac629802ff22f71d516f7979f1f4a4c34d':
  Fix useconds_t for LP64.
2013-11-21 23:00:00 -08:00
Elliott Hughes
57f4718cfc am 03adedfc: am a18a01f5: am 15a64948: Merge "Remove obsolete kernel/arch-mips headers."
* commit '03adedfc3c8d25939d8799ed2ce9292b063d8bc7':
  Remove obsolete kernel/arch-mips headers.
2013-11-21 22:59:59 -08:00
Elliott Hughes
15428215c6 am b749a010: am 8637bb53: am b135f6e5: Merge "Remove the unused arch-x86 and arch-x86-64 kernel headers."
* commit 'b749a010a3cf6b1544d1e27b360ffcb98ae1cdbc':
  Remove the unused arch-x86 and arch-x86-64 kernel headers.
2013-11-21 22:59:59 -08:00
Elliott Hughes
5df692fd4e am a38dcc02: am 70d37e34: am ca045a19: Merge "Switch to upstream sleep(3) and usleep(3)."
* commit 'a38dcc0210ad2f75aac72e2c3bef357bddb7b564':
  Switch to upstream sleep(3) and usleep(3).
2013-11-21 20:08:22 -08:00
Christopher Ferris
e3bc225413 am a626e4d8: am 26f0e54a: Merge "Script to grab uapi headers from android kernel."
* commit 'a626e4d8bc3d59cc328942fc30ffc04981b154ed':
  Script to grab uapi headers from android kernel.
2013-11-21 18:43:58 -08:00
Elliott Hughes
68a4187c4a am 50f6b836: am fa7b48bf: Merge "Regenerate uapi header files."
* commit '50f6b8363e1429316311450f2a3041040977d67c':
  Regenerate uapi header files.
2013-11-21 18:43:57 -08:00
Elliott Hughes
81768e18bb am 5e818b33: am 880d0e6c: Merge "Remove hidden __reboot from header"
* commit '5e818b331430c34c42259a1405a75cc4106a27d0':
  Remove hidden __reboot from header
2013-11-21 18:43:51 -08:00
Elliott Hughes
8acd5dd2f8 am 84336795: am eec57b37: Merge "Add support for the ternary operator to the header scrubber."
* commit '843367953f40ee84bcc53e08a60c82215303e1fb':
  Add support for the ternary operator to the header scrubber.
2013-11-21 18:43:48 -08:00
Elliott Hughes
5a2526ac62 am cb478f23: am d4143c8e: Merge "Fix useconds_t for LP64."
* commit 'cb478f23cc3765e3193beaf83fb35dd2d353d301':
  Fix useconds_t for LP64.
2013-11-21 18:43:47 -08:00
Elliott Hughes
03adedfc3c am a18a01f5: am 15a64948: Merge "Remove obsolete kernel/arch-mips headers."
* commit 'a18a01f553ce5350923c470c144dca87dfc8e992':
  Remove obsolete kernel/arch-mips headers.
2013-11-21 18:43:47 -08:00
Elliott Hughes
b749a010a3 am 8637bb53: am b135f6e5: Merge "Remove the unused arch-x86 and arch-x86-64 kernel headers."
* commit '8637bb5345bce20374ed345490d6de80cb874554':
  Remove the unused arch-x86 and arch-x86-64 kernel headers.
2013-11-21 18:43:46 -08:00
Elliott Hughes
a38dcc0210 am 70d37e34: am ca045a19: Merge "Switch to upstream sleep(3) and usleep(3)."
* commit '70d37e343aa0c8c771e01259377c98958fbfd3ee':
  Switch to upstream sleep(3) and usleep(3).
2013-11-21 17:15:03 -08:00
Elliott Hughes
3bc173dfad am 7c883327: am 556c7402: am 39bc7ecd: Merge "Fix <signal.h> for mips uapi."
* commit '7c88332701cc9aa2ed95148bed40f50c54adb36b':
  Fix <signal.h> for mips uapi.
2013-11-21 17:12:04 -08:00
Elliott Hughes
7c88332701 am 556c7402: am 39bc7ecd: Merge "Fix <signal.h> for mips uapi."
* commit '556c740298a07e586c423480328231cfd50966b6':
  Fix <signal.h> for mips uapi.
2013-11-21 17:07:47 -08:00
Christopher Ferris
26f0e54ae0 Merge "Script to grab uapi headers from android kernel." 2013-11-21 22:20:14 +00:00
Christopher Ferris
e994d41578 Script to grab uapi headers from android kernel.
Change-Id: Ia140e3ab27fbfee6b02f04c085f3e0e351bbe68d
2013-11-21 14:09:54 -08:00
Elliott Hughes
8cb52b056c Regenerate uapi header files.
Change-Id: Idc934ed8ae17aba3300e4022e9b42177b0907e9d
2013-11-21 13:43:23 -08:00
Elliott Hughes
880d0e6c64 Merge "Remove hidden __reboot from header" 2013-11-21 20:37:26 +00:00
Pavel Chupin
811cba00af Remove hidden __reboot from header
This change is required:
https://android-review.googlesource.com/#/c/70570

Change-Id: Idb991f96a424aa5b0f9e06d9fb787fe8c8530750
Signed-off-by: Pavel Chupin <pavel.v.chupin@intel.com>
2013-11-22 00:19:34 +04:00
Elliott Hughes
1198fd3864 Add support for the ternary operator to the header scrubber.
Used in various uapi headers.

Change-Id: Id0f862d2adc7ddc9727e8a29160d5435f8d547c3
2013-11-21 11:12:34 -08:00
Elliott Hughes
b55bc155f6 am 0b4ca7e3: am 004ecb39: am db1dec1e: Merge "Clean up pthread_internal_t."
* commit '0b4ca7e3ce59e6993b47cb7856e74c3c46b44c9b':
  Clean up pthread_internal_t.
2013-11-21 10:15:35 -08:00
Christopher Ferris
96a2e56fad am 47580cc0: am 3c6d1b88: am 2a34009f: Merge "Add .cfi_startproc/.cfi_endproc to ENTRY/END."
* commit '47580cc01768dcb67ab152915a2e78a98e36b463':
  Add .cfi_startproc/.cfi_endproc to ENTRY/END.
2013-11-21 10:15:34 -08:00
Elliott Hughes
07f35d9596 am 3eb08b0e: am f4e03b03: am bf652a5f: Merge "Provide <sys/user.h>."
* commit '3eb08b0e298e5b283add3a6a1abf0026d7cbcd98':
  Provide <sys/user.h>.
2013-11-21 10:15:33 -08:00
Elliott Hughes
0b4ca7e3ce am 004ecb39: am db1dec1e: Merge "Clean up pthread_internal_t."
* commit '004ecb39e1cc0aed57b6185d4adf015b61b2d0c6':
  Clean up pthread_internal_t.
2013-11-21 10:12:26 -08:00
Christopher Ferris
47580cc017 am 3c6d1b88: am 2a34009f: Merge "Add .cfi_startproc/.cfi_endproc to ENTRY/END."
* commit '3c6d1b887692ecc7198e5292d49e3635b68fa95c':
  Add .cfi_startproc/.cfi_endproc to ENTRY/END.
2013-11-21 10:12:25 -08:00
Elliott Hughes
3eb08b0e29 am f4e03b03: am bf652a5f: Merge "Provide <sys/user.h>."
* commit 'f4e03b03656527caf88b9e582ab5ca19ae697700':
  Provide <sys/user.h>.
2013-11-21 10:12:24 -08:00
Elliott Hughes
d4143c8e4c Merge "Fix useconds_t for LP64." 2013-11-21 17:05:04 +00:00
Elliott Hughes
15a6494856 Merge "Remove obsolete kernel/arch-mips headers." 2013-11-21 17:04:44 +00:00
Elliott Hughes
b135f6e58c Merge "Remove the unused arch-x86 and arch-x86-64 kernel headers." 2013-11-21 17:04:24 +00:00
Elliott Hughes
9c67d4307c Fix useconds_t for LP64.
Change-Id: I869e60484999c1feda3dcdb86bee5b5373e6b3df
2013-11-21 08:55:46 -08:00
Elliott Hughes
0e309c87ab am 0df47ece: am d5a59aa7: am 1b2d214b: Merge "Clean up forking and cloning."
* commit '0df47ece78b2e596dde3a2369b44917842bbbd4b':
  Clean up forking and cloning.
2013-11-21 08:12:58 -08:00
Elliott Hughes
7a7429b4f7 am 67026112: am 8154f010: am 318e86ed: Merge "bionic: call stdio cleanup on exit"
* commit '67026112a00b94f9d13c3adea2ffbb4fb83d55c5':
  bionic: call stdio cleanup on exit
2013-11-21 08:12:57 -08:00
Elliott Hughes
9280a859a6 am 86ae0ff1: am 044d4655: am 303fe0cb: Merge "Fix pthread_join."
* commit '86ae0ff135456b2b695f49cf40ccc4e8ebc60f51':
  Fix pthread_join.
2013-11-21 08:12:56 -08:00
Christopher Ferris
54b98c638a am 37e5c6ba: am 750668f5: am 862faa12: Merge "Pull in cleaned version.h header."
* commit '37e5c6ba89b9daca67b1c09e2b73b4c6eac805a5':
  Pull in cleaned version.h header.
2013-11-21 08:12:55 -08:00
Elliott Hughes
0a0fb39e8a am a8276f64: am 18368fc8: am f246c589: Merge "Clean up the pthread_create trampoline."
* commit 'a8276f64b203a01d1b393a11dc9c492d1a6557e3':
  Clean up the pthread_create trampoline.
2013-11-21 08:12:54 -08:00
Elliott Hughes
6442706d42 am 00f25edc: am 5b524852: am 645d4269: Merge "Switch pthread_create over to __bionic_clone."
* commit '00f25edccace521bc4cbc3cfe3d05e8e1a9b6652':
  Switch pthread_create over to __bionic_clone.
2013-11-21 08:12:53 -08:00
Elliott Hughes
0df47ece78 am d5a59aa7: am 1b2d214b: Merge "Clean up forking and cloning."
* commit 'd5a59aa767d4d87738b53995d73461be2778b9ee':
  Clean up forking and cloning.
2013-11-21 08:10:07 -08:00
Elliott Hughes
67026112a0 am 8154f010: am 318e86ed: Merge "bionic: call stdio cleanup on exit"
* commit '8154f010a1c017b56ec7de3014e3ddf958f92536':
  bionic: call stdio cleanup on exit
2013-11-21 08:10:03 -08:00
Elliott Hughes
86ae0ff135 am 044d4655: am 303fe0cb: Merge "Fix pthread_join."
* commit '044d4655b7c06c9d5988f7dc604e59f76e098f5d':
  Fix pthread_join.
2013-11-21 08:10:02 -08:00
Christopher Ferris
37e5c6ba89 am 750668f5: am 862faa12: Merge "Pull in cleaned version.h header."
* commit '750668f5abd9813bea6f33cb84d941ae306afea8':
  Pull in cleaned version.h header.
2013-11-21 08:09:59 -08:00
Elliott Hughes
a8276f64b2 am 18368fc8: am f246c589: Merge "Clean up the pthread_create trampoline."
* commit '18368fc8e696c54adbd1537bf2d7c5c217210957':
  Clean up the pthread_create trampoline.
2013-11-21 08:09:46 -08:00
Elliott Hughes
00f25edcca am 5b524852: am 645d4269: Merge "Switch pthread_create over to __bionic_clone."
* commit '5b5248526b0295e54f51dcc2fec6c1d8e5a3b9e2':
  Switch pthread_create over to __bionic_clone.
2013-11-21 08:09:43 -08:00
Elliott Hughes
b867fd6825 Remove obsolete kernel/arch-mips headers.
Bug: 11559337
Change-Id: I70e205ff1f5acd07fddd7d82367e818b13847acd
2013-11-20 18:09:34 -08:00
Elliott Hughes
ab61eb366a Switch to upstream sleep(3) and usleep(3).
Also fix the signature of usleep, and the definition of useconds_t which
should be unsigned, as the 'u' in its name implies.

This patch also cleans up the existing FreeBSD hacks by moving the libm
stuff from <sys/cdefs.h> to a libm-private header, and adding comments
about the hacks we use to build FreeBSD source.

Change-Id: Ibe5067a380502df94a0a3a7901969b35411085b6
2013-11-20 16:24:16 -08:00
Elliott Hughes
d8482b6c7e Fix <signal.h> for mips uapi.
Bug: 11559337
Change-Id: I4c6080f162d74ee78c81d698c7b50470b0e09586
2013-11-20 12:51:52 -08:00
Elliott Hughes
db1dec1ed4 Merge "Clean up pthread_internal_t." 2013-11-20 01:23:33 +00:00
Elliott Hughes
cef3faec0e Clean up pthread_internal_t.
Bug: 11755300
Change-Id: Ib509e8c5ec6b23513aa78b5ac5141d7c34ce2dc8
2013-11-19 17:22:22 -08:00
Elliott Hughes
5cb66cfdc2 Remove the unused arch-x86 and arch-x86-64 kernel headers.
x86-64 already used uapi headers, and x86 can too now.

Bug: 11559337
Change-Id: I1196d2500f06ad40f2488b96fc8ccc7e02c7d5c0
2013-11-19 16:57:42 -08:00
Christopher Ferris
507cfe2e10 Add .cfi_startproc/.cfi_endproc to ENTRY/END.
Bug: 10414953
Change-Id: I711718098b9f3cc0ba8277778df64557e9c7b2a0
2013-11-19 16:31:24 -08:00
Elliott Hughes
e888de81df Provide <sys/user.h>.
strace wants this, for example.

Change-Id: Icb4d64bde392abbc091fa3375a4fa19b2707b12c
2013-11-19 15:32:31 -08:00
Elliott Hughes
36d6188f8c Clean up forking and cloning.
The kernel now maintains the pthread_internal_t::tid field for us,
and __clone was only used in one place so let's inline it so we don't
have to leave such a dangerous function lying around. Also rename
files to match their content and remove some useless #includes.

Change-Id: I24299fb4a940e394de75f864ee36fdabbd9438f9
2013-11-19 14:08:54 -08:00
Elliott Hughes
318e86ed88 Merge "bionic: call stdio cleanup on exit" 2013-11-19 04:01:55 +00:00
Elliott Hughes
303fe0cb38 Merge "Fix pthread_join." 2013-11-19 03:49:00 +00:00
Elliott Hughes
877ec6d904 Fix pthread_join.
Let the kernel keep pthread_internal_t::tid updated, including
across forks and for the main thread. This then lets us fix
pthread_join to only return after the thread has really exited.

Also fix the thread attributes of the main thread so we don't
unmap the main thread's stack (which is really owned by the
dynamic linker and contains things like environment variables),
which fixes crashes when joining with an exited main thread
and also fixes problems reported publicly with accessing environment
variables after the main thread exits (for which I've added a new
unit test).

In passing I also fixed a bug where if the clone(2) inside
pthread_create(3) fails, we'd unmap the child's stack and TLS (which
contains the mutex) and then try to unlock the mutex. Boom! It wasn't
until after I'd uploaded the fix for this that I came across a new
public bug reporting this exact failure.

Bug: 8206355
Bug: 11693195
Bug: https://code.google.com/p/android/issues/detail?id=57421
Bug: https://code.google.com/p/android/issues/detail?id=62392
Change-Id: I2af9cf6e8ae510a67256ad93cad891794ed0580b
2013-11-18 19:48:11 -08:00
Pawit Pornkitprasan
652289942d bionic: call stdio cleanup on exit
As of 61e699a133, stdio clean up
functions are no longer registered in atexit and must be called
manually via __cleanup.

The issue this fixes is some static binaries linked against bionic
cannot output properly when piped or redirected because the buffer
is not flushed before closing.

This is done by pulling in exit.c (and other dependencies) from
netbsd.

Change-Id: I193e54a6d08900f291550029fe75ce76394d9e22
2013-11-19 09:49:17 +07:00
Christopher Ferris
e372ec8cf9 Pull in cleaned version.h header.
Change-Id: Ia917af9336b63ed5a10147770a8110134cb274cb
2013-11-15 16:29:28 -08:00
Elliott Hughes
e48b68570d Clean up the pthread_create trampoline.
Bug: 8206355
Bug: 11693195
Change-Id: I35cc024d5b6ebd19d1d2e45610db185addaf45df
2013-11-15 14:57:45 -08:00
Elliott Hughes
70b24b1cc2 Switch pthread_create over to __bionic_clone.
Bug: 8206355
Bug: 11693195
Change-Id: I04aadbc36c87e1b7e33324b9a930a1e441fbfed6
2013-11-15 14:41:19 -08:00
Elliott Hughes
24cbf1991a am 04b4339a: am 60a67a0c: am 05ec00bf: Merge "[MIPS] Reimplement syscall to invoke the system call directly"
* commit '04b4339ad5396690329877df10fbe568bd4dd600':
  [MIPS] Reimplement syscall to invoke the system call directly
2013-11-14 17:09:48 -08:00
Elliott Hughes
04b4339ad5 am 60a67a0c: am 05ec00bf: Merge "[MIPS] Reimplement syscall to invoke the system call directly"
* commit '60a67a0c7e44dfc47b9b4271ea4ae2dbf336849a':
  [MIPS] Reimplement syscall to invoke the system call directly
2013-11-14 17:07:13 -08:00
Chris Dearman
effaa7824d [MIPS] Reimplement syscall to invoke the system call directly
Some MIPS kernels do not correctly restart interrupted system calls that
have been invoked using the indirect syscall (NR_syscall).

The simplest workaround is to handle the indirection in userland and then
call the required system call directly.

Change-Id: I8385399621529db9a52b463c96925f6decaaca30
2013-11-14 16:53:15 -08:00
Elliott Hughes
ad7e42d6bd am 1b782289: am 5a70acd1: am ae5c3dd7: Merge "Remove the mips regdef.h and fpregdef.h old kernel headers."
* commit '1b782289f4f89434693e3e906df9c9cf43b4d277':
  Remove the mips regdef.h and fpregdef.h old kernel headers.
2013-11-13 18:47:59 -08:00
Elliott Hughes
1b782289f4 am 5a70acd1: am ae5c3dd7: Merge "Remove the mips regdef.h and fpregdef.h old kernel headers."
* commit '5a70acd176a792868a61c94169d5e6c0679202f2':
  Remove the mips regdef.h and fpregdef.h old kernel headers.
2013-11-13 16:28:37 -08:00
Elliott Hughes
007eced93b Remove the mips regdef.h and fpregdef.h old kernel headers.
Bug: 11559337
Change-Id: I6352cac9c4ef425cb21e34d0299223711ec079af
2013-11-13 16:13:01 -08:00
Elliott Hughes
5ebfaf84df am 5c56512e: am cdd6fdec: am 6768c1ee: Merge "Add a temporary uapi/linux/compiler.h until upstream has one."
* commit '5c56512eebc14558a2b3b83cdca09f04084d609c':
  Add a temporary uapi/linux/compiler.h until upstream has one.
2013-11-08 16:03:52 -08:00
Elliott Hughes
41392e2802 am e9664fea: am 5b6290bc: am ff5b0fc8: Merge "Remove the dependency on the non-uapi __kernel_nlink_t."
* commit 'e9664fea54d21f765c906006db27b8e275c4a198':
  Remove the dependency on the non-uapi __kernel_nlink_t.
2013-11-08 16:03:51 -08:00
Elliott Hughes
5c56512eeb am cdd6fdec: am 6768c1ee: Merge "Add a temporary uapi/linux/compiler.h until upstream has one."
* commit 'cdd6fdec6c8175b4b9f132a2b11c1fc5f20e8869':
  Add a temporary uapi/linux/compiler.h until upstream has one.
2013-11-08 15:25:38 -08:00
Elliott Hughes
e9664fea54 am 5b6290bc: am ff5b0fc8: Merge "Remove the dependency on the non-uapi __kernel_nlink_t."
* commit '5b6290bcfb47ffb27a66450c9cc3258021e259fa':
  Remove the dependency on the non-uapi __kernel_nlink_t.
2013-11-08 15:17:19 -08:00
Elliott Hughes
740531354e Add a temporary uapi/linux/compiler.h until upstream has one.
Bug: 11559337
Change-Id: I205974b1a26e4f85d0e11503afa80669195d211c
2013-11-08 15:13:54 -08:00
Elliott Hughes
2ecc164ae9 Remove the dependency on the non-uapi __kernel_nlink_t.
The kernel doesn't have an nlink_t; it just uses the equivalent of
uint32_t. We already had a usable __nlink_t in the C library, so
let's just define our nlink_t in terms of __nlink_t, which is what
__nlink_t was meant for anyway.

Note that our struct stat just follows the kernel, and doesn't refer
to nlink_t anyway.

Change-Id: I2a56e418e42404b1741b08c50554b03c11caebae
2013-11-08 14:38:12 -08:00
Elliott Hughes
0538d38a30 am 26d8853a: am cac7eec5: am 68723453: Merge "Generate the uapi headers for mips and x86/x86_64."
* commit '26d8853ab5d3c42654a90bf31e54bb851f3b083c':
  Generate the uapi headers for mips and x86/x86_64.
2013-11-08 14:28:57 -08:00
Elliott Hughes
26d8853ab5 am cac7eec5: am 68723453: Merge "Generate the uapi headers for mips and x86/x86_64."
* commit 'cac7eec55a4853abfcd5b8d7bce35d79ab330132':
  Generate the uapi headers for mips and x86/x86_64.
2013-11-08 14:23:38 -08:00
Elliott Hughes
abd626117c Generate the uapi headers for mips and x86/x86_64.
Bug: 11559337
Change-Id: I23b1a43e7bfa8fa6f9df7e59d2e731a0ec52dafc
2013-11-08 11:46:03 -08:00
Elliott Hughes
fae1b3d1a2 am b92de381: am 99a38fcf: am 486c8616: Merge "Prepare to switch to the uapi <linux/signal.h>."
* commit 'b92de38170e3d3aeb2b05449909fb76c96954062':
  Prepare to switch to the uapi <linux/signal.h>.
2013-11-07 15:13:24 -08:00
Elliott Hughes
693cd7ff65 am 81c24a1a: am c9c84992: am 266eb4a4: Merge "Stop using the non-uapi <linux/err.h> header file."
* commit '81c24a1a49ada6fa86ea51070a6202fce7036f36':
  Stop using the non-uapi <linux/err.h> header file.
2013-11-07 15:12:59 -08:00
Elliott Hughes
b92de38170 am 99a38fcf: am 486c8616: Merge "Prepare to switch to the uapi <linux/signal.h>."
* commit '99a38fcf33d220524e41979a3f9d842399fd638d':
  Prepare to switch to the uapi <linux/signal.h>.
2013-11-07 12:45:33 -08:00
Elliott Hughes
61fb3fc770 Prepare to switch to the uapi <linux/signal.h>.
<time.h> didn't need to copy the cruft from <signal.h>, and
<signal.h> only needs the uid_t hack when it's not using
uapi headers.

pthread_exit.cpp should include what it uses.

Change-Id: I836c36abe0f0a781d41fc425b249d1c7686bb124
2013-11-07 12:29:07 -08:00
Elliott Hughes
81c24a1a49 am c9c84992: am 266eb4a4: Merge "Stop using the non-uapi <linux/err.h> header file."
* commit 'c9c84992fb9ccbf32580c93967356383f58d9687':
  Stop using the non-uapi <linux/err.h> header file.
2013-11-07 10:48:29 -08:00
Elliott Hughes
ed74484dcb Stop using the non-uapi <linux/err.h> header file.
We only need it for MAX_ERRNO, and it's time we had somewhere to put
the little assembler utility macros we've been putting off writing.

Change-Id: I9354d2e0dc47c689296a34b5b229fc9ba75f1a83
2013-11-07 10:31:05 -08:00
Rom Lemarchand
d1cd2392c9 Merge "Refresh libc/kernel/common/linux/ion.h" 2013-11-07 13:29:57 +00:00
Elliott Hughes
2a6e13064f am 6fc4a1cd: am a034e1d3: Merge "Remove pathconf\'s dependencies on non-uapi header files."
* commit '6fc4a1cd3aecca409766e82d333f9cb127a85593':
  Remove pathconf's dependencies on non-uapi header files.
2013-11-06 17:38:12 -08:00
Elliott Hughes
07ddeb0901 am dc9b54c1: am f945732e: Merge "Fix a TODO; we\'ve had SOCK_CLOEXEC for a while now."
* commit 'dc9b54c11c3b20fe5d1dc5c591ff058788e7b376':
  Fix a TODO; we've had SOCK_CLOEXEC for a while now.
2013-11-06 17:21:35 -08:00
Elliott Hughes
7250d2e5b4 Remove pathconf's dependencies on non-uapi header files.
Change-Id: I597996e4b141b009916f7ad2866dd100e08aa4d3
2013-11-06 17:21:09 -08:00
Elliott Hughes
a4e281a549 am 76833a7c: am 9e63e03d: Merge "Clean up the 32-bit kernel support, fix LP64 fcntl declaration."
* commit '76833a7c575ca372b41cb6e2a964918d69fc0dbe':
  Clean up the 32-bit kernel support, fix LP64 fcntl declaration.
2013-11-06 17:07:35 -08:00
Elliott Hughes
9be07fa527 Fix a TODO; we've had SOCK_CLOEXEC for a while now.
Change-Id: I4bc39b57f3c33441ead74127f576bf5a4e311566
2013-11-06 17:04:56 -08:00
Elliott Hughes
9e63e03d34 Merge "Clean up the 32-bit kernel support, fix LP64 fcntl declaration." 2013-11-07 01:02:55 +00:00
Elliott Hughes
062092543f Clean up the 32-bit kernel support, fix LP64 fcntl declaration.
In practice, thanks to all the registers the stubs don't actually change,
but it's confusing to have an incorrect declaration.

I suspect that fcntl remains broken for aarch64; it happens to work for
x86_64 because the first vararg argument gets placed in the right register
anyway, but I have no reason to believe that's true for aarch64.

This patch adds a unit test, though, so we'll be able to tell when we get
as far as running the unit tests.

Change-Id: I58dd0054fe99d7d51d04c22781d8965dff1afbf3
2013-11-06 16:33:39 -08:00
Ben Cheng
64aca718ee am 99205dc9: am af10f9e9: Merge "Add processed uapi kernel headers for ARM."
* commit '99205dc987735e1d57f2e1b8446448f655808ab5':
  Add processed uapi kernel headers for ARM.
2013-11-06 16:10:15 -08:00
Elliott Hughes
c606294b93 am 3721a7e7: am 7115c802: Merge "Fix pread/pwrite for LP64."
* commit '3721a7e71fc831f6d58b7253627043d0658ad977':
  Fix pread/pwrite for LP64.
2013-11-06 16:10:14 -08:00
Elliott Hughes
a047e0ab51 am afc51b92: am c4dbc16e: Merge "Make cpp.py less braindead."
* commit 'afc51b92a0e531f05e0e5477ea857a8669e5e5d1':
  Make cpp.py less braindead.
2013-11-06 16:10:12 -08:00
Ben Cheng
af10f9e927 Merge "Add processed uapi kernel headers for ARM." 2013-11-06 23:55:25 +00:00
Ben Cheng
a6b53f03c7 Add processed uapi kernel headers for ARM.
Change-Id: Id34de841b7b4b5a1bf7d22eb793860f92f24a6e5
2013-11-06 15:51:05 -08:00
Elliott Hughes
8fbf8deb34 Fix pread/pwrite for LP64.
Unlike on 32-bit systems where off_t is 32-bit, we don't want to
throw away the top 32 bits of an LP64 system's 64-bit off_t.

Change-Id: Ib2e0daeb4fc0b8ab3d1b983d0b371d8f81033b50
2013-11-06 13:10:37 -08:00
Elliott Hughes
40596aa005 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
2013-11-06 12:04:48 -08:00
Rom Lemarchand
ea699f0cf4 Refresh libc/kernel/common/linux/ion.h
Change-Id: Ibd2bf99224b31bbad7b3a9b0d82bfef19162db7b
2013-11-06 09:55:03 -08:00
Elliott Hughes
c76ba85e16 am ffe06880: am f1258672: Merge "Fix <sys/select.h> for LP64, clean up <time.h>."
* commit 'ffe068808909c9825807dbaf8679b9f9efc2c690':
  Fix <sys/select.h> for LP64, clean up <time.h>.
2013-11-05 14:01:49 -08:00
Elliott Hughes
3503ce2177 Fix <sys/select.h> for LP64, clean up <time.h>.
The 64-bit uapi headers don't define FD_CLR and friends, so this
patch updates libc/kernel/common/linux/time.h after the change
b934bbec145e9e084bf48149a3a94ae3dd132157 in external/kernel-headers,
then fixes <sys/select.h> to work in this new world, and removes
some now-unnecessary duplication from <time.h> (with other cruft
cleaned up while I'm here).

Change-Id: Ifd26f901b4d200c65065b3e6ef1b74055127e052
2013-11-05 13:28:36 -08:00
Elliott Hughes
a0352c60ec am 3c5d651c: am 9b9f0d0c: Merge "Remove unnecessary #include."
* commit '3c5d651c051e56e7fb48214e334600cd3f361460':
  Remove unnecessary #include.
2013-11-05 12:06:58 -08:00
Elliott Hughes
6fa79c5cf5 Remove unnecessary #include.
Change-Id: I99dade0b3803272ee29eba2ad36b0311f8a24c31
2013-11-05 11:59:06 -08:00
Elliott Hughes
748ad3d3f5 am 00889af0: am 943cc1b5: Merge "Refresh libc/kernel/common/linux/uinput.h"
* commit '00889af038359e0a7e97384bad25a809e8887857':
  Refresh libc/kernel/common/linux/uinput.h
2013-10-31 16:07:39 -07:00
Scott Anderson
126f66a601 Refresh libc/kernel/common/linux/uinput.h
Change-Id: Icd830af5aee63276554ebf7bfe8192965209cc59
Signed-off-by: Scott Anderson <saa@google.com>
2013-10-31 15:45:32 -07:00
Elliott Hughes
8441e0312c am 61ec6a62: am cc9b7456: Merge "Move the pthread debugging flags to the right place."
* commit '61ec6a621c699d68246a3dfe724fa13f0555ecf4':
  Move the pthread debugging flags to the right place.
2013-10-31 14:26:46 -07:00
Elliott Hughes
66759d6041 Move the pthread debugging flags to the right place.
Change-Id: Ie805bd837d1f72cdf1818e056c0baeb0857e4e84
2013-10-31 14:09:39 -07:00
Elliott Hughes
26e9e3c76a am 1658691e: am 0360e3ab: Merge "<pthread.h> fixes and pthread cleanup."
* commit '1658691e0cfe2eb221bee837649de1907a579a0b':
  <pthread.h> fixes and pthread cleanup.
2013-10-31 13:43:18 -07:00
Elliott Hughes
c3f114037d <pthread.h> fixes and pthread cleanup.
<pthread.h> was missing nonnull attributes, noreturn on pthread_exit,
and had incorrect cv qualifiers for several standard functions.

I've also marked the non-standard stuff (where I count glibc rather
than POSIX as "standard") so we can revisit this cruft for LP64 and
try to ensure we're compatible with glibc.

I've also broken out the pthread_cond* functions into a new file.

I've made the remaining pthread files (plus ptrace) part of the bionic code
and fixed all the warnings.

I've added a few more smoke tests for chunks of untested pthread functionality.

We no longer need the libc_static_common_src_files hack for any of the
pthread implementation because we long since stripped out the rest of
the armv5 support, and this hack was just to ensure that __get_tls in libc.a
went via the kernel if necessary.

This patch also finishes the job of breaking up the pthread.c monolith, and
adds a handful of new tests.

Change-Id: Idc0ae7f5d8aa65989598acd4c01a874fe21582c7
2013-10-31 12:31:16 -07:00
Elliott Hughes
b0b2e29d4e am 9be24f71: am d0d0b52d: Merge "Remove an obsolete ARM gdb hack."
* commit '9be24f71604d4e667bf23d77bb953a29737b3f2d':
  Remove an obsolete ARM gdb hack.
2013-10-30 14:42:59 -07:00
Elliott Hughes
b5b97f20a8 Remove an obsolete ARM gdb hack.
Experiment shows that the claim in the makefile was false: gdb works fine
setting breakpoints in these functions when compiled without special treatment.

Change-Id: Ibdf4dd5a14d171c954b8c2089daaf28e1c310be9
2013-10-30 14:32:42 -07:00
Elliott Hughes
0f3973bdb5 am 6cf34775: am 47a73363: Merge "Factor out some of the makefile cruft."
* commit '6cf34775513859dd48b986162e761aff57df82fb':
  Factor out some of the makefile cruft.
2013-10-29 19:18:56 -07:00
Elliott Hughes
8695949391 am ee99ebbc: am 7a8e20c9: Merge "Explain the sigprocmask in pthread_exit."
* commit 'ee99ebbc8f0447880f316a10b2249f813f964172':
  Explain the sigprocmask in pthread_exit.
2013-10-29 18:31:06 -07:00
Elliott Hughes
2f287bc728 Factor out some of the makefile cruft.
I really don't want to add yet another copy for aarch64.

Also sort arm, mips, and x86.

Also silence the "TARGET_ARCH_VARIANT" warning for non-ARM; Intel and MIPS
have both complained about it.

Change-Id: I32c592a90c0cf0cdae250d84035b3e4655543781
2013-10-29 16:59:54 -07:00
Elliott Hughes
2b6e43e00e Explain the sigprocmask in pthread_exit.
Also remove the SIGSEGV special case, which was probably because
hand-written __exit_with_stack_teardown stubs used to try to cause
SIGSEGV if the exit system call returned (which it never does, so
that dead code disappeared).

Also move the sigprocmask into the only case where it's necessary ---
the one where we unmap the stack that would be used by a signal
handler.

Change-Id: Ie40d20c1ae2f5e7125131b6b492cba7a2c6d08e9
2013-10-29 16:11:06 -07:00
Elliott Hughes
5abb9b15d1 am 3030157f: am 8e6e7cda: Merge "Update <sys/exec_elf.h> to include EM_AARCH64."
* commit '3030157f82e012612ef4c6d999878be2f65116dd':
  Update <sys/exec_elf.h> to include EM_AARCH64.
2013-10-29 08:57:41 -07:00
Elliott Hughes
126405039e Update <sys/exec_elf.h> to include EM_AARCH64.
Upstream added the constant for us.

Change-Id: I197e32d2e5b3fd499d069546ccfcc1d35d65e0a0
2013-10-28 21:28:40 -07:00
Elliott Hughes
bb9a819857 am e89d16d2: am 6e504fda: Merge "AArch64: Add support for AArch64 to stdlib/strtod.c"
* commit 'e89d16d24bb9d07856c7cc95464bfae970f4e847':
  AArch64: Add support for AArch64 to stdlib/strtod.c
2013-10-28 16:36:46 -07:00
Elliott Hughes
8d7297538c am d4e28c23: am 830de5cb: Merge "AArch64: Autogenerated syscalls for AArch64"
* commit 'd4e28c236b592a4968bff354ad7ad192d5a3f36d':
  AArch64: Autogenerated syscalls for AArch64
2013-10-28 16:25:47 -07:00
Serban Constantinescu
65ca282ecd AArch64: Add support for AArch64 to stdlib/strtod.c
This patch adds support for AArch64 to strtod.c definitions.

Change-Id: I9491c4371d921c00e73ae169877a9a71225731fb
Signed-off-by: Serban Constantinescu <serban.constantinescu@arm.com>
2013-10-28 16:24:51 -07:00
Elliott Hughes
61f8f7b510 am 48e0ee8a: am 93b7b819: Merge "AArch64: Add support for AArch64 to the syscall interface"
* commit '48e0ee8a0900e820b2fb1bae6347e0d39da62096':
  AArch64: Add support for AArch64 to the syscall interface
2013-10-28 16:22:26 -07:00
Elliott Hughes
87de1a0154 am 5911e25b: am 07d3c6ce: Merge "Fix the *rand48 functions on LP64."
* commit '5911e25bfc8ef3815d0e1ab4f5829ff74a523088':
  Fix the *rand48 functions on LP64.
2013-10-28 16:19:02 -07:00
Serban Constantinescu
7f8863dc07 AArch64: Autogenerated syscalls for AArch64
This patch adds AArch64 syscalls, autogenerated using:
        ./libc/tools/gensyscalls.py

Change-Id: I1cc60430423ecb52a35448bf2c358b82136b2f16
Signed-off-by: Serban Constantinescu <serban.constantinescu@arm.com>
2013-10-28 16:18:42 -07:00
Serban Constantinescu
feaa89a1bc AArch64: Add support for AArch64 to the syscall interface
This patch adds support for AArch64 to the syscall interface. The kernel
implementation exports a set of canonical syscalls, therefore some of
the userspace exported syscalls are implemented as stubs based on the
canonical set.

Change-Id: Ia965d71e97769b8be9d7655193fc40303964c4df
Signed-off-by: Serban Constantinescu <serban.constantinescu@arm.com>
2013-10-28 16:16:34 -07:00
Elliott Hughes
60fd3450bf Fix the *rand48 functions on LP64.
I reported the mrand48 bug upstream, and 'matt' fixed the whole family
of functions!

Change-Id: I07fbc034e86499ce89599c3026a741738fd0cfc0
2013-10-28 15:24:26 -07:00
Elliott Hughes
85d8536f34 am 6ec070a0: am 020bcdae: Merge "Update <sys/exec_elf.h> to get the DF_* flags."
* commit '6ec070a01509c3477be6d36cd46b81c9b3876733':
  Update <sys/exec_elf.h> to get the DF_* flags.
2013-10-28 15:06:58 -07:00