Compare commits

..

1275 Commits

Author SHA1 Message Date
Naseer Ahmed
5115d4348e msm_mdp: Update header for 4 layer support
Bug: 7626586
Change-Id: I37730470dc09b7a9d6336b1603f87efd98f45e97
Signed-off-by: Iliyan Malchev <malchev@google.com>
2012-11-29 14:00:46 -08:00
The Android Automerger
f29c214d6a merge in jb-mr1-release history after reset to jb-mr1-dev 2012-10-30 20:11:57 -07:00
Elliott Hughes
a811d7a8e6 Upgrade to tzdata2012h.
The 2012h release reflects the following changes recently circulated
on the tz mailing list:

[Brazil]  Bahia no longer has DST.  (Thanks to Kelley Cook.)

[Brazil]  Tocantins has DST.  (Thanks to Rodrigo Severo.)

[Israel]  Israel has new DST rules next year.  (Thanks to Ephraim Silverberg.)

[Jordan]  Jordan stays on DST this winter.  (Thanks to Steffen Thorsen.)

Bug: 7429010
Change-Id: I82f19ce49f944f928b6dd8dc5a893786266e5cb9
2012-10-28 11:33:56 -07:00
The Android Automerger
5ba74660e3 merge in jb-mr1-release history after reset to jb-mr1-dev 2012-10-19 15:45:58 -07:00
Elliott Hughes
f0e402dbd2 Upgrade to tzdata2012g.
This release reflects the following changes recently circulated on the tz
mailing list:

        Samoa fall 2012 and later.  (Thanks to Nicholas Pereira
        and Robert Elz.)

        Palestine fall 2012.  (Thanks to Steffen Thorsen.)

This release does not reflect the possible changes discussed yesterday
for Tocantins and Bahia.

Change-Id: I52d9d2cd6e8e755885dc258200c014bee75527c9
2012-10-18 16:34:48 -07:00
The Android Automerger
7cc2dec82e merge in jb-mr1-release history after reset to jb-mr1-dev 2012-10-10 14:06:19 -07:00
Ying Wang
2c287e9510 Set up the private variables.
Now we use private variables in transform-o-to-executable to support
build executables against the NDK.
Cherry-picked from master.

Bug: 7170098
Change-Id: Ic8f1d36a116fce24f3ea6a3ff5e9bfab6cafee99
2012-10-10 10:25:13 -07:00
The Android Automerger
956092e07c merge in jb-mr1-release history after reset to jb-mr1-dev 2012-10-03 06:59:12 -07:00
Naseer Ahmed
3ef4fecd30 bionic: update processed msm_mdp.h
-- Has display commit ioctl

Bug: 7274951
Change-Id: If2d47edf3ada418e8c61a2acc7b79fb3422f3473
Signed-off-by: Iliyan Malchev <malchev@google.com>
2012-10-02 23:37:34 -07:00
Andy McFadden
98957db553 Merge "Test flags before using "info"" into jb-mr1-dev 2012-10-02 15:23:20 -07:00
Andreas Huber
2e0452cbd1 bionic: update processed msm_vidc_enc.h
Updated kernel headers to support a video encoder ioctl to preprend each IDR
frame with SPS/PPS.

related-to-bug: 7245308
Change-Id: I7244c521690d69a905deb19940a04fd4f2e06935
Signed-off-by: Iliyan Malchev <malchev@google.com>
2012-10-02 14:34:03 -07:00
Andy McFadden
f84bc8d6f6 Test flags before using "info"
Our debugger signal catcher expects to receive three args, but if
somebody cleared SA_SIGINFO we only get one, and bad things happen
when we try to use the second one.  Test to see if SA_SIGINFO is
still set before we try to use the argument.

Bug: 7272866
Change-Id: If682a2262fe8a575f3802fb0c60a53eea3082456
2012-10-02 14:30:41 -07:00
The Android Automerger
f27642c082 merge in jb-mr1-release history after reset to jb-mr1-dev 2012-09-30 06:59:14 -07:00
Saurabh Shah
204b26b440 bionic: Update msm_mdp.h with new MSMFB_OVERLAY_COMMIT ioctl
This change adds msm_mdp.h header changes to bionic.

This IOCTL is a substitute for PAN on external panel.  It waits for DMAE to
finish before returning and avoid delays in the PAN path.

Bug: 7249589
Acked-by: Arun Kumar K.R <akumarkr@codeaurora.org>
Change-Id: I4b04a4538919ffcb994699a432c4322e9f94e870
Signed-off-by: Iliyan Malchev <malchev@google.com>
2012-09-28 13:46:13 -07:00
The Android Automerger
9014818f61 merge in jb-mr1-release history after reset to jb-mr1-dev 2012-09-25 06:59:12 -07:00
Elliott Hughes
f4b34b6c39 DO NOT MERGE Revert "Add the libcutils localtime_tz and mktime_t extensions to bionic."
This reverts commit 3a936a4980.

We don't want this in jb-mr1.
2012-09-24 10:13:12 -07:00
Elliott Hughes
6c0e373d38 am ec432608: am 0c24effd: Merge "Add the libcutils localtime_tz and mktime_t extensions to bionic."
* commit 'ec4326084ed2a717b3e318f36c2675ef033c30ff':
  Add the libcutils localtime_tz and mktime_t extensions to bionic.
2012-09-24 09:40:18 -07:00
Elliott Hughes
ec4326084e am 0c24effd: Merge "Add the libcutils localtime_tz and mktime_t extensions to bionic."
* commit '0c24effd01736e533fd082b2cf1de8926b0fe880':
  Add the libcutils localtime_tz and mktime_t extensions to bionic.
2012-09-24 08:55:27 -07:00
Elliott Hughes
ecf67e152a am 2d51dddf: am 85049ead: Merge "Use hidden visibility for several internal-use-only functions."
* commit '2d51dddf1a649c73f207ecf48d419fea8a8ed4de':
  Use hidden visibility for several internal-use-only functions.
2012-09-24 08:52:15 -07:00
Elliott Hughes
d2eea0e6d6 am baa74eff: am 882c6af9: Merge "[MIPS] Add CONFIG_32BIT to kernel_default_arch_macros for MIPS. Some of the required structure definitons are defined under this macro."
* commit 'baa74eff0dd56b1dbf8e8a233a82e6382828ad72':
  [MIPS] Add CONFIG_32BIT to kernel_default_arch_macros for MIPS. Some of the required structure definitons are defined under this macro.
2012-09-24 08:52:14 -07:00
Elliott Hughes
2d51dddf1a am 85049ead: Merge "Use hidden visibility for several internal-use-only functions."
* commit '85049ead251b0af9411ada3ad1db0f6b75f8e4a8':
  Use hidden visibility for several internal-use-only functions.
2012-09-24 08:43:45 -07:00
Elliott Hughes
baa74eff0d am 882c6af9: Merge "[MIPS] Add CONFIG_32BIT to kernel_default_arch_macros for MIPS. Some of the required structure definitons are defined under this macro."
* commit '882c6af953e5b3fd4b9f4fe74a68128ea16fba3b':
  [MIPS] Add CONFIG_32BIT to kernel_default_arch_macros for MIPS. Some of the required structure definitons are defined under this macro.
2012-09-24 08:43:44 -07:00
Elliott Hughes
0c24effd01 Merge "Add the libcutils localtime_tz and mktime_t extensions to bionic." 2012-09-24 08:41:55 -07:00
Elliott Hughes
85049ead25 Merge "Use hidden visibility for several internal-use-only functions." 2012-09-23 11:08:19 -07:00
The Android Automerger
cc95d69c25 merge in jb-mr1-release history after reset to jb-mr1-dev 2012-09-22 09:41:22 -07:00
Elliott Hughes
95a7a64ac8 Use hidden visibility for several internal-use-only functions.
Change-Id: Ibeea6963ff0cc06479d0a3ed7e868eeece8c55a0
2012-09-21 18:27:40 -07:00
Elliott Hughes
882c6af953 Merge "[MIPS] Add CONFIG_32BIT to kernel_default_arch_macros for MIPS. Some of the required structure definitons are defined under this macro." 2012-09-21 18:20:03 -07:00
Raghu Gandham
988ff8ff9f [MIPS] Add CONFIG_32BIT to kernel_default_arch_macros for MIPS.
Some of the required structure definitons are defined under this macro.

Change-Id: I7a9a986e371381697dcb56bd8ea362856ffa7509
2012-09-21 17:14:05 -07:00
The Android Automerger
e0a00a8a2c merge in jb-mr1-release history after reset to jb-mr1-dev 2012-09-21 06:59:14 -07:00
Naseer Ahmed
f707007435 bionic: Update MDP header for sync
Change-Id: I5e13cdc9132fd99b8072b2e0836b9a92bc54f9c3
2012-09-20 18:29:45 -07:00
Rebecca Schultz Zavin
a9dca77315 Update ion header to add FLAG_CACHED_NEEDS_SYNC
Bug: 6854979
Change-Id: Ic94c1b7b10ab750a6b4b0db83d2fb1fa073d91b9
Signed-off-by: Rebecca Schultz Zavin <rebecca@android.com>
2012-09-20 09:47:37 -07:00
The Android Automerger
8ab03a28d0 merge in jb-mr1-release history after reset to jb-mr1-dev 2012-09-19 07:01:27 -07:00
Iliyan Malchev
4430aa6aaa Merge "Update headers for Adreno graphics driver" into jb-mr1-dev 2012-09-18 20:27:34 -07:00
Jeff Boody
02e06782fc Update headers for Adreno graphics driver
Change-Id: Ic66de698667c8c8607b2c19712a8626a4651da7f
Signed-off-by: Iliyan Malchev <malchev@google.com>
2012-09-18 19:52:01 -07:00
Elliott Hughes
0ef0009044 am 30289f0d: am 47dc4d43: Merge "Make pthread_create more forgiving of invalid sched_policy. Bug: 7005326"
* commit '30289f0dd6ab644290bfb37b22b03b7d006628f4':
  Make pthread_create more forgiving of invalid sched_policy. Bug: 7005326
2012-09-18 17:18:39 -07:00
Elliott Hughes
30289f0dd6 am 47dc4d43: Merge "Make pthread_create more forgiving of invalid sched_policy. Bug: 7005326"
* commit '47dc4d431017e701239dd7d9a16333e0ad56a0ac':
  Make pthread_create more forgiving of invalid sched_policy. Bug: 7005326
2012-09-18 17:13:15 -07:00
Elliott Hughes
47dc4d4310 Merge "Make pthread_create more forgiving of invalid sched_policy. Bug: 7005326" 2012-09-18 16:56:45 -07:00
Dave Burke
88f1ea8f82 Make pthread_create more forgiving of invalid sched_policy.
Bug: 7005326

(cherry-pick of e58303249b9e799a4fe84c5a2dfe71518441a6ec.)

Change-Id: Ie81494e0f6a71caa6fd9fabbcfc47a23077554d6
2012-09-18 16:55:24 -07:00
The Android Automerger
4513ad77ef merge in jb-mr1-release history after reset to jb-mr1-dev 2012-09-18 06:59:21 -07:00
Dave Burke
e58303249b Make pthread_create more forgiving of invalid sched_policy.
Bug: 7005326

Change-Id: I4e33d8e7d70fbfcf8a1bcc0e4c33279b42092a0a
2012-09-17 21:55:24 -07:00
Elliott Hughes
2aceb4bcb3 am e2a17ef4: am 77ac158e: Merge "Don\'t copy strerror(3) or strsignal(3) strings if we can share."
* commit 'e2a17ef444e1d3b3e27e649440a320139038d1d9':
  Don't copy strerror(3) or strsignal(3) strings if we can share.
2012-09-17 15:53:22 -07:00
Elliott Hughes
e2a17ef444 am 77ac158e: Merge "Don\'t copy strerror(3) or strsignal(3) strings if we can share."
* commit '77ac158e90712a975f61b7559b8de558f644f48d':
  Don't copy strerror(3) or strsignal(3) strings if we can share.
2012-09-17 15:50:18 -07:00
Elliott Hughes
77ac158e90 Merge "Don't copy strerror(3) or strsignal(3) strings if we can share." 2012-09-17 15:36:27 -07:00
Elliott Hughes
4198fa4c23 Don't copy strerror(3) or strsignal(3) strings if we can share.
Change-Id: Ic405269f63b945c6fb347e7c4346cd6f104aff35
2012-09-17 15:23:35 -07:00
The Android Automerger
dd526b010d merge in jb-mr1-release history after reset to jb-mr1-dev 2012-09-16 06:59:15 -07:00
Elliott Hughes
4b3ff1f0fa am f8902bf7: am 047a285d: Merge "Fix <sys/klog.h> to correspond to the kernel operations."
* commit 'f8902bf7079be1a7ad51b82ebb24556ff40a1fff':
  Fix <sys/klog.h> to correspond to the kernel operations.
2012-09-14 16:21:18 -07:00
Elliott Hughes
f8902bf707 am 047a285d: Merge "Fix <sys/klog.h> to correspond to the kernel operations."
* commit '047a285d41e3fe0b1a8071ec19f436baf6f187b2':
  Fix <sys/klog.h> to correspond to the kernel operations.
2012-09-14 16:18:00 -07:00
Elliott Hughes
047a285d41 Merge "Fix <sys/klog.h> to correspond to the kernel operations." 2012-09-14 16:14:48 -07:00
Elliott Hughes
b67d4ec5ba am 950a3c01: am 51519521: Merge "Add tty defaults to bionic"
* commit '950a3c010cfbb18bb5974a78040ab9946370e553':
  Add tty defaults to bionic
2012-09-14 16:04:30 -07:00
Elliott Hughes
950a3c010c am 51519521: Merge "Add tty defaults to bionic"
* commit '51519521979c2daa417f6ca50c175e631c55dfb0':
  Add tty defaults to bionic
2012-09-14 16:01:19 -07:00
Elliott Hughes
5151952197 Merge "Add tty defaults to bionic" 2012-09-14 15:45:46 -07:00
Elliott Hughes
e249b05963 Fix <sys/klog.h> to correspond to the kernel operations.
This makes the constants correspond to those in the Linux kernel's
include/linux/syslog.h, but keeping our old badly-named constants for
source compatibility.

Change-Id: Ia47d1299205754cbfffd29ed48b497b53d1edaae
2012-09-14 15:42:30 -07:00
The Android Automerger
9d1defbf47 merge in jb-mr1-release history after reset to jb-mr1-dev 2012-09-14 07:11:00 -07:00
Elliott Hughes
b2af8b6848 am 66a97ea9: am 4e9d953a: Merge "libc: add ftw / nftw functions"
* commit '66a97ea9fbc96c8ebf7f9aae8c2512ec3ffbdb80':
  libc: add ftw / nftw functions
2012-09-13 17:12:40 -07:00
Elliott Hughes
1eaa3e6f72 am 77fd7075: am e895e6de: Merge "Update libc/NOTICE and record the incantation."
* commit '77fd70758ae579aadf153124f7c26494e4a54988':
  Update libc/NOTICE and record the incantation.
2012-09-13 17:12:39 -07:00
Elliott Hughes
66a97ea9fb am 4e9d953a: Merge "libc: add ftw / nftw functions"
* commit '4e9d953a0e9334c0f3519f470b97973c31da5bb6':
  libc: add ftw / nftw functions
2012-09-13 17:09:51 -07:00
Elliott Hughes
77fd70758a am e895e6de: Merge "Update libc/NOTICE and record the incantation."
* commit 'e895e6deaab620f874b3e9f196eb6b67f58dc278':
  Update libc/NOTICE and record the incantation.
2012-09-13 17:09:50 -07:00
Elliott Hughes
4e9d953a0e Merge "libc: add ftw / nftw functions" 2012-09-13 16:55:39 -07:00
Nick Kralevich
5e58ea07d4 libc: add ftw / nftw functions
Please see "man 3 ftw" for a description of the
ftw / nftw functions.

This code is taken directly from netbsd unmodified.

Change-Id: Ia4879ac57212b424adf5281b5e92858e216d0f14
2012-09-13 16:54:57 -07:00
Elliott Hughes
e895e6deaa Merge "Update libc/NOTICE and record the incantation." 2012-09-13 16:52:35 -07:00
Elliott Hughes
965b867512 Update libc/NOTICE and record the incantation.
Change-Id: I0673d6263de2c5a21cd549f18c0648d0fa4bb40f
2012-09-13 16:51:57 -07:00
Kenny Root
2b270a0cac am a4ea1a3d: am f7e403d6: Merge changes I06ee0b67,I914d2205
* commit 'a4ea1a3d2e12f8b240a70d90ddf1f54af06c286c':
  Print out shared app gids correctly
  Add tests for Android-specific stubs
2012-09-13 15:33:57 -07:00
Elliott Hughes
155a70b93f am de9db8f7: am fa36875d: Merge "Make strerror(3) and strsignal(3) thread-safe, and add psignal(3) and psiginfo(3)."
* commit 'de9db8f7efb10cdab1c81f1d3164f3b55e5f08e9':
  Make strerror(3) and strsignal(3) thread-safe, and add psignal(3) and psiginfo(3).
2012-09-13 15:33:57 -07:00
Elliott Hughes
c7fda6a96d am d4623e56: am b338ea30: Merge "Upgrade to tzdata2012f."
* commit 'd4623e56fb61b38e2c436f214a1282252908b93b':
  Upgrade to tzdata2012f.
2012-09-13 15:33:56 -07:00
Kenny Root
a4ea1a3d2e am f7e403d6: Merge changes I06ee0b67,I914d2205
* commit 'f7e403d66355faed93bb1472f6961acd380796d1':
  Print out shared app gids correctly
  Add tests for Android-specific stubs
2012-09-13 15:30:35 -07:00
Elliott Hughes
de9db8f7ef am fa36875d: Merge "Make strerror(3) and strsignal(3) thread-safe, and add psignal(3) and psiginfo(3)."
* commit 'fa36875df423af968d053c584c0de18a2448516b':
  Make strerror(3) and strsignal(3) thread-safe, and add psignal(3) and psiginfo(3).
2012-09-13 15:30:34 -07:00
Elliott Hughes
d4623e56fb am b338ea30: Merge "Upgrade to tzdata2012f."
* commit 'b338ea30b299099a2b26a4e8a6b2ccd7bfac631a':
  Upgrade to tzdata2012f.
2012-09-13 15:30:33 -07:00
Kenny Root
f7e403d663 Merge changes I06ee0b67,I914d2205
* changes:
  Print out shared app gids correctly
  Add tests for Android-specific stubs
2012-09-13 15:26:13 -07:00
Kenny Root
8a05a01de7 Print out shared app gids correctly
For applications that share resources across users such as
forward-locked applications, print out their group name correctly.

Change-Id: I06ee0b67e4325cfa415ffd7a03e301700399a66d
2012-09-13 15:25:09 -07:00
Kenny Root
2a54e5ecd0 Add tests for Android-specific stubs
Also fix problem with multi-user IDs that the home directory was
returned as "/data" instead of "/" unlike all the other uids.

Change-Id: I914d22052e5a86552989f8969b85aadbc748c65d
2012-09-13 15:25:09 -07:00
Elliott Hughes
fa36875df4 Merge "Make strerror(3) and strsignal(3) thread-safe, and add psignal(3) and psiginfo(3)." 2012-09-13 15:19:37 -07:00
Irina Tirdea
b5f053b5a7 Make strerror(3) and strsignal(3) thread-safe, and add psignal(3) and psiginfo(3).
Change-Id: I426109db25e907980d6cb3a7a695796e45783b78
2012-09-13 15:18:21 -07:00
Elliott Hughes
b338ea30b2 Merge "Upgrade to tzdata2012f." 2012-09-13 15:15:09 -07:00
Elliott Hughes
88b61cb691 Upgrade to tzdata2012f.
This release reflects the following change circulated on the tz
mailing list:

  * australasia (Pacific/Fiji): Fiji DST is October 21 through January
    20 this year.  (Thanks to Steffen Thorsen.)

Change-Id: Ie21ea791ff5191264967aff685cbfa5c73f1fa5c
2012-09-13 14:54:51 -07:00
Elliott Hughes
bec648ee9f am 8db4b91b: am d2236e2c: Merge "Fix Mac build."
* commit '8db4b91bd2a069b2afb377f7e5190f625c3002cf':
  Fix Mac build.
2012-09-13 11:11:54 -07:00
Elliott Hughes
8db4b91bd2 am d2236e2c: Merge "Fix Mac build."
* commit 'd2236e2c0717818e150215b4eee7af58cd3540d8':
  Fix Mac build.
2012-09-13 11:09:49 -07:00
Elliott Hughes
d2236e2c07 Merge "Fix Mac build." 2012-09-13 11:02:22 -07:00
Elliott Hughes
38bfa21695 Fix Mac build.
Change-Id: Id625806fab0f2f7f90f9508c5fce649afe970414
2012-09-13 11:01:46 -07:00
Elliott Hughes
478f8ff3f0 am b2550dd4: am 4a9b7c69: Merge "Add libdl into libc_malloc_debug_leak build"
* commit 'b2550dd4c85845974bf61d3e4071b2b957fbcf09':
  Add libdl into libc_malloc_debug_leak build
2012-09-13 09:52:38 -07:00
Elliott Hughes
29861b5d8e am 58d15966: am af4d630e: Merge "Added new test for dlopen which is failing for MIPS."
* commit '58d15966c8f95998f82a90a5b24e23d56ba6254f':
  Added new test for dlopen which is failing for MIPS.
2012-09-13 09:52:37 -07:00
Elliott Hughes
b2550dd4c8 am 4a9b7c69: Merge "Add libdl into libc_malloc_debug_leak build"
* commit '4a9b7c694a8312160d3cd953a8227c23a1624868':
  Add libdl into libc_malloc_debug_leak build
2012-09-13 09:47:52 -07:00
Elliott Hughes
58d15966c8 am af4d630e: Merge "Added new test for dlopen which is failing for MIPS."
* commit 'af4d630e4d87dca38cc2026b992bb50c49911db9':
  Added new test for dlopen which is failing for MIPS.
2012-09-13 09:47:51 -07:00
Elliott Hughes
4a9b7c694a Merge "Add libdl into libc_malloc_debug_leak build" 2012-09-13 09:46:31 -07:00
Elliott Hughes
af4d630e4d Merge "Added new test for dlopen which is failing for MIPS." 2012-09-13 09:42:50 -07:00
The Android Automerger
f238e06d3a merge in jb-mr1-release history after reset to jb-mr1-dev 2012-09-13 06:59:18 -07:00
Pavel Chupin
e007775f4b Add libdl into libc_malloc_debug_leak build
Otherwise libc_malloc_debug_leak.so is failed to load runtime in x86
case

Change-Id: I8207ce06d1ec17b233f4e4fcfdd2b161673b4fa8
Signed-off-by: Pavel Chupin <pavel.v.chupin@intel.com>
2012-09-13 12:03:06 +04:00
jeffhao
acf5aa76a5 Added new test for dlopen which is failing for MIPS.
Change-Id: I2240faefb387a11647f49b1a15699907a40f98c1
2012-09-12 19:19:13 -07:00
Elliott Hughes
f801cf55be resolved conflicts for merge of 47bda0c2 to jb-mr1-dev
Change-Id: Ia1969c79111c006bde709920254a515646c20aa7
2012-09-12 16:08:14 -07:00
Elliott Hughes
47bda0c293 am 7593fa8e: Merge "Update the kernel headers to match external/kernel-headers."
* commit '7593fa8eb7d8c3950a069e5edd244fb68872ec17':
  Update the kernel headers to match external/kernel-headers.
2012-09-12 15:59:29 -07:00
Elliott Hughes
7593fa8eb7 Merge "Update the kernel headers to match external/kernel-headers." 2012-09-12 15:56:11 -07:00
Elliott Hughes
86ec05acc9 Update the kernel headers to match external/kernel-headers.
Note that the Linux kernel handed over responsibility for most of the
socket constants to glibc some time ago. Someone had updated our
external/kernel-headers file but not regenerated the bionic headers,
so this change copies the missing stuff from the old bionic <linux/socket.h>
into <sys/socket.h>. This is what glibc does.

I've hacked a few of the other files to #include <sys/socket.h> for
backward compatibility, but even so this requires numerous other
changes to switch people over from direct inclusion of <linux/...> headers.

Change-Id: I0e4af64e631d3cef911a31d90f2f806e058278a0
2012-09-12 12:30:22 -07:00
Elliott Hughes
ccd7ee624a am 90ae787b: am 666d06fe: Merge "Backwards and forwards compatibility for an upcoming <sys/socket.h> change."
* commit '90ae787b30890dc7d0f5d95b67ea5578d53bd61e':
  Backwards and forwards compatibility for an upcoming <sys/socket.h> change.
2012-09-12 11:07:12 -07:00
Elliott Hughes
90ae787b30 am 666d06fe: Merge "Backwards and forwards compatibility for an upcoming <sys/socket.h> change."
* commit '666d06fee9e1d2e1401a4b42d94d01e8f38ad1a5':
  Backwards and forwards compatibility for an upcoming <sys/socket.h> change.
2012-09-12 11:03:24 -07:00
Elliott Hughes
666d06fee9 Merge "Backwards and forwards compatibility for an upcoming <sys/socket.h> change." 2012-09-12 10:51:48 -07:00
Elliott Hughes
0d207ba624 Backwards and forwards compatibility for an upcoming <sys/socket.h> change.
Change-Id: Iba58077a1f057a968eb2283ebba259975925ff4c
2012-09-12 10:51:05 -07:00
The Android Automerger
5766b0932f merge in jb-mr1-release history after reset to jb-mr1-dev 2012-09-12 06:59:18 -07:00
Elliott Hughes
cc0f225365 am 7f798147: am cc8668f2: Merge "[MIPS] Check error status from pipe system call"
* commit '7f798147980798718ac893229ae20dba9e3a26c7':
  [MIPS] Check error status from pipe system call
2012-09-11 16:47:25 -07:00
Elliott Hughes
7f79814798 am cc8668f2: Merge "[MIPS] Check error status from pipe system call"
* commit 'cc8668f261ae5d0ed38961f357e33c026502ed0d':
  [MIPS] Check error status from pipe system call
2012-09-11 16:43:39 -07:00
Elliott Hughes
cc8668f261 Merge "[MIPS] Check error status from pipe system call" 2012-09-11 16:38:43 -07:00
KwongYuan Wong
b03bc56b79 [MIPS] Check error status from pipe system call
Change-Id: Iaaea0e826c2678aa7f6fad9d46b16302a4d3b876
2012-09-11 16:38:04 -07:00
Irina Tirdea
e77e1afe24 Add tty defaults to bionic
Add ttydefaults.h bionic. Some userspace programs (e.g. perf) need the
definitions from this file. This header file is copied from NetBSD
(http://netbsd.org/) under the NetBSD Foundation's (TNF) license (“2 clause”
Berkeley-style license).

Change-Id: I9c862415b52b710f25adb1629a699627cd715775
Signed-off-by: Irina Tirdea <irina.tirdea@intel.com>
2012-09-11 22:47:31 +03:00
Elliott Hughes
3a936a4980 Add the libcutils localtime_tz and mktime_t extensions to bionic.
Bug: 7012465
Change-Id: Ib66f061e29199ba134545111dc79f9b50c8f4a21
2012-09-11 11:15:53 -07:00
The Android Automerger
49b5eb4ded merge in jb-mr1-release history after reset to jb-mr1-dev 2012-09-11 06:59:14 -07:00
Elliott Hughes
f50b99f471 am e8b4d67a: am 59726bed: Merge "Rename crtstart variables as crtbegin, to match reality."
* commit 'e8b4d67a37e27ffc34086562ad13dcd9316a8249':
  Rename crtstart variables as crtbegin, to match reality.
2012-09-10 12:04:28 -07:00
Elliott Hughes
e8b4d67a37 am 59726bed: Merge "Rename crtstart variables as crtbegin, to match reality."
* commit '59726beda5bec7e3db9d0c403a0ef11d0a7f182f':
  Rename crtstart variables as crtbegin, to match reality.
2012-09-10 12:01:04 -07:00
Elliott Hughes
59726beda5 Merge "Rename crtstart variables as crtbegin, to match reality." 2012-09-10 11:52:12 -07:00
Elliott Hughes
12949e5d39 Rename crtstart variables as crtbegin, to match reality.
No functional change, but it's confusing that the variable
names don't match the filenames.

Change-Id: I7109f917797be2f056e69fddb92e4a7306281813
2012-09-10 11:16:12 -07:00
Ying Wang
e3738414a6 am f9920563: am 67546bf2: Merge "Generate header dependency makefiles for the crt*.o"
* commit 'f9920563dabc21a5c741ef630e6ca8fe66fbbe5b':
  Generate header dependency makefiles for the crt*.o
2012-09-10 10:07:17 -07:00
Ying Wang
f9920563da am 67546bf2: Merge "Generate header dependency makefiles for the crt*.o"
* commit '67546bf209b2c5480aa4811b2bb3c42e7862af62':
  Generate header dependency makefiles for the crt*.o
2012-09-10 10:05:14 -07:00
Ying Wang
67546bf209 Merge "Generate header dependency makefiles for the crt*.o" 2012-09-10 09:48:46 -07:00
The Android Automerger
9209fd3868 merge in jb-mr1-release history after reset to jb-mr1-dev 2012-09-09 06:59:39 -07:00
Elliott Hughes
af4371b46b am 56ba6336: am f1d57e16: Merge "Add more pthreads tests."
* commit '56ba6336d9c07cdfb5af2324aaa52da0c8d00ef2':
  Add more pthreads tests.
2012-09-07 20:35:01 -07:00
Elliott Hughes
56ba6336d9 am f1d57e16: Merge "Add more pthreads tests."
* commit 'f1d57e16686153b69a27c1eb9e339c77232c0edd':
  Add more pthreads tests.
2012-09-07 18:38:41 -07:00
Elliott Hughes
f1d57e1668 Merge "Add more pthreads tests." 2012-09-07 18:30:18 -07:00
Ying Wang
cf464878ef Generate header dependency makefiles for the crt*.o
Bug: 7127743
Change-Id: I606e5f7cd2b513f855a1fefd2b001abd365fc854
2012-09-07 17:13:37 -07:00
Elliott Hughes
4d014e15b4 Add more pthreads tests.
Someone reported a bug if pthread_detach is called while a pthread_join is
already in progress, but I'm unable to reproduce it. Keep the tests I wrote,
though.

Change-Id: I3d71450bbbb5345f2cb213dc56310ec020d528cc
2012-09-07 16:47:54 -07:00
Elliott Hughes
b010245490 am 7c7a7f8e: am d10309c3: Merge "Rename __dso_handle_so.c to __dso_handle_so.h"
* commit '7c7a7f8e526518f37eae3ce2a785344316f263e0':
  Rename __dso_handle_so.c to __dso_handle_so.h
2012-09-07 11:09:23 -07:00
Elliott Hughes
b18d4f6361 am 72fcdbe9: am 691ef3c8: Merge "Add mlockall and munlockall for Google TV."
* commit '72fcdbe9025b0405251c17eb391f326e03bf92ef':
  Add mlockall and munlockall for Google TV.
2012-09-07 11:09:23 -07:00
Elliott Hughes
7c7a7f8e52 am d10309c3: Merge "Rename __dso_handle_so.c to __dso_handle_so.h"
* commit 'd10309c36b93176a473baeeddef6f3fba8bf0678':
  Rename __dso_handle_so.c to __dso_handle_so.h
2012-09-07 11:07:13 -07:00
Elliott Hughes
72fcdbe902 am 691ef3c8: Merge "Add mlockall and munlockall for Google TV."
* commit '691ef3c80b4af278aa90d6e005ba42de1e52c140':
  Add mlockall and munlockall for Google TV.
2012-09-07 11:07:10 -07:00
Elliott Hughes
d10309c36b Merge "Rename __dso_handle_so.c to __dso_handle_so.h" 2012-09-07 10:59:20 -07:00
Elliott Hughes
691ef3c80b Merge "Add mlockall and munlockall for Google TV." 2012-09-07 10:51:49 -07:00
Andrew Hsieh
048569be54 Rename __dso_handle_so.c to __dso_handle_so.h
Also chang libc/arch-arm/bionic/crtbegin_so.c to include it
as a header.

Change-Id: Ib91b0b8caf5c8b936425aa8a4fc1a229b2b27929
2012-09-07 12:49:41 +08:00
Ian Rogers
973bf681b7 am 77039d34: am e8f81547: Merge "Fix build warning of initialization but no use."
* commit '77039d34449e369b9425a36eaed38d41b9d20884':
  Fix build warning of initialization but no use.
2012-09-06 11:50:22 -07:00
Ian Rogers
77039d3444 am e8f81547: Merge "Fix build warning of initialization but no use."
* commit 'e8f815473ba463b875cea757bc0a52fc32f10748':
  Fix build warning of initialization but no use.
2012-09-06 11:45:54 -07:00
Ian Rogers
e8f815473b Merge "Fix build warning of initialization but no use." 2012-09-06 11:41:52 -07:00
Elliott Hughes
1ad05db9ce Add mlockall and munlockall for Google TV.
Change-Id: I10e961d701e74aab07211ec7975f61167e387853
2012-09-06 11:24:45 -07:00
Elliott Hughes
de0dc25112 am 41ff8b98: am 6e3b0f2d: Merge "Don\'t corrupt the thread list in static executables."
* commit '41ff8b98044de19d6ea5228452c2d555c4224da7':
  Don't corrupt the thread list in static executables.
2012-09-06 10:44:13 -07:00
Elliott Hughes
41ff8b9804 am 6e3b0f2d: Merge "Don\'t corrupt the thread list in static executables."
* commit '6e3b0f2d2e89a8f3bbfc5d26dcdc13233c1111ba':
  Don't corrupt the thread list in static executables.
2012-09-06 10:40:43 -07:00
Elliott Hughes
6e3b0f2d2e Merge "Don't corrupt the thread list in static executables." 2012-09-06 10:31:52 -07:00
Ian Rogers
09f76cdd9b Fix build warning of initialization but no use.
first_run is only used with LOCK_AT_FORK, however, care needs to be
taken with the #if to avoid compiler warnings when LOCK_AT_FORK isn't
being used.

Change-Id: I6bcfac2ab8732c91607f4a1bcd7c0019f29c2eec
2012-09-06 09:59:13 -07:00
The Android Automerger
abce26b05a merge in jb-mr1-release history after reset to jb-mr1-dev 2012-09-06 06:33:25 -07:00
Ajay Dudani
183d0a57a2 Update msm_ion.h ioctls so they dont conflict with ion.h
Change-Id: Ib6ffcc147e39b3f9f2eb9a8ed403b74d99bc755f
Signed-off-by: Iliyan Malchev <malchev@google.com>
2012-09-05 21:47:32 -07:00
Ajay Dudani
85811fc7c2 Revert "msm_ion: switch to using legacy_ion.h"
This reverts commit 66edcd9dad.
2012-09-05 21:43:15 -07:00
Ajay Dudani
dc81b44759 Revert "add legacy_ion.h"
This reverts commit 5f1d206de3.
2012-09-05 21:42:10 -07:00
Elliott Hughes
bfeab1bbe7 Don't corrupt the thread list in static executables.
Several previous changes conspired to make a mess of the thread list
in static binaries. This was most obvious when trying to call
pthread_key_delete(3) on the main thread.

Bug: http://code.google.com/p/android/issues/detail?id=36893
Change-Id: I2a2f553114d8fb40533c481252b410c10656da2e
2012-09-05 17:47:37 -07:00
Elliott Hughes
2da907059e am 008f4df5: am ff4608ae: Merge "Add missing dependencies."
* commit '008f4df5ba52ff502651da957ad8dbe149ff2ed6':
  Add missing dependencies.
2012-09-05 14:55:45 -07:00
Elliott Hughes
008f4df5ba am ff4608ae: Merge "Add missing dependencies."
* commit 'ff4608ae0cb78caa05b83e109fc2633682958089':
  Add missing dependencies.
2012-09-05 14:51:30 -07:00
Elliott Hughes
ff4608ae0c Merge "Add missing dependencies." 2012-09-05 14:46:15 -07:00
Elliott Hughes
2e8f4345df Add missing dependencies.
Change-Id: I53c1cfb59ac7a89952a8d6b906b2b9e16a66624f
2012-09-05 14:27:17 -07:00
Elliott Hughes
faf361a6ac am 2fc3e1ef: am b2c5bd54: Merge "ARM: warn about atexit() calls from legacy shared libraries"
* commit '2fc3e1efda003d9eb110c3fc08bb32f29c6e8a4b':
  ARM: warn about atexit() calls from legacy shared libraries
2012-09-05 10:32:25 -07:00
Elliott Hughes
2fc3e1efda am b2c5bd54: Merge "ARM: warn about atexit() calls from legacy shared libraries"
* commit 'b2c5bd543dcbbc1b2cbf7afd8b124256ce2c128e':
  ARM: warn about atexit() calls from legacy shared libraries
2012-09-05 10:29:23 -07:00
Elliott Hughes
b2c5bd543d Merge "ARM: warn about atexit() calls from legacy shared libraries" 2012-09-05 10:18:43 -07:00
Elliott Hughes
ac3e35cd8f am a76f2eca: am 26f2e4a1: Merge "ARM: make CRT_LEGACY_WORKAROUND work as intended"
* commit 'a76f2ecaa203bd8b5cc2ca157f06c0d2de66a52f':
  ARM: make CRT_LEGACY_WORKAROUND work as intended
2012-09-05 10:01:48 -07:00
Elliott Hughes
a76f2ecaa2 am 26f2e4a1: Merge "ARM: make CRT_LEGACY_WORKAROUND work as intended"
* commit '26f2e4a1639a959513c4ff5981b4eb52757e8012':
  ARM: make CRT_LEGACY_WORKAROUND work as intended
2012-09-05 09:57:15 -07:00
Elliott Hughes
26f2e4a163 Merge "ARM: make CRT_LEGACY_WORKAROUND work as intended" 2012-09-05 09:43:35 -07:00
Ian Rogers
f71d757f6e am 7310a1c4: am 82978cae: Merge "Avoid malloc lock while calling pthread_atfork."
* commit '7310a1c4326bc875aeea2ce091a4b6558d183b2d':
  Avoid malloc lock while calling pthread_atfork.
2012-09-05 07:52:12 -07:00
Ian Rogers
7310a1c432 am 82978cae: Merge "Avoid malloc lock while calling pthread_atfork."
* commit '82978cae4eec238a9d631d2b61b8985daa02516e':
  Avoid malloc lock while calling pthread_atfork.
2012-09-05 07:48:14 -07:00
Ian Rogers
82978cae4e Merge "Avoid malloc lock while calling pthread_atfork." 2012-09-05 07:41:32 -07:00
The Android Automerger
3a8807df34 merge in jb-mr1-release history after reset to jb-mr1-dev 2012-09-05 06:33:22 -07:00
Elliott Hughes
ab558163a3 am b9f0a6eb: am be19a367: Merge "termios: add tcdrain"
* commit 'b9f0a6eb75aa8f1eec95fb5718d84cef1d0f61b8':
  termios: add tcdrain
2012-09-04 18:13:50 -07:00
Elliott Hughes
b9f0a6eb75 am be19a367: Merge "termios: add tcdrain"
* commit 'be19a3671709879ccc0156b94f7ef7540027dc37':
  termios: add tcdrain
2012-09-04 18:10:07 -07:00
Elliott Hughes
be19a36717 Merge "termios: add tcdrain" 2012-09-04 17:52:40 -07:00
Elliott Hughes
f34c6d7796 am bc374078: am 5ff23471: Merge "Add getsid system call to bionic"
* commit 'bc3740787ac4108c2e0e247bc7ca2ea66329c5ab':
  Add getsid system call to bionic
2012-09-04 16:47:44 -07:00
Elliott Hughes
bc3740787a am 5ff23471: Merge "Add getsid system call to bionic"
* commit '5ff23471303a1b99ddc1e1751662aa45f34b5e21':
  Add getsid system call to bionic
2012-09-04 16:44:54 -07:00
Elliott Hughes
5ff2347130 Merge "Add getsid system call to bionic" 2012-09-04 16:36:27 -07:00
Elliott Hughes
877ad30fd6 am 507bcabb: am e03ab936: Merge "Add missing MALLOC_FAILURE_ACTION calls to dlmalloc."
* commit '507bcabb3565d20541242ad61f987bc1a6483ba1':
  Add missing MALLOC_FAILURE_ACTION calls to dlmalloc.
2012-09-04 16:00:20 -07:00
Elliott Hughes
507bcabb35 am e03ab936: Merge "Add missing MALLOC_FAILURE_ACTION calls to dlmalloc."
* commit 'e03ab936996a1a46d461cdad463d7f5bca10b051':
  Add missing MALLOC_FAILURE_ACTION calls to dlmalloc.
2012-09-04 15:56:12 -07:00
Elliott Hughes
e03ab93699 Merge "Add missing MALLOC_FAILURE_ACTION calls to dlmalloc." 2012-09-04 15:51:55 -07:00
Elliott Hughes
63deae5e4f Add missing MALLOC_FAILURE_ACTION calls to dlmalloc.
Without these, sometimes malloc(3) returns NULL without setting errno.

Change-Id: I4708c3f675bf2c878ddcaf012fde7848b255826b
2012-09-04 15:42:23 -07:00
Elliott Hughes
c0e3b9ddd6 am b438c54d: am 1db615b4: Merge "bionic: Fix TINY_ANDROID build"
* commit 'b438c54d02b722a93a72ff6e834ab78053ca3add':
  bionic: Fix TINY_ANDROID build
2012-09-04 13:49:41 -07:00
Elliott Hughes
b438c54d02 am 1db615b4: Merge "bionic: Fix TINY_ANDROID build"
* commit '1db615b4ae469c9f33dc1d88b24924ca8efc10ef':
  bionic: Fix TINY_ANDROID build
2012-09-04 13:46:46 -07:00
Elliott Hughes
1db615b4ae Merge "bionic: Fix TINY_ANDROID build" 2012-09-04 13:42:57 -07:00
Benoit Goby
5ac9eee1d3 bionic: Fix TINY_ANDROID build
(cherry-pick of 545d5dbbcb0dc9e44323c4f2e687a3aace75a483.)

Change-Id: Ifc91e84ffed5a3a287accabd7f08b02752688db6
2012-09-04 13:36:54 -07:00
Vitaly Wool
954923858b termios: add tcdrain
Change-Id: I05c0007f7bcc6ef5295c32f86fafbf1ad31e07fa
2012-09-04 14:11:28 +02:00
The Android Automerger
2b49277d84 merge in jb-mr1-release history after reset to jb-mr1-dev 2012-09-03 06:33:17 -07:00
Irina Tirdea
1ad10a566e Add getsid system call to bionic
Add getsid() system call to bionic for
all architectures. This is needed for various tools
(e.g. perf).

Adding the getsid system call was done in 3 steps:
() add getsid system call (function name and syscall
number) to libc/SYSCALLS.TXT
() generate all necessary headers by calling
libc/tools/gensyscalls.py. This patch is adding
the generated files since the build system
does not call gensyscalls.py.
() add the system call signature to libc/include/unistd.h

Change-Id: Id69a257e13ec02e1a44085a6b217a3f19ab025b1
Signed-off-by: Irina Tirdea <irina.tirdea@intel.com>
2012-09-03 01:38:34 +03:00
Kirill Artamonov
3e2d2936b0 Avoid malloc lock while calling pthread_atfork.
Expecting the memory in a forked child process to be sane wrt threading
is a bad idea. An example of a problem is when the parent process has
the malloc lock and a child process is forked. The malloc lock in the
child will appear locked by a thread that doesn't exist.

This change aims to make bionic more compatible with glibc by reseting
the malloc lock in the child forked process, as well as holding it
during the fork. This is a feature in dlmalloc 2.8.6 called
LOCK_AT_FORK. In general this feature isn't necessary as a forked
process will then exec. Some bad applications rely on being able to use
features like malloc before the exec and having multiple threads running
in the parent program. This isn't a problem with glibc and this patch
makes it not a problem for bionic.

Unfortunately for use in bionic, LOCK_AT_FORK has an issue as internally
it uses pthread_atfork that in bionic uses malloc. This leads to the
LOCK_AT_FORK initialization deadlocking with pthread_atfork's call to
malloc due to the malloc lock. This change moves the pthread_atfork logic
in LOCK_AT_FORK to be called without the malloc lock held.

Change-Id: Id68175a564a6abb936ee4488b44d9479f7311f69
2012-08-31 11:11:40 -07:00
Ian Rogers
b9ad1a1e00 am 6abab301: am 6fe901ef: Merge "Upgrade to dlmalloc 2.8.6."
* commit '6abab301db84af7c98a4873fbf49997078aa19cc':
  Upgrade to dlmalloc 2.8.6.
2012-08-31 08:58:33 -07:00
Ian Rogers
6abab301db am 6fe901ef: Merge "Upgrade to dlmalloc 2.8.6."
* commit '6fe901ef38898d9cb6007720940e915f7180fc11':
  Upgrade to dlmalloc 2.8.6.
2012-08-31 08:55:41 -07:00
Ian Rogers
6fe901ef38 Merge "Upgrade to dlmalloc 2.8.6." 2012-08-31 08:42:41 -07:00
The Android Automerger
83d5e567d6 merge in jb-mr1-release history after reset to jb-mr1-dev 2012-08-30 06:33:17 -07:00
Ian Rogers
c6d95add30 Upgrade to dlmalloc 2.8.6.
This fixes a bug and enables the use of MORECORE_CONTIGUOUS.

Change-Id: Ia7c5d32bdc46e99b3ecb92ee94d1f702c4385d5d
2012-08-29 18:18:29 -07:00
Elliott Hughes
8c368b5d1d am dde94f4c: am 8b4e8a93: Merge "Improve the dynamic linker diagnostics."
* commit 'dde94f4c1664c6908d9a2944aff84e8667557d02':
  Improve the dynamic linker diagnostics.
2012-08-29 14:06:58 -07:00
Nick Kralevich
fe7d7d4693 am 92133ca4: am 17d9be8a: Merge "disable _FORTIFY_SOURCE under clang"
* commit '92133ca427b9c697d5afb59b74cb2cff50840c8e':
  disable _FORTIFY_SOURCE under clang
2012-08-29 14:06:57 -07:00
Elliott Hughes
dde94f4c16 am 8b4e8a93: Merge "Improve the dynamic linker diagnostics."
* commit '8b4e8a937be2e7ac94e52d596813095ef16c9ec8':
  Improve the dynamic linker diagnostics.
2012-08-29 14:04:25 -07:00
Nick Kralevich
92133ca427 am 17d9be8a: Merge "disable _FORTIFY_SOURCE under clang"
* commit '17d9be8ad73170275f25ffe8795a0d04b3e2cd8b':
  disable _FORTIFY_SOURCE under clang
2012-08-29 14:04:24 -07:00
Elliott Hughes
8b4e8a937b Merge "Improve the dynamic linker diagnostics." 2012-08-29 13:56:40 -07:00
Nick Kralevich
17d9be8ad7 Merge "disable _FORTIFY_SOURCE under clang" 2012-08-29 13:54:49 -07:00
Elliott Hughes
8900e2de45 am e5b85f45: am 0d7177c0: Merge "Clean up warnings in the malloc_debug_* files."
* commit 'e5b85f45f9b23b4adbea5a9bb0bc29099880ed69':
  Clean up warnings in the malloc_debug_* files.
2012-08-29 13:19:58 -07:00
Elliott Hughes
e5b85f45f9 am 0d7177c0: Merge "Clean up warnings in the malloc_debug_* files."
* commit '0d7177c0d47517514c81713427fc28e04dc3cd37':
  Clean up warnings in the malloc_debug_* files.
2012-08-29 13:15:10 -07:00
Elliott Hughes
e9b6fc6f82 Improve the dynamic linker diagnostics.
Lose the pid, only show the name of the function (not its whole signature),
and include the name of the library we failed to load. (I hadn't noticed
that the library name was missing before because in Java we add that into
the UnsatisfiedLinkError detail message.)

The new output looks like this:

  Cannot load library: soinfo_relocate(linker.cpp:968): cannot locate symbol "__libc_malloc_default_dispatch" referenced by "libc_malloc_debug_leak.so"...

Change-Id: I3bb5c9780d9aaf3a9e4418ea55bc98122a81f80f
2012-08-29 13:10:54 -07:00
Elliott Hughes
0d7177c0d4 Merge "Clean up warnings in the malloc_debug_* files." 2012-08-29 13:08:50 -07:00
Nick Kralevich
829c089f83 disable _FORTIFY_SOURCE under clang
Clang and _FORTIFY_SOURCE are just plain incompatible with
each other.  First of all, clang doesn't understand the
__attribute__((gnu_inline)) header. Second of all,
Clang doesn't have support for __builtin_va_arg_pack()
and __builtin_va_arg_pack_len() (see
http://clang.llvm.org/docs/UsersManual.html#c_unimpl_gcc)

Until we can resolve these issues, don't even try using
_FORTIFY_SOURCE under clang.

Change-Id: I81c2b8073bb3276fa9a4a6b93c427b641038356a
2012-08-29 12:47:41 -07:00
Elliott Hughes
c4d1fecc10 Clean up warnings in the malloc_debug_* files.
Also clean up cpplint.py-detected lint.

Change-Id: Ia18e89c4c6878764f8d7ed34b8247e7a8d8fe88b
2012-08-29 12:08:13 -07:00
Ian Rogers
15afed42ca Merge "Revert "Revert "Restore posix_memalign""" into jb-mr1-dev 2012-08-29 08:53:41 -07:00
Ian Rogers
f71fa0830a Merge "Revert "Revert "Upgrade to dlmalloc 2.8.5.""" into jb-mr1-dev 2012-08-29 08:53:26 -07:00
The Android Automerger
b2d46d3632 merge in jb-mr1-release history after reset to jb-mr1-dev 2012-08-29 06:33:16 -07:00
Iliyan Malchev
66edcd9dad msm_ion: switch to using legacy_ion.h
Change-Id: I0fa64cb9684062f371bd21a1f94f6c7dad8d854d
Signed-off-by: Iliyan Malchev <malchev@google.com>
2012-08-29 01:31:34 -07:00
Iliyan Malchev
5f1d206de3 add legacy_ion.h
legacy_ion.h is a pre android-3.4 copy of the ion.h header, for backwards
compatibility

Change-Id: Iaf2f1659f19a3b55334df929d9500069bf8acbdd
Signed-off-by: Iliyan Malchev <malchev@google.com>
2012-08-29 01:24:49 -07:00
Ian Rogers
e0d680176f Revert "Revert "Restore posix_memalign""
This reverts commit 78a3069f82.
2012-08-28 16:36:08 -07:00
Ian Rogers
2c344d3631 Revert "Revert "Upgrade to dlmalloc 2.8.5.""
This reverts commit f72ee26927.
2012-08-28 15:53:10 -07:00
Nick Kralevich
4f90a0932c am d3d09f7d: am 069c64cd: Merge "ARM: make sure __on_dlclose() actually gets called"
* commit 'd3d09f7d75726dbe7cd9dfae211427f8bebe1397':
  ARM: make sure __on_dlclose() actually gets called
2012-08-28 13:41:10 -07:00
Nick Kralevich
d3d09f7d75 am 069c64cd: Merge "ARM: make sure __on_dlclose() actually gets called"
* commit '069c64cdf2d3da7b7ff6ea5d1041f982fb10ab22':
  ARM: make sure __on_dlclose() actually gets called
2012-08-28 13:17:00 -07:00
Nick Kralevich
54662dd4de am 1389db8b: am e026b1d8: Merge "ARM: remove dummy entries from .so init_array/fini_array"
* commit '1389db8b94ca0cff4744dc070d99f48c6cf53b07':
  ARM: remove dummy entries from .so init_array/fini_array
2012-08-28 13:04:47 -07:00
Nick Kralevich
d7440f3725 am 7cab2188: am ad180738: Merge "linker: Fix ARM_R_COPY relocations"
* commit '7cab21885ac039375264a45b2c774106415be664':
  linker: Fix ARM_R_COPY relocations
2012-08-28 13:04:46 -07:00
Nick Kralevich
069c64cdf2 Merge "ARM: make sure __on_dlclose() actually gets called" 2012-08-28 13:04:22 -07:00
Nick Kralevich
1389db8b94 am e026b1d8: Merge "ARM: remove dummy entries from .so init_array/fini_array"
* commit 'e026b1d89a0dcada499da186d4d94cc3ce5d3ef3':
  ARM: remove dummy entries from .so init_array/fini_array
2012-08-28 13:01:22 -07:00
Nick Kralevich
7cab21885a am ad180738: Merge "linker: Fix ARM_R_COPY relocations"
* commit 'ad18073897378d3a13aaa6a7e7005f254ab8c1c8':
  linker: Fix ARM_R_COPY relocations
2012-08-28 13:01:21 -07:00
Nick Kralevich
e026b1d89a Merge "ARM: remove dummy entries from .so init_array/fini_array" 2012-08-28 12:49:46 -07:00
Nick Kralevich
ad18073897 Merge "linker: Fix ARM_R_COPY relocations" 2012-08-28 12:48:01 -07:00
The Android Automerger
6fa20f8296 Revert "Update ion header"
This reverts commit eb75db7d83.
2012-08-28 11:49:35 -07:00
Nick Kralevich
d39c3abd5a linker: Fix ARM_R_COPY relocations
Per http://infocenter.arm.com/help/topic/com.arm.doc.ihi0044d/IHI0044D_aaelf.pdf
Section 4.7.1.10, ARM_R_COPY relocations are only suppose to reference shared
libraries, not the executable itself.  When resolving an R_ARM_COPY symbol,
ensure we don't look in our own symbol.

This partially addresses
http://code.google.com/p/android/issues/detail?id=28598 .  After this
patch, the printfs generated by the test program are:

global = 0x42 (0x401c7000)
global = 0x42 (0x11000)

before, the output was:

global = 0x42 (0x40071000)
global = 0x0 (0x11000)

I'm still not very happy with this patch, but I think it's an improvement
over where we were at before.

This change was modeled after https://android-review.googlesource.com/38871

Change-Id: Id7ad921e58395e76a36875bcc742ec5eeba53f08
2012-08-28 11:48:32 -07:00
Nick Kralevich
3ffdef19b4 am c7d9c400: am c410a961: Merge "libc: remove ctors/dtors sections"
* commit 'c7d9c400126f1d1159025d1005248ab556dbdb7e':
  libc: remove ctors/dtors sections
2012-08-28 10:38:28 -07:00
Nick Kralevich
c7d9c40012 am c410a961: Merge "libc: remove ctors/dtors sections"
* commit 'c410a9613a837790d2ea13aee3f88881e0d54c17':
  libc: remove ctors/dtors sections
2012-08-28 10:34:14 -07:00
Nick Kralevich
c410a9613a Merge "libc: remove ctors/dtors sections" 2012-08-28 10:20:27 -07:00
The Android Automerger
4be256b50b merge in jb-mr1-release history after reset to jb-mr1-dev 2012-08-28 06:33:16 -07:00
Ard Biesheuvel
144c291866 ARM: warn about atexit() calls from legacy shared libraries
Legacy ARM shared libraries use this generic version of atexit(),
which queues exit functions for invocation at program exit, at
which time the library may have been dlclose()'d, causing the
program to crash.

Change-Id: I41ae153c23268daa65ede7fb8966fc3e9caec369
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@gmail.com>
2012-08-28 11:23:06 +02:00
Ard Biesheuvel
f3cfcd869d ARM: make CRT_LEGACY_WORKAROUND work as intended
To properly support legacy ARM shared libraries, libc.so needs
to export the symbols __dso_handle and atexit, even though
these are now supplied by the crt startup code.

This patch reshuffles the existing CRT_LEGACY_WORKAROUND
conditionally compiled code slightly so it works as the
original author likely intended.

Change-Id: Id6c0e94dc65b7928324a5f0bad7eba6eb2f464b9
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@gmail.com>
2012-08-28 10:27:02 +02:00
Ard Biesheuvel
c23092887f ARM: remove dummy entries from .so init_array/fini_array
The runtime linker parses the ELF section headers to
discover the size of the init_array and fini_array, so
there is no point in putting NULL terminators at the end.

Change-Id: I3246cd585efce9314155600277dd829e9f37d04f
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@gmail.com>
2012-08-28 09:55:51 +02:00
Nick Kralevich
48c8880429 am 775dabd4: am 9dfaa63a: Merge "Allow linker to compile with -DLINKER_DEBUG=1"
* commit '775dabd4d7f1c08d4229a3578d15990e86dd9c92':
  Allow linker to compile with -DLINKER_DEBUG=1
2012-08-27 16:08:12 -07:00
Nick Kralevich
775dabd4d7 am 9dfaa63a: Merge "Allow linker to compile with -DLINKER_DEBUG=1"
* commit '9dfaa63a1c0d1b8e75dd9d7077a8103a19821fa9':
  Allow linker to compile with -DLINKER_DEBUG=1
2012-08-27 16:06:34 -07:00
Nick Kralevich
9dfaa63a1c Merge "Allow linker to compile with -DLINKER_DEBUG=1" 2012-08-27 16:00:50 -07:00
Elliott Hughes
8c7f4777ec am d2d8031d: am bc366292: Merge "Added missing cache failed notification"
* commit 'd2d8031df16c78b4d5bdbe481ebe6856caa69fd1':
  Added missing cache failed notification
2012-08-27 15:22:35 -07:00
Elliott Hughes
d2d8031df1 am bc366292: Merge "Added missing cache failed notification"
* commit 'bc366292ff47ad9a5053e213ec253992baeee648':
  Added missing cache failed notification
2012-08-27 15:18:52 -07:00
Elliott Hughes
bc366292ff Merge "Added missing cache failed notification" 2012-08-27 15:00:51 -07:00
The Android Automerger
19c0b800a3 :Revert "Update ion header"
This reverts commit eb75db7d83.
2012-08-27 12:46:37 -07:00
Iliyan Malchev
3ad36e525f bionic: update sanitized MSM, V4L2 kernel headers
Change-Id: I4ca8835ff7a1d21f80a139b1d76ceacf82b48502
Signed-off-by: Iliyan Malchev <malchev@google.com>
2012-08-27 12:11:41 -07:00
The Android Automerger
eeddc30e7e merge in jb-mr1-release history after reset to jb-mr1-dev 2012-08-27 06:33:20 -07:00
Nick Kralevich
3697b52605 Allow linker to compile with -DLINKER_DEBUG=1
Change-Id: I27e734048cbcb9ed936369115582b3c734de1280
2012-08-24 17:11:45 -07:00
Ian Rogers
a190cbb825 am 05fddb41: am a37ce7fa: Merge "Add missing va_end() to prevent stack corruptions"
* commit '05fddb41d00710a31181693cebed570d711acd37':
  Add missing va_end() to prevent stack corruptions
2012-08-24 15:23:11 -07:00
Ian Rogers
05fddb41d0 am a37ce7fa: Merge "Add missing va_end() to prevent stack corruptions"
* commit 'a37ce7faa6d6c7355e3c6f6e09e5268cbf29c291':
  Add missing va_end() to prevent stack corruptions
2012-08-24 15:21:12 -07:00
Ian Rogers
a37ce7faa6 Merge "Add missing va_end() to prevent stack corruptions" 2012-08-24 15:10:07 -07:00
Rebecca Schultz Zavin
cbd76d15af Merge "Update ion header" into jb-mr1-dev 2012-08-23 16:31:45 -07:00
Rebecca Schultz Zavin
eb75db7d83 Update ion header
Change-Id: Ib06a2c63070c9f507c14a43a0a0ac4d362f68d22
Signed-off-by: Rebecca Schultz Zavin <rebecca@android.com>
2012-08-23 16:29:23 -07:00
Nick Kralevich
81af404b63 am e8198b97: am 26facba2: Merge "hardening: remove pointless ARM __get_pc() function"
* commit 'e8198b97c369292a3ea97e5a2009bfba8229ddb5':
  hardening: remove pointless ARM __get_pc() function
2012-08-23 12:34:21 -07:00
The Android Automerger
21120f6d7b merge in jb-mr1-release history after reset to jb-mr1-dev 2012-08-23 06:33:25 -07:00
Brian Carlstrom
561bf16be5 Revert "Upgrade to dlmalloc 2.8.5."
This reverts commit 999089181e.
2012-08-22 14:56:19 -07:00
Brian Carlstrom
453294d1da Revert "Restore posix_memalign"
This reverts commit bfc1d97531.
2012-08-22 14:56:13 -07:00
Brian Carlstrom
f72ee26927 Revert "Upgrade to dlmalloc 2.8.5."
This reverts commit 999089181e.
2012-08-22 12:07:33 -07:00
Brian Carlstrom
78a3069f82 Revert "Restore posix_memalign"
This reverts commit bfc1d97531.
2012-08-22 12:07:26 -07:00
Nick Kralevich
e8198b97c3 am 26facba2: Merge "hardening: remove pointless ARM __get_pc() function"
* commit '26facba288df013fd898f8df12d84e5669ece6eb':
  hardening: remove pointless ARM __get_pc() function
2012-08-22 11:55:59 -07:00
Ard Biesheuvel
0a150ead18 libc: remove ctors/dtors sections
None of the supported ARCHs actually populate these sections,
so there is no point in keeping them in the binaries.

Change-Id: I21a364f510118ac1114e1b49c53ec8c895c6bc6b
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@gmail.com>
2012-08-22 20:45:26 +02:00
Nick Kralevich
26facba288 Merge "hardening: remove pointless ARM __get_pc() function" 2012-08-22 11:41:53 -07:00
Ard Biesheuvel
404e28ff8c hardening: remove pointless ARM __get_pc() function
Useful if you're trying to defeat ASLR, otherwise not
so much ...

Change-Id: I17ebb50bb490a3967db9c3038f049adafe2b8ea7
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@gmail.com>
2012-08-22 20:38:54 +02:00
Jean-Baptiste Queru
e49df0203c am 170ad354: am c7de0225: Merge "Use unambiguous mnemonics"
* commit '170ad35419620b428c15a8945416ce8cedef3e81':
  Use unambiguous mnemonics
2012-08-22 07:32:21 -07:00
Jean-Baptiste Queru
170ad35419 am c7de0225: Merge "Use unambiguous mnemonics"
* commit 'c7de02259052b1eeebbfd3a0c21acf56a7e84357':
  Use unambiguous mnemonics
2012-08-22 07:30:56 -07:00
Jean-Baptiste Queru
c7de022590 Merge "Use unambiguous mnemonics" 2012-08-22 07:18:50 -07:00
The Android Automerger
6773054eb3 merge in jb-mr1-release history after reset to jb-mr1-dev 2012-08-22 06:33:14 -07:00
Erik Gilling
974e16cd82 update linux/sync.h
Change-Id: Ic2133976b675cdcd3ca88f4845180a7ff1c79e34
Signed-off-by: Erik Gilling <konkers@android.com>
2012-08-21 18:17:24 -07:00
Kevin Schoedel
c0b4d18d7d Use unambiguous mnemonics
Change-Id: I8da0af54cc3cbf69d9e485eb71bc44a6976b1adc
Author: Kevin P Schoedel <kevin.p.schoedel@intel.com>
Reviewed-by: Edwin Vane <edwin.vane@intel.com>
2012-08-21 15:28:23 -04:00
The Android Automerger
5d8cfb3e66 merge in jb-mr1-release history after reset to jb-mr1-dev 2012-08-21 06:33:32 -07:00
Ard Biesheuvel
5ed48a4d7f ARM: make sure __on_dlclose() actually gets called
Change-Id: I280e5428b0543cccf17ca36baee4865395928cdb
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@gmail.com>
2012-08-21 12:56:05 +02:00
Andrew Hsieh
f861705f8c am 5cd1efb2: am 1bd035cf: Merge "Enclosed functions in fenv.h with __BEGIN_DECLS/__END_DECLS"
* commit '5cd1efb2ba68cdde13682ee37a3499b7bd974bdb':
  Enclosed functions in fenv.h with __BEGIN_DECLS/__END_DECLS
2012-08-21 03:31:02 -07:00
Andrew Hsieh
5cd1efb2ba am 1bd035cf: Merge "Enclosed functions in fenv.h with __BEGIN_DECLS/__END_DECLS"
* commit '1bd035cf119a2e4a667f07907c7860e5ec223cee':
  Enclosed functions in fenv.h with __BEGIN_DECLS/__END_DECLS
2012-08-21 03:29:14 -07:00
Andrew Hsieh
1bd035cf11 Merge "Enclosed functions in fenv.h with __BEGIN_DECLS/__END_DECLS" 2012-08-21 03:25:46 -07:00
Andrew Hsieh
2f7d7c6538 Enclosed functions in fenv.h with __BEGIN_DECLS/__END_DECLS
Those are C funcitons

Related CL: https://android-review.googlesource.com/#/c/41833/

Change-Id: I4386bcf948ad31c3690c9b7a145103088133d041
2012-08-21 15:41:34 +08:00
Ian Rogers
4ac3b0a148 am 8af726b2: am 7b0d9b79: Merge "Restore posix_memalign"
* commit '8af726b24fbb9ab545719bd3980a4f0ad9bcb8a8':
  Restore posix_memalign
2012-08-20 19:45:12 -07:00
Ian Rogers
8af726b24f am 7b0d9b79: Merge "Restore posix_memalign"
* commit '7b0d9b798474ab62d4bf67c79ae901f4c4789f27':
  Restore posix_memalign
2012-08-20 19:43:15 -07:00
Ian Rogers
7b0d9b7984 Merge "Restore posix_memalign" 2012-08-20 19:35:25 -07:00
Brian Carlstrom
bfc1d97531 Restore posix_memalign
Change-Id: I24e31bcb8b1d8be9375852e76964f09becd11938
2012-08-20 19:25:39 -07:00
Brian Carlstrom
cc1f4acbda Restore posix_memalign
Change-Id: I24e31bcb8b1d8be9375852e76964f09becd11938
2012-08-20 18:28:20 -07:00
Brian Carlstrom
76f60e2ebd am fe87596a: am c37dcd3d: Merge "Upgrade to dlmalloc 2.8.5."
* commit 'fe87596a5ba5a5b0773b2854f9fce85f49367611':
  Upgrade to dlmalloc 2.8.5.
2012-08-20 16:31:29 -07:00
Brian Carlstrom
fe87596a5b am c37dcd3d: Merge "Upgrade to dlmalloc 2.8.5."
* commit 'c37dcd3d3ab8e32c37ce034b8d1772b4a7b9add9':
  Upgrade to dlmalloc 2.8.5.
2012-08-20 16:29:48 -07:00
Brian Carlstrom
c37dcd3d3a Merge "Upgrade to dlmalloc 2.8.5." 2012-08-20 16:12:33 -07:00
Ian Rogers
999089181e Upgrade to dlmalloc 2.8.5.
Move dlmalloc code to upstream-dlmalloc to make pulling upstream changes
easier.
Declare pvalloc and malloc_usable_size routines present in malloc.h but with
missing implementations. Remove other functions from malloc.h that have
no implementation nor use in Android.

Change-Id: Ia6472ec6cbebc9ad1ef99f4669de9d33fcc2efb4
2012-08-20 14:12:20 -07:00
The Android Automerger
f706b3dfcf merge in jb-mr1-release history after reset to jb-mr1-dev 2012-08-20 06:33:38 -07:00
Elliott Hughes
dd0e991c6a am 2651d6c6: am 9417a80e: Merge "Always define the 64-bit int types."
* commit '2651d6c6cbd0fafff83aafb61ab7bc9cbab413d2':
  Always define the 64-bit int types.
2012-08-17 16:58:10 -07:00
Elliott Hughes
2651d6c6cb am 9417a80e: Merge "Always define the 64-bit int types."
* commit '9417a80e48d3bba4bea814178aaa79b905ebab8c':
  Always define the 64-bit int types.
2012-08-17 16:56:14 -07:00
Elliott Hughes
9417a80e48 Merge "Always define the 64-bit int types." 2012-08-17 16:48:14 -07:00
Elliott Hughes
db2903fac3 am cbeccc84: am 200de748: Merge "Fix race condition in pthread_create()"
* commit 'cbeccc849a45ac9adc124a6d1781c1ddc7bad54e':
  Fix race condition in pthread_create()
2012-08-17 16:26:37 -07:00
Elliott Hughes
cbeccc849a am 200de748: Merge "Fix race condition in pthread_create()"
* commit '200de748b91d7638a2c434584abcb3840704494b':
  Fix race condition in pthread_create()
2012-08-17 16:23:53 -07:00
Elliott Hughes
200de748b9 Merge "Fix race condition in pthread_create()" 2012-08-17 16:19:56 -07:00
Jurijs Oniscuks
2932f04832 Fix race condition in pthread_create()
Save thread id to *thread_out before new
thread is allowed to run else there's a
risk that the thread has finished and
been deleted when *thread_out is assigned.

Change-Id: I6b84c61a8df06840877d4ab036f26feace3192d8
2012-08-17 16:18:32 -07:00
Elliott Hughes
6d6731adc0 Always define the 64-bit int types.
These preprocessor tricks have caused trouble for -std=gnu99 and -ansi, and
both netbsd's libc and glibc seem to unconditionally define these types.

Change-Id: Ib8dffa341a8ca88f80d275ba2b7f93a4c910ee32
2012-08-17 14:30:06 -07:00
Elliott Hughes
efd3983446 am e5242bfd: am 1771a33d: Merge "Add link.h for all platforms with dl_phdr_info"
* commit 'e5242bfdd731a67282389ece515f094d57bb7300':
  Add link.h for all platforms with dl_phdr_info
2012-08-17 14:01:53 -07:00
Elliott Hughes
e5242bfdd7 am 1771a33d: Merge "Add link.h for all platforms with dl_phdr_info"
* commit '1771a33d11a24f1c47b1ef75e3726c5d9e751f5b':
  Add link.h for all platforms with dl_phdr_info
2012-08-17 14:00:11 -07:00
Elliott Hughes
1771a33d11 Merge "Add link.h for all platforms with dl_phdr_info" 2012-08-17 13:54:43 -07:00
Pavel Chupin
b7beb69075 Add link.h for all platforms with dl_phdr_info
This header is used on bionic build and should be propagated into
sysroot on toolchain rebuild. Discussion re. this header is here:
http://gcc.gnu.org/ml/gcc-patches/2012-08/msg00936.html

It is available already in mips NDK platforms:
development/ndk/platforms/android-9/arch-mips/include/link.h

Change-Id: I39ff467cdac9f448e31c11ee3e14a6200e82ab57
Signed-off-by: Pavel Chupin <pavel.v.chupin@intel.com>
2012-08-17 12:44:23 -07:00
Henrik Engström
ce5ba8bfcd Added missing cache failed notification
Added a missing call to _resolv_cache_query_failed for another fail
case where it was missing (it doesn't go through the error handling
under the "fail" label). This missing notification caused requests to
have to wait for timeout instead of beeing notified on some failed
requests.

Change-Id: I904d60269c59b926784e3a397d2a860329f55142
2012-08-17 09:18:47 +02:00
Joe Onorato
28ae6f5dfd am cefb93b6: am 6c98cdb1: Merge "Don\'t over-generalize makefiles. Host modules always build. This isn\'t needed on eng builds."
* commit 'cefb93b632fc5a65bf7620095155cc1c314e29f2':
  Don't over-generalize makefiles.  Host modules always build. This isn't needed on eng builds.
2012-08-17 00:11:56 -07:00
Joe Onorato
cefb93b632 am 6c98cdb1: Merge "Don\'t over-generalize makefiles. Host modules always build. This isn\'t needed on eng builds."
* commit '6c98cdb1924afd3e71d39904557933fa10adaebf':
  Don't over-generalize makefiles.  Host modules always build. This isn't needed on eng builds.
2012-08-16 23:50:35 -07:00
Joe Onorato
6c98cdb192 Merge "Don't over-generalize makefiles. Host modules always build. This isn't needed on eng builds." 2012-08-16 23:37:50 -07:00
Joe Onorato
7b841f3b4a Don't over-generalize makefiles. Host modules always build. This isn't needed on eng builds.
Change-Id: I5821ced7a8a9042fd2094204e07470d8002263ca
2012-08-16 22:36:36 -07:00
Elliott Hughes
a7d8f3d50e am c80ca54f: am 60ef95e1: Merge "Enhance getcwd(3) to handle NULL like glibc."
* commit 'c80ca54f3cd2d7e20770e286f4478fb589742478':
  Enhance getcwd(3) to handle NULL like glibc.
2012-08-16 17:05:40 -07:00
Elliott Hughes
c80ca54f3c am 60ef95e1: Merge "Enhance getcwd(3) to handle NULL like glibc."
* commit '60ef95e1c1b171635adb4d11289347674b1b8987':
  Enhance getcwd(3) to handle NULL like glibc.
2012-08-16 17:04:11 -07:00
Elliott Hughes
60ef95e1c1 Merge "Enhance getcwd(3) to handle NULL like glibc." 2012-08-16 16:58:34 -07:00
Elliott Hughes
04a83a48ed Enhance getcwd(3) to handle NULL like glibc.
Bug: http://code.google.com/p/android/issues/detail?id=36085
Change-Id: I960a1b585887eb66176c61d29c5c61c239a4003f
2012-08-16 15:59:12 -07:00
Elliott Hughes
820ad4283d am 74438bb2: am 449d4634: Merge "bionic: add macro protection for MALLOC_ALIGNMENT"
* commit '74438bb22505b55ec72224932ae9982fbf9b4b65':
  bionic: add macro protection for MALLOC_ALIGNMENT
2012-08-16 14:23:56 -07:00
Elliott Hughes
74438bb225 am 449d4634: Merge "bionic: add macro protection for MALLOC_ALIGNMENT"
* commit '449d4634bea0ff8f6b29a2826871279dd654f941':
  bionic: add macro protection for MALLOC_ALIGNMENT
2012-08-16 12:27:47 -07:00
Elliott Hughes
449d4634be Merge "bionic: add macro protection for MALLOC_ALIGNMENT" 2012-08-16 12:09:13 -07:00
Jin Wei
9862f5e08b bionic: add macro protection for MALLOC_ALIGNMENT
In previous commit: 2fd81ef7, .mk file has been modified to
configure MALLOC_ALIGNMENT dynamicly according to board config.
Add the missing macor protection here.

Change-Id: I703cca2ce0504ab3e11aab226b2c61fcc0c6afa1
Author: Jin Wei <wei.a.jin@intel.com>
Signed-off-by: Xiaokang Qin <xiaokang.qin@intel.com>
Signed-off-by: Beare, Bruce J <bruce.j.beare@intel.com>
Signed-off-by: Jack Ren <jack.ren@intel.com>
2012-08-16 12:08:36 -07:00
Scott Anderson
09d9dd3acd Merge "Add clean kernel header for uhid." into jb-mr1-dev 2012-08-16 12:03:25 -07:00
Scott Anderson
52bf2d5659 Add clean kernel header for uhid.
The original kernel header was submitted in this change:

  commit 45b515c106161bb3b00d2c097504b9d44505f2d9
  Author: Scott Anderson <saa@android.com>
  Date:   Wed Aug 15 14:52:27 2012 -0700

      Add uhid original header.

      This header was cherry-picked from the upstream series that ends
      with patch adefb69b1b94df29ea2df05cd838c0e032b2c473.

      Change-Id: If516e41b6b14754e7feebdf062461dd38a31900a
      Signed-off-by: Scott Anderson <saa@android.com>

Change-Id: I088a0df4449df859835f8267d0d2e6cd4ed3c478
Signed-off-by: Scott Anderson <saa@android.com>
2012-08-16 11:56:11 -07:00
The Android Automerger
e20afb140c merge in jb-mr1-release history after reset to jb-mr1-dev 2012-08-16 06:33:16 -07:00
Elliott Hughes
a626bbdb36 am 4af9141c: am ae728099: Merge "enable clone system call for x86"
* commit '4af9141c5cc0989df6a1efcb10b2cfd484f2d9d2':
  enable clone system call for x86
2012-08-15 17:24:21 -07:00
Elliott Hughes
4af9141c5c am ae728099: Merge "enable clone system call for x86"
* commit 'ae7280994e7845037b667fd6ebdcb6f299ba1aab':
  enable clone system call for x86
2012-08-15 17:22:50 -07:00
Elliott Hughes
29af938cbd am ab8850f7: am 07cd1125: Merge "Fix comment typos."
* commit 'ab8850f7e2b79914af4cf83816e9a263b9e6dec3':
  Fix comment typos.
2012-08-15 17:08:01 -07:00
Elliott Hughes
4d63f33cdc am 76aad1d2: am e1cd69a7: Merge "Regenerate all NOTICE files with the latest version of the script."
* commit '76aad1d2746f62aaaacdf717b4f51fa45560521d':
  Regenerate all NOTICE files with the latest version of the script.
2012-08-15 17:07:59 -07:00
Elliott Hughes
ab8850f7e2 am 07cd1125: Merge "Fix comment typos."
* commit '07cd11251f52ff8a8a98dba795f69aaa75199473':
  Fix comment typos.
2012-08-15 17:06:53 -07:00
Elliott Hughes
76aad1d274 am e1cd69a7: Merge "Regenerate all NOTICE files with the latest version of the script."
* commit 'e1cd69a708d30fbc3b9e0e8d4db67f67fc123b65':
  Regenerate all NOTICE files with the latest version of the script.
2012-08-15 17:06:51 -07:00
Elliott Hughes
ae7280994e Merge "enable clone system call for x86" 2012-08-15 17:05:47 -07:00
Jin Wei
22d366cc09 enable clone system call for x86
Add __bionic_clone function for x86, which will be
used for clone system call.

Change-Id: I889dc9bf4b7ebb4358476e17e6f3233e26491f4d
Signed-off-by: Jin Wei <wei.a.jin@intel.com>
Signed-off-by: Xiaokang Qin <xiaokang.qin@intel.com>
Signed-off-by: Beare, Bruce J <bruce.j.beare@intel.com>
Signed-off-by: Jack Ren <jack.ren@intel.com>
Author-tracking-BZ: 51414
2012-08-15 17:04:50 -07:00
Elliott Hughes
07cd11251f Merge "Fix comment typos." 2012-08-15 16:59:21 -07:00
Elliott Hughes
105bc26fa6 Fix comment typos.
Change-Id: I8feeec1ee9935a6d6baebe57f1c0043ff90ff94f
2012-08-15 16:56:00 -07:00
Elliott Hughes
e1cd69a708 Merge "Regenerate all NOTICE files with the latest version of the script." 2012-08-15 16:51:56 -07:00
Elliott Hughes
2e3756b4d3 am 9b3bbcda: am fe43c768: Merge "Switch to the current NetBSD regex implementation."
* commit '9b3bbcda8478a31fa2c3865e0bd8cb3011dfc26e':
  Switch to the current NetBSD regex implementation.
2012-08-15 15:59:44 -07:00
Elliott Hughes
9b3bbcda84 am fe43c768: Merge "Switch to the current NetBSD regex implementation."
* commit 'fe43c768ec803a1febde0424bb5e69c343dd7ae9':
  Switch to the current NetBSD regex implementation.
2012-08-15 15:58:39 -07:00
Elliott Hughes
32dbc03c73 Regenerate all NOTICE files with the latest version of the script.
This sorts every entry, so we should have more stability and fewer
merge conflicts in future.

Change-Id: Ifc5347dc53352da22c82d41ca59b483966fcfc6b
2012-08-15 15:43:13 -07:00
Elliott Hughes
fe43c768ec Merge "Switch to the current NetBSD regex implementation." 2012-08-15 15:39:49 -07:00
Elliott Hughes
cc213f871b Switch to the current NetBSD regex implementation.
Change-Id: If32b28dd85d6a7ab8957ab81d19fa4c0de9499d5
2012-08-15 15:39:11 -07:00
The Android Automerger
46bb2a222e merge in jb-mr1-release history after reset to jb-mr1-dev 2012-08-15 06:33:26 -07:00
Elliott Hughes
8225911775 am 008a0a5d: am 53493a9b: Merge "Sort NOTICE entries."
* commit '008a0a5d50965f73d5954607a0b17b95a7f1fd0e':
  Sort NOTICE entries.
2012-08-14 15:43:57 -07:00
Elliott Hughes
008a0a5d50 am 53493a9b: Merge "Sort NOTICE entries."
* commit '53493a9b26e9fb665de590abf3502af94eaf3f44':
  Sort NOTICE entries.
2012-08-14 15:42:36 -07:00
Iliyan Malchev
df88d88f56 Merge changes I2e8af44e,Ie9250a0e into jb-mr1-dev
* changes:
  update msm_mdp.h header to support vsync
  update processed msm_camera.h and msm_isp.h
2012-08-14 15:40:21 -07:00
Elliott Hughes
53493a9b26 Merge "Sort NOTICE entries." 2012-08-14 15:31:18 -07:00
Elliott Hughes
fdbecf3b5a am 63696738: am b6a97196: Merge "More cleanup."
* commit '63696738e5d0684fb1e769c541fba2e552c5110a':
  More cleanup.
2012-08-14 15:10:51 -07:00
Elliott Hughes
63696738e5 am b6a97196: Merge "More cleanup."
* commit 'b6a971962acdf2684fd98658ec6fe6aa9952d84b':
  More cleanup.
2012-08-14 15:08:38 -07:00
Elliott Hughes
261e2232c1 Sort NOTICE entries.
Also make sure we get the whole of any copyright header, in case
there's text before the "Copyright" line.

Change-Id: Iabcc5e0931a39c0107b833539fec7c5a3d134592
2012-08-14 15:04:05 -07:00
Elliott Hughes
b6a971962a Merge "More cleanup." 2012-08-14 15:02:40 -07:00
Elliott Hughes
bedfe38b8b More cleanup.
Make more stuff static, remove some dead code, and fix a few typos.

Change-Id: I010b0eadeaf61e2899c37014ad1e7082c70bd510
2012-08-14 14:07:59 -07:00
Naseer Ahmed
056b4bc499 update msm_mdp.h header to support vsync
Change-Id: I2e8af44e430ff4955615d166bd25d7a2102ccc0f
2012-08-14 12:51:42 -07:00
Ajay Dudani
77b25702ba update processed msm_camera.h and msm_isp.h
Change-Id: Ie9250a0ef888a2d1ba0b736b19fede369daeef84
2012-08-14 12:51:42 -07:00
Elliott Hughes
89a3543568 am 16a0cbaa: am b7c6991c: Merge "Update MS_ mount flags, define unshare() syscall."
* commit '16a0cbaa83dc653a5b6a0fa62088f08cdfa4dedc':
  Update MS_ mount flags, define unshare() syscall.
2012-08-14 12:29:01 -07:00
Elliott Hughes
16a0cbaa83 am b7c6991c: Merge "Update MS_ mount flags, define unshare() syscall."
* commit 'b7c6991c9af3882bd13cbf6bc42da85c884aa5f5':
  Update MS_ mount flags, define unshare() syscall.
2012-08-14 12:27:44 -07:00
Elliott Hughes
b7c6991c9a Merge "Update MS_ mount flags, define unshare() syscall." 2012-08-14 12:14:29 -07:00
Elliott Hughes
dc320d99f1 am 82b69fcb: am b9c6854c: Merge "linker: avoid clobbering the .dynamic section of shared libs"
* commit '82b69fcbb3cc94bcde82c72d5c66fb3b504cdb6e':
  linker: avoid clobbering the .dynamic section of shared libs
2012-08-14 12:14:13 -07:00
Elliott Hughes
b6d6ec5326 am 370a7094: am c50e0197: Merge "Switch to upstream NetBSD tdelete/tfind/tsearch."
* commit '370a70948ad56046f685ffda34ead8ae88dcad2a':
  Switch to upstream NetBSD tdelete/tfind/tsearch.
2012-08-14 12:14:12 -07:00
Elliott Hughes
82b69fcbb3 am b9c6854c: Merge "linker: avoid clobbering the .dynamic section of shared libs"
* commit 'b9c6854cd9d5286f991aec66be3a8a57f5e3e7be':
  linker: avoid clobbering the .dynamic section of shared libs
2012-08-14 12:11:54 -07:00
Elliott Hughes
370a70948a am c50e0197: Merge "Switch to upstream NetBSD tdelete/tfind/tsearch."
* commit 'c50e019734fb379e2efc1d50e188dd51cf085b96':
  Switch to upstream NetBSD tdelete/tfind/tsearch.
2012-08-14 12:11:53 -07:00
Jeff Sharkey
74c0464006 Update MS_ mount flags, define unshare() syscall.
(cherry-pick of 82393decdfc6b0383054fb5d2f54725bbee88b8c.)

Bug: 6925012
Change-Id: I4f962d8975ad62ff4b9983150f9e481796092b9d
2012-08-14 12:09:25 -07:00
Elliott Hughes
b9c6854cd9 Merge "linker: avoid clobbering the .dynamic section of shared libs" 2012-08-14 12:07:18 -07:00
Jeff Sharkey
d8450043b0 Merge "Update MS_ mount flags, define unshare() syscall." into jb-mr1-dev 2012-08-14 12:05:46 -07:00
Elliott Hughes
c50e019734 Merge "Switch to upstream NetBSD tdelete/tfind/tsearch." 2012-08-14 11:56:30 -07:00
Jeff Sharkey
82393decdf Update MS_ mount flags, define unshare() syscall.
Bug: 6925012
Change-Id: I4ad79b4bccb7737d4dc704476cdb5795d124f53e
2012-08-14 11:45:12 -07:00
Ard Biesheuvel
12c78bbded linker: avoid clobbering the .dynamic section of shared libs
This patch removes the DT_NEEDED hack which stores pointers
to soinfo structs in the .dynamic section of the library
being loaded.

Instead, it caches the soinfo struct pointers on the stack
during relocation time. After relocation time, i.e. when
calling constructors and destructors of the shared library
and its dependencies, uncached access is used instead,
doing lookups using the string table entries pointed to by
the DT_NEEDED entries.

By removing this hack, it is no longer needed to undo the
PT_GNURELRO protection, i.e., all non-writable mappings
can remain non-writable during their entire lifespan.

Even though, strictly speaking, the algorithmic complexity
has increased somewhat, the real-world adverse effect
is negligible on the systems I have tested.

Change-Id: I2361502560b96b5878f7f94a8e8a215350d70d64
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@gmail.com>
2012-08-14 19:38:28 +02:00
The Android Automerger
59b222ac75 merge in jb-mr1-release history after reset to jb-mr1-dev 2012-08-14 07:06:10 -07:00
Elliott Hughes
409302f0f9 Switch to upstream NetBSD tdelete/tfind/tsearch.
tdestroy is a GNU extension, so that stays.

Change-Id: Iedebaff25ea7e92b1ab1dd4440da12b67b99aa40
2012-08-13 17:41:49 -07:00
Elliott Hughes
93a9d53485 am d544bdfa: am 54655eaf: Merge "Fix nice..."
* commit 'd544bdfac8da8aa7052aab47468acb3baf8e461a':
  Fix nice...
2012-08-13 17:14:40 -07:00
Elliott Hughes
d544bdfac8 am 54655eaf: Merge "Fix nice..."
* commit '54655eaf92ca91bfe2fa293896059a181e27b6eb':
  Fix nice...
2012-08-13 17:12:48 -07:00
Elliott Hughes
54655eaf92 Merge "Fix nice..." 2012-08-13 16:56:18 -07:00
Elliott Hughes
3d2d448af1 Fix nice...
...by switching to the NetBSD implementation.

Change-Id: I562b27b237a24ded95804035cc322c7bff12ff59
2012-08-13 16:38:29 -07:00
Elliott Hughes
69fc1522a3 am aa6c8994: am b66bc514: Merge "Clean up warnings in stubs.cpp."
* commit 'aa6c8994b7c40ea637d60fa4413928e62b5d814a':
  Clean up warnings in stubs.cpp.
2012-08-13 16:24:38 -07:00
Elliott Hughes
aa6c8994b7 am b66bc514: Merge "Clean up warnings in stubs.cpp."
* commit 'b66bc51423a1f3969d0e70e035126ac4c4898b50':
  Clean up warnings in stubs.cpp.
2012-08-13 16:22:43 -07:00
Elliott Hughes
b66bc51423 Merge "Clean up warnings in stubs.cpp." 2012-08-13 16:17:55 -07:00
Elliott Hughes
de727caee2 Clean up warnings in stubs.cpp.
Switch to C++ to get extra warnings, and format the code Google style.

Change-Id: Ifc0131bf297a6ee8a8a6b8d049a02518b0b1a4b7
2012-08-13 16:10:19 -07:00
Elliott Hughes
eab7bddd9e am ca09412a: am 222eec2e: Merge "Handle naming for system uids running as secondary users"
* commit 'ca09412a1f13c6e2df72c1efccdad1d9960ba99b':
  Handle naming for system uids running as secondary users
2012-08-13 16:03:27 -07:00
Elliott Hughes
ad8ff472b6 am c1eb7619: am 440e417d: Merge "Add dependencies on all the makefiles."
* commit 'c1eb76198ec81802f69b52a8c6fbf97765d46f53':
  Add dependencies on all the makefiles.
2012-08-13 16:03:26 -07:00
Elliott Hughes
cfd0345fe0 am 35dcf19b: am 66fba009: Merge "Update arch-mips/asm/unistd.h for the newer syscalls"
* commit '35dcf19b2bcf388cda7f4c9baacb159c15c9b03f':
  Update arch-mips/asm/unistd.h for the newer syscalls
2012-08-13 16:03:16 -07:00
Elliott Hughes
ca09412a1f am 222eec2e: Merge "Handle naming for system uids running as secondary users"
* commit '222eec2ecfc4afcbd5cf0f08e16f69f6c3c424fa':
  Handle naming for system uids running as secondary users
2012-08-13 15:00:55 -07:00
Elliott Hughes
222eec2ecf Merge "Handle naming for system uids running as secondary users" 2012-08-13 14:45:27 -07:00
Elliott Hughes
c1eb76198e am 440e417d: Merge "Add dependencies on all the makefiles."
* commit '440e417d5f8fb3ab3b5296eaea3720be52086730':
  Add dependencies on all the makefiles.
2012-08-13 14:30:35 -07:00
Amith Yamasani
bf9441efb8 Handle naming for system uids running as secondary users
Allow naming such as u1_system, u2_radio, u2_media.
Forward and reverse mapping for the above.

(cherry-pick of c60a0027b1ef3bc4929d2023e7083fbce12fafe7.)

Change-Id: I46eeb23fee4f57b2907640570504123d3ce99985
2012-08-13 14:19:16 -07:00
Elliott Hughes
440e417d5f Merge "Add dependencies on all the makefiles." 2012-08-13 14:12:02 -07:00
Elliott Hughes
ae5c64413b Add dependencies on all the makefiles.
This should help prevent broken builds next time I'm messing with
assembler/compiler/linker flags...

Change-Id: I30f15a3ce3c3f3c60cad7bc59aaba9f42d792224
2012-08-13 14:06:05 -07:00
Amith Yamasani
ca7ee8a9e5 Merge "Handle naming for system uids running as secondary users" into jb-mr1-dev 2012-08-13 13:49:51 -07:00
Amith Yamasani
c60a0027b1 Handle naming for system uids running as secondary users
Allow naming such as u1_system, u2_radio, u2_media.
Forward and reverse mapping for the above.

Change-Id: Iebe6e5702fc1ed83aa67769a12f693c1be7968ed
2012-08-13 13:35:31 -07:00
Elliott Hughes
35dcf19b2b am 66fba009: Merge "Update arch-mips/asm/unistd.h for the newer syscalls"
* commit '66fba00991f03d07c72f809d033b88748f839bda':
  Update arch-mips/asm/unistd.h for the newer syscalls
2012-08-13 12:47:13 -07:00
Elliott Hughes
66fba00991 Merge "Update arch-mips/asm/unistd.h for the newer syscalls" 2012-08-13 12:42:01 -07:00
Raghu Gandham
7d9f1c46bb Update arch-mips/asm/unistd.h for the newer syscalls
Change-Id: Ie292c091cbf4b972e1b5faa7d779645c6e4442f0
2012-08-13 11:54:53 -07:00
Elliott Hughes
71c0366fc7 am e135d7f3: am a61ac525: Merge "Fix module constructor order."
* commit 'e135d7f305c00272ce1544b8243f999bb99979ec':
  Fix module constructor order.
2012-08-13 11:11:58 -07:00
Elliott Hughes
e135d7f305 am a61ac525: Merge "Fix module constructor order."
* commit 'a61ac5257bea15d6cbfc640c03f18c2fb808b139':
  Fix module constructor order.
2012-08-13 11:10:32 -07:00
Elliott Hughes
a61ac5257b Merge "Fix module constructor order." 2012-08-13 11:06:53 -07:00
Evgeniy Stepanov
9181a5dcfe Fix module constructor order.
.preinit_array goes before the constructors of LD_PRELOAD-ed libraries.

Change-Id: I1af32ce29eaf3ca4351ae8a0f7f5da5165853216
2012-08-13 11:05:47 -07:00
Nick Kralevich
19b1041930 am 89fd9ecc: am 20b94c0c: Merge "linker: don\'t perform unnecessary mprotects"
* commit '89fd9eccdca0eb5aed296bd7a2003424defe970c':
  linker: don't perform unnecessary mprotects
2012-08-13 09:48:17 -07:00
Nick Kralevich
89fd9eccdc am 20b94c0c: Merge "linker: don\'t perform unnecessary mprotects"
* commit '20b94c0ce99ea3d2315535091c8bcd02f831d252':
  linker: don't perform unnecessary mprotects
2012-08-13 09:46:43 -07:00
Nick Kralevich
20b94c0ce9 Merge "linker: don't perform unnecessary mprotects" 2012-08-13 09:28:54 -07:00
Nick Kralevich
5135b3ae6e linker: don't perform unnecessary mprotects
The linker only needs to mark the text segment as
writable iff the file has text relocations. Unnecessarily
calling mprotect when it isn't necessary is slow, and some
security enhanced kernels don't like it. Pages which are
simultaneously writable and executable are considered a no-no.

The vast majority of executables / shared libraries on Android
do NOT have text relocations.

Change-Id: Ic38ce30a99b7e33ecf21efd9c108547a58eafa35
2012-08-13 08:50:11 -07:00
The Android Automerger
df0cf64781 merge in jb-mr1-release history after reset to jb-mr1-dev 2012-08-13 08:09:08 -07:00
Elliott Hughes
2a22a69e94 am 877dc946: am 072a7e6c: Merge "MIPS support to the libc Makefile"
* commit '877dc946090749ba7a71f7ae07f51aa32f966083':
  MIPS support to the libc Makefile
2012-08-11 15:16:34 -07:00
Ben Cheng
9eeaa4bd17 am 7e3918eb: am 0bf5cf87: Merge "Set the dynamic field in the link map for the linker itself."
* commit '7e3918eb62d31224fc5d1cff44d591fecd31e9d0':
  Set the dynamic field in the link map for the linker itself.
2012-08-11 15:16:33 -07:00
Elliott Hughes
877dc94609 am 072a7e6c: Merge "MIPS support to the libc Makefile"
* commit '072a7e6ced29d9be29e38721d0ab7de0ba3f7377':
  MIPS support to the libc Makefile
2012-08-11 11:51:37 -07:00
Ben Cheng
7e3918eb62 am 0bf5cf87: Merge "Set the dynamic field in the link map for the linker itself."
* commit '0bf5cf87c6b7d3de8962ba132ecfb6f0e4b84f06':
  Set the dynamic field in the link map for the linker itself.
2012-08-11 11:51:36 -07:00
Elliott Hughes
072a7e6ced Merge "MIPS support to the libc Makefile" 2012-08-11 09:36:05 -07:00
Raghu Gandham
a4c7933b49 MIPS support to the libc Makefile
Change-Id: Ia1f3f545ca61a5abb235e99046cb3cdaf24d4205
2012-08-10 17:24:02 -07:00
Ben Cheng
0bf5cf87c6 Merge "Set the dynamic field in the link map for the linker itself." 2012-08-10 16:46:09 -07:00
Ben Cheng
06f0e74a2b Set the dynamic field in the link map for the linker itself.
Otherwise gdb will print a spurious warning each time gdb is used:

warning: .dynamic section for "/system/bin/linker" is not at the expected
address (wrong library or version mismatch?)

BUG:6946614
Change-Id: Ib21b8db0615751189c1601140deb43bc089289b6
2012-08-10 16:07:02 -07:00
Elliott Hughes
0837c69a63 am edf09bf9: am 316ee626: Merge "MIPS support to sigsuspend and sigwait routines"
* commit 'edf09bf990c8b011a084dbdb92050879e08ad8a9':
  MIPS support to sigsuspend and sigwait routines
2012-08-10 15:17:05 -07:00
Elliott Hughes
edf09bf990 am 316ee626: Merge "MIPS support to sigsuspend and sigwait routines"
* commit '316ee626b729e3f66a5505a20128af26440cfd19':
  MIPS support to sigsuspend and sigwait routines
2012-08-10 15:15:23 -07:00
Elliott Hughes
316ee626b7 Merge "MIPS support to sigsuspend and sigwait routines" 2012-08-10 15:05:36 -07:00
Nick Kralevich
73d99958bb am fabeb736: am 38a02b4b: Merge "crtend*: Add GNU_STACK note"
* commit 'fabeb736e91d4f4f79a1cbbed696cffb50a860a9':
  crtend*: Add GNU_STACK note
2012-08-10 14:46:56 -07:00
Nick Kralevich
fabeb736e9 am 38a02b4b: Merge "crtend*: Add GNU_STACK note"
* commit '38a02b4b80f50aa1b3e2ee39e9e98146cf42be3d':
  crtend*: Add GNU_STACK note
2012-08-10 14:42:11 -07:00
Nick Kralevich
38a02b4b80 Merge "crtend*: Add GNU_STACK note" 2012-08-10 14:29:27 -07:00
Elliott Hughes
d71ada630d am 535477ca: am 3ede900b: Merge "Revert "Revert "Switch to NetBSD\'s strxfrm(3)."""
* commit '535477ca5e29f3c14dff11ac362423156b5971ec':
  Revert "Revert "Switch to NetBSD's strxfrm(3).""
2012-08-10 14:12:08 -07:00
Nick Kralevich
6eee1fc68f crtend*: Add GNU_STACK note
Add a GNU_STACK marker to crtend* files. This tells the linker
that these files do not require an executable stack.

When linking, a missing GNU_STACK marker in any .o file can prevent
the compiler from automatically marking the final executable as NX
safe (executable stack not required).  In Android, we normally work
around this by adding -Wa,--noexecstack / -Wl,-z,noexecstack.
For files like crtend.S / crtend_so.S, which are included in every
executable / shared library, it's better to add the GNU_STACK note
directly to the assembly file.  This allows the compiler to
automatically mark the final executable as NX safe without any
special command line options.

References: http://www.gentoo.org/proj/en/hardened/gnu-stack.xml

Change-Id: I07bd058f9f60ddd8b146e0fb36ba26ff84c0357d
2012-08-10 14:12:00 -07:00
Elliott Hughes
535477ca5e am 3ede900b: Merge "Revert "Revert "Switch to NetBSD\'s strxfrm(3)."""
* commit '3ede900b644c2a7c2fa41177b81735c8a09bd14a':
  Revert "Revert "Switch to NetBSD's strxfrm(3).""
2012-08-10 14:10:03 -07:00
Elliott Hughes
3ede900b64 Merge "Revert "Revert "Switch to NetBSD's strxfrm(3).""" 2012-08-10 14:03:06 -07:00
Elliott Hughes
5adc7fdc2b am b54e5f2a: am a1822dce: Merge "Add unshare() syscall."
* commit 'b54e5f2a2fd014a5cbf105daea7b2eb8b59dec29':
  Add unshare() syscall.
2012-08-10 13:06:35 -07:00
Elliott Hughes
b54e5f2a2f am a1822dce: Merge "Add unshare() syscall."
* commit 'a1822dced3ed8625438b3cbf1c53f907f78a3a48':
  Add unshare() syscall.
2012-08-10 13:04:22 -07:00
Elliott Hughes
a1822dced3 Merge "Add unshare() syscall." 2012-08-10 12:59:49 -07:00
Jeff Sharkey
e36c826f7a Add unshare() syscall.
(cherry-pick of 5467f25f82934d611c60f8bc57a05114f3c1bea0.)

Bug: 6925012
Change-Id: Ic5ea2fbd606311087de05d7a3594df2fa9b2fef9
2012-08-10 12:57:43 -07:00
Elliott Hughes
5140b785a0 am f6922be2: am f91e2f72: Merge "Fix typo in SIGTTOU description."
* commit 'f6922be2a5e30fc594f48ec435d92b5386648061':
  Fix typo in SIGTTOU description.
2012-08-10 12:49:12 -07:00
Elliott Hughes
5520650483 am a618ea30: am 4ec9e343: Merge "Revert "Switch to NetBSD\'s strxfrm(3).""
* commit 'a618ea30e1c9d4f06031fb4ecdae31666db92993':
  Revert "Switch to NetBSD's strxfrm(3)."
2012-08-10 12:49:10 -07:00
Elliott Hughes
29b8fb3d5e am 3e83da43: am 9ad1d6f5: Merge "Switch to NetBSD\'s strxfrm(3)."
* commit '3e83da435b3ad7bee739972fca53dbfb692e6438':
  Switch to NetBSD's strxfrm(3).
2012-08-10 12:49:08 -07:00
Elliott Hughes
b6c1e34dca am dc6d5327: am 0836a7ff: Merge "Auto-generate a complete NOTICE file."
* commit 'dc6d5327bb6b030d154675f753d3e4f96dfa5e14':
  Auto-generate a complete NOTICE file.
2012-08-10 12:36:22 -07:00
Elliott Hughes
f6922be2a5 am f91e2f72: Merge "Fix typo in SIGTTOU description."
* commit 'f91e2f72861643e1d31ffc3e6c374b52d33d2423':
  Fix typo in SIGTTOU description.
2012-08-10 12:34:17 -07:00
Elliott Hughes
f91e2f7286 Merge "Fix typo in SIGTTOU description." 2012-08-10 12:27:06 -07:00
Elliott Hughes
01030e6388 Fix typo in SIGTTOU description.
Change-Id: Ie0db3e7df3e1f17b43f5645d027a90603139be2f
2012-08-10 12:23:58 -07:00
Elliott Hughes
f8b3a920a8 Revert "Revert "Switch to NetBSD's strxfrm(3).""
This reverts commit 8793e7c7d2,
and fixes the build by building upstream NetBSD source as a
separate library that's then swallowed whole into libc_common.

Change-Id: I6c9317d8c48b5ccaf85a7b185bc07fb31176ff97
2012-08-10 12:10:10 -07:00
Elliott Hughes
a618ea30e1 am 4ec9e343: Merge "Revert "Switch to NetBSD\'s strxfrm(3).""
* commit '4ec9e343cf445c5032d9a782d2e92b1dba713e61':
  Revert "Switch to NetBSD's strxfrm(3)."
2012-08-10 11:44:29 -07:00
Elliott Hughes
4ec9e343cf Merge "Revert "Switch to NetBSD's strxfrm(3)."" 2012-08-10 11:36:31 -07:00
Elliott Hughes
8793e7c7d2 Revert "Switch to NetBSD's strxfrm(3)."
This reverts commit be1d78b0dc

Change-Id: I11a95db474796f3da004f27652b081d5ba4ec9b4
2012-08-10 11:36:17 -07:00
Jeff Sharkey
6ccc2c8f43 Merge "Add unshare() syscall." into jb-mr1-dev 2012-08-10 11:29:53 -07:00
Elliott Hughes
3e83da435b am 9ad1d6f5: Merge "Switch to NetBSD\'s strxfrm(3)."
* commit '9ad1d6f58ccbc830ce87e3ddf35708e519a8f23e':
  Switch to NetBSD's strxfrm(3).
2012-08-10 11:28:40 -07:00
Elliott Hughes
9ad1d6f58c Merge "Switch to NetBSD's strxfrm(3)." 2012-08-10 11:23:30 -07:00
Jeff Sharkey
5467f25f82 Add unshare() syscall.
Bug: 6925012
Change-Id: I2530a8f6cea49eb32b60f8f9c4d86963773456ca
2012-08-10 11:17:59 -07:00
Elliott Hughes
be1d78b0dc Switch to NetBSD's strxfrm(3).
There were two bugs in our implementation. Intel found one, but another
remainined, and tracking upstream is the way forward for functions where
we add no value.

Change-Id: Ida9bac0293fb2c4cbc942b1e0515ee0477c6538b
2012-08-10 11:03:02 -07:00
Raghu Gandham
abd10011a7 MIPS support to sigsuspend and sigwait routines
Change-Id: I870e798ed7eac5a8c74e5784a670f3a4f24331a9
2012-08-09 18:51:19 -07:00
Elliott Hughes
dc6d5327bb am 0836a7ff: Merge "Auto-generate a complete NOTICE file."
* commit '0836a7ffb13890558fe568119b023007cce66373':
  Auto-generate a complete NOTICE file.
2012-08-09 16:39:15 -07:00
Elliott Hughes
0836a7ffb1 Merge "Auto-generate a complete NOTICE file." 2012-08-09 16:25:19 -07:00
Elliott Hughes
387d4b7de9 Auto-generate a complete NOTICE file.
Remove the hand-collated ones, and switch to a script that pulls the
copyright headers out of every file and collects the unique ones.

Change-Id: Ied3b98b3f56241df97166c410ff81de4e0157c9d
2012-08-09 16:05:31 -07:00
Elliott Hughes
31ab6ac05e am 8cc8f7e0: am 709bb0f7: Merge "Remove ThirdPartyProject.prop."
* commit '8cc8f7e0d566aaa4c4fbf9d9c8da72b268250617':
  Remove ThirdPartyProject.prop.
2012-08-09 14:47:24 -07:00
Elliott Hughes
8cc8f7e0d5 am 709bb0f7: Merge "Remove ThirdPartyProject.prop."
* commit '709bb0f79ced522e5fb145182472ee4063b85368':
  Remove ThirdPartyProject.prop.
2012-08-09 14:46:00 -07:00
Elliott Hughes
709bb0f79c Merge "Remove ThirdPartyProject.prop." 2012-08-09 14:31:27 -07:00
Elliott Hughes
df675370d7 Remove ThirdPartyProject.prop.
These are dead. I cleaned up external/ a long time ago, but didn't
realize there were any in the main tree.

Change-Id: I5f35b2da132558e2763164285eb38629cd68ffda
2012-08-09 14:29:23 -07:00
Elliott Hughes
3fc211983e am 531d348d: am a17b85d9: Merge "Remove the last .jam file."
* commit '531d348d6e37deb751efbefc0613934c5a80de1d':
  Remove the last .jam file.
2012-08-09 12:11:08 -07:00
Elliott Hughes
531d348d6e am a17b85d9: Merge "Remove the last .jam file."
* commit 'a17b85d97b16583ba922a88346cc54976a0bfa28':
  Remove the last .jam file.
2012-08-09 12:08:53 -07:00
Elliott Hughes
a17b85d97b Merge "Remove the last .jam file." 2012-08-09 11:59:20 -07:00
Elliott Hughes
a554212992 Remove the last .jam file.
How did I miss this before?

Change-Id: I2e582133fc4800656fdd81104f8dfc7ee8f5b580
2012-08-09 11:54:23 -07:00
The Android Automerger
536b1daf00 merge in jb-mr1-release history after reset to jb-mr1-dev 2012-08-09 09:29:41 -07:00
Elliott Hughes
b13ad93f4a am 3820229b: am d504eee9: Merge "MIPS support to sys/ headers"
* commit '3820229b46ed3012f19a32cea70b6007ad54b746':
  MIPS support to sys/ headers
2012-08-08 17:44:20 -07:00
Elliott Hughes
73ac7d94b7 am d2040cb2: am f655ce7e: Merge "Fix x86 build."
* commit 'd2040cb2244bbd253951b5ff808efe67246e5154':
  Fix x86 build.
2012-08-08 17:44:14 -07:00
Elliott Hughes
3820229b46 am d504eee9: Merge "MIPS support to sys/ headers"
* commit 'd504eee9fa7dda59a41eb3e12ef973f32ee1169f':
  MIPS support to sys/ headers
2012-08-08 16:51:01 -07:00
Elliott Hughes
d504eee9fa Merge "MIPS support to sys/ headers" 2012-08-08 16:32:55 -07:00
Elliott Hughes
d2040cb224 am f655ce7e: Merge "Fix x86 build."
* commit 'f655ce7ef3df277442ccc47f91cb919c1cd9ebd6':
  Fix x86 build.
2012-08-08 16:19:25 -07:00
Elliott Hughes
f655ce7ef3 Merge "Fix x86 build." 2012-08-08 16:07:27 -07:00
Elliott Hughes
57e6d9ab48 Fix x86 build.
Change-Id: Ice50ca71a19f3bf26de7cfd4c02075f1e6e0823f
2012-08-08 16:06:51 -07:00
Elliott Hughes
366c01992a am f3ffb8fa: am 78129204: Merge "Clean up the linker a bit, remove prelinking support."
* commit 'f3ffb8fa6ecd9db2da19eb3144a5da7724a875bc':
  Clean up the linker a bit, remove prelinking support.
2012-08-08 15:30:39 -07:00
Elliott Hughes
f3ffb8fa6e am 78129204: Merge "Clean up the linker a bit, remove prelinking support."
* commit '7812920487070d392984f94c9f80006dad8c198a':
  Clean up the linker a bit, remove prelinking support.
2012-08-08 15:29:27 -07:00
Elliott Hughes
7812920487 Merge "Clean up the linker a bit, remove prelinking support." 2012-08-08 15:17:23 -07:00
Elliott Hughes
10e2d222ce am d463f6e9: am 34959e0b: Merge "Clean up libc/Android.mk a bit after the crtbrand changes."
* commit 'd463f6e98011fe3b5a23cef2502705dedd702173':
  Clean up libc/Android.mk a bit after the crtbrand changes.
2012-08-08 14:43:00 -07:00
Elliott Hughes
d463f6e980 am 34959e0b: Merge "Clean up libc/Android.mk a bit after the crtbrand changes."
* commit '34959e0bd5c0d7c9d9b243adbf7752077436cbb5':
  Clean up libc/Android.mk a bit after the crtbrand changes.
2012-08-08 14:40:54 -07:00
Elliott Hughes
34959e0bd5 Merge "Clean up libc/Android.mk a bit after the crtbrand changes." 2012-08-08 14:32:24 -07:00
Jean-Baptiste Queru
affd1b4243 am 9f3a8aaf: am 7e248be7: Merge "Add a .note.android.ident section to Android ELF binaries."
* commit '9f3a8aaf926bb0439b7e6b7b62efab62f1900d02':
  Add a .note.android.ident section to Android ELF binaries.
2012-08-08 14:08:29 -07:00
Elliott Hughes
76be660aae Clean up libc/Android.mk a bit after the crtbrand changes.
Change-Id: Icfb95fffe70967418cd93da8cbeae22dcd68f8c9
2012-08-08 14:07:37 -07:00
Jean-Baptiste Queru
9f3a8aaf92 am 7e248be7: Merge "Add a .note.android.ident section to Android ELF binaries."
* commit '7e248be76441daa0ee27cc461c806e6010405c25':
  Add a .note.android.ident section to Android ELF binaries.
2012-08-08 14:04:19 -07:00
Jean-Baptiste Queru
7e248be764 Merge "Add a .note.android.ident section to Android ELF binaries." 2012-08-08 13:44:27 -07:00
Elliott Hughes
4688279db5 Clean up the linker a bit, remove prelinking support.
Also make the errors more readable, since none of us seemed to know
what they actually meant. The new style is still as verbose as the
old, but that's probably necessary in the absence of chained exceptions
in C. Here's what you'd see if you try to boot after removing
libsurfaceflinger.so:

  32267 32267 E AndroidRuntime: java.lang.UnsatisfiedLinkError: Cannot load library: (linker.c:1629, pid 32259) soinfo_link_image: could not load library "libsystem_server.so" needed by "libandroid_servers.so"; caused by (linker.c:1629, pid 32259) soinfo_link_image: could not load library "libsurfaceflinger.so" needed by "libsystem_server.so"; caused by (linker.c:709, pid 32259) load_library: library "libsurfaceflinger.so" not found

This patch also fixes almost all of the compiler warnings.

Change-Id: I64bb59aed6d4e039c15ea45be2367f319ef879f8
2012-08-07 11:41:10 -07:00
The Android Automerger
eeb321c54e merge in jb-mr1-release history after reset to jb-mr1-dev 2012-08-07 06:33:32 -07:00
Shih-wei Liao
f4497e15b7 When compiling with clang, don't "fortify_source" the strlcpy and
strlcat.

Change-Id: I91f58322f28e425ab9d22b51c23fcd6b772ede97
2012-08-06 13:17:05 -07:00
Shih-wei Liao
a72246d67e When compiling with clang, don't "fortify_source" the strlen.
At this point, FORTIFY_SOURCE and clang are just plain incompatible.
Need to solve the underlying incompatibility first.

Change-Id: I3366477d19461e1ec93b1c30e0c7e8145b391b9b
2012-08-06 13:16:56 -07:00
Shih-wei Liao
5fec211f60 Revert "Fix the clang build: this compiler doesn't support the gnu_inline function attribute"
This reverts commit 4f1f149c37.
2012-08-06 13:16:48 -07:00
Shih-wei Liao
3b4c9db256 am df523880: am e2731d98: Merge "When compiling with clang, don\'t "fortify_source" the strlcpy and strlcat."
* commit 'df523880b59604ef36e212cb7ba30d663eeea179':
  When compiling with clang, don't "fortify_source" the strlcpy and strlcat.
2012-08-06 11:09:35 -07:00
Shih-wei Liao
df523880b5 am e2731d98: Merge "When compiling with clang, don\'t "fortify_source" the strlcpy and strlcat."
* commit 'e2731d98c1f0cd32d94b34cc4ee77148d6d52647':
  When compiling with clang, don't "fortify_source" the strlcpy and strlcat.
2012-08-06 11:08:40 -07:00
Shih-wei Liao
e2731d98c1 Merge "When compiling with clang, don't "fortify_source" the strlcpy and strlcat." 2012-08-06 11:02:19 -07:00
Shih-wei Liao
d600617645 When compiling with clang, don't "fortify_source" the strlcpy and
strlcat.

Change-Id: I91f58322f28e425ab9d22b51c23fcd6b772ede97
2012-08-06 10:57:37 -07:00
Shih-wei Liao
6ff66601a4 am ce4a5cd5: am 8173d767: Merge "Revert "Fix the clang build: this compiler doesn\'t support the gnu_inline function attribute""
* commit 'ce4a5cd5f3ee09fbc8dea7ffdfcd4fd097f8ed34':
  Revert "Fix the clang build: this compiler doesn't support the gnu_inline function attribute"
2012-08-06 10:18:21 -07:00
Shih-wei Liao
cddedade5b am 924fd920: am 601a49d3: Merge "When compiling with clang, don\'t "fortify_source" the strlen."
* commit '924fd920137135729483d0beacea20d5a0552c15':
  When compiling with clang, don't "fortify_source" the strlen.
2012-08-06 10:18:20 -07:00
Shih-wei Liao
ce4a5cd5f3 am 8173d767: Merge "Revert "Fix the clang build: this compiler doesn\'t support the gnu_inline function attribute""
* commit '8173d76740cafc2ceb49d2fddf1ceabfaa823236':
  Revert "Fix the clang build: this compiler doesn't support the gnu_inline function attribute"
2012-08-06 10:17:09 -07:00
Shih-wei Liao
924fd92013 am 601a49d3: Merge "When compiling with clang, don\'t "fortify_source" the strlen."
* commit '601a49d39829005803670088da02179e61719551':
  When compiling with clang, don't "fortify_source" the strlen.
2012-08-06 10:17:08 -07:00
Shih-wei Liao
8173d76740 Merge "Revert "Fix the clang build: this compiler doesn't support the gnu_inline function attribute"" 2012-08-06 10:05:15 -07:00
Shih-wei Liao
601a49d398 Merge "When compiling with clang, don't "fortify_source" the strlen." 2012-08-06 10:04:22 -07:00
Shih-wei Liao
9a3d53fad0 When compiling with clang, don't "fortify_source" the strlen.
At this point, FORTIFY_SOURCE and clang are just plain incompatible.
Need to solve the underlying incompatibility first.

Change-Id: I3366477d19461e1ec93b1c30e0c7e8145b391b9b
2012-08-06 09:50:56 -07:00
Elliott Hughes
eaac1e5a1c am 94ce1356: am 7c92b6ca: Merge "Remove an awkward #include that is no longer upstream."
* commit '94ce135693a73ac09116dabc0f2440604bba5c87':
  Remove an awkward #include that is no longer upstream.
2012-08-06 08:06:27 -07:00
Elliott Hughes
94ce135693 am 7c92b6ca: Merge "Remove an awkward #include that is no longer upstream."
* commit '7c92b6ca409f514e7ff67ac8c10d73ce92ff38d2':
  Remove an awkward #include that is no longer upstream.
2012-08-06 08:04:33 -07:00
Elliott Hughes
7c92b6ca40 Merge "Remove an awkward #include that is no longer upstream." 2012-08-06 07:57:59 -07:00
The Android Automerger
7bf1c31cac merge in jb-mr1-release history after reset to jb-mr1-dev 2012-08-06 06:27:31 -07:00
Shih-wei Liao
2b7f68c03d Revert "Fix the clang build: this compiler doesn't support the gnu_inline function attribute"
This reverts commit 4f1f149c37.
2012-08-03 17:44:08 -07:00
Elliott Hughes
4bac8f689e am 7e81ee04: am 1c861728: Merge "Remove yet more SH4 cruft."
* commit '7e81ee04532e9c26f90d73061d9a53f09e2c3fa1':
  Remove yet more SH4 cruft.
2012-08-03 15:12:39 -07:00
Elliott Hughes
7e81ee0453 am 1c861728: Merge "Remove yet more SH4 cruft."
* commit '1c861728e5c8dda7589e6595f4850d77ec21a236':
  Remove yet more SH4 cruft.
2012-08-03 15:09:55 -07:00
Elliott Hughes
1c861728e5 Merge "Remove yet more SH4 cruft." 2012-08-03 15:05:15 -07:00
Ajay Dudani
5f0701c9fa Update msm_camera.h to version that supports instance handle based lookup
Change-Id: If33a45f378e2cbbfe28b51643808df94e8d1f5e7
2012-08-03 15:02:07 -07:00
Elliott Hughes
bbf094fdf5 Remove yet more SH4 cruft.
Surely this is the last piece?

Change-Id: I4bd43afb102334ec34d0e14a65c2b319826473d7
2012-08-03 14:58:18 -07:00
Elliott Hughes
c9dbebe344 am f5385754: am aea5f00d: Merge "bionic: modify syscall to use 6 registers to pass parameter."
* commit 'f5385754e29dcb093cb9445c40b69e45bd71d685':
  bionic: modify syscall to use 6 registers to pass parameter.
2012-08-03 14:29:45 -07:00
Elliott Hughes
f5385754e2 am aea5f00d: Merge "bionic: modify syscall to use 6 registers to pass parameter."
* commit 'aea5f00df4704a618331e16473b552e54bed269b':
  bionic: modify syscall to use 6 registers to pass parameter.
2012-08-03 14:27:08 -07:00
Elliott Hughes
aea5f00df4 Merge "bionic: modify syscall to use 6 registers to pass parameter." 2012-08-03 13:55:56 -07:00
Jin Wei
c164f2a969 bionic: modify syscall to use 6 registers to pass parameter.
Kernel allows to use 6 registers(exclude eax) to pass parameter.
But in syscall's implementation, it only uses five registers.
It will lead to error when 6 parameters passed.

Change-Id: I92d663194e6334c3847f0c0c257ca3b9dee0edef
Author: Jin Wei <wei.a.jin@intel.com>
Signed-off-by: Xiaokang Qin <xiaokang.qin@intel.com>
Signed-off-by: Beare, Bruce J <bruce.j.beare@intel.com>
Signed-off-by: Jack Ren <jack.ren@intel.com>
Author-tracking-BZ: 30838
2012-08-03 13:54:29 -07:00
Elliott Hughes
48955d24b9 am c6f15ecf: am 1510795f: Merge "Upgrade to tzdata2012e."
* commit 'c6f15ecf76842801db653d58a262c7d342be2a93':
  Upgrade to tzdata2012e.
2012-08-03 13:33:15 -07:00
Elliott Hughes
c6f15ecf76 am 1510795f: Merge "Upgrade to tzdata2012e."
* commit '1510795fec5aa8b8700a08200f37f6e57dea8d04':
  Upgrade to tzdata2012e.
2012-08-03 13:30:44 -07:00
Elliott Hughes
1510795fec Merge "Upgrade to tzdata2012e." 2012-08-03 12:30:18 -07:00
Elliott Hughes
094651335e Upgrade to tzdata2012e.
Includes this change:

  * australasia (Pacific/Fakaofo): Tokelau is UTC+13, not UTC+14.
    (Thanks to Steffen Thorsen.)

Change-Id: I51bfab759f424b90daeb1960c6cfb2b55b78ff46
2012-08-03 12:26:06 -07:00
David Turner
d7552a3101 am 2f2b7212: am 16d40217: Merge "Fix the clang build: this compiler doesn\'t support the gnu_inline function attribute"
* commit '2f2b72120489d9e7e67a97a059a731aa72a34f72':
  Fix the clang build: this compiler doesn't support the gnu_inline function attribute
2012-08-03 05:00:03 -07:00
David Turner
2f2b721204 am 16d40217: Merge "Fix the clang build: this compiler doesn\'t support the gnu_inline function attribute"
* commit '16d40217d05a1d9ad8ec475ce5f68c35bbef7029':
  Fix the clang build: this compiler doesn't support the gnu_inline function attribute
2012-08-03 04:57:56 -07:00
David Turner
16d40217d0 Merge "Fix the clang build: this compiler doesn't support the gnu_inline function attribute" 2012-08-03 04:40:37 -07:00
Shih-wei Liao
4f1f149c37 Fix the clang build: this compiler doesn't support the gnu_inline function attribute
Recent clang compiler doesn't have gnu_inline working. When frameworks/rs
is compiled with clang instead of gcc, it no longer works. Will be fixed
by this patch.

Change-Id: I8b281a1305151909e18958b73914ea27343cb4cd
2012-08-03 04:38:15 -07:00
Elliott Hughes
9b6a453865 am 0ce92b96: am 1e304a3b: Merge "[MIPS] Support for TLS register"
* commit '0ce92b9625c5d0cc4e72047e6c8759c4cc079dcb':
  [MIPS] Support for TLS register
2012-08-02 18:48:04 -07:00
Elliott Hughes
0ce92b9625 am 1e304a3b: Merge "[MIPS] Support for TLS register"
* commit '1e304a3bce347da08f0f9409829d911493bad1bb':
  [MIPS] Support for TLS register
2012-08-02 18:45:56 -07:00
Elliott Hughes
1e304a3bce Merge "[MIPS] Support for TLS register" 2012-08-02 18:33:20 -07:00
Elliott Hughes
bdcc14d721 Remove an awkward #include that is no longer upstream.
This was causing trouble in https://android-review.googlesource.com/#/c/37590/.

Change-Id: Ib7cb4fbaef6e9c1470c59f67d24bd24c7ce90bcc
2012-08-02 18:12:36 -07:00
Raghu Gandham
6437eac15a MIPS support to sys/ headers
Change-Id: I32207a1d918e4842da341f6b242ae39c69a83b03
2012-08-02 18:03:54 -07:00
Raghu Gandham
1c30398143 [MIPS] Support for TLS register
Change-Id: I6b5194e5e379b573e3b1203d8015e20fb3edd647
Signed-off-by: Chris Dearman <chris@mips.com>
2012-08-02 18:01:05 -07:00
Elliott Hughes
f94effdab2 am fd4685be: am 52f3ee96: Merge "MIPS support for libc."
* commit 'fd4685be87fa2c957d4f95deb75a6ba763fd7339':
  MIPS support for libc.
2012-08-02 16:34:57 -07:00
Elliott Hughes
fd4685be87 am 52f3ee96: Merge "MIPS support for libc."
* commit '52f3ee962b384bf247638adb653f0024ce92a895':
  MIPS support for libc.
2012-08-02 16:32:47 -07:00
Elliott Hughes
52f3ee962b Merge "MIPS support for libc." 2012-08-02 16:14:47 -07:00
Elliott Hughes
82dcfee5fc am 19e30fc4: am a1c0f08d: Merge "Fix a ENOTUP/ENOTSUP typo."
* commit '19e30fc41030ab0524134b097dfef88baea14f4a':
  Fix a ENOTUP/ENOTSUP typo.
2012-08-02 16:07:41 -07:00
Elliott Hughes
c07196605c am 670766c5: am 994935f6: Merge "Error numbers are target specific."
* commit '670766c5649086ad5ffe26c0deadeb460139202f':
  Error numbers are target specific.
2012-08-02 16:07:40 -07:00
Raghu Gandham
405b8029a6 MIPS support for libc.
Change-Id: I2864dea04b3faf2d919165dcaa600af5b16c41c8
Signed-off-by: Chris Dearman <chris@mips.com>
Signed-off-by: Raghu Gandham <raghu@mips.com>
2012-08-02 16:07:26 -07:00
Elliott Hughes
19e30fc410 am a1c0f08d: Merge "Fix a ENOTUP/ENOTSUP typo."
* commit 'a1c0f08d3ccbe5c40be53903615e59113ade4922':
  Fix a ENOTUP/ENOTSUP typo.
2012-08-02 15:59:22 -07:00
Elliott Hughes
670766c564 am 994935f6: Merge "Error numbers are target specific."
* commit '994935f64cdbd7553ecbfbd15d4e4dd429277409':
  Error numbers are target specific.
2012-08-02 15:59:21 -07:00
Elliott Hughes
a1c0f08d3c Merge "Fix a ENOTUP/ENOTSUP typo." 2012-08-02 15:46:44 -07:00
Elliott Hughes
ecb53eab4b Fix a ENOTUP/ENOTSUP typo.
Change-Id: Ifa347a09a2aa1f505965ae7c1383fd0caf95793c
2012-08-02 15:45:04 -07:00
Elliott Hughes
994935f64c Merge "Error numbers are target specific." 2012-08-02 15:42:48 -07:00
Elliott Hughes
673c092e0f am 54830578: am f34ecbff: Merge "MIPS support to the linker"
* commit '5483057817d071140d94299452b31881c4a6e748':
  MIPS support to the linker
2012-08-02 15:39:45 -07:00
Brian Muramatsu
402ec70899 Merge "Update msm_camera.h to version that supports instance handle based lookup" into jb-mr1-dev 2012-08-02 15:20:58 -07:00
Elliott Hughes
5483057817 am f34ecbff: Merge "MIPS support to the linker"
* commit 'f34ecbff0dd2b8e6961020b8c91260f33d4cf3ea':
  MIPS support to the linker
2012-08-02 14:57:52 -07:00
Elliott Hughes
f34ecbff0d Merge "MIPS support to the linker" 2012-08-02 14:43:55 -07:00
Raghu Gandham
d7daacb463 MIPS support to the linker
Change-Id: I37ec2d6c51d82bb9e9dbfef4b38c85366bead255
Signed-off-by: Chris Dearman <chris@mips.com>
Signed-off-by: Raghu Gandham <raghu@mips.com>
Signed-off-by: Bhanu Chetlapalli <bhanu@mips.com>
2012-08-02 14:39:50 -07:00
The Android Automerger
248321bb6f merge in jb-mr1-release history after reset to jb-mr1-dev 2012-08-02 07:41:45 -07:00
Chris Dearman
da2611084f Error numbers are target specific.
Use the system supplied error numbers when mapping error numbers to messages.

Change-Id: I520556fa3e2ff668fdc4eda36ad31491fbb48ea8
Signed-off-by: Chris Dearman <chris@mips.com>
Signed-off-by: Raghu Gandham <raghu@mips.com>
2012-08-01 17:53:07 -07:00
The Android Automerger
617a5ee417 merge in jb-mr1-release history after reset to jb-mr1-dev 2012-08-01 07:10:06 -07:00
Ajay Dudani
cbbe9528ca Update msm_camera.h to version that supports instance handle based lookup
Change-Id: If33a45f378e2cbbfe28b51643808df94e8d1f5e7
2012-07-31 21:32:50 -07:00
Shih-wei Liao
4f13bdd45c am 7565d5b1: am 0ca9d074: Merge "Had include/arm/fenv.h, but missed include/mips/fenv.h."
* commit '7565d5b118420cc0dff2d59cf3542e99f415601a':
  Had include/arm/fenv.h, but missed include/mips/fenv.h.
2012-07-31 21:02:52 -07:00
Shih-wei Liao
7565d5b118 am 0ca9d074: Merge "Had include/arm/fenv.h, but missed include/mips/fenv.h."
* commit '0ca9d0748e3229c849e3ee17259e0e55d7214800':
  Had include/arm/fenv.h, but missed include/mips/fenv.h.
2012-07-31 21:00:39 -07:00
Shih-wei Liao
0ca9d0748e Merge "Had include/arm/fenv.h, but missed include/mips/fenv.h." 2012-07-31 20:54:18 -07:00
Elliott Hughes
81f1617a68 am 8d2c5b24: am b910b6f8: Merge "Updated the cleaned header file mman.h for MIPS."
* commit '8d2c5b247e701f51ce3d750e9ee3ff37009630c3':
  Updated the cleaned header file mman.h for MIPS.
2012-07-31 15:32:45 -07:00
Elliott Hughes
8d2c5b247e am b910b6f8: Merge "Updated the cleaned header file mman.h for MIPS."
* commit 'b910b6f8dee14e379664635f4cd7343b3acc7b27':
  Updated the cleaned header file mman.h for MIPS.
2012-07-31 15:31:53 -07:00
Elliott Hughes
b910b6f8de Merge "Updated the cleaned header file mman.h for MIPS." 2012-07-31 15:16:07 -07:00
Raghu Gandham
c29f295d39 Updated the cleaned header file mman.h for MIPS.
Change-Id: I8b3734e535711ca07fbf4066e6d967d1ce0f30eb
2012-07-31 14:47:51 -07:00
Elliott Hughes
f19979710a am 7645355e: am a513f70b: Merge "bionic: Stack pointer/signal race condition."
* commit '7645355ecdf29301bdc65f9ea8e00c20e51da3f5':
  bionic: Stack pointer/signal race condition.
2012-07-31 10:40:06 -07:00
Elliott Hughes
b78aa53904 am bf397b60: am 21372896: Merge "fix __cxa_finalize() implementation to be thread safe."
* commit 'bf397b601189f8a63c8a842e16af5ed004ef75f5':
  fix __cxa_finalize() implementation to be thread safe.
2012-07-31 10:40:05 -07:00
Elliott Hughes
7645355ecd am a513f70b: Merge "bionic: Stack pointer/signal race condition."
* commit 'a513f70b43e75136145d756388b50028ac4fc4b8':
  bionic: Stack pointer/signal race condition.
2012-07-31 10:38:26 -07:00
Elliott Hughes
bf397b6011 am 21372896: Merge "fix __cxa_finalize() implementation to be thread safe."
* commit '21372896ea0f13938c130c8c82cdc3a6b9ccd297':
  fix __cxa_finalize() implementation to be thread safe.
2012-07-31 10:38:25 -07:00
Elliott Hughes
a513f70b43 Merge "bionic: Stack pointer/signal race condition." 2012-07-31 10:32:59 -07:00
Elliott Hughes
21372896ea Merge "fix __cxa_finalize() implementation to be thread safe." 2012-07-31 10:31:20 -07:00
The Android Automerger
15e0ca8186 merge in jb-mr1-release history after reset to jb-mr1-dev 2012-07-31 07:35:13 -07:00
Srinavasa Nagaraju
2270dfa0c4 fix __cxa_finalize() implementation to be thread safe.
__cxa_finalize() modifies the access permissions of __atexit
global variable without acquiring  _ATEXIT_LOCK(). Fix it prevent
any possible races.

Change-Id: I11939d0ebcbf6f360c14163222d40a449d96948e
2012-07-31 12:30:28 +02:00
Michael Hope
ea8fad11d9 Add a .note.android.ident section to Android ELF binaries.
This allows debugging tools to know they are working with Android
binaries and adapt accordingly.

Signed-off-by: Thiago Jung Bauermann <thiago.bauermann@linaro.org>
Signed-off-by: Michael Hope <michael.hope@linaro.org>

Change-Id: Ic906992fcad61c028bb765821637a3e1333bf52b
2012-07-31 16:18:22 +12:00
Shih-wei Liao
4e86ebb4b6 Had include/arm/fenv.h, but missed include/mips/fenv.h.
Needed for the device-build for LLVM's constant folding pass.

Change-Id: I412a98d52458231650801a8b59fe3159a789b8b9
Author: fu@mips.com
2012-07-30 20:12:46 -07:00
Shih-wei Liao
0c2d318837 am 18421669: am 1ee6e3b7: Merge "Install crt(begin|end)_so.o to target library path."
* commit '184216696a9945a5bf6cb186b4d3a42ffe582818':
  Install crt(begin|end)_so.o to target library path.
2012-07-30 13:13:26 -07:00
Shih-wei Liao
184216696a am 1ee6e3b7: Merge "Install crt(begin|end)_so.o to target library path."
* commit '1ee6e3b7370b36ac72a14c0e31c34963b1bdbbb2':
  Install crt(begin|end)_so.o to target library path.
2012-07-30 13:10:11 -07:00
Shih-wei Liao
1ee6e3b737 Merge "Install crt(begin|end)_so.o to target library path." 2012-07-30 12:44:58 -07:00
Ed Heyl
e5b635c885 am 681ccffb: Merge jb-dev-mako plus fixes to libc/kernel/common/linux/fb.h
* commit '681ccffb4593875a3bcc2c17da9713a1215232d9':
  bionic: Update MDP and rotator headers
  Adding msm_dsps.h header
  Update msm headers for audio, camera, ion, charm, rmnet
  bionic: Update msm_mdp.h from the kernel
  update linux/fb.h to support fb ioctl in kernel 3.4
  Use sanitized video decode/encode header files
  bionic: Update MDP and KGSL headers
  add processed sound/tlv.h header
  add processed genlock.h for qualcomm
2012-07-29 22:40:26 -07:00
Ed Heyl
681ccffb45 Merge jb-dev-mako plus fixes to libc/kernel/common/linux/fb.h
Change-Id: I1fbe64653db7b8e9bfc6e10fa42deb295aa15a09
2012-07-29 08:22:16 -07:00
Shih-wei Liao
fc0725ec5c Install crt(begin|end)_so.o to target library path.
BUG=6886348.

Change-Id: I176b2c4963d9731b06d10d4e0b92c010a0006b59
2012-07-28 00:33:28 -07:00
Elliott Hughes
b7dd54f0c7 am d6c3369c: am 7a450b4d: am 643e5722: Merge "Report errors to the log, not just stderr."
* commit 'd6c3369cec68de60dec0d9ab7469457d817539e1':
  Report errors to the log, not just stderr.
2012-07-27 18:32:56 -07:00
Elliott Hughes
d6c3369cec am 7a450b4d: am 643e5722: Merge "Report errors to the log, not just stderr."
* commit '7a450b4d9efc5457a987f5b5665ca7c6e7f57e34':
  Report errors to the log, not just stderr.
2012-07-27 18:30:04 -07:00
Elliott Hughes
7a450b4d9e am 643e5722: Merge "Report errors to the log, not just stderr."
* commit '643e5722338d303c0b5aac41107432d8fde4081c':
  Report errors to the log, not just stderr.
2012-07-27 18:28:11 -07:00
Elliott Hughes
643e572233 Merge "Report errors to the log, not just stderr." 2012-07-27 18:16:17 -07:00
Elliott Hughes
52d6233296 Report errors to the log, not just stderr.
In particular this affects assert(3) and __cxa_pure_virtual, both of
which have managed to confuse people this week by apparently aborting
without reason. (Because stderr goes nowhere, normally.)

Bug: 6852995
Bug: 6840813
Change-Id: I7f5d17d5ddda439e217b7932096702dc013b9142
2012-07-27 17:43:38 -07:00
Elliott Hughes
65b48f892e am c823b2c7: am 616f3680: am a7916509: Merge "Fix a TEMP_FAILURE_RETRY usage error in the linker."
* commit 'c823b2c74137230fc1a166527b5141e3a6bacd65':
  Fix a TEMP_FAILURE_RETRY usage error in the linker.
2012-07-27 16:25:03 -07:00
Elliott Hughes
2eb46df63a am d7dfcb0c: am 514ace95: am 9061c6e7: Merge "Replace ALL_PREBUILTS with BUILD_PREBUILT"
* commit 'd7dfcb0cb07bc1bb2b716075697f86de1b4d8e54':
  Replace ALL_PREBUILTS with BUILD_PREBUILT
2012-07-27 16:24:50 -07:00
The Android Open Source Project
a1d1abbc26 am 22bd479e: am e35ae86e: Reconcile with jb-release
* commit '22bd479e2e8454ed726f8c650e52b78702262d34':
2012-07-27 16:24:00 -07:00
Elliott Hughes
c823b2c741 am 616f3680: am a7916509: Merge "Fix a TEMP_FAILURE_RETRY usage error in the linker."
* commit '616f368076c9d7f0fc4459b79ba26c1d1ec0a247':
  Fix a TEMP_FAILURE_RETRY usage error in the linker.
2012-07-27 16:00:36 -07:00
Elliott Hughes
616f368076 am a7916509: Merge "Fix a TEMP_FAILURE_RETRY usage error in the linker."
* commit 'a7916509a3446afd0e863b03e4204cee73e81555':
  Fix a TEMP_FAILURE_RETRY usage error in the linker.
2012-07-27 15:58:57 -07:00
Elliott Hughes
d7dfcb0cb0 am 514ace95: am 9061c6e7: Merge "Replace ALL_PREBUILTS with BUILD_PREBUILT"
* commit '514ace9534233aa7ef5ff3f9d9c614c94eeefc1f':
  Replace ALL_PREBUILTS with BUILD_PREBUILT
2012-07-27 15:51:24 -07:00
Elliott Hughes
514ace9534 am 9061c6e7: Merge "Replace ALL_PREBUILTS with BUILD_PREBUILT"
* commit '9061c6e7ae1d9b0e4d2f8a62b3682a565282f9b9':
  Replace ALL_PREBUILTS with BUILD_PREBUILT
2012-07-27 15:47:37 -07:00
The Android Open Source Project
22bd479e2e am e35ae86e: Reconcile with jb-release
* commit 'e35ae86e70b1e728c220867d5a2aa66955c87c34':
2012-07-27 15:45:49 -07:00
Elliott Hughes
a7916509a3 Merge "Fix a TEMP_FAILURE_RETRY usage error in the linker." 2012-07-27 15:43:11 -07:00
Elliott Hughes
8dfc073b14 Fix a TEMP_FAILURE_RETRY usage error in the linker.
Similar to the fix in c20d0f3993.

grep(1) says this was the only other instance in bionic.

Change-Id: I1729038762ee1c7c4743a6bd11d5558afd6f5749
2012-07-27 15:30:51 -07:00
The Android Open Source Project
e35ae86e70 Reconcile with jb-release
Change-Id: I89a2498aeb91f29a70f1e100c41f03cf41a2e49e
2012-07-27 14:49:51 -07:00
Elliott Hughes
9061c6e7ae Merge "Replace ALL_PREBUILTS with BUILD_PREBUILT" 2012-07-27 14:14:41 -07:00
Ying Wang
6171d11e72 Replace ALL_PREBUILTS with BUILD_PREBUILT
(cherry-picked from 186b36b65bdfbf2c89a661539bf530359364eac9.)

Bug: 6857263
Change-Id: If787d84415dd2ac07105fe0d0b7a27c9be75df64
2012-07-27 13:44:01 -07:00
Elliott Hughes
cb9ea8873a am 408e3e50: am 45038ae4: am 12f411d9: Merge "Correction to use of TEMP_FAILURE_RETRY in send_prop_msg"
* commit '408e3e5046ed030c464cdae6c95bc6a9d6de39cc':
  Correction to use of TEMP_FAILURE_RETRY in send_prop_msg
2012-07-27 10:21:45 -07:00
Elliott Hughes
408e3e5046 am 45038ae4: am 12f411d9: Merge "Correction to use of TEMP_FAILURE_RETRY in send_prop_msg"
* commit '45038ae483313a5cc445a90fb0499d4c6ad69b1d':
  Correction to use of TEMP_FAILURE_RETRY in send_prop_msg
2012-07-27 10:16:50 -07:00
Elliott Hughes
45038ae483 am 12f411d9: Merge "Correction to use of TEMP_FAILURE_RETRY in send_prop_msg"
* commit '12f411d9a696ca7a0fe490fb530a9accbda66a99':
  Correction to use of TEMP_FAILURE_RETRY in send_prop_msg
2012-07-27 10:14:50 -07:00
Elliott Hughes
12f411d9a6 Merge "Correction to use of TEMP_FAILURE_RETRY in send_prop_msg" 2012-07-27 10:02:59 -07:00
Jens Gulin
c20d0f3993 Correction to use of TEMP_FAILURE_RETRY in send_prop_msg
RETRY macro may retry command if result is -1. In this
case the command was "connect < 0" instead of just
connect. The comparison will not return -1 and thus
retry is never done. This is now corrected so that
interrupts will cause retry instead of fail.

(There was no other negative side effect of the bug.
The result code from RETRY was used in an if-statement
and it would be true for all negative connect results.
This was according to expectations.)

Change-Id: Ie206b39878e9befea4e3be9a4061ee39eb232d80
2012-07-27 15:18:23 +02:00
Peter Enderborg
3460db9490 bionic: Stack pointer/signal race condition.
Move the stackpointer so a captured signal does not corrupt
stack variables needed for __thread_entry.

Change-Id: I3e1e7b94a6d7cd3a07081f849043262743aa8064
2012-07-27 15:11:01 +02:00
Elliott Hughes
6320848df6 am c636ff19: am 9a9ca7c1: am 7d6c3f70: Merge "Remove the \'Factory\' time zone by not processing the \'factory\' file."
* commit 'c636ff1944ca9c67953e3162ba7a8c39e44fff42':
  Remove the 'Factory' time zone by not processing the 'factory' file.
2012-07-26 22:56:12 -07:00
Elliott Hughes
c636ff1944 am 9a9ca7c1: am 7d6c3f70: Merge "Remove the \'Factory\' time zone by not processing the \'factory\' file."
* commit '9a9ca7c1e8079aaae6b1833bd06719e98ca0783e':
  Remove the 'Factory' time zone by not processing the 'factory' file.
2012-07-26 22:34:57 -07:00
Elliott Hughes
9a9ca7c1e8 am 7d6c3f70: Merge "Remove the \'Factory\' time zone by not processing the \'factory\' file."
* commit '7d6c3f700b8089d31a33ba0f9f6eed9407724d0d':
  Remove the 'Factory' time zone by not processing the 'factory' file.
2012-07-26 17:44:38 -07:00
Elliott Hughes
7d6c3f700b Merge "Remove the 'Factory' time zone by not processing the 'factory' file." 2012-07-26 17:36:21 -07:00
Elliott Hughes
541c225320 Remove the 'Factory' time zone by not processing the 'factory' file.
The factory file (and Factory time zone) was meant as a way to say
"not configured" that would give a clear error when running date(1).
For us it would just look like UTC, so it is of no value.

Bug: 2997381
Change-Id: I1a4b85dce97d1d9370b22ba79e8fe5dafff56541
2012-07-26 16:19:46 -07:00
Ying Wang
186b36b65b Replace ALL_PREBUILTS with BUILD_PREBUILT
Bug: 6857263
Change-Id: Ib639f1c4d572fec088298f95f6d5a2951d56cd12
2012-07-26 15:55:34 -07:00
Nick Kralevich
68c1f682ff am b4fc64c9: am cc5edd83: Merge "vfprintf: fix spelling."
* commit 'b4fc64c96cad1be63b5c52af835c4a93b0e60204':
  vfprintf: fix spelling.
2012-07-25 22:26:13 -07:00
Nick Kralevich
b4fc64c96c am cc5edd83: Merge "vfprintf: fix spelling."
* commit 'cc5edd83ec0303ceb682c563073d98f8a592737d':
  vfprintf: fix spelling.
2012-07-25 22:22:20 -07:00
Nick Kralevich
cc5edd83ec Merge "vfprintf: fix spelling." 2012-07-25 16:09:34 -07:00
Nick Kralevich
9145ad3f0a vfprintf: fix spelling.
Change-Id: I6dc611143fb1f3e9ccf0a77b40ee48a3c1d72ca9
2012-07-25 16:01:38 -07:00
The Android Automerger
a501f6c7e3 merge in jb-release history after reset to jb-dev 2012-07-24 20:23:07 -07:00
Elliott Hughes
edc5fe530f am 9dbd4c06: am c27103d8: Merge "[MIPS] Use an aligned address to provoke SIGSEGV in abort()"
* commit '9dbd4c06fe143a4187d2d8d418c1a3b7c1ed39ba':
  [MIPS] Use an aligned address to provoke SIGSEGV in abort()
2012-07-24 18:05:28 -07:00
Elliott Hughes
7c3323516b am 860dc7e2: am c98e2365: Merge "Fix implementation of generic atomic operations"
* commit '860dc7e25d4ba64b5bd49fe123bae6e6105dd2e7':
  Fix implementation of generic atomic operations
2012-07-24 18:05:27 -07:00
Elliott Hughes
9dbd4c06fe am c27103d8: Merge "[MIPS] Use an aligned address to provoke SIGSEGV in abort()"
* commit 'c27103d84c124d40f3f4cff46d7cfa74342e0585':
  [MIPS] Use an aligned address to provoke SIGSEGV in abort()
2012-07-24 18:03:22 -07:00
Elliott Hughes
860dc7e25d am c98e2365: Merge "Fix implementation of generic atomic operations"
* commit 'c98e2365cdd0c2330711118b689171df143f6399':
  Fix implementation of generic atomic operations
2012-07-24 18:03:12 -07:00
Elliott Hughes
c27103d84c Merge "[MIPS] Use an aligned address to provoke SIGSEGV in abort()" 2012-07-24 17:42:51 -07:00
Chris Dearman
00a66a6fe8 [MIPS] Use an aligned address to provoke SIGSEGV in abort()
Change-Id: I269c9ccc07058773fb0f9d70673673157ab38f6a
2012-07-24 17:42:06 -07:00
Elliott Hughes
c98e2365cd Merge "Fix implementation of generic atomic operations" 2012-07-24 17:21:47 -07:00
Chris Dearman
958dad705a Fix implementation of generic atomic operations
Change-Id: Ie1ea5aacc561e2d6d40125d2952ed0e9116b7b0d
2012-07-24 13:56:38 -07:00
Elliott Hughes
0b82e1bd77 am d33ce20e: am 344aca8c: Merge "[MIPS] Add atomic routines"
* commit 'd33ce20e6dfbe5be081867c9ace538022991bb10':
  [MIPS] Add atomic routines
2012-07-24 13:53:37 -07:00
Elliott Hughes
d33ce20e6d am 344aca8c: Merge "[MIPS] Add atomic routines"
* commit '344aca8ced2522074f799439e201226377d02dba':
  [MIPS] Add atomic routines
2012-07-24 13:51:10 -07:00
Elliott Hughes
344aca8ced Merge "[MIPS] Add atomic routines" 2012-07-24 13:41:06 -07:00
Raghu Gandham
f7fb9e1ef1 [MIPS] Add atomic routines
Change-Id: I2cb20ce44dd230d222b7fc1ede2e1e3dce6e692b
2012-07-24 10:30:22 -07:00
Elliott Hughes
7cfe2c5c07 am 5e2a2705: am b109e437: Merge "Upgrade to tzdata2012d."
* commit '5e2a2705f237130bc516b62ff1372e94ad508f12':
  Upgrade to tzdata2012d.
2012-07-23 19:04:50 -07:00
Elliott Hughes
5e2a2705f2 am b109e437: Merge "Upgrade to tzdata2012d."
* commit 'b109e437fcbc1cbe09fce8ce2abb6f951d5a0274':
  Upgrade to tzdata2012d.
2012-07-21 14:20:17 -07:00
Elliott Hughes
b109e437fc Merge "Upgrade to tzdata2012d." 2012-07-21 14:09:24 -07:00
Elliott Hughes
5d967e43d0 Upgrade to tzdata2012d.
This upgrade involved rewriting the script; the data has moved to ftp.iana.org,
where it's slightly less convenient to access, so it's time to use something
that can talk FTP...

As for tzdata2012d, it's just updating Morocco for this weekend's changes, now
they've been decided at the last minute (as usual).

Change-Id: I772df57a6e09b3bf3d9541bfc08930d6f18633b4
2012-07-20 16:53:32 -07:00
Elliott Hughes
acda32c8f2 am a94c708a: am 654b1501: Merge "Update time.h for CLOCK_BOOTTIME."
* commit 'a94c708a15713535c0ece63ffc43d016eccfebe1':
  Update time.h for CLOCK_BOOTTIME.
2012-07-20 10:00:47 -07:00
Naseer Ahmed
2730674ca9 bionic: Update MDP and rotator headers
Change-Id: I585e07b004dfa6b5113050211ca67e4c057f5531
2012-07-20 08:54:32 -07:00
Elliott Hughes
a94c708a15 am 654b1501: Merge "Update time.h for CLOCK_BOOTTIME."
* commit '654b1501f7a936034d07f579c3d4a15d1319dac2':
  Update time.h for CLOCK_BOOTTIME.
2012-07-19 17:37:33 -07:00
Elliott Hughes
654b1501f7 Merge "Update time.h for CLOCK_BOOTTIME." 2012-07-19 17:18:37 -07:00
Nick Pelly
0351955a68 Update time.h for CLOCK_BOOTTIME.
(cherry-pick of 8958a38329)

Change-Id: Ie8de6b32fa81566db53ad7e9fd4b197f4cede628
2012-07-19 17:10:14 -07:00
Nick Pelly
8958a38329 Update time.h for CLOCK_BOOTTIME.
Change-Id: Iafbc6a2f57587feb68526e4eab67452aa0db5311
2012-07-19 16:33:58 -07:00
The Android Open Source Project
6591be6c52 Reconcile with jb-mr0-release
Change-Id: I5e181b92fbcc4b3d312396124a149f1c5224e55b
2012-07-19 08:35:39 -07:00
Ajay Dudani
3e210abf7d Adding msm_dsps.h header
Change-Id: I7736a3a895b9c81d5184f7c97ac0ed5aeb138d25
2012-07-19 07:26:26 -07:00
The Android Automerger
59fae8abaf merge in jb-release history after reset to jb-dev 2012-07-18 23:04:34 -07:00
Nick Kralevich
f6ee33cee7 Merge "linker: Fix LD_PRELOADS for calling constructors" 2012-07-18 14:02:22 -07:00
Elliott Hughes
3fd5e91e58 Merge "bionic: Report linker relocation address to gdb" 2012-07-16 11:38:23 -07:00
Elliott Hughes
05f03b8875 Merge "linker: cleanup of undefined state handling, which is really dead code" 2012-07-16 10:08:17 -07:00
Robin Burchell
8211bc6325 linker: cleanup of undefined state handling, which is really dead code
Given that _elf_lookup (and thus, _do_lookup) cannot possibly return an
undefined symbol (due to the check for SHN_UNDEF in _elf_lookup), there's
no need for spurious checks for SHN_UNDEF on its return value.

Conflicts:

	linker/linker.c

Change-Id: Ic73cf439924b45f72d4d9ba3f64a888c96cbbd9b
2012-07-16 10:03:35 -07:00
Elliott Hughes
decb531ce2 Merge "linker: Use SHN_UNDEF instead of describing what it is trying to do." 2012-07-16 10:00:38 -07:00
Robin Burchell
439fa8ea8c linker: Use SHN_UNDEF instead of describing what it is trying to do. 2012-07-16 09:51:17 -07:00
Elliott Hughes
8d7355ac2f Merge "Use std=gnu99 for the dynamic linker as well as libc." 2012-07-16 09:45:27 -07:00
Elliott Hughes
856512ea9c Use std=gnu99 for the dynamic linker as well as libc.
Change-Id: I76dd78576c5af6eb6282555f069647b6260edc31
2012-07-16 09:43:14 -07:00
Elliott Hughes
fabddfe833 Merge "limits.h: Include page.h when relying on PAGE_SIZE" 2012-07-16 09:39:24 -07:00
Nick Kralevich
b0f0d4276d Merge "FORTIFY_SOURCE: revert memcpy changes." 2012-07-16 08:24:32 -07:00
Ryan V. Bissell
bb5c30a3ee bionic: Report linker relocation address to gdb
GDB needs the runtime linker's base address in order to
locate the latter's ".text" and ".plt" sections, for the
purpose of detecting solib trampolines.  It also can
potentially use this to calculate the relocated address
of rtld_db_dlactivity.

Bug: http://code.google.com/p/android/issues/detail?id=34856
Change-Id: I63d3e7ae4e20a684ceb25967f2241e7d58dd685d
Signed-off-by: Ryan V. Bissell <ryan@bissell.org>
2012-07-16 02:16:18 -05:00
Kito Cheng
326e85eca6 linker: Fix LD_PRELOADS for calling constructors
Change-Id: I1eae77a4c59e8a5acc009127d271455bb6fc01b6
2012-07-15 00:49:34 +08:00
Nick Kralevich
c37fc1ab6a FORTIFY_SOURCE: revert memcpy changes.
Performance regressions.  Hopefully this is a temporary
rollback.

Bug: 6821003
Change-Id: I84abbb89e1739d506b583f2f1668f31534127764
2012-07-13 17:58:37 -07:00
Nick Kralevich
e1d909f71e Merge "FORTIFY_SOURCE: introduce __BIONIC_FORTIFY_UNKNOWN_SIZE macro" 2012-07-13 15:06:56 -07:00
Nick Kralevich
147b0690a9 Merge "FORTIFY_SOURCE: strlen check." 2012-07-13 15:06:41 -07:00
Nick Kralevich
ad7f966281 Merge "FORTIFY_SOURCE: restore __memcpy_chk()" 2012-07-13 14:52:26 -07:00
Nick Kralevich
9b6cc223a3 FORTIFY_SOURCE: introduce __BIONIC_FORTIFY_UNKNOWN_SIZE macro
Replace all occurances of "(size_t) -1" with a
__BIONIC_FORTIFY_UNKNOWN_SIZE macro.

Change-Id: I0b188f6cf31417d2dbef0e1bd759de3f9782873a
2012-07-13 14:49:33 -07:00
Nick Kralevich
260bf8cfe0 FORTIFY_SOURCE: strlen check.
This test is designed to detect code such as:

int main() {
  char buf[10];
  memcpy(buf, "1234567890", sizeof(buf));
  size_t len = strlen(buf); // segfault here with _FORTIFY_SOURCE
  printf("%d\n", len);
  return 0;
}

or anytime strlen reads beyond an object boundary. This should
help address memory leakage vulnerabilities and make other
unrelated vulnerabilities harder to exploit.

Change-Id: I354b425be7bef4713c85f6bab0e9738445e00182
2012-07-13 13:49:59 -07:00
Nick Kralevich
b2060b027c FORTIFY_SOURCE: restore __memcpy_chk()
In our previous FORTIFY_SOURCE change, we started using a custom
inline for memcpy(), rather than using GCC's __builtin_memcpy_chk().
This allowed us to delete our copy of __memcpy_chk(), and replace it
by __memcpy_chk2().

Apparently GCC uses __memcpy_chk() outside of __builtin_memcpy_chk().
Specifically, __memcpy_chk() is used by __builtin__memMOVE_chk() under
certain optimization levels.

Keep the old __memcpy_chk() function around, and have it call into
__memcpy_chk2().

Change-Id: I2453930b24b8a492a3b6ed860e18d92a6b762b80
2012-07-13 13:49:45 -07:00
Nick Kralevich
88bfc28ac4 Merge "FORTIFY_SOURCE: enhanced memcpy protections." 2012-07-13 07:57:58 -07:00
Yaroslav Miroshnychenko
c7dcd67d56 Add missing va_end() to prevent stack corruptions
Added va_end() for copied variable arguments lists
in __vfprintf() and __find_arguments().
This is by C standard.
Important for systems which pass arguments in registers.

Change-Id: I7ac42beaa6645bfe856c18132253352dae29ea37
2012-07-13 09:37:57 +02:00
Nick Kralevich
f3913b5b68 FORTIFY_SOURCE: enhanced memcpy protections.
Two changes:

1) Detect memory read overruns.

For example:

int main() {
  char buf[10];
  memcpy(buf, "abcde", sizeof(buf));
  sprintf("%s\n", buf);
}

because "abcde" is only 6 bytes, copying 10 bytes from it is a bug.
This particular bug will be detected at compile time.  Other similar
bugs may be detected at runtime.

2) Detect overlapping buffers on memcpy()

It is a bug to call memcpy() on buffers which overlap. For
example, the following code is buggy:

  char buf3[0x800];
  char *first_half  = &buf3[0x400];
  char *second_half = &buf3[1];
  memset(buf3, 0, sizeof(buf3));
  memcpy(first_half, second_half, 0x400);
  printf("1: %s\n", buf3);

We now detect this at compile and run time.

Change-Id: I092bd89f11f18e08e8a9dda0ca903aaea8e06d91
2012-07-12 15:38:15 -07:00
Nick Kralevich
86a4fca0b4 Merge "memmove: Don't call memcpy if regions overlap" 2012-07-12 10:06:28 -07:00
The Android Automerger
e13338429f merge in jb-mr0-release history after reset to jb-dev 2012-07-11 23:11:59 -07:00
Nick Kralevich
e64259e860 memmove: Don't call memcpy if regions overlap
memmove() unconditionally calls memcpy() if "dst" < "src". For
example, in the code below, memmove() would end up calling memcpy(),
even though the regions of memory overlap.

int main() {
  char buf3[0x800];
  char *dst  = &buf3[1];
  char *src = &buf3[0x400];
  memset(buf3, 0, sizeof(buf3));
  memmove(dst, src, 0x400);
  printf("1: %s\n", buf3);
  return 0;
}

Calling memcpy() on overlaping regions only works if you assume
that memcpy() copies from start to finish. On some architectures,
it's more efficient to call memcpy() from finish to start.

This is also triggering a failure in some of my code.

More reading:
* http://lwn.net/Articles/414467/
* https://bugzilla.redhat.com/show_bug.cgi?id=638477#c31 (comment 31)

Change-Id: I65a51ae3a52dd4af335fe5c278056b8c2cbd8948
2012-07-11 17:46:03 -07:00
Nick Kralevich
6334c662ca Don't use -fstack-protector on ssp.c
libc's stack protector initialization routine (__guard_setup)
is in bionic/ssp.c. This code deliberately modifies the stack
canary.  This code should never be compiled with -fstack-protector-all
otherwise it will crash (mismatched canary value).

Force bionic/ssp.c to be compiled with -fno-stack-protector

Change-Id: Ib95a5736e4bafe1a460d6b4e522ca660b417d8d6
2012-07-10 10:51:41 -07:00
Arun Raghavan
6331db3fd2 limits.h: Include page.h when relying on PAGE_SIZE
limits.h relies on PAGE_SIZE being defined without actually including
page.h. Make sure this is included to avoid compilation failures.

Signed-off-by: Arun Raghavan <arun.raghavan@collabora.co.uk>
2012-07-10 10:36:37 +05:30
Nick Kralevich
8f08e1c902 Merge "FORTIFY_SOURCE: Add openat, fix bug" 2012-07-09 12:55:32 -07:00
Nick Kralevich
a3e230d1fa FORTIFY_SOURCE: Add openat, fix bug
Add fortify_source support for openat(). This change requires that
an argument be supplied when using O_CREAT.

Fix unnecessary call to __open_2. If, at compile time, we know that
"flags" is constant and DOESN'T contain O_CREAT, the call to __open_2
is useless.

Change-Id: Ifcd29c4fb25e25656961d7552d672e161f0cfdbd
2012-07-09 12:30:40 -07:00
Nick Kralevich
a099e8e7d3 Merge "FORTIFY_SOURCE: add fgets support." 2012-07-09 12:28:35 -07:00
Andrew Hsieh
793e6aedf2 am 67636eea: am 40e7ed58: Unhide rtld_db_dlactivity()
* commit '67636eea20f7789e6689ee8cf6017e7d48735ca1':
  Unhide rtld_db_dlactivity()
2012-07-09 11:07:46 -07:00
Andrew Hsieh
b9462d5f88 am 40e7ed58: Unhide rtld_db_dlactivity()
* commit '40e7ed58d73eae59d0cf2fed61284d16692e307b':
  Unhide rtld_db_dlactivity()
2012-07-09 11:05:49 -07:00
Andrew Hsieh
67636eea20 am 40e7ed58: Unhide rtld_db_dlactivity()
* commit '40e7ed58d73eae59d0cf2fed61284d16692e307b':
  Unhide rtld_db_dlactivity()
2012-07-09 11:05:16 -07:00
Nick Kralevich
965dbc6405 FORTIFY_SOURCE: add fgets support.
Change-Id: I8c3410a90c71a3336c4ac8581618fa9330edf5e3
2012-07-09 09:57:18 -07:00
Ajay Dudani
3fc3b7fd94 Update msm headers for audio, camera, ion, charm, rmnet
Change-Id: I226a1c57b94ea542fa5f3ea081582d49b3b9a3d1
2012-07-08 23:53:32 -07:00
Naseer Ahmed
05ad617b5b bionic: Update msm_mdp.h from the kernel
Adds more color formats that were missing

Change-Id: I4e247ab630d9afa3ba75444bde7cd2dcd39f2ab2
2012-07-06 12:03:26 -07:00
Andrew Hsieh
40e7ed58d7 Unhide rtld_db_dlactivity()
Since linker is built with -fvisibility=hidden rtld_db_dlactivity()
if hidden from gdb.  Unhide it otherwise gdb may not know linker
activity and rescan solib

Change-Id: Ia8cd8d9738c6ea5696ba2ef0ebf2cf783f9ca70a
2012-07-02 11:17:04 -07:00
choongryeol.lee
402b93c16d update linux/fb.h to support fb ioctl in kernel 3.4
Change-Id: I959e4f445360263a34f20b0ae1a8b42123710c13
2012-06-28 21:11:08 -07:00
Rebecca Schultz Zavin
2ddf77b377 Merge "Modify ion header" 2012-06-28 14:16:10 -07:00
Nick Kralevich
bd73eede46 Merge "FORTIFY_SOURCE: add open() checks" 2012-06-27 12:56:52 -07:00
Nick Kralevich
cb228fb4a9 libc: cleanups
Prefix private functions with underscores, to prevent name
conflicts.

Use __error__ instead of error, since occasionally programs will
create their own "#define error ...".

Change-Id: I7bb171df58aec5627e61896032a140db547fd95d
2012-06-26 16:05:19 -07:00
Nick Kralevich
8118f62a7d FORTIFY_SOURCE: add open() checks
Add a FORTIFY_SOURCE check which requires that you pass a
"mode" argument when calling open(..., O_CREAT). If a mode isn't
passed, then the file is created with "undefined" permissions.

Change-Id: I4427be4f9ce170c69da01af5b00fb05b03613a28
2012-06-26 15:19:12 -07:00
David 'Digit' Turner
b52e4385c4 linker: improve loadable segment protection.
Use the functions in linker_phdr.c to load the PT_LOAD segments
in memory, and toggle their mapping's writable protection bit
as needed. In particular:

  - when loading a library, load the segments then unprotected
    them to allow relocations to work.

  - when relocating the linker of the executable, unprotect
    the segments loaded by the kernel to make relocations work
    too.

  - after all relocations are done, re-protect the segments,
    and apply GNU RELRO protection if needed.

  - just before calling the destructors, undo the GNU RELRO
    protection.

Change-Id: I50e709f03958204b8d6140c0f51ebe24fe089a1b
2012-06-26 10:39:55 +02:00
David 'Digit' Turner
63f99f4a4e linker: simplify code for dynamic and ARM exidx sections.
This moves the code that determines where the .dynamic and .ARM.exidx
sections are to a single place in soinfo_link_image().

Change-Id: I98adcb440577bed86442349f03f3c629c945efec
2012-06-26 10:39:55 +02:00
David 'Digit' Turner
8941cfa17a Merge "linker: rename load_offset to load_bias." 2012-06-26 01:34:41 -07:00
David 'Digit' Turner
ff9ff758ad Merge "linker: avoid mapping the whole library before load." 2012-06-26 01:34:31 -07:00
David 'Digit' Turner
48d6c8ed23 Merge "linker: Add PAGE_START/OFFSET/END convenience macros" 2012-06-26 01:34:18 -07:00
David 'Digit' Turner
c6025b6047 Merge "linker: New sources to manage the ELF program header table." 2012-06-26 01:34:07 -07:00
Elliott Hughes
0ff08d22f0 am 5af97ca8: am c7bab8cb: Merge "Enable sqrtf() x86 assembly code"
* commit '5af97ca8514d9fb4175bff3a79abf26889b94530':
  Enable sqrtf() x86 assembly code
2012-06-25 14:09:42 -07:00
Elliott Hughes
5af97ca851 am c7bab8cb: Merge "Enable sqrtf() x86 assembly code"
* commit 'c7bab8cb8483e7869eabdbd4add7c9e5beeecc80':
  Enable sqrtf() x86 assembly code
2012-06-25 14:06:06 -07:00
Elliott Hughes
c7bab8cb84 Merge "Enable sqrtf() x86 assembly code" 2012-06-25 10:46:41 -07:00
David 'Digit' Turner
bea23e59f7 linker: rename load_offset to load_bias.
This patch changes the definition of the 'load_offset' field
in struct soinfo. The field is renamed because it is not the
basic load bias to add to every p_vaddr value read from the ELF
file to get the corresponding memory address.

This also slightly simplifies the relocation code.

+ Fix for proper load_bias computation for relocatable executables.

Change-Id: I72502c75a70751cba324deee7d313ae61f96609e
2012-06-25 11:52:40 +02:00
David 'Digit' Turner
23363ed750 linker: avoid mapping the whole library before load.
This patch changes the load_library() function in the
dynamic linker to avoid reserving a huge read-only
address-space range just to read the ELF header and
program header (which are typically very small and easily
fit in the first page).

Instead, we use the functions in linker_phdr.c to only
load the data that we need in a temporary mmap-allocated
page of memory, which we release when the function exits.

This avoids issues when loading very large libraries, or
simply debug versions that only need to load a tiny percentage
of their overall file content in RAM.

Change-Id: Id3a189fad2119a870a1b3d43dd81380c54ea6044
2012-06-25 11:52:40 +02:00
David 'Digit' Turner
a6545f4678 linker: Add PAGE_START/OFFSET/END convenience macros
This patch adds a few macros related to memory pages to help
clarify some of the code in linker.c

Change-Id: I36c727132d257b1497398dd0a9e8a5a4505467ca
2012-06-25 11:52:40 +02:00
David 'Digit' Turner
c1bd559d5b linker: New sources to manage the ELF program header table.
This patch introduces two new source files containing a set of functions
to manage the program header table in an ELF binary, including the ability
to load PT_LOAD segments, and apply PT_GNU_RELRO protection.

Note: the files are not used currently, this will appear in a series
      of future patches that will gradually modify linker.c to use
      the phdr_table_xxx functions properly.

Change-Id: Ia3d4c1ff5fc3e265d8258b64b492f4e643f51bdc
2012-06-25 11:52:40 +02:00
xqian6
29aa009924 Enable sqrtf() x86 assembly code
This patch can improve the sqrtf() performance.

Change-Id: Ic9d11d6a9ecd9b263f54d4878e13595e136b95ce
2012-06-25 16:20:09 +08:00
Evgeniy Stepanov
20bc061dc7 Add module base to main executable's ARM_exidx.
BUG:6697872

Change-Id: I448f4b86397307086231776da38a7af334a75fe5
2012-06-22 14:56:01 +04:00
Haynes Mathew George
3fad2b17b9 Use sanitized video decode/encode header files
Change-Id: Id4897181da94af51992c71cd49aff1f40970e6c7
2012-06-21 15:45:28 -07:00
Naseer Ahmed
240b3349fc bionic: Update MDP and KGSL headers
Update headers for MSM MDP, MSM KGSL and MSM
rotator to match the version in the Linux
3.4 kernel baseline

Change-Id: I37052486be8c8862e65cac1f6934368ecc055a76
2012-06-21 11:50:01 -07:00
Andrew Hsieh
63d0ceec75 am fa136e8c: am a5948157: Merge "Define __stack_chk_fail_local.S"
* commit 'fa136e8ca71cb20956cd1792251869cac8bed257':
  Define __stack_chk_fail_local.S
2012-06-20 19:00:55 -07:00
Andrew Hsieh
fa136e8ca7 am a5948157: Merge "Define __stack_chk_fail_local.S"
* commit 'a5948157fd34acb2b1d1bfaf129901af865ab5fc':
  Define __stack_chk_fail_local.S
2012-06-20 18:58:18 -07:00
Andrew Hsieh
a5948157fd Merge "Define __stack_chk_fail_local.S" 2012-06-20 18:37:48 -07:00
Andrew Hsieh
6973e3da87 Define __stack_chk_fail_local.S
With -fstack-protector, x86 -m32 needs __stack_chk_fail_local
defined in crtbegin_*.o.

Include __stack_chk_fail_local.S in begin.S otherwise linker
(which is built w/o crt*) may not link.

Change-Id: Id242fcf3eff157264afe3b04f27288ab7991220a
2012-06-21 09:26:33 +08:00
The Android Open Source Project
214feeba19 am effc607e: Reconcile with jb-release
* commit 'effc607e87add0aec14fefb4ac1c00d36559149a':
2012-06-20 08:28:23 -07:00
The Android Open Source Project
effc607e87 Reconcile with jb-release
Change-Id: Ia5de9692e507a605d3b6937ec65da26169a3ea8e
2012-06-20 08:25:32 -07:00
The Android Automerger
77093f2a8b merge in jb-release history after reset to jb-dev 2012-06-20 06:59:21 -07:00
David 'Digit' Turner
823aeb9294 Merge "linker: reduce size by nearly 20KB" 2012-06-19 14:51:28 -07:00
Andy McFadden
f2ba5c9afa am 63c4179f: am 4d0128f1: Merge "Minor tweak to get memory around corrupted heap chunks dumped." into jb-dev
* commit '63c4179f5951edc2d68700fe75659fbd34febe63':
  Minor tweak to get memory around corrupted heap chunks dumped.
2012-06-19 11:33:19 -07:00
Andy McFadden
63c4179f59 am 4d0128f1: Merge "Minor tweak to get memory around corrupted heap chunks dumped." into jb-dev
* commit '4d0128f13a3ca9f7a0c81b6e69f7e20d28e9e6e3':
  Minor tweak to get memory around corrupted heap chunks dumped.
2012-06-19 11:31:14 -07:00
Andy McFadden
5e94df8a4f am 4d0128f1: Merge "Minor tweak to get memory around corrupted heap chunks dumped." into jb-dev
* commit '4d0128f13a3ca9f7a0c81b6e69f7e20d28e9e6e3':
  Minor tweak to get memory around corrupted heap chunks dumped.
2012-06-19 11:31:06 -07:00
Andy McFadden
4d0128f13a Merge "Minor tweak to get memory around corrupted heap chunks dumped." into jb-dev 2012-06-19 11:28:15 -07:00
Ben Cheng
ec2ab73b87 Minor tweak to get memory around corrupted heap chunks dumped.
Change-Id: I8f72c5c7e23960b13fc53e2354cd74aca8aac3c0
2012-06-19 07:11:38 -07:00
David 'Digit' Turner
166b7dbd4a linker: reduce size by nearly 20KB
This patch adds a trivial implementation of snprintf() that calls
our internal vsnprintf().

Inspection of the generated machine code showed that the linker
contained a full implementation of stdio's vfprintf. It was pulled
in because the pthread implementation uses snprintf() somewhere.

ProTip: It's possible to see why specific objects files are included
in a final binary by adding the following to your Android.mk, then
looking at the content of /tmp/MAP.TXT:

  LOCAL_LDFLAGS += -Wl,-Map=/tmp/MAP.TXT

Change-Id: I325e71b0cad1d01116a2e00c09e30a80cb716aa3
2012-06-19 10:53:11 +02:00
Arve Hjønnevåg
ece8f502ed Merge "Add watchdog.h" 2012-06-14 16:13:16 -07:00
Nick Kralevich
70f6901c3d libc: make atoi, atol, and atoll pure functions
Change-Id: Ib831c079c865929b6c91d42f35e117f2e974808f
2012-06-14 13:57:43 -07:00
Nick Kralevich
8df49ad246 FORTIFY_SOURCE: add strlcpy / strlcat support
Add strlcpy / strlcat support to FORTIFY_SOURCE. This allows
us to do consistency checks on to ensure we don't overflow buffers
when the compiler is able to tell us the size of the buffer we're
dealing with.

Unlike previous changes, this change DOES NOT use the compiler's
builtin support. Instead, we do everything the compiler would
normally do.

Change-Id: I47c099a911382452eafd711f8e9bfe7c2d0a0d22
2012-06-14 12:52:42 -07:00
Arve Hjønnevåg
420f4939b3 Add watchdog.h
Change-Id: Ib12d437151ccfbd634e9f01acd8556c79977ca04
2012-06-13 21:58:08 -07:00
David 'Digit' Turner
4442d512c6 Merge "linker: small code-cleanup" 2012-06-13 21:45:52 -07:00
Nick Kralevich
a5eaa02f62 Merge "Don't mark realloc with __attribute__((malloc))" 2012-06-13 16:13:32 -07:00
Nick Kralevich
b27631b9ae Don't mark realloc with __attribute__((malloc))
According to
http://gcc.gnu.org/onlinedocs/gcc/Function-Attributes.html

realloc should NOT be marked with __attribute__((malloc)). Quoting:

   realloc-like functions do not have this property as the memory
   pointed to does not have undefined content.

For reference, __mallocfunc is defined in sys/cdefs.h as:

    #define __mallocfunc  __attribute__((malloc))

Change-Id: I56083542ba92e4608dd7c55fb5596a138eb50cc9
2012-06-13 15:43:14 -07:00
David 'Digit' Turner
1608416811 linker: small code-cleanup
This patch adds to make the linker a little bit easier to understand
by making all functions that acts on a sofino object with a soinfo_
prefix.

This is to more easily distinguish functions that operate on global
state, and those that operate on individual libraries.

This should be purely stylistic, i.e. no feature/behaviour change.

Change-Id: Ie510d13d743aa4317644caefa9910b8af7e84f44
2012-06-13 22:47:20 +02:00
Nick Kralevich
8c54c56723 Merge "FORTIFY_SOURCE: add sprintf / vsprintf support" 2012-06-13 11:03:42 -07:00
Nick Kralevich
9b549c39c9 FORTIFY_SOURCE: add sprintf / vsprintf support
sprintf FORTIFY_SOURCE protections are not available
on clang.

Also add various __attribute__s to stdio functions.

Change-Id: I936d1f9e55fe53a68885c4524b7b59e68fed218d
2012-06-13 09:14:30 -07:00
Nick Kralevich
ca622f5748 Merge "update filter.h / prctl.h / seccomp.h" 2012-06-12 16:34:46 -07:00
Robert Greenwalt
8f88aa7d38 am c5cab345: am 028ccf5d: Merge "Avoid multiple dns lookups for the same query"
* commit 'c5cab3452d5ced55474e56497594579108670b51':
  Avoid multiple dns lookups for the same query
2012-06-12 15:56:29 -07:00
Robert Greenwalt
c5cab3452d am 028ccf5d: Merge "Avoid multiple dns lookups for the same query"
* commit '028ccf5d40dd9a945ea92aa79822c08c6f6aa1d2':
  Avoid multiple dns lookups for the same query
2012-06-12 15:52:56 -07:00
Nick Kralevich
d1a6918508 update filter.h / prctl.h / seccomp.h
Pull in an updated version of filter.h / prctl.h / seccomp.h
from the linux kernel.  Pulled from upstream kernel at
94fa83c424321189ca24fb6cb4c0d224cdedc72d

This file was generated using the following command:

cd bionic/libc/kernel/
./tools/clean_header.py -u ../../../external/kernel-headers/original/linux/seccomp.h
./tools/clean_header.py -u ../../../external/kernel-headers/original/linux/filter.h
./tools/clean_header.py -u ../../../external/kernel-headers/original/linux/prctl.h

Change-Id: I1ca996541d05b0d5927ab828a6ce49c09877ea01
2012-06-12 15:46:31 -07:00
Robert Greenwalt
028ccf5d40 Merge "Avoid multiple dns lookups for the same query" 2012-06-12 15:06:24 -07:00
Nick Kralevich
c2f1d215b1 Merge "FORTIFY_SOURCE: add snprintf, vsnprintf" 2012-06-12 08:50:57 -07:00
Elliott Hughes
f525fb525b am 20afd4e7: am e0961445: Merge "Remove the meaningless on Linux if_dl.h header."
* commit '20afd4e70c2f346d7cd03a7a3049f8de2d176d5c':
  Remove the meaningless on Linux if_dl.h header.
2012-06-11 17:42:44 -07:00
Elliott Hughes
c9142d4d8e am 571da80c: am c75491e2: Merge "Remove an obsolete jamfile."
* commit '571da80c58e13eac4d4fb29d38342879e5dede13':
  Remove an obsolete jamfile.
2012-06-11 17:42:43 -07:00
Elliott Hughes
20afd4e70c am e0961445: Merge "Remove the meaningless on Linux if_dl.h header."
* commit 'e0961445124b5ff39412da32578e14e0d1f6afd6':
  Remove the meaningless on Linux if_dl.h header.
2012-06-11 17:41:10 -07:00
Elliott Hughes
571da80c58 am c75491e2: Merge "Remove an obsolete jamfile."
* commit 'c75491e291586540c213ae088fc75b71fc4d3752':
  Remove an obsolete jamfile.
2012-06-11 17:41:04 -07:00
Elliott Hughes
e096144512 Merge "Remove the meaningless on Linux if_dl.h header." 2012-06-11 16:49:57 -07:00
Nick Kralevich
cffdf6693f FORTIFY_SOURCE: add snprintf, vsnprintf
Add _FORTIFY_SOURCE support for snprintf, vsnprintf

At this time, we opt out of these protections for clang, as clang
does not implement __builtin_va_arg_pack().

http://clang.llvm.org/docs/UsersManual.html#c_unimpl_gcc

Change-Id: I73ebe5ec8dad1dca8898a76d6afb693a25f75375
2012-06-11 16:46:16 -07:00
Elliott Hughes
c75491e291 Merge "Remove an obsolete jamfile." 2012-06-11 16:29:46 -07:00
Elliott Hughes
4c19e4f64f Remove an obsolete jamfile.
Was bionic ever built with jam? Weird!

Change-Id: Iea9a7af8bf46ee8319963e642da48e3bb49f6c60
2012-06-11 16:17:45 -07:00
Nick Kralevich
0f5b48ce28 Merge "inet_ntop: pass the size of tmp to snprintf()" 2012-06-11 16:11:20 -07:00
Nick Kralevich
85b06f9365 inet_ntop: pass the size of tmp to snprintf()
Fix runtime error when snprintf() FORTIFY_SOURCE protections are
applied. The size passed to snprintf() is larger than the tmp
buffer size, which results in a runtime assertion failure.

Even though the size passed to snprintf is larger than the buffer,
there's no danger of overwriting the buffer because of the format
string passed to snprintf.

Change-Id: I35f0217d25f3b9c6d04c5a76c3238759c235545a
2012-06-11 16:00:52 -07:00
Rebecca Schultz Zavin
6d3f548294 Modify ion header
Change-Id: Ib963e8b064f7883bf098e006c70df20732496100
Signed-off-by: Rebecca Schultz Zavin <rebecca@android.com>
2012-06-11 15:52:02 -07:00
Elliott Hughes
c3d45b822c Remove the meaningless on Linux if_dl.h header.
This was misleading 'configure' into thinking we actually support AF_LINK,
but we're Linux, so we don't, and we never implemented the functions we
declared here either.

Reported to AOSP by Jun-ya Kato.

(cherry-pick of 5056f1fad1187cd67729bb04ba72397d78256f03.)

Change-Id: Ic67f674d2221497c8166994812bb5fc7f0831066
2012-06-11 15:13:37 -07:00
Elliott Hughes
7c5c68f5c7 Merge "Remove the meaningless on Linux if_dl.h header." 2012-06-11 15:09:57 -07:00
Elliott Hughes
5056f1fad1 Remove the meaningless on Linux if_dl.h header.
This was misleading 'configure' into thinking we actually support AF_LINK,
but we're Linux, so we don't, and we never implemented the functions we
declared here either.

Reported to AOSP by Jun-ya Kato.

Change-Id: I111f9887f3812469b411b9cf5124d9dd624f19f7
2012-06-11 15:01:10 -07:00
Iliyan Malchev
29d03a8f39 add processed sound/tlv.h header
Change-Id: Ia57dd1293a5bd58c1b1950f1d243b394a0dd1eb8
Signed-off-by: Iliyan Malchev <malchev@google.com>
2012-06-11 14:54:44 -07:00
Iliyan Malchev
3cb8cdea3c add processed genlock.h for qualcomm
Change-Id: Id1ea77cf84e4924077b30c661d1c4bea427ad87e
Signed-off-by: Iliyan Malchev <malchev@google.com>
2012-06-11 14:16:21 -07:00
Geremy Condra
631498de43 Merge "Added event logging for some spoofed DNS queries." 2012-06-11 12:17:12 -07:00
Geremy Condra
fd49579f3a Merge "Added actual event logging calls to the FORTIFY_SOURCE methods." 2012-06-11 11:50:03 -07:00
Geremy Condra
524c87c61c Added event logging for some spoofed DNS queries.
Change-Id: I40909306e8cf922f1dd5a5685db89f732a709794
2012-06-11 11:44:48 -07:00
Geremy Condra
009f38478e Added actual event logging calls to the FORTIFY_SOURCE methods.
Change-Id: I3bf4fa8678c33187cb8ce4b75e666ddcd24403ab
2012-06-11 11:30:56 -07:00
The Android Open Source Project
8f2887be93 am 5ff025a5: Reconcile with jb-release
* commit '5ff025a50ccd7d30ea39c989d9ed8b1084ded47f':
2012-06-11 09:23:11 -07:00
The Android Open Source Project
5ff025a50c Reconcile with jb-release
Change-Id: I7cbfbab55783f245c0854543843c2052c4c2e932
2012-06-11 09:20:36 -07:00
The Android Automerger
ff7eae7b08 merge in jb-release history after reset to jb-dev 2012-06-11 06:59:25 -07:00
Nick Kralevich
76656afc6d _FORTIFY_SOURCE: check for integer overflows
Ensure that strcat / strncat check for integer overflows
when computing the length of the resulting string.

Change-Id: Ib806ad33a0d3b50876f384bc17787a28f0dddc37
2012-06-08 20:18:19 -07:00
Jeff Brown
f41855949d am e4db460a: am b7630f01: Use new debuggerd protocol.
* commit 'e4db460a54e4f024b83a7df9a3f9920d695da9f3':
  Use new debuggerd protocol.
2012-06-08 15:33:31 -07:00
Jeff Brown
e4db460a54 am b7630f01: Use new debuggerd protocol.
* commit 'b7630f018abc83261acf78e8cf9a88c1df72f7f5':
  Use new debuggerd protocol.
2012-06-08 15:30:39 -07:00
Geremy Condra
ec8addcc8a Merge "Adding event logging to libc." 2012-06-08 12:17:11 -07:00
Geremy Condra
8b11c4cec2 Adding event logging to libc.
I've basically just copied the relevant bits out of liblog and
EventLog.cpp. While this will let us do the uid logging we want
to address the concerns in 245c07027f78565858dd489eb0d94c3d48743e9d
it doesn't give us much else.

Change-Id: Icac6ff20bc0a3ade5927f6f76fedffe1ae6f8522
2012-06-08 12:14:48 -07:00
Nick Kralevich
7e5993bec7 Merge "_FORTIFY_SOURCE: add memset / bzero support" 2012-06-07 14:30:20 -07:00
Nick Kralevich
71a18dd435 _FORTIFY_SOURCE: add memset / bzero support
Add _FORTIFY_SOURCE support for the following functions:

* memset
* bzero

Move the __BIONIC_FORTIFY_INLINE definition to cdefs.h so it
can be used from multiple header files.

Change-Id: Iead4d5e35de6ec97786d58ee12573f9b11135bb7
2012-06-07 14:19:52 -07:00
Elliott Hughes
1a6b0bb3a6 Merge "Support non-zero p_vaddr in first PT_LOAD segment" 2012-06-07 11:43:47 -07:00
The Android Open Source Project
7d11009a97 am d06a73bc: Reconcile with jb-release
* commit 'd06a73bcb330e1a560373158be9009daef10a046':
2012-06-07 07:51:59 -07:00
The Android Open Source Project
d06a73bcb3 Reconcile with jb-release
Change-Id: I2c8264a9a4e3299bca7fc01d67063993b6b1b886
2012-06-07 07:48:47 -07:00
Jeff Brown
b7630f018a Use new debuggerd protocol.
Bug: 6615693
Change-Id: Ibfddc0de3fa2a882f7d0238ab797e5b29296b54b
2012-06-06 18:37:48 -07:00
Elliott Hughes
459049719c am d0c25027: am 2b89f1e3: Merge "Fix sysconf(_SC_NPROCESSORS_CONF) on ARM."
* commit 'd0c250271c983c3de282ff02bd2528e74ad8b5f1':
  Fix sysconf(_SC_NPROCESSORS_CONF) on ARM.
2012-06-06 13:50:29 -07:00
Elliott Hughes
d0c250271c am 2b89f1e3: Merge "Fix sysconf(_SC_NPROCESSORS_CONF) on ARM."
* commit '2b89f1e37df838e466d382fc602728930bad4c68':
  Fix sysconf(_SC_NPROCESSORS_CONF) on ARM.
2012-06-06 13:48:07 -07:00
Elliott Hughes
2b89f1e37d Merge "Fix sysconf(_SC_NPROCESSORS_CONF) on ARM." 2012-06-06 13:32:19 -07:00
Elliott Hughes
a985076bfe Fix sysconf(_SC_NPROCESSORS_CONF) on ARM.
Bug: http://code.google.com/p/enh/issues/detail?id=33
Change-Id: I679b4cd888d362031042284e8edf01c5273a92aa
2012-06-06 12:04:38 -07:00
Elliott Hughes
158ad015c2 am 3069270d: am c2bba24d: Merge "Give the timer_create SIGEV_THREAD helper threads sensible names."
* commit '3069270d8641c7bb57aa308d8f90b4d2dcbf66fc':
  Give the timer_create SIGEV_THREAD helper threads sensible names.
2012-06-06 11:37:25 -07:00
Elliott Hughes
3069270d86 am c2bba24d: Merge "Give the timer_create SIGEV_THREAD helper threads sensible names."
* commit 'c2bba24d0a6b906f00d7b9f20ac9d32d63bb2e9d':
  Give the timer_create SIGEV_THREAD helper threads sensible names.
2012-06-06 11:35:32 -07:00
Elliott Hughes
c2bba24d0a Merge "Give the timer_create SIGEV_THREAD helper threads sensible names." 2012-06-06 10:44:32 -07:00
Elliott Hughes
470631ed79 Give the timer_create SIGEV_THREAD helper threads sensible names.
Bug: 6609676
Change-Id: I286b197c75beee4d9930b0973f2d7dd47c14e91c
2012-06-06 10:32:56 -07:00
Nick Kralevich
204c6e5ff3 Merge "arm: rewrite crtbegin* as C files." 2012-06-06 08:54:22 -07:00
Nick Kralevich
0a2301598c libc: implement some FORTIFY_SOURCE functions
Add initial support for -D_FORTIFY_SOURCE to bionic for the
following functions:

* memcpy
* memmove
* strcpy
* strcat
* strncpy
* strncat

This change adds a new version of the above functions which passes
the size of the destination buffer to __builtin___*_chk.

If the compiler can determine, at compile time, that the destination
buffer is large enough, or the destination buffer can point to an object
of unknown size, then the check call is bypassed.

If the compiler can't make a compile time decision, then it calls
the __*_chk() function, which does a runtime buffer size check

These options are only enabled if the code is compiled with
-D_FORTIFY_SOURCE=1 or 2, and only when optimizations are enabled.

Please see
* http://gcc.gnu.org/onlinedocs/gcc/Object-Size-Checking.html
* http://gcc.gnu.org/ml/gcc-patches/2004-09/msg02055.html

for additional details on FORTIFY_SOURCE.

Testing: Compiled the entire Android tree with -D_FORTIFY_SOURCE=1,
and verified that everything appears to be working properly.
Also created a test buffer overflow, and verified that it was
caught by this change.

Change-Id: I4fddb445bafe92b16845b22458d72e6dedd24fbc
2012-06-05 15:44:31 -07:00
Ji-Hwan Lee
f186a1819a Support non-zero p_vaddr in first PT_LOAD segment
Before changing mmap() permission to PROT_NONE in alloc_mem_region(),
such libraries once worked with a bug that uses mmap'ed region outside of
memory region allocated by alloc_mem_region().  This possibly incurs
SIGSEGV because it can overwrite memory region of previously loaded
library, but it sometimes worked, depending on loading order.

After PROT_NONE, this caused SIGSEGV earlier during calculation of
si->phdr in load_library(), but this was fixed by:

    75917c84d1  Use mmap to read an ...

Now the behaviour is the same as before applying PROT_NONE in
alloc_mem_region().

This CL fixed the original issue, supporting shared libraries that have
non-zero p_vaddr in first (= with lowest p_vaddr) PT_LOAD segment.

Bug: 6561258
Change-Id: Ib6176dd3e44c4d99a340eb1cbd16fb037586b0bc
2012-06-04 07:44:10 -07:00
The Android Automerger
db2e7a4cb6 merge in jb-release history after reset to jb-dev 2012-06-03 05:59:30 -07:00
Iliyan Malchev
31431f454a am 252a5c85: resolved conflicts for merge of e1dd3c28 to jb-dev-plus-aosp
* commit '252a5c854a08e89fc7337ea679220161fe4ea98f':
  bionic: import heaptracker as chk_malloc
2012-06-02 08:35:07 -07:00
Iliyan Malchev
143ad4cf31 am f0ddaa2f: am 7d2e24eb: bionic: introduce libc.debug.malloc.program
* commit 'f0ddaa2fac00ac20059c0b2c142da9de2838a7b6':
  bionic: introduce libc.debug.malloc.program
2012-06-02 08:20:09 -07:00
Iliyan Malchev
252a5c854a resolved conflicts for merge of e1dd3c28 to jb-dev-plus-aosp
Change-Id: I58b9c13d20771aa39b703ec05cbff8aeaad38fe8
2012-06-02 08:14:36 -07:00
Iliyan Malchev
f0ddaa2fac am 7d2e24eb: bionic: introduce libc.debug.malloc.program
* commit '7d2e24eb167b6257f7935c7bd2023a708704ca1a':
  bionic: introduce libc.debug.malloc.program
2012-06-01 19:03:06 -07:00
Iliyan Malchev
e1dd3c287b bionic: import heaptracker as chk_malloc
This patch is a rewrite of libc.debug.malloc = 10 (chk_malloc).  It provides
the same features as the original (poison freed memory, detect heap overruns
and underruns), except that it provides more debugging information whenever it
detects a problem.

In addition to the original features, the new chk_malloc() implementation
detects multiple frees within a given range of the last N allocations, N being
configurable via the system property libc.debug.malloc.backlog.

Finally, this patch keeps track of all outstanding memory allocations.  On
program exit, we walk that list and report each outstanding allocation.

(There is support (not enabled) for a scanner thread periodically walks over
the list of outstanding allocations as well as the backlog of recently-freed
allocations, checking for heap-usage errors.)

Feature overview:

  1) memory leaks
  2) multiple frees
  3) use after free
  4) overrun

Implementation:

-- for each allocation, there is a:
  1) stack trace at the time the allocation is made
  2) if the memory is freed, there is also a stack trace at the point
  3) a front and rear guard (fence)
  4) the stack traces are kept together with the allocation

-- the following lists and maintained

  1) all outstanding memory allocations
  3) a backlog of allocations what are freed; when you call free(), instead of
     actually freed, the allocation is moved to this backlog;
  4) when the backlog of allocations gets full, the oldest entry gets evicted
     from it; at that point, the allocation is checked for overruns or
     use-after-free errors, and then actually freed.
  5) when the program exits, the list of outstanding allocations and the
     backlog are inspected for errors, then freed;

To use this, set the following system properties before running the process or
processes you want to inspect:

libc.malloc.debug.backlog # defaults to 100
libc.malloc.debug 10

When a problem is detected, you will see the following on logcat for a multiple
free:

E/libc    ( 7233): +++ ALLOCATION 0x404b9278 SIZE 10 BYTES MULTIPLY FREED!
E/libc    ( 7233): +++ ALLOCATION 0x404b9278 SIZE 10 ALLOCATED HERE:
E/libc    ( 7233): *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
E/libc    ( 7233):      #00  pc 0000c35a  /system/lib/libc_malloc_debug_leak.so
E/libc    ( 7233):      #01  pc 0000c658  /system/lib/libc_malloc_debug_leak.so
E/libc    ( 7233):      #02  pc 00016d80  /system/lib/libc.so
E/libc    ( 7233):      #03  pc 4009647c  /system/bin/malloctest
E/libc    ( 7233):      #04  pc 00016f24  /system/lib/libc.so
E/libc    ( 7233): +++ ALLOCATION 0x404b9278 SIZE 10 FIRST FREED HERE:
E/libc    ( 7233): *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
E/libc    ( 7233):      #00  pc 0000c35a  /system/lib/libc_malloc_debug_leak.so
E/libc    ( 7233):      #01  pc 0000c7d2  /system/lib/libc_malloc_debug_leak.so
E/libc    ( 7233):      #02  pc 00016d94  /system/lib/libc.so
E/libc    ( 7233):      #03  pc 40096490  /system/bin/malloctest
E/libc    ( 7233):      #04  pc 00016f24  /system/lib/libc.so
E/libc    ( 7233): +++ ALLOCATION 0x404b9278 SIZE 10 NOW BEING FREED HERE:
E/libc    ( 7233): *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
E/libc    ( 7233):      #00  pc 0000c35a  /system/lib/libc_malloc_debug_leak.so
E/libc    ( 7233):      #01  pc 0000c6ac  /system/lib/libc_malloc_debug_leak.so
E/libc    ( 7233):      #02  pc 00016d94  /system/lib/libc.so
E/libc    ( 7233):      #03  pc 400964a0  /system/bin/malloctest
E/libc    ( 7233):      #04  pc 00016f24  /system/lib/libc.so

The following for a heap overrun and underrun:

E/libc    ( 7233): +++ REAR GUARD MISMATCH [10, 11)
E/libc    ( 7233): +++ ALLOCATION 0x404b9198 SIZE 10 HAS A CORRUPTED REAR GUARD
E/libc    ( 7233): +++ ALLOCATION 0x404b9198 SIZE 10 ALLOCATED HERE:
E/libc    ( 7233): *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
E/libc    ( 7233):      #00  pc 0000c35a  /system/lib/libc_malloc_debug_leak.so
E/libc    ( 7233):      #01  pc 0000c658  /system/lib/libc_malloc_debug_leak.so
E/libc    ( 7233):      #02  pc 00016d80  /system/lib/libc.so
E/libc    ( 7233):      #03  pc 40096438  /system/bin/malloctest
E/libc    ( 7233):      #04  pc 00016f24  /system/lib/libc.so
E/libc    ( 7233): +++ ALLOCATION 0x404b9198 SIZE 10 FREED HERE:
E/libc    ( 7233): *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
E/libc    ( 7233):      #00  pc 0000c35a  /system/lib/libc_malloc_debug_leak.so
E/libc    ( 7233):      #01  pc 0000c7d2  /system/lib/libc_malloc_debug_leak.so
E/libc    ( 7233):      #02  pc 00016d94  /system/lib/libc.so
E/libc    ( 7233):      #03  pc 40096462  /system/bin/malloctest
E/libc    ( 7233):      #04  pc 00016f24  /system/lib/libc.so
E/libc    ( 7233): +++ ALLOCATION 0x404b9358 SIZE 10 HAS A CORRUPTED FRONT GUARD
E/libc    ( 7233): +++ ALLOCATION 0x404b9358 SIZE 10 ALLOCATED HERE:
E/libc    ( 7233): *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
E/libc    ( 7233):      #00  pc 0000c35a  /system/lib/libc_malloc_debug_leak.so
E/libc    ( 7233):      #01  pc 0000c658  /system/lib/libc_malloc_debug_leak.so
E/libc    ( 7233):      #02  pc 00016d80  /system/lib/libc.so
E/libc    ( 7233):      #03  pc 400964ba  /system/bin/malloctest
E/libc    ( 7233):      #04  pc 00016f24  /system/lib/libc.so
E/libc    ( 7233): +++ ALLOCATION 0x404b9358 SIZE 10 FREED HERE:
E/libc    ( 7233): *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
E/libc    ( 7233):      #00  pc 0000c35a  /system/lib/libc_malloc_debug_leak.so
E/libc    ( 7233):      #01  pc 0000c7d2  /system/lib/libc_malloc_debug_leak.so
E/libc    ( 7233):      #02  pc 00016d94  /system/lib/libc.so
E/libc    ( 7233):      #03  pc 400964e4  /system/bin/malloctest
E/libc    ( 7233):      #04  pc 00016f24  /system/lib/libc.so

The following for a memory leak:

E/libc    ( 7233): +++ THERE ARE 1 LEAKED ALLOCATIONS
E/libc    ( 7233): +++ DELETING 4096 BYTES OF LEAKED MEMORY AT 0x404b95e8 (1 REMAINING)
E/libc    ( 7233): +++ ALLOCATION 0x404b95e8 SIZE 4096 ALLOCATED HERE:
E/libc    ( 7233): *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
E/libc    ( 7233):      #00  pc 0000c35a  /system/lib/libc_malloc_debug_leak.so
E/libc    ( 7233):      #01  pc 0000c658  /system/lib/libc_malloc_debug_leak.so
E/libc    ( 7233):      #02  pc 00016d80  /system/lib/libc.so
E/libc    ( 7233):      #03  pc 0001bc94  /system/lib/libc.so
E/libc    ( 7233):      #04  pc 0001edf6  /system/lib/libc.so
E/libc    ( 7233):      #05  pc 0001b80a  /system/lib/libc.so
E/libc    ( 7233):      #06  pc 0001c086  /system/lib/libc.so
E/libc    ( 7233):      #07  pc 40096402  /system/bin/malloctest
E/libc    ( 7233):      #08  pc 00016f24  /system/lib/libc.so

Change-Id: Ic440e9d05a01e2ea86b25e8998714e88bc2d16e0
Signed-off-by: Iliyan Malchev <malchev@google.com>
2012-06-01 15:54:34 -07:00
Nick Kralevich
9d40326830 arm: rewrite crtbegin* as C files.
Rewrite
 crtbegin.S     -> crtbegin.c
 crtbegin_so.S  -> crtbegin_so.c

This change allows us to generate PIC code without relying
on text relocations.

As a consequence of this rewrite, also rewrite
  __dso_handle.S    -> __dso_handle.c
  __dso_handle_so.S -> __dso_handle_so.c
  atexit.S          -> atexit.c

In crtbegin.c _start, place the __PREINIT_ARRAY__, __INIT_ARRAY__,
__FINI_ARRAY__, and __CTOR_LIST__ variables onto the stack, instead of
passing a pointer to the text section of the binary.

This change appears sorta wonky, as I attempted to preserve,
as much as possible, the structure of the original assembly.
As a result, you have C files including other C files, and other
programming uglyness.

Result: This change reduces the number of files with text-relocations
from 315 to 19 on my Android build.

Before:
  $ scanelf -aR $OUT/system | grep TEXTREL | wc -l
  315

After:
  $ scanelf -aR $OUT/system | grep TEXTREL | wc -l
  19

Change-Id: Ib9f98107c0eeabcb606e1ddc7ed7fc4eba01c9c4
2012-06-01 14:41:27 -07:00
The Android Automerger
e1d591540e merge in jb-release history after reset to jb-dev 2012-05-31 06:59:25 -07:00
Iliyan Malchev
7d2e24eb16 bionic: introduce libc.debug.malloc.program
libc.debug.malloc.program  provides an additional level of control over which
processes to enable libc.debug.malloc functionality for.  The string value of
libc.debug.malloc.program is matched against the program name; if the value of
libc.debug.malloc.program is a substring of the program name, then malloc debug
is applied to that program at whatever level libc.debug.malloc specifies.

If lib.debug.malloc.program is not specified, then libc.debug.malloc has the
same effect as before.

For example, to enable libc.deubug.malloc = 10 only to the mediaserver, do the
following:

   adb root # necessary for setprop
   adb setprop libc.debug.malloc.program mediaserver
   adb setprop libc.debug.malloc 10
   adb kill -9 $(pid mediaserver)

Change-Id: I6f01c12f033c8e2e015d73025369d7f1685ba200
Signed-off-by: Iliyan Malchev <malchev@google.com>
2012-05-30 20:03:47 -07:00
Nick Kralevich
857fc9eab9 Merge "crtbegin: eliminate duplicate code" 2012-05-30 13:29:58 -07:00
Nick Kralevich
83a73d1afe crtbegin: eliminate duplicate code
crtbegin_dynamic and crtbegin_static are essentially identical,
minus a few trivial differences (comments and whitespace).

Eliminate duplicates.

Change-Id: Ic9fae6bc9695004974493b53bfc07cd3bb904480
2012-05-30 11:45:12 -07:00
Geremy Condra
207d7673e5 am 5a095ef2: am 03539a36: Merge "Ensure that the port number and TXID are properly randomized." into jb-dev
* commit '5a095ef28716b54f86d9c1727b9a2493ba775255':
  Ensure that the port number and TXID are properly randomized.
2012-05-30 11:11:33 -07:00
Geremy Condra
5a095ef287 am 03539a36: Merge "Ensure that the port number and TXID are properly randomized." into jb-dev
* commit '03539a36b634bdfa61c06277cf25e0ca8e3105ba':
  Ensure that the port number and TXID are properly randomized.
2012-05-30 11:09:05 -07:00
Geremy Condra
03539a36b6 Merge "Ensure that the port number and TXID are properly randomized." into jb-dev 2012-05-30 11:06:54 -07:00
The Android Open Source Project
1ebb243d1a am cb9ba3c8: Reconcile with jb-release
* commit 'cb9ba3c88a97f34784559a55317ff5970d4c4dba':
  Print the corrupted address passed to free().
2012-05-29 09:41:51 -07:00
The Android Open Source Project
cb9ba3c88a Reconcile with jb-release
Change-Id: Id0b365ef6729dc36b88193f1675d3819e56bd426
2012-05-29 09:39:17 -07:00
Elliott Hughes
1dd9efc541 Merge "Use mmap to read an initial ELF header of library" 2012-05-25 15:11:35 -07:00
Ji-Hwan Lee
75917c84d1 Use mmap to read an initial ELF header of library
Also, fixes SIGSEV during calculation of si->phdr in load_library(),
which is caused by accessing PHDR area, which is not guaranteed to be
loaded.

Note that this usually does not happen because program header area is
covered by immediately following PT_LOAD entry.  But it does not hold
always.

Bug: 6561258
Change-Id: Ie376253c773b5420279ca89044e81b1aad5a5736
2012-05-26 06:15:50 +09:00
Ben Cheng
2481468f22 Print the corrupted address passed to free().
For example:

@@@ ABORTING: INVALID HEAP ADDRESS IN dlfree addr=0x5c3bfbd0
Fatal signal 11 (SIGSEGV) at 0xdeadbaad (code=1), thread 2942

The addr=0x5c3bfbd0 part is new.

Change-Id: I8670144b2b0a3a6182384150d762c97dfee5452f
2012-05-25 11:14:20 -07:00
Ben Cheng
41c2a112c2 am d7b60b20: am c84ff11d: Print the corrupted address passed to free().
* commit 'd7b60b207be79513b99faf2ef576db333f9c7a78':
  Print the corrupted address passed to free().
2012-05-24 17:23:43 -07:00
Ben Cheng
d7b60b207b am c84ff11d: Print the corrupted address passed to free().
* commit 'c84ff11dad26435dc5760bceda18e8f1175a6061':
  Print the corrupted address passed to free().
2012-05-24 17:21:03 -07:00
Ben Cheng
c84ff11dad Print the corrupted address passed to free().
For example:

@@@ ABORTING: INVALID HEAP ADDRESS IN dlfree addr=0x5c3bfbd0
Fatal signal 11 (SIGSEGV) at 0xdeadbaad (code=1), thread 2942

The addr=0x5c3bfbd0 part is new.

Change-Id: I8670144b2b0a3a6182384150d762c97dfee5452f
2012-05-24 17:06:43 -07:00
Geremy Condra
b23f193dcc Ensure that the port number and TXID are properly randomized.
This fix reads from /dev/urandom to get the required entropy.

Bug: 6535492
Change-Id: Ibc2fec3f71a67607b608ad9b767b0b6504993c1d
2012-05-24 15:26:12 -07:00
Jean-Baptiste Queru
15ed08d065 am d155ba57: am c7882ab2: Merge "bionic: add clean kernel header ucontext.h"
* commit 'd155ba57a32ce3182d8a5b79ff27bc5e7fa55df9':
  bionic: add clean kernel header ucontext.h
2012-05-21 12:41:30 -07:00
Elliott Hughes
7cce04381a resolved conflicts for merge of dc6c2b77 to master
Change-Id: Ifab4573a825cf5caa7158d8888243bb8d5d01148
2012-05-17 17:15:01 -07:00
Jean-Baptiste Queru
d155ba57a3 am c7882ab2: Merge "bionic: add clean kernel header ucontext.h"
* commit 'c7882ab2a99a74c8f772ab03fdfd9a3b53515e46':
  bionic: add clean kernel header ucontext.h
2012-05-17 13:28:10 -07:00
Jean-Baptiste Queru
c7882ab2a9 Merge "bionic: add clean kernel header ucontext.h" 2012-05-17 12:25:02 -07:00
Elliott Hughes
dc6c2b779b am 70cf0bc0: Merge "Remove the last references to SuperH."
* commit '70cf0bc0496a1d4c0e83fe3f1933f667ab66c148':
  Remove the last references to SuperH.
2012-05-16 17:18:23 -07:00
Elliott Hughes
70cf0bc049 Merge "Remove the last references to SuperH." 2012-05-16 09:56:37 -07:00
Nick Kralevich
d8f9198644 am 1727a041: am cf8e554c: (-s ours) Merge "Make the linker relocatable."
* commit '1727a041b59995b00c1d497022600be929bcaf3e':
  Make the linker relocatable.
2012-05-16 09:17:32 -07:00
Nick Kralevich
38e81b4294 am 574e8ec2: am 36e0345a: Merge "linker: set LOCAL_NO_CRT := true"
* commit '574e8ec28fac106a5e9b2c98b7b5a4e9532ecf5c':
  linker: set LOCAL_NO_CRT := true
2012-05-16 09:15:15 -07:00
Nick Kralevich
ed434302f0 am ee6916c0: am 1adc7c03: Merge "linker: Fix the computation of si->base"
* commit 'ee6916c00718185df3930a18050e5b47685ef524':
  linker: Fix the computation of si->base
2012-05-16 09:15:14 -07:00
Nick Kralevich
82576526e3 am c62d55cb: am cd6b2007: (-s ours) Merge "Add linker support for PIE"
* commit 'c62d55cbaef8001c7eb0a8d5e85e2fc72283063a':
  Add linker support for PIE
2012-05-16 09:15:07 -07:00
Nick Kralevich
1727a041b5 am cf8e554c: (-s ours) Merge "Make the linker relocatable."
* commit 'cf8e554c72af1dd634d4f36a9065e34e853f8714':
  Make the linker relocatable.
2012-05-16 09:14:22 -07:00
Nick Kralevich
574e8ec28f am 36e0345a: Merge "linker: set LOCAL_NO_CRT := true"
* commit '36e0345af89e2ed768ed38dcdf016a7640cf8ba5':
  linker: set LOCAL_NO_CRT := true
2012-05-16 09:11:52 -07:00
Nick Kralevich
ee6916c007 am 1adc7c03: Merge "linker: Fix the computation of si->base"
* commit '1adc7c03898ee1f6a4c7f8cffa3c07507b9da5a9':
  linker: Fix the computation of si->base
2012-05-16 09:11:50 -07:00
Nick Kralevich
c62d55cbae am cd6b2007: (-s ours) Merge "Add linker support for PIE"
* commit 'cd6b2007b851f1cfa47d8bcc7ec859dfa7557382':
  Add linker support for PIE
2012-05-16 09:11:49 -07:00
The Android Open Source Project
75931ee6e1 am 918e6a73: Reconcile with jb-release nakasi-factoryrom-release
* commit '918e6a730cd059392ee6d8b5c5a0f5fa0e5bbd93':
  Revert "linker: remove STB_LOCAL hack"
  Revert "Reference __dso_handle in PIC way"
  Revert "Use the new NativeDaemonConnector style."
  libc: Add __aeabi_llsl and __aeabi_llsr to libgcc_compat
2012-05-16 08:34:13 -07:00
The Android Open Source Project
918e6a730c Reconcile with jb-release nakasi-factoryrom-release
Change-Id: I5a5b95da6c33afbc36893e162f3b57c09c161ee2
2012-05-16 08:31:49 -07:00
Elliott Hughes
e33af61c70 Remove the last references to SuperH.
Change-Id: Icb44c1f94cb178d90b4c2b1e8f6d175586aec4e1
2012-05-15 17:08:41 -07:00
Ying Wang
fc9e525fe0 Rename the misleading var name TARGET_OUT_STATIC_LIBRARIES
TARGET_OUT_STATIC_LIBRARIES is actually the same as
TARGET_OUT_INTERMEDIATE_LIBRARIES.

Change-Id: I11ac35256031d461d20156cd4c19ed7eae781d22
2012-05-15 15:15:11 -07:00
Nick Kralevich
cf8e554c72 Merge "Make the linker relocatable." 2012-05-15 15:10:24 -07:00
Nick Kralevich
36e0345af8 Merge "linker: set LOCAL_NO_CRT := true" 2012-05-15 15:10:12 -07:00
Nick Kralevich
1adc7c0389 Merge "linker: Fix the computation of si->base" 2012-05-15 15:10:01 -07:00
Nick Kralevich
cd6b2007b8 Merge "Add linker support for PIE" 2012-05-15 15:09:45 -07:00
Nick Kralevich
dcbc3787bf Make the linker relocatable.
Previously, the linker always loaded itself into the same
location in memory, which inhibited the effectiveness of Android's
ASLR implementation. Modify the linker code so it can be relocatable
and link itself at runtime.

Change-Id: Ia80273d7a00ff648b4da545f4b69debee6343968
2012-05-15 10:41:14 -07:00
Nick Kralevich
e742c1f564 linker: set LOCAL_NO_CRT := true
Use LOCAL_NO_CRT to prevent linking against crtbegin.o, rather than
messing with build rules. This also prevents linking against crtend.o,
which isn't needed for the linker.

Change-Id: I0c5b9999be7e8676560fe145c1c033ffce8db4d1
2012-05-15 10:08:39 -07:00
David 'Digit' Turner
077891b199 linker: Fix the computation of si->base
The computation of si->base assumed that the first entry in the
program header table is a PT_PHDR. This results in the dynamic
linker crashing with a SIGSEGV/MAPERR when trying to load some
of the NDK unit test programs, which happen to have an EXIDX
header first, followed byu a PHDR one.

This patch fixes the computation by parsing the program header
table, looking explicitely for the PHDR entry. This fixes the
load of the NDK unit test programs, and doesn't affect system
libraries.

Change-Id: Id18ea6037dbe950b5abbbce816c2960321f0b81d
2012-05-15 09:58:33 -07:00
Nick Kralevich
6cdefd06c0 Add linker support for PIE
Modify the dynamic linker so that executables can be loaded
at locations other than 0x00000000.

Modify crtbegin* so that non-PIC compilant "thumb interwork
veneers" are not created by the linker.

Bug: 5323301
Change-Id: Iece0272e2b708c79034f302c20160e1fe9029588
2012-05-15 09:56:32 -07:00
Kito Cheng
c425bc0532 bionic: add clean kernel header ucontext.h
Change-Id: I34fd0b0147fa33fd74c13480bc11827634233a41
2012-05-14 01:42:12 +08:00
Elliott Hughes
1b56aaa659 am f2f7bf76: am 4f05d1c7: Merge "bionic/x86: Optimization for memcpy"
* commit 'f2f7bf76dfd1d6014ed3baa1e27b221388e70a09':
  bionic/x86: Optimization for memcpy
2012-05-10 23:15:00 -07:00
Elliott Hughes
f2f7bf76df am 4f05d1c7: Merge "bionic/x86: Optimization for memcpy"
* commit '4f05d1c758ba141c617f25251a661ecb66627e9e':
  bionic/x86: Optimization for memcpy
2012-05-10 21:31:48 -07:00
Elliott Hughes
4f05d1c758 Merge "bionic/x86: Optimization for memcpy" 2012-05-10 10:14:44 -07:00
Iliyan Malchev
83a38b8c44 am 8034415d: resolved conflicts for merge of 08e72d01 to jb-dev-plus-aosp
* commit '8034415ddd8404f8788199ed993af89692235dc5':
  bionic: add support for non-NEON memcpy() on NEON SoCs
2012-05-10 09:24:46 -07:00
Iliyan Malchev
8034415ddd resolved conflicts for merge of 08e72d01 to jb-dev-plus-aosp
Change-Id: If00e354a5953ed54b31963d4f8ea77e1603c321e
2012-05-10 09:19:59 -07:00
The Android Automerger
4dc3a7e1ed merge in jb-release history after reset to jb-dev 2012-05-10 06:59:27 -07:00
Elliott Hughes
537867aed8 am 804147cb: am edb7cad9: Merge "Actually set the header guard in "linux-syscalls.h"."
* commit '804147cb7d533f5635da6adc28fbca1467a3078b':
  Actually set the header guard in "linux-syscalls.h".
2012-05-09 20:12:40 -07:00
Elliott Hughes
804147cb7d am edb7cad9: Merge "Actually set the header guard in "linux-syscalls.h"."
* commit 'edb7cad9b764f029c5faac2750f749d3d84bd86a':
  Actually set the header guard in "linux-syscalls.h".
2012-05-09 20:10:14 -07:00
Elliott Hughes
edb7cad9b7 Merge "Actually set the header guard in "linux-syscalls.h"." 2012-05-09 16:39:40 -07:00
Elliott Hughes
1928523c87 Actually set the header guard in "linux-syscalls.h".
Spotted while merging a MIPS change.

Change-Id: I36fb5a07d0bba0c117e9fe9733957bd37ca4b4c0
2012-05-09 16:34:11 -07:00
Elliott Hughes
2a5fab9a5f am dbd5ecad: resolved conflicts for merge of e5408907 to jb-dev-plus-aosp
* commit 'dbd5ecad26e39281bb83f97664bc32555c5c071a':
  [MIPS] Add support for MIPS syscalls
2012-05-09 13:57:12 -07:00
Elliott Hughes
dbd5ecad26 resolved conflicts for merge of e5408907 to jb-dev-plus-aosp
Change-Id: If4c3f51bf87b28da8074be2e46ae772a374b266f
2012-05-09 13:53:37 -07:00
Prajakta Gudadhe
08e72d0161 bionic: add support for non-NEON memcpy() on NEON SoCs
Some SoCs that support NEON nevertheless perform better with a non-NEON than a
NEON memcpy().  This patch adds build variable ARCH_ARM_USE_NON_NEON_MEMCPY,
which can be set in BoardConfig.mk.  When ARCH_ARM_USE_NON_NEON_MEMCPY is
defined, we compile in the non-NEON optimized memcpy() even if the SoC supports
NEON.

Change-Id: Ia0e5bee6bad5880ffc5ff8f34a1382d567546cf9
2012-05-09 13:34:31 -07:00
Elliott Hughes
fd8bd2c432 am 58a00b49: am 7eb1cc23: Merge "bionic: allow the board to customize MALLOC_ALIGNMENT"
* commit '58a00b4977b6fa073a8f56d94d741b1e4cb49856':
  bionic: allow the board to customize MALLOC_ALIGNMENT
2012-05-09 12:56:15 -07:00
Elliott Hughes
22167aafba am eab2889e: am fd955033: Merge "pthread: Invalidate stale stack pointers on pthread_exit()"
* commit 'eab2889e66d4fe03f3c5590d7e8b14e3777179ec':
  pthread: Invalidate stale stack pointers on pthread_exit()
2012-05-09 12:56:15 -07:00
Elliott Hughes
58a00b4977 am 7eb1cc23: Merge "bionic: allow the board to customize MALLOC_ALIGNMENT"
* commit '7eb1cc23f8976a2062ba0cf92f030216a8e64e60':
  bionic: allow the board to customize MALLOC_ALIGNMENT
2012-05-09 12:53:16 -07:00
Elliott Hughes
eab2889e66 am fd955033: Merge "pthread: Invalidate stale stack pointers on pthread_exit()"
* commit 'fd95503347acba5c52d669a186ad2b161338a8a7':
  pthread: Invalidate stale stack pointers on pthread_exit()
2012-05-09 12:53:16 -07:00
Elliott Hughes
e54089079b Merge "[MIPS] Add support for MIPS syscalls" 2012-05-09 11:50:07 -07:00
Raghu Gandham
1fa0d84957 [MIPS] Add support for MIPS syscalls
Change-Id: I4deba67e15c865c4c2db03064c04098a09828ea6
Signed-off-by: Raghu Gandham <raghu@mips.com>
Signed-off-by: Chris Dearman <chris@mips.com>
2012-05-09 11:46:28 -07:00
Elliott Hughes
7d4da4ea5c am 57f8d4b5: resolved conflicts for merge of 3919b96e to jb-dev-plus-aosp
* commit '57f8d4b5b5564fad7a9c7f8a6e5108f31c75056f':
  Implement the "abort" stub in assembly for ARM.
2012-05-09 10:13:02 -07:00
Ben Cheng
8e38a509d2 am da0d8534: am 08b51e2c: Implement the "abort" stub in assembly for ARM.
* commit 'da0d8534f1a6273a383f1dc631fbaf032674bb4d':
  Implement the "abort" stub in assembly for ARM.
2012-05-09 10:12:04 -07:00
Elliott Hughes
7eb1cc23f8 Merge "bionic: allow the board to customize MALLOC_ALIGNMENT" 2012-05-09 09:52:56 -07:00
Jack Ren
2fd81ef71c bionic: allow the board to customize MALLOC_ALIGNMENT
Currently the dlmalloc allocates the memory with 8-byte alignment.
According to the com.aurorasoftworks.quadrant.ui.professional benchmark data:
We can get much better memory performance if we change it to be 16-byte aligned.
For example, On Nexus-S:
8-byte aligned :
    1378 1070  1142 1665 1765  1163 1179  1263  1404 avg: 1336.555555556
16-byte aligned:
    1691 1731  1780 1691 1671  1678 1802  1758  1780 avg: 1731.333333333
                                                    gain: 29.53%

That patch provides flexibity to customize the MALLOC_ALIGNMENT from the
board config.The macro MALLOC_ALIGNMENT defaults to 8.
To change it, please define BOARD_MALLOC_ALIGNMENT in the BoardConfig.mk:
BOARD_MALLOC_ALIGNMENT := <whatever>

Change-Id: I8da0376944a0bbcef1d0fc026bfb6d9125db9739
Signed-off-by: Jin Wei <wei.a.jin@intel.com>
Signed-off-by: Jack Ren <jack.ren@intel.com>
Signed-off-by: Beare, Bruce J <bruce.j.beare@intel.com>
2012-05-09 09:52:22 -07:00
Elliott Hughes
fd95503347 Merge "pthread: Invalidate stale stack pointers on pthread_exit()" 2012-05-09 09:46:02 -07:00
Elliott Hughes
57f8d4b5b5 resolved conflicts for merge of 3919b96e to jb-dev-plus-aosp
Change-Id: I80571b5f024a4e1abe2606d10e07006f53bbc01f
2012-05-09 09:38:40 -07:00
The Android Automerger
e2390bff2e merge in jb-release history after reset to jb-dev 2012-05-09 07:46:07 -07:00
Elliott Hughes
1d8b9ef92c am a674a571: am 20bea000: Merge "Cherry-pick "generate PIC code"."
* commit 'a674a571dbf0eebf4825f80f3ab229b1d62d49da':
  Cherry-pick "generate PIC code".
2012-05-09 01:54:16 -07:00
Ben Cheng
da0d8534f1 am 08b51e2c: Implement the "abort" stub in assembly for ARM.
* commit '08b51e2c091d036c124259ae59eb7be6bbe346af':
  Implement the "abort" stub in assembly for ARM.
2012-05-09 01:48:40 -07:00
Elliott Hughes
a674a571db am 20bea000: Merge "Cherry-pick "generate PIC code"."
* commit '20bea00090e530f2e6f4d97de4b7cf8031b86a86':
  Cherry-pick "generate PIC code".
2012-05-08 19:57:58 -07:00
Bjorn Andersson
0753dc653e pthread: Invalidate stale stack pointers on pthread_exit()
A call to pthread_key_delete() after pthread_exit() have unmapped the stack of a thread
but before the ongoing pthread_join() have finished executing will result in an access
to unmapped memory.
Avoid this by invalidating the stack_base and tls pointers during pthread_exit().

This is based on the investigation and proprosed solution by
Srinavasa Nagaraju <srinavasa.x.nagaraju@sonyericsson.com>

Change-Id: I145fb5d57930e91b00f1609d7b2cd16a55d5b3a9
2012-05-08 17:43:57 -07:00
Elliott Hughes
a4e84d285c am 9c3eca7b: resolved conflicts for merge of 6cf3c7c5 to jb-dev-plus-aosp
* commit '9c3eca7bcee694e6a477a7d50065f11cf1e805bb':
  Let pthread_create fail if schedparam can't be set
2012-05-08 15:13:20 -07:00
Elliott Hughes
3919b96ecc Merge "Implement the "abort" stub in assembly for ARM." 2012-05-08 14:54:57 -07:00
Ben Cheng
eda7be454d Implement the "abort" stub in assembly for ARM.
So that we can always get the full stack trace regardless of gcc's handling
of the "noreturn" attribute associated with abort().

(Cherry pick of Id264a5167e7cabbf11515fbc48f5469c527e34d4.)

Bug: 6455193

Conflicts:

	libc/Android.mk

Change-Id: I568fc5303fd1d747075ca933355f914122f94dac
2012-05-08 14:47:20 -07:00
Ben Cheng
08b51e2c09 Implement the "abort" stub in assembly for ARM.
So that we can always get the full stack trace regardless of gcc's handling
of the "noreturn" attribute associated with abort().

[cherry-picked from master]

BUG:6455193
Change-Id: I0102355f5bf20e636d3feab9d1424495f38e39e2
2012-05-08 14:39:35 -07:00
Ben Cheng
12cbf0605e Merge "Implement the "abort" stub in assembly for ARM." 2012-05-08 14:01:22 -07:00
Ben Cheng
017f438534 Implement the "abort" stub in assembly for ARM.
So that we can always get the full stack trace regardless of gcc's handling
of the "noreturn" attribute associated with abort().

BUG:6455193
Change-Id: Id264a5167e7cabbf11515fbc48f5469c527e34d4
2012-05-08 13:43:12 -07:00
Elliott Hughes
9c3eca7bce resolved conflicts for merge of 6cf3c7c5 to jb-dev-plus-aosp
Change-Id: Ib22a8ae1ef63bf9b9c82ce6e22afd188ba7c2806
2012-05-08 13:26:28 -07:00
Jack Ren
c47703a521 bionic/x86: Optimization for memcpy
Signed-off-by: Liubov Dmitrieva <liubov.dmitrieva@intel.com>
Signed-off-by: H.J. Lu <hongjiu.lu@intel.com>
Signed-off-by: Wei A Jin <wei.a.jin@intel.com>
Signed-off-by: Jack Ren <jack.ren@intel.com>
Signed-off-by: Bruce Beare <bruce.j.beare@intel.com>

Conflicts:

	libc/arch-x86/string/ssse3-memcpy5.S

Change-Id: I41e70d1d19d5457e65c89b64da452fbdaf3a00a7
2012-05-08 12:18:25 -07:00
Elliott Hughes
20bea00090 Merge "Cherry-pick "generate PIC code"." 2012-05-08 11:56:13 -07:00
Nick Kralevich
5982e33aca Cherry-pick "generate PIC code".
Change-Id: I7d5f2e5663df263493f65e364c959e663fc4d13a
2012-05-08 11:53:28 -07:00
Elliott Hughes
2eef0ca111 am ff0d1ce4: am e3bc7192: Merge "bionic: fix integer overflows in chk_malloc(), leak_malloc(), and leak_memalign()"
* commit 'ff0d1ce4dfceb35a65440259c3f325106fc9e39b':
  bionic: fix integer overflows in chk_malloc(), leak_malloc(), and leak_memalign()
2012-05-08 11:32:58 -07:00
Elliott Hughes
9b25457498 am 53daf475: am 73a6566d: Merge "Remove expired dns cache entries before removing oldest"
* commit '53daf4757d36522c132006e2f74ed81bb4ed717a':
  Remove expired dns cache entries before removing oldest
2012-05-08 11:32:57 -07:00
Elliott Hughes
e34c7ffc57 am e636e1f2: am 8657eafc: Merge "Adjust memcpy for ARM Cortex A9 cache line size"
* commit 'e636e1f2c17d7097b6638cb4ae2b4857765b502d':
  Adjust memcpy for ARM Cortex A9 cache line size
2012-05-08 11:32:55 -07:00
Elliott Hughes
6cf3c7c50a Merge "Let pthread_create fail if schedparam can't be set" 2012-05-08 10:56:01 -07:00
Pierre Peiffer
d0c884d359 Let pthread_create fail if schedparam can't be set
The creation of a thread succeeds even if the requested scheduling
parameters can not be set. This is not POSIX compliant, and even
worse, it leads to a wrong behavior. Let pthread_create() fail in this
case.

Change-Id: Ice66e2a720975c6bde9fe86c2cf8f649533a169c
Signed-off-by: Christian Bejram <christian.bejram@stericsson.com>
2012-05-08 10:54:51 -07:00
Mattias Falk
a59cfcfd08 Avoid multiple dns lookups for the same query
If two or more rapid dns requests for the same server are done
from different threads it turns into separate dns reques, if
the response of the request isn't found in the cache.

This patch avoid multiple request for the same server by
letting subsequents request wait until the first request
has finished.

Change-Id: Ic72ea0e7d3964a4164eddf866feb4357ec4dfe54
2012-05-07 18:04:25 -07:00
Nick Kralevich
a2758f19ce libc: stop using the custom linker script
stop using the custom linker script. It prevents relro from
working on libc.

This reverts commit b091dd9bf2.
2012-05-07 14:33:32 -07:00
Elliott Hughes
ff0d1ce4df am e3bc7192: Merge "bionic: fix integer overflows in chk_malloc(), leak_malloc(), and leak_memalign()"
* commit 'e3bc7192ec4254bed00eb8b352735665c6072995':
  bionic: fix integer overflows in chk_malloc(), leak_malloc(), and leak_memalign()
2012-05-07 14:00:01 -07:00
Elliott Hughes
53daf4757d am 73a6566d: Merge "Remove expired dns cache entries before removing oldest"
* commit '73a6566da337db50cfc73c369d774ac1905a30c2':
  Remove expired dns cache entries before removing oldest
2012-05-07 13:59:59 -07:00
Elliott Hughes
e636e1f2c1 am 8657eafc: Merge "Adjust memcpy for ARM Cortex A9 cache line size"
* commit '8657eafc3552f36c176667c1591beab255308da6':
  Adjust memcpy for ARM Cortex A9 cache line size
2012-05-07 13:59:58 -07:00
Elliott Hughes
e3bc7192ec Merge "bionic: fix integer overflows in chk_malloc(), leak_malloc(), and leak_memalign()" 2012-05-07 10:51:29 -07:00
Xi Wang
7f5aa4f35e bionic: fix integer overflows in chk_malloc(), leak_malloc(), and leak_memalign()
The allocation size in chk_malloc(), leak_malloc(), and leak_memalign()
functions may be rounded up to a small value, leading to buffer overflows.
The code only runs in debugging mode.

This patch complements commit 6f04a0f4 (CVE-2009-0607).

Change-Id: Id899bcd2bcd2ea2205e5753c433390710032dc83
Signed-off-by: Xi Wang <xi.wang@gmail.com>
2012-05-07 10:50:21 -07:00
Elliott Hughes
73a6566da3 Merge "Remove expired dns cache entries before removing oldest" 2012-05-07 10:41:53 -07:00
Elliott Hughes
8657eafc35 Merge "Adjust memcpy for ARM Cortex A9 cache line size" 2012-05-07 09:13:35 -07:00
Henrik Smiding
fe6338da91 Adjust memcpy for ARM Cortex A9 cache line size
ARM Cortex A8 use 64 bytes and ARM Cortex A9 use 32 bytes cache line
size.

The following patch:
  Adds code to adjust memcpy cache line size to match A9 cache line
  size.
  Adds a flag to select between 32 bytes and 64 bytes cache line
  size.

  Copyright (C) ST-Ericsson SA 2010
    Modified neon implementation to fit Cortex A9 cache line size
    Author: Henrik Smiding henrik.smiding@stericsson.com for
            ST-Ericsson.

Change-Id: I8a55946bfb074e6ec0a14805ed65f73fcd0984a3
Signed-off-by: Christian Bejram <christian.bejram@stericsson.com>
2012-05-07 14:18:02 +02:00
Elliott Hughes
2ddea18f81 am f7db5ecc: Merge "MIPS support to libm, libdl and libthread_db"
* commit 'f7db5ecc4d662da8368f31d57401ca1a39690e40':
  MIPS support to libm, libdl and libthread_db
2012-05-04 18:07:11 -07:00
Elliott Hughes
f7db5ecc4d Merge "MIPS support to libm, libdl and libthread_db" 2012-05-04 12:00:19 -07:00
Chris Dearman
726800e8f4 MIPS support to libm, libdl and libthread_db
Change-Id: I9106721af7fe0cd45df82976250db0d300a20117
Signed-off-by: Raghu Gandham <raghu@mips.com>
2012-05-04 11:34:40 -07:00
Elliott Hughes
5a6c96396b am 10579fc4: Merge "Update s_fabsl.c to upstream head."
* commit '10579fc43d3ade285eed7318aee062a999f2784d':
  Update s_fabsl.c to upstream head.
2012-05-01 04:56:57 -07:00
Elliott Hughes
10579fc43d Merge "Update s_fabsl.c to upstream head." 2012-04-30 22:35:02 -07:00
Elliott Hughes
7735a38935 Update s_fabsl.c to upstream head.
Bug: http://code.google.com/p/android/issues/detail?id=29539
Change-Id: I843dcfcbfe49e8e9f43c49aae6ade1edb57a3053
2012-04-30 16:12:43 -07:00
The Android Automerger
e0f1fca46c merge in jb-release history after reset to jb-dev 2012-04-30 06:59:25 -07:00
Ken Sumrall
3f31504db9 am 6baffed2: Add the posix_memalign(3) function to bionic
* commit '6baffed252d0efbce5a79f356c2f156f4f818996':
  Add the posix_memalign(3) function to bionic
2012-04-27 10:49:42 -07:00
Ken Sumrall
6baffed252 Add the posix_memalign(3) function to bionic
The posix_memalign(3) function is very similar to the traditional
memalign(3) function, but with better error reporting and a guarantee
that the memory it allocates can be freed.  In bionic, memalign(3)
allocated memory can be freed, so posix_memalign(3) is just a wrapper
around memalign(3).

Change-Id: I62ee908aa5ba6b887d8446a00d8298d080a6a299
2012-04-27 09:34:53 -07:00
Mike Lockwood
4fab6f901c am efcf8893: Merge "Update f_accessory.h kernel header" into jb-dev
* commit 'efcf8893a97df2eb2ecb7aab305998878771d2f2':
  Update f_accessory.h kernel header
2012-04-26 13:12:54 -07:00
Mike Lockwood
efcf8893a9 Merge "Update f_accessory.h kernel header" into jb-dev 2012-04-26 13:10:25 -07:00
Nick Kralevich
2cc0894992 am b091dd9b: libc: continue to use Android\'s custom linker script
* commit 'b091dd9bf27a9132c4ac9da55f2f4a87ffe3b59f':
  libc: continue to use Android's custom linker script
2012-04-26 11:58:48 -07:00
Nick Kralevich
b091dd9bf2 libc: continue to use Android's custom linker script
By default, Android no longer compiles code using it's custom
linker script /build/core/armelf.xsc. However, this causes
problems for libc. Certain programs linked using older versions
of GOLD expect libc.so to export __exidx_start and __exidx_end.
Removing the custom linker script causes libc.so not to export
those symbols.

For now, continue using the old linker script, until we can
figure out a better solution.

Change-Id: Iaf002afd63a58b848818da24e5a4525620dc4d74
2012-04-26 11:04:44 -07:00
Mike Lockwood
ed87404c44 Update f_accessory.h kernel header
Change-Id: I29ec4aa4843b9308cbfa412df88e026e8475b715
Signed-off-by: Mike Lockwood <lockwood@google.com>
2012-04-25 09:57:32 -07:00
Jean-Baptiste Queru
203aae7d79 Merge from AOSP
Change-Id: If2e8e4305d10df738cc4ebcf226077f273a48cbf
2012-04-25 09:29:40 -07:00
The Android Automerger
22d80c0b35 merge in jb-release history after reset to jb-dev 2012-04-25 07:47:06 -07:00
Andrew Hsieh
1e343cb119 Merge "[MIPS] Fix the warning originating from the kernel header signal.h. This is a clean header generated from the corresponding change in external/kernel-headers repository. (CL 35760)" 2012-04-24 23:44:18 -07:00
Raghu Gandham
e328ce6c55 [MIPS] Fix the warning originating from the kernel header signal.h.
This is a clean header generated from the corresponding change in
external/kernel-headers repository. (CL 35760)
2012-04-23 18:59:41 -07:00
Nick Kralevich
94179a509e linker: remove STB_LOCAL hack
The ARM static linker wasn't properly handling __exidx_start
and __exidx_end symbols. Now that the static linker has been fixed,
we don't need the dynamic linker to work around this problem.

Change-Id: I041b94903609fafab33663a7d441a5e70b7ffcdd
2012-04-23 16:50:34 -07:00
The Android Automerger
5fb8130be9 merge in jb-release history after reset to master 2012-04-19 06:59:25 -07:00
Erik Gilling
baeacba04d add linux/sw_sync.h
Change-Id: I79de18d04b950c21b985d5ebc01cd3306a43d318
Signed-off-by: Erik Gilling <konkers@android.com>
2012-04-18 15:37:01 -07:00
Erik Gilling
6b99103c31 add linux/sync.h
Change-Id: I38bb9498e18cb2b2e84a97487d4ad1e15fabd9d4
Signed-off-by: Erik Gilling <konkers@android.com>
2012-04-18 14:23:04 -07:00
The Android Automerger
91b76aa298 merge in jb-release history after reset to master 2012-04-18 06:59:34 -07:00
Evgeniy Stepanov
4a9d6e50bb Fix segv when unwinding stack past __libc_init.
This change mirrors cd15bac for statically-linked binaries.

Change-Id: Id870832a50b37f0ef3e79e1ed03ed31390bfc9ef
2012-04-18 12:59:38 +04:00
The Android Automerger
bfb300152c merge in jb-release history after reset to master 2012-04-17 06:59:17 -07:00
Elliott Hughes
762a4fe2ee resolved conflicts for merge of 35d592cc to master
Change-Id: I8184302daf61814d26c837f9920b4e68d96d7f65
2012-04-16 14:40:26 -07:00
Elliott Hughes
f848321c4f resolved conflicts for merge of ef987656 to master
Change-Id: I3854de8f4cddaf344444efa6f9da027642a237d9
2012-04-16 14:26:43 -07:00
Elliott Hughes
8ecb4770a0 resolved conflicts for merge of 6b8fd054 to master
Change-Id: Ifc5a10d9c2f7764ad80d64cc552aad81d5fbf5eb
2012-04-16 14:16:42 -07:00
Elliott Hughes
8266cf94d3 am ff219e57: am 6435d27f: Merge "bionic: fix NULL parameter failure in getcwd()"
* commit 'ff219e57c0ffe5ac2816f79677ce4f1afa677277':
  bionic: fix NULL parameter failure in getcwd()
2012-04-16 13:15:13 -07:00
Elliott Hughes
35d592cc5a am 418e647a: Merge "libstdc++: Fix x86 thread-safe one-time-construction implementation."
* commit '418e647a8300bb8e62b6b73814a5211152cbaacd':
  libstdc++: Fix x86 thread-safe one-time-construction implementation.
2012-04-16 13:12:47 -07:00
Elliott Hughes
ef9876569a am 4994deae: Merge "Bionic: Fix wrong prototype of system call clock_nanosleep"
* commit '4994deaef51d5fa1ac12e6160b47d9cbe3b2bc43':
  Bionic: Fix wrong prototype of system call clock_nanosleep
2012-04-16 13:12:46 -07:00
Elliott Hughes
6b8fd05414 am 7b8666e6: Merge "bionic: Fix wrong prototype of system call getresuid/getresgid"
* commit '7b8666e683e56549091b86fd7b9c421fd0124dbc':
  bionic: Fix wrong prototype of system call getresuid/getresgid
2012-04-16 13:12:46 -07:00
Elliott Hughes
ff219e57c0 am 6435d27f: Merge "bionic: fix NULL parameter failure in getcwd()"
* commit '6435d27f9d45d01fbd15bcc3dcd9617b86b825bb':
  bionic: fix NULL parameter failure in getcwd()
2012-04-16 13:12:45 -07:00
Elliott Hughes
418e647a83 Merge "libstdc++: Fix x86 thread-safe one-time-construction implementation." 2012-04-16 09:13:13 -07:00
Elliott Hughes
4994deaef5 Merge "Bionic: Fix wrong prototype of system call clock_nanosleep" 2012-04-16 09:09:05 -07:00
Elliott Hughes
7b8666e683 Merge "bionic: Fix wrong prototype of system call getresuid/getresgid" 2012-04-16 09:06:22 -07:00
Jack Ren
d515ce465b Bionic: Fix wrong prototype of system call clock_nanosleep
In bionic/libc/SYSCALLS.TXT, the prototype of system call
clock_nanosleep is incorrect.

According to man page:
int clock_nanosleep(clockid_t clock_id, int flags,
                    const struct timespec *request,
                    struct timespec *remain);

Change-Id: Ic44c6db3d632293aa17998035554eacd664c2d57
Signed-off-by: Jin Wei <wei.a.jin@intel.com>
Signed-off-by: Jack Ren <jack.ren@intel.com>
Signed-off-by: Bruce Beare <bruce.j.beare@intel.com>
2012-04-16 23:53:05 +08:00
Elliott Hughes
6435d27f9d Merge "bionic: fix NULL parameter failure in getcwd()" 2012-04-16 08:48:19 -07:00
Jack Ren
41070dd15f bionic: Fix wrong prototype of system call getresuid/getresgid
In bionic/libc/SYSCALLS.TXT, the prototypes of system call
getresuid/getresgid are incorrect.

According to man page, they should be:
    int getresuid(uid_t *ruid, uid_t *euid, uid_t *suid);
    int getresgid(gid_t *rgid, gid_t *egid, gid_t *sgid);

Change-Id: I676098868bb05a9e1fe45419b234cf397626fdad
Signed-off-by: Jin Wei <wei.a.jin@intel.com>
Signed-off-by: Jack Ren <jack.ren@intel.com>
Signed-off-by: Bruce Beare <bruce.j.beare@intel.com>
2012-04-16 23:45:36 +08:00
Jack Ren
e5bf068147 bionic: fix NULL parameter failure in getcwd()
LTP: getcwd01 failed in LTP

Need to check getcwd parameters, otherwise it will lead to
posix test case to fail.

Change-Id: Ieb673b6dd4ca6481da81c5339dbf7ec0a463f263
Signed-off-by: Jin Wei <wei.a.jin@intel.com>
Signed-off-by: Jack Ren <jack.ren@intel.com>
Signed-off-by: Bruce Beare <bruce.j.beare@intel.com>
2012-04-16 23:35:05 +08:00
The Android Automerger
b5e8d57664 merge in jb-release history after reset to master 2012-04-16 06:59:27 -07:00
Fengwei Yin
ee18fb4aac libstdc++: Fix x86 thread-safe one-time-construction implementation.
The root of the problem is that the existing implementation is based on the
ARM C++ ABI, which mandates a different guard variable layout than the
Itanium/x86 C++ one.

This patch modifies the implementation in a way that satisfies both ABIs (and
doesn't require changing the toolchains).

Change-Id: I885e9adc7f088b9c0a78355bd752f1e6aeec9f07
Signed-off-by: Fengwei Yin <fengwei.yin@intel.com>
Signed-off-by: Jack Ren <jack.ren@intel.com>
Signed-off-by: Bruce Beare <bruce.j.beare@intel.com>
2012-04-16 14:20:30 +08:00
Elliott Hughes
307d1c982d am cebc8fb0: am 6bc18fa5: Merge "libm: fix invalid result of function remquo/remquof"
* commit 'cebc8fb0862a8e1ecd86f9d09b0a3fca0f0781fa':
  libm: fix invalid result of function remquo/remquof
2012-04-13 17:10:06 -07:00
Elliott Hughes
cebc8fb086 am 6bc18fa5: Merge "libm: fix invalid result of function remquo/remquof"
* commit '6bc18fa58849a4307cf6ddcfd526d9258e8175fc':
  libm: fix invalid result of function remquo/remquof
2012-04-13 17:07:43 -07:00
Kenny Root
a401160cee Merge changes I427a1881,I959b6428
* changes:
  Add faccessat to syscall list
  Update unistd.h for new syscalls
2012-04-13 16:03:51 -07:00
Kenny Root
f0ec06ba60 Add faccessat to syscall list
Change-Id: I427a18811089cb280769ac8da3ed8adc00a65a10
2012-04-13 15:45:42 -07:00
Elliott Hughes
6bc18fa588 Merge "libm: fix invalid result of function remquo/remquof" 2012-04-13 14:57:59 -07:00
Kenny Root
e54cc75f59 Update unistd.h for new syscalls
gensyscalls.py run from external/kernel-headers at commit
efab8f3e49f7f36ef0354b0996ecd5f3fa031e52

Change-Id: I959b64280e184655ef8c713aa79f9e23cb1f7df4
2012-04-13 14:50:14 -07:00
Travis Geiselbrecht
8565e21f4d am 0613dce0: regenerate linux/fb.h
* commit '0613dce0a7b806d48758cabfb2d638d0ba4dd2bc':
  regenerate linux/fb.h
2012-04-12 16:09:29 -07:00
Travis Geiselbrecht
0613dce0a7 regenerate linux/fb.h
Change-Id: Icd8c0f53306a48ffd513378abdf387af21e886a3
2012-04-12 14:51:43 -07:00
Evgeniy Stepanov
1a78fbb5c8 Initialize TLS before any application code is run.
Since e19d702b8e, dlsym and friends use recursive mutexes that
require the current thread id, which is not available before the libc
constructor. This prevents us from using dlsym() in .preinit_array.

This change moves TLS initialization from libc constructor to the earliest
possible point - immediately after linker itself is relocated. As a result,
pthread_internal_t for the initial thread is available from the start.

As a bonus, values stored in TLS in .preinit_array are not lost when libc is
initialized.

Change-Id: Iee5a710ee000173bff63e924adeb4a4c600c1e2d
2012-04-13 00:08:11 +04:00
Elliott Hughes
d5099016f7 Merge "Fix segv when unwinding stack past __libc_init." 2012-04-12 11:52:44 -07:00
The Android Automerger
f0a9d98a39 merge in jb-release history after reset to master 2012-04-12 06:59:24 -07:00
Kenny Root
470835b215 Move end of __on_dlclose up
The END macro was put too far down which made the linker complain about
it. Move up to the end of the code.

Change-Id: Ica71a9c6083b437d2213c7cefe34b0083c78f16b
2012-04-11 14:24:28 -07:00
The Android Automerger
85611165ab merge in jb-release history after reset to master 2012-04-11 06:59:29 -07:00
Kenny Root
03273f8fc0 __on_dlclose should be aligned
Marking segments read-only was pushing the alignment of __on_dlclose by
2 bytes making it unaligned. This change makes sure the ARM code is
aligned to the 4 byte boundary.

Bug: 6313309
Change-Id: Ic2bf475e120dd61225ec19e5d8a9a8b1d0b7f081
2012-04-10 17:53:11 -07:00
Nick Kralevich
ad7ff82771 Revert "linker: remove STB_LOCAL hack"
This reverts commit 61ff83475c.

This code is harmless, and only applies to the linker, so
there's no harm in keeping it in the tree a little bit longer.
Let's roll this back while we try to figure out the root cause
of bug 6314858.

Bug: 6314858
Change-Id: I9f5ed81d23a7abe273baf792aa8a0a2839ef094c
2012-04-10 16:08:31 -07:00
Nick Kralevich
7f03d2356f Revert "linker: remove STB_LOCAL hack"
This reverts commit 61ff83475c.

This code is harmless, and only applies to the linker, so
there's no harm in keeping it in the tree a little bit longer.
Let's roll this back while we try to figure out the root cause
of bug 6314858.

Bug: 6314858
Change-Id: I9f5ed81d23a7abe273baf792aa8a0a2839ef094c
2012-04-10 13:49:35 -07:00
The Android Automerger
92cf47c006 merge in jb-release history after reset to master 2012-04-10 06:59:26 -07:00
Evgeniy Stepanov
cd15bacf33 Fix segv when unwinding stack past __libc_init.
This change fixes a segmentation fault in the libc unwinder when it goes
past __libc_init.

Unwind instructions for __libc_init direct it to grab the return address from
the stack frame. Without this change, the unwinder gets a wild address and
looks up further unwind instructions for the routine at that address. If it's
unlucky enough to hit an existing function, it will try to unwind it. Bad
things happen then.

With this change, the return address always points to the _start function,
which does not have unwind instructions associated with it. This stop the
unwind process.

__libc_init never returns, so this does not affect program execution, other
than adding 4 bytes on the main thread stack.

Change-Id: Id58612172e8825c8729cccd081541a13bff96bd0
2012-04-10 16:45:54 +04:00
Jack Ren
bd0383acf8 libm: fix invalid result of function remquo/remquof
Currently we will get the wrong result as follows:
remquof(0x7bb33336, 0x63000000) = -671088640, 0x00000000
remquo(0xbff0000000000003, 0x3ff0000000000003) = 1, 0x8000000000000000
remquo(0x9120000000000001, 0x0000000000000005) = -1288490188, 0x0000000000000004
while the correct one should be:
remquof(0x7bb33336, 0x63000000) = 1476395008, 0x00000000
remquo(0xbff0000000000003, 0x3ff0000000000003) = -1, 0x8000000000000000
remquo(0x9120000000000001, 0x0000000000000005) = -1288490189, 0x0000000000000001

Fixed in this patch.

Change-Id: I540b348cd10a539f3b39b1753945c893c4c7ec46
Signed-off-by: Jingwei Zhang <jingwei.zhang@intel.com>
Signed-off-by: Jin Wei <wei.a.jin@intel.com>
Signed-off-by: Jack Ren <jack.ren@intel.com>
Signed-off-by: Bruce Beare <bruce.j.beare@intel.com>
2012-04-10 12:55:43 +08:00
Nick Kralevich
8777e2f54e Merge "linker: remove STB_LOCAL hack" 2012-04-09 13:41:14 -07:00
Nick Kralevich
61ff83475c linker: remove STB_LOCAL hack
The ARM static linker wasn't properly handling __exidx_start
and __exidx_end symbols. Now that the static linker has been fixed,
we don't need the dynamic linker to work around this problem.

Change-Id: Ic567122b6c7746cc016795e2befba2c6bd7c0478
2012-04-09 12:50:17 -07:00
Jeff Brown
d09f5a2e01 Merge "Update linux/input.h to version 3.4." 2012-04-09 11:24:27 -07:00
The Android Automerger
66929e845d merge in jb-release history after reset to master 2012-04-09 06:59:24 -07:00
Jeff Brown
0fdc190cc0 Update linux/input.h to version 3.4.
Bug: 6292993
Change-Id: Ic7628068df6c8de9cb3711a4540d51365b96ebdb
2012-04-06 19:25:25 -07:00
Dima Zavin
07a387e196 libc/kernel: update cleaned v4l2 header
Change-Id: Ib3747b45eb1e4095cca3de6d7692387953e8c4a7
Signed-off-by: Dima Zavin <dima@android.com>
2012-04-06 14:11:09 -07:00
JP Abgrall
048822d6af Merge "libc/kernel-headers: Auto generated files for netfilter/xt_IDLETIMER" 2012-04-05 20:36:36 -07:00
Ashish Sharma
17ed54ddcf libc/kernel-headers: Auto generated files for netfilter/xt_IDLETIMER
From Change I526b5fce: Add NETLINK_IDLETIMER msg type and include the corresponding header file.

Change-Id: I24bffc11394c8664e4d7d7f439b0600545f07536
Signed-off-by: Ashish Sharma <ashishsharma@google.com>
2012-04-05 19:52:24 -07:00
The Android Automerger
199213bba9 merge in jb-release history after reset to master 2012-04-05 06:59:23 -07:00
Nick Kralevich
8c4f3ce8d0 linker: surround "debug_verbosity" by "#if LINKER_DEBUG"
Avoid executing useless code when we're not compiled
with debugging support.

Change-Id: Iea1821b241acacdf65d1a91d743356058dfef273
2012-04-04 12:43:32 -07:00
Nick Kralevich
3a7ea52f17 linker: enable -fvisibility=hidden
Compile the linker with -fvisibility=hidden. This reduces the number
of symbols that show up in the .dynsym section of the linker.
These symbols are never exported to other applications.

In particular, this fixes a problem with setting -DLINKER_DEBUG=1
introduced in 468319ce4f.
Because the symbols "debug_verbosity" and "format_log" have not been
resolved before the linker links itself, any attempt to call
PRINT / INFO / TRACE / WARN / ERROR will result in a segfault.
This change allows the static linker to produce a relative reference
to these symbols rather than relying on relocation.

This also has a nice side effect of making the linker slightly smaller
and slightly more optimized.

The following symbols no longer in the .dynsym section of the linker
after this change:

-addr_to_name
-call_constructors_recursi
-calloc
-debugger_init
-debugger_signal_handler
-debug_verbosity
-dladdr
-dlclose
-dlerror
-dl_lock
-dlopen
-dlsym
-dl_unwind_find_exidx
-find_containing_library
-find_containing_symbol
-find_library
-format_buffer
-free
-libdl_info
-linker_env_get
-linker_env_init
-linker_env_secure
-linker_env_unset
-linker_get_error
-__linker_init
-lookup
-lookup_in_library
-malloc
-notify_gdb_of_libraries
-notify_gdb_of_load
-notify_gdb_of_unload
-realloc
-rtld_db_dlactivity
-unload_library
-vsnprintf

Bug: 5827809
Change-Id: I5e8cd7dcf48c1d6831a970a67f63f24916c5e437
2012-04-04 11:13:51 -07:00
Mike Lockwood
8aeaa478df Merge remote-tracking branch 'goog/ics-aah' 2012-04-03 11:35:33 -07:00
The Android Automerger
485fc9f4ef merge in jb-release history after reset to master 2012-04-03 03:27:58 -07:00
Elliott Hughes
1302f6936b am fdb11929: am b88f810d: Merge "Update to tzdata2012c."
* commit 'fdb119297ac421e2fc2ec096a6d5370b81938de8':
  Update to tzdata2012c.
2012-04-02 16:09:36 -07:00
Elliott Hughes
fdb119297a am b88f810d: Merge "Update to tzdata2012c."
* commit 'b88f810d585a1736a1759c2c22e9f4999441ae00':
  Update to tzdata2012c.
2012-04-02 16:07:46 -07:00
Elliott Hughes
b88f810d58 Merge "Update to tzdata2012c." 2012-04-02 10:25:43 -07:00
Elliott Hughes
8f78ddb422 Update to tzdata2012c.
From the release notes:

       africa
               Summer time changes for Morocco (to start late April 2012)

       asia
               Changes for 2012 for Gaza & the West Bank (Hebron) and Syria

       northamerica
               Haiti following US/Canada rules for 2012 (and we're assuming,
               for now anyway, for the future).

Also include a change made internally to the 'generate' script as part of
the tzdata2011m update that apparently never made it to AOSP; the original
checkin comment for which was:

    Update to tzdata2011m.

    Fixes for Europe/Tiraspol (Moldova) and all four Ukrainian zones.

    Also show the MD5 of the downloaded data, for comparison against the MD5
    given in the announcement mails. (There's a plan to move to proper signing,
    but that's not implemented on their end yet.)

(I'm repeating the tzdata change for the convenience of anyone grepping the
log, since the 2012 tzdata releases also contain the 2011m changes; 2011m
is the only missing release I noticed.)

Change-Id: I9a2e530b3a8ea88e3375334a12376e3d8526f267
2012-04-02 07:43:15 -07:00
The Android Automerger
b955ffa5b3 merge in jb-release history after reset to master 2012-04-02 06:59:31 -07:00
Elliott Hughes
4e362f230b am cd834618: am 63b14755: Merge "libc/x86: ensure the stack 16-byte aligned when tasks created"
* commit 'cd834618c4752b61d54ff4005a8baa8219b822e4':
  libc/x86: ensure the stack 16-byte aligned when tasks created
2012-03-30 22:16:02 -07:00
Elliott Hughes
cd834618c4 am 63b14755: Merge "libc/x86: ensure the stack 16-byte aligned when tasks created"
* commit '63b14755512d515762cbe3ad8544c561a576f32e':
  libc/x86: ensure the stack 16-byte aligned when tasks created
2012-03-30 15:53:19 -07:00
Elliott Hughes
63b1475551 Merge "libc/x86: ensure the stack 16-byte aligned when tasks created" 2012-03-30 13:42:42 -07:00
Dima Zavin
ddb2f13549 Revert "libc/kernel: Add rules to autogenerate device specific kernel headers"
This reverts commit 884147c7d0.

Change-Id: I09723858ac961f3e1155791aa5c54d5d3abfbd36
Signed-off-by: Dima Zavin <dima@android.com>
2012-03-30 10:21:25 -07:00
The Android Automerger
30c8b110f3 merge in jb-release history after reset to master 2012-03-28 06:59:31 -07:00
Elliott Hughes
8fd682f7f2 am ea76f414: am d509f9cc: am 09ce7749: Merge "[MIPS] Clean Kernel headers are generated by running libc/kernel/tools/update_all.py script. This patch ignores any changes to libc/kernel directory not related to MIPS architecture."
* commit 'ea76f4147825cc39d9aa91230cd863ed29f28e27':
  [MIPS] Clean Kernel headers are generated by running libc/kernel/tools/update_all.py script. This patch ignores any changes to libc/kernel directory not related to MIPS architecture.
2012-03-27 17:58:57 -07:00
Elliott Hughes
ea76f41478 am d509f9cc: am 09ce7749: Merge "[MIPS] Clean Kernel headers are generated by running libc/kernel/tools/update_all.py script. This patch ignores any changes to libc/kernel directory not related to MIPS architecture."
* commit 'd509f9ccbba6e1dd53acfd7425bfc06d6b3f8693':
  [MIPS] Clean Kernel headers are generated by running libc/kernel/tools/update_all.py script. This patch ignores any changes to libc/kernel directory not related to MIPS architecture.
2012-03-27 17:57:41 -07:00
Elliott Hughes
d509f9ccbb am 09ce7749: Merge "[MIPS] Clean Kernel headers are generated by running libc/kernel/tools/update_all.py script. This patch ignores any changes to libc/kernel directory not related to MIPS architecture."
* commit '09ce7749d74733b28d4fa7a1d36457cb366cc5da':
  [MIPS] Clean Kernel headers are generated by running libc/kernel/tools/update_all.py script. This patch ignores any changes to libc/kernel directory not related to MIPS architecture.
2012-03-27 17:53:35 -07:00
Elliott Hughes
09ce7749d7 Merge "[MIPS] Clean Kernel headers are generated by running libc/kernel/tools/update_all.py script. This patch ignores any changes to libc/kernel directory not related to MIPS architecture." 2012-03-27 16:49:29 -07:00
Raghu Gandham
82fa43febc [MIPS] Clean Kernel headers are generated by running
libc/kernel/tools/update_all.py script. This patch ignores
any changes to libc/kernel directory not related to MIPS
architecture.

Change-Id: I2c9e461dccb7c33eb4420be2db1a562f45137c8d
Signed-off-by: Raghu Gandham <raghu@mips.com>
Signed-off-by: Chris Dearman <chris@mips.com>
2012-03-27 11:38:00 -07:00
Jean-Baptiste Queru
32913bf7d9 am b52c941e: am d7c6147e: am 56731351: Merge "bionic: fix atfork hanlder_mutex deadlock"
* commit 'b52c941ed4f24134b78a73daee84bdc328f969da':
  bionic: fix atfork hanlder_mutex deadlock
2012-03-27 10:10:50 -07:00
The Android Automerger
8149d73652 merge in jb-release history after reset to master 2012-03-27 06:59:30 -07:00
Jean-Baptiste Queru
b52c941ed4 am d7c6147e: am 56731351: Merge "bionic: fix atfork hanlder_mutex deadlock"
* commit 'd7c6147eff65572762d55950b965db949ccd0281':
  bionic: fix atfork hanlder_mutex deadlock
2012-03-26 18:29:23 -07:00
Jean-Baptiste Queru
d7c6147eff am 56731351: Merge "bionic: fix atfork hanlder_mutex deadlock"
* commit '56731351de7230180fc99a1a4b0afd12f881b0f7':
  bionic: fix atfork hanlder_mutex deadlock
2012-03-26 18:25:43 -07:00
Benoit Goby
8491327448 Merge "Add auto-generated headers for USB FunctionFS" 2012-03-26 17:14:24 -07:00
Jean-Baptiste Queru
56731351de Merge "bionic: fix atfork hanlder_mutex deadlock" 2012-03-26 16:19:36 -07:00
Jean-Baptiste Queru
faca92f2f1 Handle pthread-related changes (mutex/atfork)
First commit:

Revert "Revert "am be741d47: am 2f460fbe: am 73b5cad9: Merge "bionic: Fix wrong kernel_id in pthread descriptor after fork()"""

This reverts commit 06823da2f0.

Second commit:

bionic: fix atfork hanlder_mutex deadlock

This cherry-picks commit 34e89c232d

After applying the kernel_id fix, the system refused to boot up and we
got following crash log:
I/DEBUG   (  113): pid: 618, tid: 618  >>> org.simalliance.openmobileapi.service:remote <<<
I/DEBUG   (  113): signal 16 (SIGSTKFLT), code -6 (?), fault addr --------
I/DEBUG   (  113):  eax fffffe00  ebx b77de994  ecx 00000080  edx 00724002
I/DEBUG   (  113):  esi 00000000  edi 00004000
I/DEBUG   (  113):  xcs 00000073  xds 0000007b  xes 0000007b  xfs 00000000 xss 0000007b
I/DEBUG   (  113):  eip b7761351  ebp bfdf3de8  esp bfdf3dc4  flags 00000202
I/DEBUG   (  113):     #00  eip: 00015351  /system/lib/libc.so
I/DEBUG   (  113):     #01  eip: 0000d13c  /system/lib/libc.so (pthread_mutex_lock)
I/DEBUG   (  113):     #02  eip: 00077b48  /system/lib/libc.so (__bionic_atfork_run_prepare)
I/DEBUG   (  113):     #03  eip: 00052cdb  /system/lib/libc.so (fork)
I/DEBUG   (  113):     #04  eip: 0009ae91  /system/lib/libdvm.so (_Z18dvmOptimizeDexFileillPKcjjb)
I/DEBUG   (  113):     #05  eip: 000819d6  /system/lib/libdvm.so (_Z14dvmJarFileOpenPKcS0_PP7JarFileb)
I/DEBUG   (  113):     #06  eip: 000b175e  /system/lib/libdvm.so (_ZL40Dalvik_dalvik_system_DexFile_openDexFilePKjP6JValue)
I/DEBUG   (  113):     #07  eip: 0011fb94  /system/lib/libdvm.so

Root cause:
The atfork uses the mutex handler_mutex to protect the atfork_head. The
parent will call __bionic_atfork_run_prepare() to lock the handler_mutex,
and need both the parent and child to unlock their own copy of handler_mutex
after fork. At that time, the owner of hanlder_mutex is set as the parent.
If we apply the kernel_id fix, then the child's kernel_id will be set as
child's tid.
The handler_mutex is a recursive lock, and pthread_mutex_unlock(&hander_mutex)
will fail because the mutex owner is the parent, while the current tid
(__get_thread()->kernel_id) is child, not matched with the mutex owner.
At that time, the handler_mutex is left in lock state.If the child wants to
fork other process after than, then it will try to lock handler_mutex, and
then be deadlocked.

Fix:
Since the child has its own copy of vm space from the the parent, the
child space's handler_mutex should be reset to the initialized state.

Change-Id: I3907dd9a153418fb78862f2aa6d0302c375d9e27
Signed-off-by: Jack Ren <jack.ren@intel.com>
Signed-off-by: Chenyang Du <chenyang.du@intel.com>
Signed-off-by: Bruce Beare <bruce.j.beare@intel.com>

Change-Id: Ic8072f366a877443a60fe215f3c00b3df5a259c8
2012-03-26 15:38:59 -07:00
Benoit Goby
2ab5bfd43f Add auto-generated headers for USB FunctionFS
linux/usb/ch9.h and linux/usb/functionfs.h

Change-Id: I2907081aba63b32740eb9916315759692a96ab42
2012-03-26 15:10:29 -07:00
The Android Automerger
665a2207af merge in jb-release history after reset to master 2012-03-26 06:59:35 -07:00
Andrew Hsieh
126601dd3f Fixed to #include correct 32-bit headers; Refreshed libc/kernel headers
This patch fixes an issue where 64-bit hreaders are incorrectly included
in kernel headers.  For example, file "libc/kernel/arch-x86/asm/io.h"
incorreclty includes "io_64.h" (missing, BTW) instead of "io_32.h".

The reason is because CONFIG_X86_32 isn't considered pre-defined in
"kernel_default_arch_macros" for x86, and clean_header.py doesn't
look at it at all anyway (ie. __i386__ is also ignored, but it's
okay since x86 cross compiler defines it back)

Fixed 2 tools/*py, README.TXT, and refreshed libc/kernel headers

Change-Id: Iac834cc8b3548f055d3f2a214af36072dd679fe8
2012-03-23 23:07:36 +08:00
Jack Ren
cb08204053 libc/x86: ensure the stack 16-byte aligned when tasks created
Currently Renderscript sample code RsBalls crashed on x86 when SSE2
enabled. The root cause is that the stack was not 16-byte aligned
from the beginning when the processes/threads were created, so the
RsBalls crashed when SSE2 instructions tried to access the variables
on the stack.

- For the thread created by fork():
Its stack alignment is determined by crtbegin_{dynamic, static}.S

- For the thread created by pthread_create():
Its stack alignment is determined by clone.S. __thread_entry( ) is
a standard C function. In order to have its stack be aligned with
16 byte properly, __thread_entry() needs the stack with following
layout when it is called:
layout #1 (correct)
--------------
|            |
-------------- <--ESP (ECX - 20)
| ret EIP    |
-------------- <--ECX - 16
| arg0       |
-------------- <--ECX - 12
| arg1       |
-------------- <--ECX - 8
| arg2       |
-------------- <--ECX - 4
| unused     |
-------------- <--ECX (16-byte boundary)

But it has following layout for now:
layout #2: (incorrect)
--------------
|            |
-------------- <--ESP (ECX - 16)
| unused     |
-------------- <--ECX - 12
| arg0       |
-------------- <--ECX - 8
| arg1       |
-------------- <--ECX - 4
| arg2       |
-------------- <--ECX (16-byte boundary)

Fixed in this patch.

Change-Id: Ibe01f64db14be14033c505d854c73033556ddaa8
Signed-off-by: Michael Liao <michael.liao@intel.com>
Signed-off-by: H.J. Lu <hongjiu.lu@intel.com>
Signed-off-by: Jack Ren <jack.ren@intel.com>
Signed-off-by: Bruce Beare <bruce.j.beare@intel.com>
2012-03-23 20:04:04 +08:00
Ben Cheng
eaae81082c Initialize mspace->least_addr properly in the mmap path.
BUG: 6206963
Change-Id: Id2ab580246de50a4511b56a734a7bece98fb945c
2012-03-21 15:47:12 -07:00
Nick Kralevich
891966d020 Merge "string.h: add __attribute__ ((pure)) to string functions" 2012-03-21 14:40:41 -07:00
Iliyan Malchev
1ca0b9d158 Merge "bionic: pass MADV_MERGEABLE on private & anonymous mmaps" 2012-03-21 13:51:42 -07:00
JP Abgrall
16a8fcce9f Merge "Update the libc kernel includes to support the newer mman for KSM support" 2012-03-21 13:43:10 -07:00
JP Abgrall
b8e1e9685e bionic: pass MADV_MERGEABLE on private & anonymous mmaps
Change-Id: I8bc167bb33dec6417fe772172697ea6ff97da2f6
Signed-off-by: Iliyan Malchev <malchev@google.com>
2012-03-21 13:21:33 -07:00
JP Abgrall
2f33c5a8e4 Update the libc kernel includes to support the newer mman for KSM support
These are generated from the matching external/kernel-headers/original
files (from kernel/samsung android-samsung-3.0-wip).

Change-Id: I982ff6a0d522ea250c3a437f5756766fcc6c5c91
2012-03-21 13:21:33 -07:00
Nick Kralevich
f082444291 Merge "fnmatch.c: Update to version in OpenBSD HEAD" 2012-03-21 10:07:55 -07:00
Nick Kralevich
d1860ad8dd fnmatch.c: Update to version in OpenBSD HEAD
Upgrade fnmatch.c from OpenBSD version 1.13 to 1.16.
This is needed primarily to address CVE-2011-0419.

This is a straight copy from upstream's version at
http://www.openbsd.org/cgi-bin/cvsweb/src/lib/libc/gen/fnmatch.c and
incorporates the following changes:

Revision 1.16:
New fnmatch(3) implementation which is not recursive.
Written and provided under BSD licence by William A. Rowe Jr.
Originally released in Apache APR-1.4.5.
Merged class matching code from r1.14 and PATH_MAX check from r1.15.
ok miod millert

Revision 1.15:
Put a limit on recursion during matching, and reject input of size greater
or equal PATH_MAX. Based on similar fix made in NetBSD.
ok miod@ millert@

Revision 1.14:
POSIX character class support for fnmatch(3) and glob(3).  OK deraadt@

Version 1.14 introduced charclasses.h, which we copy unmodified
from upstream version 1.1.
http://www.openbsd.org/cgi-bin/cvsweb/src/lib/libc/gen/charclass.h

Bug: 3435120
Change-Id: I45133468f0c3d439fd10eb087a1c647799f9d25b
2012-03-21 09:53:05 -07:00
Ben Cheng
e80f799d89 Merge "New additions/bug fixes required/found when porting perf." 2012-03-21 09:32:24 -07:00
Nick Kralevich
a677907ee8 string.h: add __attribute__ ((pure)) to string functions
cdefs.h: Introduce the __purefunc attribute, which allows us to mark
certain functions as being "pure".

http://gcc.gnu.org/onlinedocs/gcc/Function-Attributes.html

  Many functions have no effects except the return value and their
  return value depends only on the parameters and/or global variables.
  Such a function can be subject to common subexpression elimination
  and loop optimization just as an arithmetic operator would be.

string.h: Mark many commently used string functions as "pure", to
allow for additional compiler optimizations.

Change-Id: I42961f90f822b6dbcbc3fd72cdbe774a7adc8785
2012-03-21 08:54:54 -07:00
The Android Automerger
9f7df549a2 merge in jb-release history after reset to master 2012-03-21 06:59:50 -07:00
Dima Zavin
884147c7d0 libc/kernel: Add rules to autogenerate device specific kernel headers
This change will automatically post-process kernel headers
specified by device, board, and product. This will allow us
to not check in each kernel header twice, at least for the
device specific headers for now.

Change-Id: I3bb144b6535504b7c26b807daa75de495554356d
Signed-off-by: Dima Zavin <dima@android.com>
2012-03-20 15:28:34 -07:00
Ben Cheng
21eab513e7 New additions/bug fixes required/found when porting perf.
New functions:
	tfind
	tsearch
	tdelete
	twalk
	tdestroy (GNU extension)

Bug fix: the current implementation for realpath would crash
	if the second argument (resolved_path) is NULL.

New headers:
	ar.h
	search.h

Change-Id: Ib6c1e42fc186a6d597a6e5a9692b16acaa155804
2012-03-20 12:54:55 -07:00
Nick Kralevich
aac0dc97a9 Merge "linker: fix off-by-one error in GNU_RELRO handling" 2012-03-20 10:52:42 -07:00
Nick Kralevich
0814eea3ec Merge "linker: initially reserved memory as PROT_NONE" 2012-03-20 10:52:23 -07:00
Nick Kralevich
d73b5cafa0 linker: fix off-by-one error in GNU_RELRO handling
Fix a bug where the GNU_RELRO end address could be exactly
the end of the loadable segment.

Change-Id: If6c43acabc06e9aff9217c0f6016e158b28bb41f
2012-03-20 09:24:58 -07:00
The Android Automerger
6e9e53d15f merge in jb-release history after reset to master 2012-03-19 06:59:35 -07:00
Jack Ren
34e89c232d bionic: fix atfork hanlder_mutex deadlock
After applying the kernel_id fix, the system refused to boot up and we
got following crash log:
I/DEBUG   (  113): pid: 618, tid: 618  >>> org.simalliance.openmobileapi.service:remote <<<
I/DEBUG   (  113): signal 16 (SIGSTKFLT), code -6 (?), fault addr --------
I/DEBUG   (  113):  eax fffffe00  ebx b77de994  ecx 00000080  edx 00724002
I/DEBUG   (  113):  esi 00000000  edi 00004000
I/DEBUG   (  113):  xcs 00000073  xds 0000007b  xes 0000007b  xfs 00000000 xss 0000007b
I/DEBUG   (  113):  eip b7761351  ebp bfdf3de8  esp bfdf3dc4  flags 00000202
I/DEBUG   (  113):     #00  eip: 00015351  /system/lib/libc.so
I/DEBUG   (  113):     #01  eip: 0000d13c  /system/lib/libc.so (pthread_mutex_lock)
I/DEBUG   (  113):     #02  eip: 00077b48  /system/lib/libc.so (__bionic_atfork_run_prepare)
I/DEBUG   (  113):     #03  eip: 00052cdb  /system/lib/libc.so (fork)
I/DEBUG   (  113):     #04  eip: 0009ae91  /system/lib/libdvm.so (_Z18dvmOptimizeDexFileillPKcjjb)
I/DEBUG   (  113):     #05  eip: 000819d6  /system/lib/libdvm.so (_Z14dvmJarFileOpenPKcS0_PP7JarFileb)
I/DEBUG   (  113):     #06  eip: 000b175e  /system/lib/libdvm.so (_ZL40Dalvik_dalvik_system_DexFile_openDexFilePKjP6JValue)
I/DEBUG   (  113):     #07  eip: 0011fb94  /system/lib/libdvm.so

Root cause:
The atfork uses the mutex handler_mutex to protect the atfork_head. The
parent will call __bionic_atfork_run_prepare() to lock the handler_mutex,
and need both the parent and child to unlock their own copy of handler_mutex
after fork. At that time, the owner of hanlder_mutex is set as the parent.
If we apply the kernel_id fix, then the child's kernel_id will be set as
child's tid.
The handler_mutex is a recursive lock, and pthread_mutex_unlock(&hander_mutex)
will fail because the mutex owner is the parent, while the current tid
(__get_thread()->kernel_id) is child, not matched with the mutex owner.
At that time, the handler_mutex is left in lock state.If the child wants to
fork other process after than, then it will try to lock handler_mutex, and
then be deadlocked.

Fix:
Since the child has its own copy of vm space from the the parent, the
child space's handler_mutex should be reset to the initialized state.

Change-Id: I3907dd9a153418fb78862f2aa6d0302c375d9e27
Signed-off-by: Jack Ren <jack.ren@intel.com>
Signed-off-by: Chenyang Du <chenyang.du@intel.com>
Signed-off-by: Bruce Beare <bruce.j.beare@intel.com>
2012-03-17 17:08:54 +08:00
Nick Kralevich
6625986f3a linker: initially reserved memory as PROT_NONE
When the dynamic linker loads a shared library into memory, it
initially allocates a chunk of memory. The memory is then carved
into smaller chunks for each LOAD region, and appropriate memory
protections applied.

Modify the initial memory allocation so that the pages are mapped
as PROT_NONE, rather than PROT_READ / PROT_EXEC. This ensures that
gaps between LOAD regions are not inadvertantly readable / executable.

(Long term, we should munmap() these gaps entirely)

Change-Id: If128a203ccc6fe12dcbbd2bfe0cf13a2045675af
2012-03-16 13:06:12 -07:00
Kenny Root
ad812ef2a4 Add in auto-generated if_alg.h header
Change-Id: I5d0934069e74be2eafecdee43074590124db57a7
2012-03-15 21:59:01 -07:00
The Android Automerger
9bcaf0ea6d merge in jb-release history after reset to master 2012-03-14 06:59:45 -07:00
Ben Cheng
adb6989786 Merge "Update kernel headers and add syscall "perf_event_open"" 2012-03-13 13:04:22 -07:00
Ben Cheng
1a823691a2 Update kernel headers and add syscall "perf_event_open"
Change-Id: I43f12b727881df002a8524f2738586c043833bae
2012-03-13 12:28:40 -07:00
Guang Zhu
06823da2f0 Revert "am be741d47: am 2f460fbe: am 73b5cad9: Merge "bionic: Fix wrong kernel_id in pthread descriptor after fork()""
This reverts commit 76d56cf4a9, reversing
changes made to c59ba4595b.

Bug: 6157577
2012-03-12 22:05:36 -07:00
Elliott Hughes
76d56cf4a9 am be741d47: am 2f460fbe: am 73b5cad9: Merge "bionic: Fix wrong kernel_id in pthread descriptor after fork()"
* commit 'be741d472868a8ffcb455588f18cda889b0f465c':
  bionic: Fix wrong kernel_id in pthread descriptor after fork()
2012-03-12 17:12:35 -07:00
Elliott Hughes
be741d4728 am 2f460fbe: am 73b5cad9: Merge "bionic: Fix wrong kernel_id in pthread descriptor after fork()"
* commit '2f460fbee9abe2936175379c49c6618de7421233':
  bionic: Fix wrong kernel_id in pthread descriptor after fork()
2012-03-12 17:10:46 -07:00
Elliott Hughes
2f460fbee9 am 73b5cad9: Merge "bionic: Fix wrong kernel_id in pthread descriptor after fork()"
* commit '73b5cad989da317cc8089b57ee25f502b1cac71f':
  bionic: Fix wrong kernel_id in pthread descriptor after fork()
2012-03-12 17:06:09 -07:00
Elliott Hughes
73b5cad989 Merge "bionic: Fix wrong kernel_id in pthread descriptor after fork()" 2012-03-12 10:32:02 -07:00
Jack Ren
d8bc6e7119 bionic: Fix wrong kernel_id in pthread descriptor after fork()
After forking, the kernel_id field in the phtread_internal_t returned by pthread_self()
is incorrect --- it's the tid from the parent, not the new tid of the
child.

The root cause is that: currently the kernel_id is set by
_init_thread(), which is called in 2 cases:
(1) called by __libc_init_common(). That happens when the execv( ) is
called after fork( ). But when the zygote tries to fork the android
application, the child application doesn't call execv( ), instread, it
tries to call the Java main method directly.
(2) called by pthread_create(). That happens when a new thread is
created.

For the lead thread which is the thread created by fork(), it should
call execv() but it doesn't, as described in (1) above. So its kernel_id
will inherit the parent's kernel_id.

Fixed it in this patch.

Change-Id: I63513e82af40ec5fe51fbb69456b1843e4bc0fc7
Signed-off-by: Chenyang Du <chenyang.du@intel.com>
Signed-off-by: Jack Ren <jack.ren@intel.com>
Signed-off-by: Bruce Beare <bruce.j.beare@intel.com>
2012-03-12 23:14:56 +08:00
The Android Automerger
26b666b35e merge in jb-release history after reset to master 2012-03-12 06:59:42 -07:00
Robert Greenwalt
c59ba4595b Use new binary code format
3-digits + null.  Old was 3-digits + space + null.

Change-Id: If5fdf9ced073f432ace3a76858025ad651c74e3d
2012-03-09 11:50:46 -08:00
Andy McFadden
ca9a0712b8 Re-throw signals
If we catch a fatal signal that won't automatically re-throw when
the thread resumes, re-throw it manually.  (Common examples are
SIGPIPE and the SIGFPE from integer division by zero.)

Change-Id: I329e6d4db907047c555957b42cbd09c50fc808e7
2012-03-08 11:14:37 -08:00
The Android Automerger
56ae6bdaa1 merge in jb-release history after reset to master 2012-03-08 06:59:22 -08:00
Ben Cheng
654325de02 Update bionic kernel headers using update_all.py
Change-Id: I9c377436e9bf158e7236b3b7dcebf3e79fa961de
2012-03-07 21:13:49 -08:00
Selim Gurun
db6d20be77 Merge "Prevent potential stall on dns proxy operations." 2012-03-07 17:05:15 -08:00
Ben Cheng
36c8c1039f Merge "Revert "Update bionic kernel headers using update_all.py"" 2012-03-07 16:16:10 -08:00
Ben Cheng
4b29af0a1b Revert "Update bionic kernel headers using update_all.py"
This reverts commit 94a85f6636

There is a smoke test failure for Prime but Crespo/Stingray are fine. Will revert the change for now until further investigation is made.
2012-03-07 16:14:53 -08:00
Selim Gurun
06e1831f19 Prevent potential stall on dns proxy operations.
Update wire protocol to return and process error code first.
This will make sure dns proxy operations do not stall when
an internal error happens.
Also fix a compiler warning.
Also fix a potential buffer overflow.
And use correct types (uint32_t) rather than int when reading from network.

Change-Id: I9f99c16d6fd5e9137491a4d1b293a7c78e31b9c3
2012-03-07 15:09:05 -08:00
Ben Cheng
27a5923b24 Merge "Update bionic kernel headers using update_all.py" 2012-03-07 13:57:09 -08:00
Marco Nelissen
e5cf8166dc Merge "Log the thread id and name for fatal signals." 2012-03-07 13:09:36 -08:00
Marco Nelissen
3df3e672f5 Log the thread id and name for fatal signals.
This adds the thread id and name to the "Fatal signal" logging,
making it easier to track down where in process it actually crashed.

Change-Id: I17a365042b2f10b161debe98bc2e7070af055dfb
2012-03-07 12:32:15 -08:00
Ben Cheng
94a85f6636 Update bionic kernel headers using update_all.py
Change-Id: I4da6b23cdbce89445f1ca5d2fadeb23345ce694c
2012-03-07 12:27:59 -08:00
The Android Automerger
151fac68c3 merge in jb-release history after reset to master 2012-03-07 06:59:17 -08:00
Nick Kralevich
d027ffdd7a Merge "Add relro support" 2012-03-06 11:31:59 -08:00
Nick Kralevich
9ec0f03a0d Add relro support
Add support for PT_GNU_RELRO. This allows the static linker to
indicate that certain regions of memory should be marked as
"read-only" after dynamic linking is complete.

See:
  * http://www.akkadia.org/drepper/nonselsec.pdf (section 6)
  * http://tk-blog.blogspot.com/2009/02/relro-not-so-well-known-memory.html

Note that this change has no effect on Android right now, because
we don't compile our code with relro enabled.

Change-Id: I6541f8775367e8558b4388f7d105b1ae6e8f046b
2012-03-05 16:44:42 -08:00
Kenny Root
fa3f72ee53 Revert "Reference __dso_handle in PIC way"
This reverts commit 93cb308137
2012-03-05 11:55:23 -08:00
Kenny Root
4597687335 Merge "Revert "Reference __dso_handle in PIC way"" 2012-03-05 10:46:01 -08:00
Kenny Root
be101bf39a Revert "Reference __dso_handle in PIC way"
This reverts commit 93cb308137
2012-03-05 10:45:31 -08:00
The Android Automerger
fa944c190c merge in jb-release history after reset to master 2012-03-05 06:59:32 -08:00
Kenny Root
1fe109ecf3 Merge "Reference __dso_handle in PIC way" 2012-03-02 16:05:57 -08:00
Kenny Root
93cb308137 Reference __dso_handle in PIC way
Use the same pattern in atexit.S to reference __dso_handle in a way that
doesn't require a TEXTREL flag to be set.

Change-Id: Id69d20863ee203d2b2f7ef0db230f9b548657741
2012-03-02 13:09:36 -08:00
Elliott Hughes
079989259f am 6d074bb7: am 70d1d45f: am a58c88c2: Merge "Upgrade to tzdata2012b."
* commit '6d074bb71a316f73f35f4430a71fa706c46d4b75':
  Upgrade to tzdata2012b.
2012-03-02 11:13:05 -08:00
Elliott Hughes
6d074bb71a am 70d1d45f: am a58c88c2: Merge "Upgrade to tzdata2012b."
* commit '70d1d45f0ecaee262627a6ca323fc2b4fe3e9024':
  Upgrade to tzdata2012b.
2012-03-02 11:10:43 -08:00
Elliott Hughes
70d1d45f0e am a58c88c2: Merge "Upgrade to tzdata2012b."
* commit 'a58c88c235bfeeb17ac495991e66f7b906935852':
  Upgrade to tzdata2012b.
2012-03-02 11:07:03 -08:00
Elliott Hughes
da16ad11fe am a2b1bbc9: am a480cf93: resolved conflicts for merge of cfe535ef to stage-aosp-master
* commit 'a2b1bbc9a605819eb5ecd1df61d4f2a79f1a8f92':
  Upgrade to tzdata2011a.
2012-03-02 10:49:45 -08:00
Elliott Hughes
a2b1bbc9a6 am a480cf93: resolved conflicts for merge of cfe535ef to stage-aosp-master
* commit 'a480cf930f31ab404e7efe66259427a53d72fa2b':
  Upgrade to tzdata2011a.
2012-03-02 10:47:23 -08:00
Elliott Hughes
a480cf930f resolved conflicts for merge of cfe535ef to stage-aosp-master
Change-Id: I21a1dd41503518e75892180c14f1ce79102772ad
2012-03-02 10:11:18 -08:00
Elliott Hughes
a58c88c235 Merge "Upgrade to tzdata2012b." 2012-03-02 00:09:04 -08:00
Elliott Hughes
dd8e4045e7 Upgrade to tzdata2012b.
Summer time in Cuba has been delayed 3 weeks (now starts April 1 rather
than March 11). Since March 11 (the old start date, as listed in 2012a)
is just a little over a week away, this change is urgent.

Change-Id: Iadf4dc30072bdac0bcd0ad4b9e076a9ca071efbe
2012-03-01 23:34:11 -08:00
Elliott Hughes
cfe535ef9f Merge "Upgrade to tzdata2011a." 2012-03-01 23:32:15 -08:00
Jean-Baptiste Queru
3690bcb217 am cff86bdc: am 018c27ed: am 25f2d1f0: Merge "update stddef.h"
* commit 'cff86bdc02f70bb5758234ace75a2f84a626cc3c':
  update stddef.h
2012-03-01 15:35:45 -08:00
Jean-Baptiste Queru
4053f8530d am 568ee0d1: am 51d22d7e: am afab5a70: Merge "Eliminate duplicate constants"
* commit '568ee0d135c23c5a49fb4f93de01999b76523428':
  Eliminate duplicate constants
2012-03-01 15:35:44 -08:00
Jean-Baptiste Queru
446a772bc4 am dc755140: (-s ours) am 7c38f53d: am 7f28e0b4: Merge "Clean up the remnants of SuperH support"
* commit 'dc755140c11bb0ff64f7c3d224dd5588fc643485':
  Clean up the remnants of SuperH support
2012-03-01 15:35:20 -08:00
Elliott Hughes
69ea1c03e0 Upgrade to tzdata2011a.
From the notes:

       Chile 2011/2012 and 2012/2013 summer time date adjustments.
       Falkland Islands onto permanent summer time (we're assuming for the
               foreseeable future, though 2012 is all we're fairly certain of.)
       Armenia has abolished Summer Time.
       Tokelau jumped the International Date Line back last December
               (just the same as their near neighbour, Samoa).
       America/Creston is a new zone for a small area of British Columbia
       There will be a leapsecod 2012-06-30 23:59:60 UTC.

Change-Id: I1d66edf8d33fd1dbcf21178def91844025fd9047
2012-03-01 09:38:31 -08:00
The Android Automerger
73c88b70b2 merge in jb-release history after reset to master 2012-03-01 06:59:21 -08:00
Jean-Baptiste Queru
cff86bdc02 am 018c27ed: am 25f2d1f0: Merge "update stddef.h"
* commit '018c27eda89b54e59e6c043ea2986c6e39ec2ee0':
  update stddef.h
2012-02-29 19:12:17 -08:00
Jean-Baptiste Queru
568ee0d135 am 51d22d7e: am afab5a70: Merge "Eliminate duplicate constants"
* commit '51d22d7ea92e77f47accee59c99cb8157bf29fcb':
  Eliminate duplicate constants
2012-02-29 19:12:16 -08:00
Jean-Baptiste Queru
018c27eda8 am 25f2d1f0: Merge "update stddef.h"
* commit '25f2d1f0c3c7802af0d4d1e2bbd3bf95a7e0970b':
  update stddef.h
2012-02-29 19:08:50 -08:00
Jean-Baptiste Queru
51d22d7ea9 am afab5a70: Merge "Eliminate duplicate constants"
* commit 'afab5a703d30df613848cb30ab3ecceafd76102b':
  Eliminate duplicate constants
2012-02-29 19:08:49 -08:00
Jean-Baptiste Queru
25f2d1f0c3 Merge "update stddef.h" 2012-02-29 18:59:16 -08:00
Jean-Baptiste Queru
afab5a703d Merge "Eliminate duplicate constants" 2012-02-29 18:58:53 -08:00
Nick Kralevich
53d161a2bc update stddef.h
Pull in an updated version of stddef.h from the linux kernel.
Pulled from upstream kernel at 891003abb0db6bfffd61b76ad0ed39bb7c3db8e1

This file was generated using the following command:

cd bionic/libc/kernel/
./tools/clean_header.py -u ../../../external/kernel-headers/original/linux/stddef.h

Change-Id: I6c29f3fa100c5368da41d0f0da39bc50fa668e9d
2012-02-29 18:43:55 -08:00
Nick Kralevich
9921947e6f Eliminate duplicate constants
include/elf.h contains basically the same values as
linux/auxvec.h. Eliminate dups.

include/sys/exec_elf.h contains basically the same
values as linux/elf.h. Eliminate dups.

Change-Id: I66b8358161bb52223bb657f8f73ba28b324f4fa3
2012-02-29 18:43:51 -08:00
Jean-Baptiste Queru
dc755140c1 am 7c38f53d: am 7f28e0b4: Merge "Clean up the remnants of SuperH support"
* commit '7c38f53d1911e04acf6398921a7bd4444d585c2b':
  Clean up the remnants of SuperH support
2012-02-29 15:43:24 -08:00
Jean-Baptiste Queru
7c38f53d19 am 7f28e0b4: Merge "Clean up the remnants of SuperH support"
* commit '7f28e0b4501de7c4f8f627fd3e4be323d737ae82':
  Clean up the remnants of SuperH support
2012-02-29 15:38:55 -08:00
Jean-Baptiste Queru
7f28e0b450 Merge "Clean up the remnants of SuperH support" 2012-02-29 14:39:42 -08:00
Nick Kralevich
86addd65ab Merge "Eliminate duplicate constants" 2012-02-29 13:30:48 -08:00
Nick Kralevich
67e7a93844 Eliminate duplicate constants
include/elf.h contains basically the same values as
linux/auxvec.h. Eliminate dups.

include/sys/exec_elf.h contains basically the same
values as linux/elf.h. Eliminate dups.

Change-Id: I66b8358161bb52223bb657f8f73ba28b324f4fa3
2012-02-29 11:21:53 -08:00
Andrew Hsieh
4fc1273459 Merge "Trivial fix in comment" 2012-02-29 09:40:49 -08:00
The Android Automerger
16310b5582 merge in jb-release history after reset to master 2012-02-29 06:59:21 -08:00
Nick Kralevich
d638a500e9 Merge "update stddef.h" 2012-02-28 14:39:12 -08:00
Nick Kralevich
ec37237d69 update stddef.h
Pull in an updated version of stddef.h from the linux kernel.
Pulled from upstream kernel at 891003abb0db6bfffd61b76ad0ed39bb7c3db8e1

This file was generated using the following command:

cd bionic/libc/kernel/
./tools/clean_header.py -u ../../../external/kernel-headers/original/linux/stddef.h

Change-Id: I6c29f3fa100c5368da41d0f0da39bc50fa668e9d
2012-02-28 14:04:57 -08:00
Jean-Baptiste Queru
a1d3e0d8eb am 2e236c13: am 17edd38f: am 9c9b0fc7: Merge "libm: cherry-pick one patch from freebsd to fix logb() denormals issue"
* commit '2e236c132fe38e52d8a52d264cca5c520d778c98':
  libm: cherry-pick one patch from freebsd to fix logb() denormals issue
2012-02-28 13:55:51 -08:00
Jean-Baptiste Queru
2e236c132f am 17edd38f: am 9c9b0fc7: Merge "libm: cherry-pick one patch from freebsd to fix logb() denormals issue"
* commit '17edd38f03300af28c89f9031dad177af8232c3a':
  libm: cherry-pick one patch from freebsd to fix logb() denormals issue
2012-02-28 13:53:14 -08:00
Jean-Baptiste Queru
17edd38f03 am 9c9b0fc7: Merge "libm: cherry-pick one patch from freebsd to fix logb() denormals issue"
* commit '9c9b0fc7e1dff39baa8cdf2536be9776aa4af766':
  libm: cherry-pick one patch from freebsd to fix logb() denormals issue
2012-02-28 13:28:30 -08:00
Jean-Baptiste Queru
9c9b0fc7e1 Merge "libm: cherry-pick one patch from freebsd to fix logb() denormals issue" 2012-02-28 09:44:41 -08:00
Jack Ren
1fa7b45df8 libm: cherry-pick one patch from freebsd to fix logb() denormals issue
from http://svnweb.freebsd.org/base?view=revision&revision=176101
"
Oops, fix the fix in rev.1.10.  logb() and logbf() were broken on
 denormals, and logb() remained broken after 1.10 because the fix for
 logbf() was incompletely translated.

Convert to __FBSDID().
"

Change-Id: I54f33648db7c421b06eee1ea8e63c57a179fae0d
Signed-off-by: Jack Ren <jack.ren@intel.com>
Signed-off-by: Jin Wei <wei.a.jin@intel.com>
Signed-off-by: Bruce Beare <bruce.j.beare@intel.com>
2012-02-28 12:28:05 +08:00
The Android Automerger
fcf16907c7 merge in jb-release history after reset to master 2012-02-27 06:59:29 -08:00
Kenny Root
93b8f941f2 Revert "Use the new NativeDaemonConnector style."
The other changes relating to this were already reverted.

This reverts commit 1625c7a837
2012-02-25 10:39:07 -08:00
Dima Zavin
906dbea2b4 libc: Add __aeabi_llsl and __aeabi_llsr to libgcc_compat
Some platform libraries built for ICS do not work with master
because of some refactoring in frameworks/base.

Make sure that these libgcc symbols are always present in our libc

Change-Id: Ib8d345878be0ba711f051082a778f5cc1f1b3a19
Signed-off-by: Dima Zavin <dima@android.com>
2012-02-24 11:38:07 -08:00
Kenny Root
83c366cf09 Merge "Revert "Use the new NativeDaemonConnector style."" 2012-02-24 11:04:56 -08:00
Kenny Root
1fb6662d1a Revert "Use the new NativeDaemonConnector style."
The other changes relating to this were already reverted.

This reverts commit 1625c7a837
2012-02-24 11:04:42 -08:00
Jean-Baptiste Queru
7dbbfac0fc am 5d8fd2a0: am a71aefc6: am d041bf20: Merge "bionic/x86: fix one potential deadlock in __set_tls()"
* commit '5d8fd2a0bc059cd07405a372c98617829f8ac378':
  bionic/x86: fix one potential deadlock in __set_tls()
2012-02-23 12:34:02 -08:00
Jean-Baptiste Queru
5d8fd2a0bc am a71aefc6: am d041bf20: Merge "bionic/x86: fix one potential deadlock in __set_tls()"
* commit 'a71aefc66f6d4bf1302e0ce5c321aff1a2c769d1':
  bionic/x86: fix one potential deadlock in __set_tls()
2012-02-23 12:32:37 -08:00
Jean-Baptiste Queru
a71aefc66f am d041bf20: Merge "bionic/x86: fix one potential deadlock in __set_tls()"
* commit 'd041bf2095f5f133c87f7ba632a8dfb39537a437':
  bionic/x86: fix one potential deadlock in __set_tls()
2012-02-23 12:29:10 -08:00
Jean-Baptiste Queru
76ab561b4d am 49a05c06: am 62daffe1: am f9c5afb1: Merge "Redesign dlopen() locks to be recursive per thread."
* commit '49a05c060acd4d3e17b2819f00a694271bf40977':
  Redesign dlopen() locks to be recursive per thread.
2012-02-23 11:20:49 -08:00
Jean-Baptiste Queru
d041bf2095 Merge "bionic/x86: fix one potential deadlock in __set_tls()" 2012-02-23 08:43:30 -08:00
Jin Wei
c5393b23f6 bionic/x86: fix one potential deadlock in __set_tls()
Fix bug:
Currently the mutex lock _tls_desc_lock is not released
when __set_thread_area() fails. That will leads to the deadlock
when __set_tls( ) is called later on.

Change-Id: Iea3267cb0659971cba7766cbc3346f6924274f86
Signed-off-by: Jin Wei <wei.a.jin@intel.com>
Signed-off-by: Jack Ren <jack.ren@intel.com>
Signed-off-by: Bruce Beare <bruce.j.beare@intel.com>
2012-02-23 17:37:58 +08:00
Dima Zavin
f1a17e762b libc: Add __aeabi_llsl and __aeabi_llsr to libgcc_compat
Some platform libraries built for ICS do not work with master
because of some refactoring in frameworks/base.

Make sure that these libgcc symbols are always present in our libc

Change-Id: Ib8d345878be0ba711f051082a778f5cc1f1b3a19
Signed-off-by: Dima Zavin <dima@android.com>
2012-02-22 15:18:56 -08:00
Jean-Baptiste Queru
49a05c060a am 62daffe1: am f9c5afb1: Merge "Redesign dlopen() locks to be recursive per thread."
* commit '62daffe147e8810ce48a897df46b0b3db95ebaa3':
  Redesign dlopen() locks to be recursive per thread.
2012-02-22 09:58:17 -08:00
Jean-Baptiste Queru
62daffe147 am f9c5afb1: Merge "Redesign dlopen() locks to be recursive per thread."
* commit 'f9c5afb1f9d8e615ab98774a10bbf117962db66d':
  Redesign dlopen() locks to be recursive per thread.
2012-02-22 09:54:52 -08:00
Jean-Baptiste Queru
f9c5afb1f9 Merge "Redesign dlopen() locks to be recursive per thread." 2012-02-22 09:30:53 -08:00
Andrew Hsieh
58b2c1616b Trivial fix in comment
Very, very trivial fix for minor typo in comment about how it works

Change-Id: Ia08d332366837dec8f7e91b9728732c5edea223e
2012-02-21 15:09:32 -08:00
Pavel Chupin
e19d702b8e Redesign dlopen() locks to be recursive per thread.
That is to fix the bug:
dlxxx functions can't be called recursively.
For example, if we use dlopen() to use open one library whose constructor
also calls dlopen() in order to open another library, then the thread is
dead-blocked.

By changing the dl_lock from a non-recursive lock to a recursive lock, we can
prevent the thread from dead-blocked by recursive dlxxx calls in the same
thread context.

Change-Id: I1018b41c82f4641cc009c0a2eda31f5a47a534f9
Signed-off-by: Pavel Chupin <pavel.v.chupin@intel.com>
Signed-off-by: Jack Ren <jack.ren@intel.com>
Signed-off-by: Bruce Beare <bruce.j.beare@intel.com>
2012-02-21 14:57:26 -08:00
The Android Automerger
f351ae488b merge in jb-release history after reset to master 2012-02-14 06:59:28 -08:00
Jean-Baptiste Queru
d6b58b03b8 am 09049311: am cfff36df: am a60ff6c5: Merge "libc: Define new symbol visibility macros"
* commit '09049311a229c427f73e3e0ac873bf344b45aaf2':
  libc: Define new symbol visibility macros
2012-02-13 14:42:48 -08:00
Jean-Baptiste Queru
09049311a2 am cfff36df: am a60ff6c5: Merge "libc: Define new symbol visibility macros"
* commit 'cfff36df2bebd95f2663b7b053c6308593c343dd':
  libc: Define new symbol visibility macros
2012-02-13 14:39:52 -08:00
Jean-Baptiste Queru
cfff36df2b am a60ff6c5: Merge "libc: Define new symbol visibility macros"
* commit 'a60ff6c5b2ca76181b387d8c10aee22a2cbcf840':
  libc: Define new symbol visibility macros
2012-02-13 14:25:53 -08:00
Jean-Baptiste Queru
a60ff6c5b2 Merge "libc: Define new symbol visibility macros" 2012-02-13 14:23:13 -08:00
The Android Automerger
8f627eec55 merge in jb-release history after reset to master 2012-02-13 08:56:04 -08:00
Glenn Kasten
32c226d6ed Merge "Allow C++ to call fdprintf" 2012-02-10 13:45:49 -08:00
Dianne Hackborn
058d6d88b9 Update bionic to know users and isolated uids for uid string representation.
Change-Id: I6681bacd69299a7f9837ef8025a80c5562081bad
2012-02-09 16:14:28 -08:00
Raghu Gandham
b69060f1ae Clean up the remnants of SuperH support 2012-02-09 15:58:46 -08:00
Glenn Kasten
f39a3fe67d Allow C++ to call fdprintf
Change-Id: I1adb7b165ab9f62eaee4e7a9108e8b461350b347
2012-02-09 10:15:45 -08:00
The Android Automerger
bec678c5a7 merge in jb-release history after reset to master 2012-02-08 06:59:26 -08:00
Robert Greenwalt
1625c7a837 Use the new NativeDaemonConnector style.
Prepend a 0 to match the new sequence-number style, though this module
doesn't really need/use it.

bug:5864209
Change-Id: Iacbcddaced6fe8bb01d186596a916e4fb4805fef
2012-02-07 11:53:55 -08:00
The Android Automerger
a7bd1bf276 merge in jb-release history after reset to master 2012-02-02 06:59:19 -08:00
David 'Digit' Turner
9db064a0d3 am 5d7181a7: am 68fc85ff: am 177a7706: linker: fix x86 build
* commit '5d7181a71c0b066fe6c19b9c5906bd694a399a59':
  linker: fix x86 build
2012-02-01 11:24:29 -08:00
David 'Digit' Turner
5d7181a71c am 68fc85ff: am 177a7706: linker: fix x86 build
* commit '68fc85ffc05aca5cc187676bd1502c3c446046d9':
  linker: fix x86 build
2012-02-01 11:22:07 -08:00
David 'Digit' Turner
68fc85ffc0 am 177a7706: linker: fix x86 build
* commit '177a77067b6d3326dbcf88fd93d0664e48e27f9f':
  linker: fix x86 build
2012-02-01 11:18:06 -08:00
David 'Digit' Turner
177a77067b linker: fix x86 build
Change-Id: I47d76a0f50515013c37ccef89accba03cc69529d
2012-02-01 10:47:04 -08:00
The Android Open Source Project
0245c426ee am 09d695d7: am 44eae4c7: Reconcile with ics-mr1-release
* commit '09d695d782007f45504841c1535e53ccf2059a68':
2012-02-01 10:03:20 -08:00
The Android Open Source Project
09d695d782 am 44eae4c7: Reconcile with ics-mr1-release
* commit '44eae4c7af901e521e2e880a8300b285bbf53010':
2012-02-01 10:00:28 -08:00
Jean-Baptiste Queru
25b7a16a6e Merge c4cb87f3
Change-Id: I4cc14eba43fde75a7702fdc7ad07d3d949e9c092
2012-02-01 09:46:08 -08:00
The Android Open Source Project
44eae4c7af Reconcile with ics-mr1-release
Change-Id: I37e2eb5cd34a47e3eb7b2bf2353b50fc14972adf
2012-02-01 08:49:24 -08:00
Jean-Baptiste Queru
c4cb87f367 Merge 5b892aa7
Change-Id: Ic82bc2866bdb0c93822c94281301fa127fd4bb0c
2012-02-01 07:12:13 -08:00
The Android Automerger
a43debbc43 merge in jb-release history after reset to master 2012-02-01 06:59:19 -08:00
David 'Digit' Turner
5fbf2e0992 libc: Define new symbol visibility macros
This patch defines a few new macros that can be used to control the
visibility of symbols exported by the C library:

- ENTRY_PRIVATE() can be used in assembly sources to indicate
  that an assembler function should have "hidden" visibility, i.e.
  will never be exported by the C library's shared library.

  This is the equivalent of using __LIBC_HIDDEN__ for a C function,
  but ENTRY_PRIVATE() works like ENTRY(), and must be used with
  END() to tag the end of the function.

- __LIBC_ABI_PUBLIC__ can be used to tag a C functions as being
  part of the C library's public ABI. This is important for a
  few functions that must be exposed by the NDK to maintain
  binary compatibility.

  Once a symbol has been tagged with this macro, it shall
  *never* be removed from the library, even if it becomes
  directly unused due to implementation changes
  (e.g. __is_threaded).

- __LIBC_ABI_PRIVATE__ can be used for C functions that should
  always be exported by the C library because they are used by
  other libraries in the platform, but should not be exposed
  by the NDK. It is possible to remove such symbols from the
  implementation if all callers are also modified.

+ Add missing END() assembly macro for x86

Change-Id: Ia96236ea0dbec41d57bea634b39d246b30e5e234
2012-01-31 22:19:09 +01:00
Jean-Baptiste Queru
5b892aa7e5 Merge "remove obsolete SuperH support" 2012-01-31 12:44:01 -08:00
David 'Digit' Turner
70b1668a76 remove obsolete SuperH support
We don't have a toolchain anymore, we don't have working original
kernel headers, and nobody is maintaining this so there is really
no point in keeping this here. Details of the patch:

- removed code paths from Android.mk files related to the SuperH
  architecture ("sh")

- removed libc/arch-sh, linker/arch-sh, libc/kernel/arch-sh

- simplified libc/SYSCALLS.TXT

- simplified the scripts in libc/tools/ and libc/kernel/tools

Change-Id: I26b0e1422bdc347489e4573e2fbec0e402f75560

Signed-off-by: David 'Digit' Turner <digit@android.com>
2012-01-31 20:28:23 +01:00
David 'Digit' Turner
b118b9c5cd Merge "libc: remove global lock from recursive mutex implementation." 2012-01-31 11:02:33 -08:00
Jeff Brown
a7ad339910 Merge "Add new suspend-block input ioctls." 2012-01-31 10:05:35 -08:00
The Android Automerger
3350468499 merge in jb-release history after reset to master 2012-01-31 06:59:17 -08:00
Jesse Hall
f5d1693e3c Fix recursive ELF constructor check
The flag to avoid calling ELF constructors recursively (in the case
of recursive .so dependencies) was being set after the dangerous
recursive constructor call had already been made.

This fixes the libc's debug malloc implementation.

Change-Id: I5e601f0ea19ab1df81b8b1ad4df25c3eab0ccda4
2012-01-30 15:39:57 -08:00
The Android Automerger
a0b800aba9 merge in jb-release history after reset to master 2012-01-30 06:59:27 -08:00
David 'Digit' Turner
e1414aa96b libc: remove global lock from recursive mutex implementation.
This optimization improves the performance of recursive locks
drastically. When running the thread_stress program on a Xoom,
the total time to perform all operations goes from 1500 ms to
500 ms on average after this change is pushed to the device.

Change-Id: I5d9407a9191bdefdaccff7e7edefc096ebba9a9d
2012-01-30 10:13:41 +01:00
Jean-Baptiste Queru
632c07c092 am cc12c74f: am e8004445: Merge "Make sure __u64 is defined even for strict ansi or -std=c99"
* commit 'cc12c74f7f65c571778989cd902eb5b9fa74fb11':
  Make sure __u64 is defined even for strict ansi or -std=c99
2012-01-27 21:09:07 -08:00
Jean-Baptiste Queru
cc12c74f7f am e8004445: Merge "Make sure __u64 is defined even for strict ansi or -std=c99"
* commit 'e80044455961005ac95e405c8d553f2418d8e50c':
  Make sure __u64 is defined even for strict ansi or -std=c99
2012-01-27 07:41:43 -08:00
Jean-Baptiste Queru
e800444559 Merge "Make sure __u64 is defined even for strict ansi or -std=c99" 2012-01-27 07:31:10 -08:00
Robert Greenwalt
514126b2b5 Merge "Increase the size of the system-wide dns cache" 2012-01-26 14:51:08 -08:00
Andy McFadden
1fc51769de Log debuggerd connection failures
Write a message to the log file if the signal handler is not able
to connect to debuggerd.  This is especially handy if the failure
was caused by running out of file descriptors, since there's some
chance that the lack of fds relates to the crash.

Sample:

 F libc    : Fatal signal 11 (SIGSEGV) at 0xdeadbaad (code=1)
 F libc    : Unable to open connection to debuggerd: Too many open files

Bug 5926330

Change-Id: I0ff210d82ab1db39b08f328bae5e08f67a69e5d7
2012-01-26 13:40:38 -08:00
The Android Automerger
056daf6a1c merge in jb-release history after reset to master 2012-01-25 15:49:01 -08:00
Robert Greenwalt
52764f5546 Increase the size of the system-wide dns cache
32 enteries perhaps was ok for per-process caching with ipv4 only
but adding ipv6 records makes it effectively 16 entries and making
it system wide makes is pretty useless.  Increasing to 640 entries.

bug:5841178
Change-Id: I879f8bf4d3c4d8c1708bb46d46a67c1f64b1861f
2012-01-25 15:36:58 -08:00
Martin Storsjo
738b175a93 Make sure __u64 is defined even for strict ansi or -std=c99
The x86 asm headers define __u64 regardless of __STRICT_ANSI__.
The linux/videodev2.h header requires __u64 to be defined, thus
this fixes compiling with -std=c99 when including the
linux/videodev2.h header.

In glibc, the asm/types.h header defines __u64 regardless of
__STRICT_ANSI__.

This is the change for the generated arch-arm/asm/types.h
header, as produced by the update_all.py script (without all
the other unrelated changes that the script produces).

FWIW, the same issue also is present in
arch-sh/asm/types.h, but there are no source headers for
arch-sh in external/kernel-headers (and regenerating the
headers simply removes that file).

Change-Id: If05fcc9ed6ff5943602be121c7be140116e361fe
2012-01-25 23:41:19 +02:00
Jean-Baptiste Queru
8584a922dc am 482d59a4: am e22dfc46: Merge "execvp: bcopy() is deprecated. Use memcpy() instead"
* commit '482d59a42f6c81e3a142ffbf23c67a903836f203':
  execvp: bcopy() is deprecated. Use memcpy() instead
2012-01-25 08:57:30 -08:00
The Android Automerger
7cad7230ff merge in ics-release history after reset to master 2012-01-25 06:59:13 -08:00
Jean-Baptiste Queru
482d59a42f am e22dfc46: Merge "execvp: bcopy() is deprecated. Use memcpy() instead"
* commit 'e22dfc46b763e9b0c6300b7068609d2db60a9b2c':
  execvp: bcopy() is deprecated. Use memcpy() instead
2012-01-24 15:07:56 -08:00
Jean-Baptiste Queru
e22dfc46b7 Merge "execvp: bcopy() is deprecated. Use memcpy() instead" 2012-01-24 14:26:36 -08:00
David 'Digit' Turner
b70659d8ea Merge "libc: Fix recursive mutex lock implementation." 2012-01-24 09:28:29 -08:00
David 'Digit' Turner
b57db7581c libc: Fix recursive mutex lock implementation.
This fixes a bug that was introduced in the latest pthread optimization.
It happens when a recursive lock is contented by several threads. The main
issue was that the atomic counter increment in _recursive_increment() could
be annihilated by a non-conditional write in pthread_mutex_lock() used to
update the value's lower bits to indicate contention.

This patch re-introduces the use of the global recursive lock in
_recursive_increment(). This will hit performance, but a future patch
will be provided to remove it from the source code.

Change-Id: Ie22069d376cebf2e7d613ba00b6871567f333544
2012-01-24 13:20:38 +01:00
The Android Automerger
70f0e9d86d merge in ics-release history after reset to master 2012-01-23 06:59:19 -08:00
Jean-Baptiste Queru
f20d59e691 am c83c1da5: am cee8425f: Merge "Move variable declaration on its own line"
* commit 'c83c1da54831ef1c9ff59cf9df8d5c0173893ee5':
  Move variable declaration on its own line
2012-01-20 17:23:52 -08:00
Jean-Baptiste Queru
c3650d6a4b am 5b44655f: am 7e6a5773: Merge "Use the AT_SECURE auxv flag to determine whether to enable secure mode."
* commit '5b44655f22dd05c7cd8afcd218102616a6f5f4da':
  Use the AT_SECURE auxv flag to determine whether to enable secure mode.
2012-01-20 17:23:51 -08:00
Jean-Baptiste Queru
73fa5fdaf9 Merge 2f80f07d
Change-Id: Iff51b8530dbee01499ba4af0ecd6ab837c8c94fb
2012-01-20 16:47:01 -08:00
The Android Open Source Project
d8545e2690 am 8eb948d8: Reconcile with ics-mr1-release
* commit '8eb948d8c8b66d8442a45d398db4e970fb3bf68b':
2012-01-20 15:52:14 -08:00
Elliott Hughes
4a1f3cb4eb am dac52ff9: am e8e1efea: Update to tzdata2011n.
* commit 'dac52ff9f5591afda2b8c2a3d41aa08d7cab179e':
  Update to tzdata2011n.
2012-01-20 15:48:16 -08:00
Jean-Baptiste Queru
c83c1da548 am cee8425f: Merge "Move variable declaration on its own line"
* commit 'cee8425f22cfe268614c7bb47b2f5874ac6a0e4b':
  Move variable declaration on its own line
2012-01-20 11:54:49 -08:00
Jean-Baptiste Queru
5b44655f22 am 7e6a5773: Merge "Use the AT_SECURE auxv flag to determine whether to enable secure mode."
* commit '7e6a5773133e4b65d678535418b1f5d594859da2':
  Use the AT_SECURE auxv flag to determine whether to enable secure mode.
2012-01-20 11:54:48 -08:00
Jean-Baptiste Queru
2f80f07d81 am 23f56bbb: Merge "Add extended attribute (xattr) system call wrappers to bionic."
* commit '23f56bbb6ae053996dd821f29379aea0c7166055':
  Add extended attribute (xattr) system call wrappers to bionic.
2012-01-20 11:54:47 -08:00
Jean-Baptiste Queru
cee8425f22 Merge "Move variable declaration on its own line" 2012-01-20 11:07:41 -08:00
Stephen Smalley
bb44055d0a Move variable declaration on its own line
Change-Id: Ied54ffabccdc867ea4e124a0f0324a217270d6e7
2012-01-20 10:59:15 -08:00
Jean-Baptiste Queru
7e6a577313 Merge "Use the AT_SECURE auxv flag to determine whether to enable secure mode." 2012-01-20 10:43:19 -08:00
Stephen Smalley
861b42a2d8 Use the AT_SECURE auxv flag to determine whether to enable secure mode.
The Linux kernel provides an AT_SECURE auxv flag to inform userspace
whether or not a security transition has occurred.  This is more reliable
than directly checking the uid/gid against the euid/egid, because it covers
not only setuid/setgid but also file capabilities, SELinux, and AppArmor
security transitions.  It is also a more efficient test since it does
not require any additional system calls.

Change-Id: I9752a4f6da452273258d2876d13b05e402fb0409
2012-01-20 13:35:57 -05:00
Jean-Baptiste Queru
23f56bbb6a Merge "Add extended attribute (xattr) system call wrappers to bionic." 2012-01-20 10:29:22 -08:00
Jeff Brown
3452e301ec Add new suspend-block input ioctls.
Change-Id: I8cfd63d22ecf8e08f261eb576d6ea448f396f709
2012-01-19 14:27:30 -08:00
The Android Open Source Project
8eb948d8c8 Reconcile with ics-mr1-release
Change-Id: Iece5fc7cf15320addfda3f143235664e2ef3083d
2012-01-19 13:06:24 -08:00
The Android Automerger
cd24e61e57 merge in ics-release history after reset to master 2012-01-19 06:59:13 -08:00
David 'Digit' Turner
79fcc6948d Merge "libc: remove private declarations from <time.h> and <resolv.h>" 2012-01-19 04:15:38 -08:00
The Android Automerger
3d11bf0f3f merge in ics-mr1-release history after reset to ics-mr1 2012-01-18 21:16:26 -08:00
Elliott Hughes
de3c594723 am e8e1efea: Update to tzdata2011n.
* commit 'e8e1efeafb8754ea8358e78cfe3d0f7ad4e809b2':
  Update to tzdata2011n.
2012-01-18 16:34:28 -08:00
Elliott Hughes
dac52ff9f5 am e8e1efea: Update to tzdata2011n.
* commit 'e8e1efeafb8754ea8358e78cfe3d0f7ad4e809b2':
  Update to tzdata2011n.
2012-01-18 16:34:01 -08:00
Nick Kralevich
df49ebabfe Merge "Eliminate duplicate copies of constants." 2012-01-18 08:53:51 -08:00
The Android Automerger
45af9ba7c4 merge in ics-release history after reset to master 2012-01-18 06:59:12 -08:00
Stephen Smalley
5eb686d105 Add extended attribute (xattr) system call wrappers to bionic.
The xattr system calls are required for the SE Android userspace in
order to get and set file security contexts.  In particular, libselinux
requires these calls.

Change-Id: I78f5eb3d8f3384aed0a5e7c6a6f001781d982017
2012-01-18 08:02:23 -05:00
Jean-Baptiste Queru
5f926c2679 am b00d7a33: am eae1f1fb: Merge "res_send: Avoid spurious close()s and (rare) failure"
* commit 'b00d7a331c9f2a578a4cfc4dfe0d626aa58fa702':
  res_send: Avoid spurious close()s and (rare) failure
2012-01-17 18:18:29 -08:00
Jean-Baptiste Queru
b00d7a331c am eae1f1fb: Merge "res_send: Avoid spurious close()s and (rare) failure"
* commit 'eae1f1fba33cb105302227b044a14e5abcbe55e7':
  res_send: Avoid spurious close()s and (rare) failure
2012-01-17 18:16:10 -08:00
Elliott Hughes
e8e1efeafb Update to tzdata2011n.
There are three changes of note - most urgently, Cuba (America/Havana)
has extended summer time by two weeks, now to end on Nov 13, rather than
the (already past) Oct 30.   Second, the Pridnestrovian Moldavian Republic
(Europe/Tiraspol) decided not to split from the rest of Moldova after
all, and consequently that zone has been removed (again) and reinstated
in the "backward" file as a link to Europe/Chisinau.   And third, the
end date for Fiji's summer time this summer was moved forward from the
earlier planned Feb 26, to Jan 22.

Apart from that, Moldova (MD) returns to a single entry in zone.tab
(and the incorrect syntax that was in the 2011m version of that file
is so fixed - it would have been fixed in a different way had this
change not happened - that's the "missing" sccs version id).

Bug: 5863692

Change-Id: I78e29c682c623b1dec0b0ea2cb6545713ae9eed0
2012-01-17 17:47:59 -08:00
Nick Kralevich
ea29cd5a4a Eliminate duplicate copies of constants.
sys/personality.h and linux/personality.h contain mostly
identical contents. Eliminate dups.

Change-Id: Ie786edcb5dca57af7ee5b5fdad2949369f1bc4e4
2012-01-17 17:28:42 -08:00
Nick Kralevich
d6045cba4e Don't generate sys/linux-unistd.h
linux-unistd.h was here for reference purposes, but shouldn't
have been accessible to client code. Delete it.

Change-Id: I60c264ff6ca489a48117914bdf6daa486737af8c
2012-01-17 15:56:26 -08:00
Nick Kralevich
fc5ea79c5e Merge "update personality.h" 2012-01-17 15:46:54 -08:00
Jean-Baptiste Queru
eae1f1fba3 Merge "res_send: Avoid spurious close()s and (rare) failure" 2012-01-17 15:26:18 -08:00
Nick Kralevich
023e5409df am 06f51ba1: am f44de270: add personality() system call.
* commit '06f51ba1af2fafeec7fdfcba5d635bd001a31b3e':
  add personality() system call.
2012-01-17 13:09:53 -08:00
Nick Kralevich
b6f40f0027 update personality.h
Pull in an updated version of personality.h from the linux
kernel.

This file was generated using the following command:

cd bionic/libc/kernel/
./tools/clean_header.py -u ../../../external/kernel-headers/original/linux/personality.h

Change-Id: I860ce21110ebf7e7499fb8165584d296a73aa602
2012-01-17 13:03:11 -08:00
Nick Kralevich
e4cb70aef3 am f44de270: add personality() system call.
* commit 'f44de270bba32c9b1b5eff8a34be07b10ddff238':
  add personality() system call.
2012-01-17 11:45:42 -08:00
Nick Kralevich
06f51ba1af am f44de270: add personality() system call.
* commit 'f44de270bba32c9b1b5eff8a34be07b10ddff238':
  add personality() system call.
2012-01-17 11:45:25 -08:00
The Android Automerger
09670ec2d1 merge in ics-release history after reset to master 2012-01-17 06:59:15 -08:00
Jim Huang
87043f9c89 res_send: Avoid spurious close()s and (rare) failure
When looping over the current list of sockets we are connected to,
use getpeername() not getsockname() to find out who the remote
end is.  This change avoids spurious close() and (rare) failure.

Origin: ISC bug #18625 and fixed in libbind 6.0

Change-Id: I5e85f9ff4b98c237978e4bf4bd85ba0a90d768e6
2012-01-14 11:30:00 +08:00
Jim Huang
28a7c35fea execvp: bcopy() is deprecated. Use memcpy() instead
The function bcopy() is marked as LEGACY in POSIX.1-2001 and removed in
POSIX.1-2008. memcpy (POSIX.1-2001) is its recommended replacement.

Change-Id: I2cc0cc4673d1368255afd11132ddbfd3f87b530b
2012-01-14 11:22:36 +08:00
The Android Automerger
43828aa3a7 merge in ics-mr1-release history after reset to ics-mr1 2012-01-13 16:16:49 -08:00
Nick Kralevich
f44de270bb add personality() system call.
Change-Id: Ie899def8ea1d705930ed83adae1343c1353e7c57
2012-01-13 15:50:40 -08:00
David 'Digit' Turner
697011d3c4 Merge "libc: Copy private C library declarations to private/" 2012-01-13 14:25:25 -08:00
Glenn Kasten
c61f990566 Fix misspelled Python variable name and typos
Typos:
 - Update pathname in README.txt
 - Fix missing newlines in header update script.

Change-Id: Ib0e053f92a27ff10071b9805fa64e5653ab31b0c
2012-01-13 07:41:20 -08:00
David 'Digit' Turner
208898ee77 libc: remove private declarations from <time.h> and <resolv.h>
This patch is used to remove private C library declarations from the
public headers (that are exported to the NDK). It should *only* be
submitted after all other patches modifying the users of said
private functions have been submitted to the tree, to avoid
breakages.

Change-Id: I0a5e3014f8e3ac9ed8df86a5cdae506337c23252
2012-01-13 14:24:08 +01:00
David 'Digit' Turner
11f3d5a431 libc: Copy private C library declarations to private/
This patch is the first in a series that aims at cleaning up the
public C library headers (which end up being distributed with the NDK).

<resolv.h> and <time.h> contain declarations that should not be public.
They are used by other parts of the platform, but NDK applications should
not use or rely on them.

So copy them to private <bionic_time.h> and <resolv_iface.h> headers
and use a guard macro to avoid conflicts when both headers are included
at the same time.

The idea is that we're going to fix the other platform modules to
include these private headers. After this is done, we will remove the
duplicate definitions from <resolv.h> and <time.h>

Change-Id: I121c11936951c98ca7165e811126ed8a4a3a394d
2012-01-13 13:26:50 +01:00
Robert Greenwalt
e4ade69654 am 82c4be54: am ecd0e95a: Adding a timeout to tcp dns lookup connects.
* commit '82c4be54da0825ebe74b524932c9db733419057a':
  Adding a timeout to tcp dns lookup connects.
2012-01-12 15:05:57 -08:00
Robert Greenwalt
a70e3eb15c am ecd0e95a: Adding a timeout to tcp dns lookup connects.
* commit 'ecd0e95a0276c1ba72c7331f5e4617815f015f22':
  Adding a timeout to tcp dns lookup connects.
2012-01-12 15:04:09 -08:00
Robert Greenwalt
82c4be54da am ecd0e95a: Adding a timeout to tcp dns lookup connects.
* commit 'ecd0e95a0276c1ba72c7331f5e4617815f015f22':
  Adding a timeout to tcp dns lookup connects.
2012-01-12 15:03:52 -08:00
Robert Greenwalt
ecd0e95a02 Adding a timeout to tcp dns lookup connects.
TCP isn't supported on some dns servers, which makes the old code
hang forever.

NOT adding a stopship to remove debugging stuff - it was too painful
(14s timeout on failed tcp dns lookups) so we decided not to bother people.

bug:5766949
Change-Id: I381c20c3e11b8e994438d4f7c58ef643cd36554e
2012-01-12 14:26:41 -08:00
The Android Automerger
348eea2dbe merge in ics-release history after reset to master 2012-01-12 14:11:59 -08:00
David Turner
5977ee02f6 Merge "Execute .preinit_array before any shared object initialization functions." 2012-01-12 01:04:46 -08:00
Evgeniy Stepanov
e83c56dfbb Execute .preinit_array before any shared object initialization functions.
This change makes linker handling of .preinit_array compliant with the
System V ABI:

"These [pre-initialization] functions are executed after the dynamic linker has
built the process image and performed relocations but before any shared object
initialization functions."
http://www.sco.com/developers/gabi/latest/ch5.dynamic.html#init_fini

Change-Id: Iebfee22bb1ebe1d7c7e69cb4686e4ebae0dfc4bb
2012-01-10 13:30:41 +04:00
The Android Automerger
13585da4b4 merge in ics-release history after reset to master 2012-01-09 06:59:16 -08:00
Mathias Agopian
68d03fdbd8 Merge "implement pthread mutex deadlock detection" 2012-01-05 14:05:30 -08:00
The Android Automerger
f40d3e7608 merge in ics-release history after reset to master 2012-01-04 06:59:09 -08:00
Bruce Beare
6519c8124e am e30e9093: sreadahead: adding readahead system call into bionic libc
* commit 'e30e909363c5c706f394050d9cd00ce222caadbf':
  sreadahead: adding readahead system call into bionic libc
2012-01-03 18:37:28 -08:00
Bruce Beare
e30e909363 sreadahead: adding readahead system call into bionic libc
Add bionic libc to support readahead system call.
This is needed to enable sreadahead to work.

Change-Id: I3856e1a3833db82e6cf42fd34af7631bd40cc723
Author: Winson Yung <winson.w.yung@intel.com>
Signed-off-by: Bruce Beare <bruce.j.beare@intel.com>
2012-01-03 15:18:04 -08:00
The Android Automerger
646ca9f1c9 merge in ics-release history after reset to master 2011-12-21 06:59:12 -08:00
Ken Sumrall
334379dada Merge "Add the posix_memalign(3) function to bionic" 2011-12-20 15:06:52 -08:00
The Android Automerger
f920b20654 merge in ics-release history after reset to master 2011-12-20 06:59:10 -08:00
Bruce Beare
5936e36f6b am a37f3729: readdir: fix interface to kernel getdents64 function
* commit 'a37f3729730e4e7345977915d67adc3eea93dfe4':
  readdir: fix interface to kernel getdents64 function
2011-12-19 11:36:48 -08:00
Bruce Beare
a37f372973 readdir: fix interface to kernel getdents64 function
Issue:
  The kernel will pad the entry->d_reclen in a getdents64 call to a
  long-word boundary.  For very long records, this could exceed the
  size of a struct dirent. The mismatch in the size was causing error
  paranoid checking code in bionic to fail... thus causing an early
  "end" when reading the dirent structures from the kernel buffer.

Test:
 ls
 mkdir abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstu
 ls

Change-Id: I75d1f8e45e1655fdd7bac4a08a481d086f28073a
Author: Bruce Beare <bruce.j.beare@intel.com>
2011-12-19 09:38:48 -08:00
The Android Automerger
fbc3abcbfc merge in ics-release history after reset to master 2011-12-15 06:59:15 -08:00
Ken Sumrall
85aad90956 Add the posix_memalign(3) function to bionic
The posix_memalign(3) function is very similar to the traditional
memalign(3) function, but with better error reporting and a guarantee
that the memory it allocates can be freed.  In bionic, memalign(3)
allocated memory can be freed, so posix_memalign(3) is just a wrapper
around memalign(3).

Change-Id: I62ee908aa5ba6b887d8446a00d8298d080a6a299
2011-12-14 20:55:43 -08:00
David 'Digit' Turner
a5cb76bca0 libc: x86: Use SSE2 or SSSE3 optimized routines when possible.
This patch uses the new hardware feature macros for x86 to define
various compile-time macros used to make the C library use
SSE2 and/or SSSE3 optimized memory functions for target CPUs
that support these features.

Note that previously, we relied on the macros being defined by
build/core/combo/TARGET_linux-x86.mk, but this is no longer the
case.

Change-Id: Ieae5ff5284c0c839bc920953fb6b91d2f2633afc
2011-12-14 18:23:40 +01:00
The Android Automerger
3ea9368d92 merge in ics-release history after reset to master 2011-12-14 06:59:15 -08:00
The Android Open Source Project
f6aa779383 am c2d5944e: Reconcile with ics-mr1-release
* commit 'c2d5944e19863bb2d831b13893a3bb78e0d53783':
2011-12-13 19:11:25 -08:00
The Android Open Source Project
c2d5944e19 Reconcile with ics-mr1-release
Change-Id: I62bace5c4272d043a51d3f0f698556716838aa51
2011-12-13 19:10:03 -08:00
The Android Automerger
caf08f71b8 merge in ics-mr1-release history after reset to ics-mr1 2011-12-13 17:35:59 -08:00
Erik Gilling
ddaa771cd5 am 8d28b043: am 94963af2: update video/dsscomp.h
* commit '8d28b043e93d323684add3406ebae6b8fe6475d5':
  update video/dsscomp.h
2011-12-13 17:29:12 -08:00
Erik Gilling
24aae1b1d4 am 94963af2: update video/dsscomp.h
* commit '94963af28e445384e19775a838a29e6a71708179':
  update video/dsscomp.h
2011-12-13 16:03:09 -08:00
Erik Gilling
8d28b043e9 am 94963af2: update video/dsscomp.h
* commit '94963af28e445384e19775a838a29e6a71708179':
  update video/dsscomp.h
2011-12-13 16:02:50 -08:00
Erik Gilling
94963af28e update video/dsscomp.h
Change-Id: I9da47f7fb7f34f9c4baa860bb767cb8fd4f8020c
Signed-off-by: Erik Gilling <konkers@android.com>
2011-12-13 14:48:51 -08:00
The Android Automerger
55b9099976 merge in ics-release history after reset to master 2011-12-13 06:59:15 -08:00
Bruce Beare
e2bb45a7c0 am f3087c6e: am af96d4da: x86: libc may use the gcc flags from TARGET_linux-x86.mk
* commit 'f3087c6e86f54874538669d899d8a2ede59f7433':
  x86: libc may use the gcc flags from TARGET_linux-x86.mk
2011-12-12 15:39:04 -08:00
Bruce Beare
cb4d9c0e1d am 68ec71eb: am 7d03c9cb: pathconf: dead loop in bionic function __2_symlinks
* commit '68ec71ebd6df12596dc5688c907c76ea4b32c9b4':
  pathconf: dead loop in bionic function __2_symlinks
2011-12-12 15:30:11 -08:00
The Android Open Source Project
e2cb764778 am c14ea96f: Reconcile with ics-mr1-release
* commit 'c14ea96f2f4e36f7a3b3d9676df845afb09c2245':
2011-12-12 15:29:53 -08:00
Erik Gilling
61f90d1898 am ffe65783: am bba5c314: update video/dsscomp.h
* commit 'ffe65783b4afc3f687a54b582a4e236caa22ed30':
  update video/dsscomp.h
2011-12-12 12:34:57 -08:00
Bruce Beare
f3087c6e86 am af96d4da: x86: libc may use the gcc flags from TARGET_linux-x86.mk
* commit 'af96d4dadc3f3d8466dbbeaf3a816e6871715fbc':
  x86: libc may use the gcc flags from TARGET_linux-x86.mk
2011-12-09 16:19:30 -08:00
Mathias Agopian
7c0c379372 implement pthread mutex deadlock detection
this works by building a directed graph of acquired
pthread mutexes and making sure there are no loops in
that graph.

this feature is enabled with:

    setprop debug.libc.pthread 1

when a potential deadlock is detected, a large warning is
output to the log with appropriate back traces.

currently disabled at compile-time. set PTHREAD_DEBUG_ENABLED=1
to enable.

Change-Id: I916eed2319599e8aaf8f229d3f18a8ddbec3aa8a
2011-12-09 14:38:57 -08:00
The Android Open Source Project
b7590d784f am c448c082: Reconcile with ics-mr1-release
* commit 'c448c082cf834f95afcfa3296eba2c67780727cf':
2011-12-09 14:25:56 -08:00
Bruce Beare
af96d4dadc x86: libc may use the gcc flags from TARGET_linux-x86.mk
Change-Id: Iaf4d864d4b6fe388bd3c2d7c4d7d6e42aebb0d35
Signed-off-by: Bruce Beare <bruce.j.beare@intel.com>
2011-12-09 13:54:20 -08:00
Bruce Beare
68ec71ebd6 am 7d03c9cb: pathconf: dead loop in bionic function __2_symlinks
* commit '7d03c9cbcedb1dc7e3a8210ac0001120558ec6df':
  pathconf: dead loop in bionic function __2_symlinks
2011-12-09 10:19:37 -08:00
The Android Open Source Project
c14ea96f2f Reconcile with ics-mr1-release
Change-Id: I0a43c4d104894fdde4eff9970bc78ed0aeb88ec2
2011-12-09 07:10:40 -08:00
The Android Automerger
132b3adfcc merge in ics-mr1-release history after reset to ics-mr1 2011-12-08 17:34:07 -08:00
Erik Gilling
cb9e9ccb2b am bba5c314: update video/dsscomp.h
* commit 'bba5c314b2420483e2c0e3e441bf54bda6935bc1':
  update video/dsscomp.h
2011-12-08 14:57:32 -08:00
Erik Gilling
ffe65783b4 am bba5c314: update video/dsscomp.h
* commit 'bba5c314b2420483e2c0e3e441bf54bda6935bc1':
  update video/dsscomp.h
2011-12-08 14:57:00 -08:00
Erik Gilling
bba5c314b2 update video/dsscomp.h
Change-Id: Ic5f1c01add1f2adb5a09d05c94129f3dc9cc3f1f
Signed-off-by: Erik Gilling <konkers@android.com>
2011-12-08 14:42:04 -08:00
The Android Open Source Project
c448c082cf Reconcile with ics-mr1-release
Change-Id: Icc9d31cb9a4f379354808a4c7e913685dfa22e80
2011-12-08 10:17:32 -08:00
The Android Automerger
d6da8336b8 merge in ics-release history after reset to master 2011-12-08 06:59:13 -08:00
David 'Digit' Turner
022d303116 libc: optimize pthread mutex lock/unlock operations (1/2)
This patch provides several small optimizations to the
implementation of mutex locking and unlocking. Note that
a following patch will get rid of the global recursion
lock, and provide a few more aggressive changes, I
though it'd be simpler to split this change in two parts.

+ New behaviour: pthread_mutex_lock et al now detect
  recursive mutex overflows and will return EAGAIN in
  this case, as suggested by POSIX. Before, the counter
  would just wrap to 0.

- Remove un-necessary reloads of the mutex value from memory
  by storing it in a local variable (mvalue)

- Remove un-necessary reload of the mutex value by passing
  the 'shared' local variable to _normal_lock / _normal_unlock

- Remove un-necessary reload of the mutex value by using a
  new macro (MUTEX_VALUE_OWNER()) to compare the thread id
  for recursive/errorcheck mutexes

- Use a common inlined function to increment the counter
  of a recursive mutex. Also do not use the global
  recursion lock in this case to speed it up.

Change-Id: I106934ec3a8718f8f852ef547f3f0e9d9435c816
2011-12-07 22:09:48 +01:00
David 'Digit' Turner
6c6de44f04 libc: optimize pthread_once() implementation.
This patch changes the implementation of pthread_once()
to avoid the use of a single global recursive mutex. This
should also slightly speed up the non-common case where
we have to call the init function, or wait for another
thread to finish the call.

Change-Id: I8a93f4386c56fb89b5d0eb716689c2ce43bdcad9
2011-12-07 22:06:36 +01:00
Bruce Beare
7d03c9cbce pathconf: dead loop in bionic function __2_symlinks
Fix dead loops in file ./bionic/libc/unistd/pathconf.c

Change-Id: I7a1e6bcd9879c96bacfd376b88a1f899793295c8
Author: Jin Wei <wei.a.jin@intel.com>
Signed-off-by: Bruce Beare <bruce.j.beare@intel.com>
2011-12-07 09:47:20 -08:00
The Android Automerger
6855359e57 merge in ics-release history after reset to master 2011-12-07 06:59:12 -08:00
Rabin Vincent
6e9d51701e am a73de44b: am 177ba8cb: Prevent deadlock when using fork
* commit 'a73de44b7c0a50908ea8afe16134316cfc6cfbbe':
  Prevent deadlock when using fork
2011-12-06 16:04:56 -08:00
Rabin Vincent
a73de44b7c am 177ba8cb: Prevent deadlock when using fork
* commit '177ba8cb42ed6d232e7c8bcad5e6ee21fc51a0e8':
  Prevent deadlock when using fork
2011-12-06 13:59:56 -08:00
Rabin Vincent
177ba8cb42 Prevent deadlock when using fork
When forking of a new process in bionic, it is critical that it
does not allocate any memory according to the comment in
java_lang_ProcessManager.c:
"Note: We cannot malloc() or free() after this point!
A no-longer-running thread may be holding on to the heap lock, and
an attempt to malloc() or free() would result in deadlock."
However, as fork is using standard lib calls when tracing it a bit,
they might allocate memory, and thus causing the deadlock.
This is a rewrite so that the function cpuacct_add, that fork calls,
will use system calls instead of standard lib calls.

Signed-off-by: christian bejram <christian.bejram@stericsson.com>

Change-Id: Iff22ea6b424ce9f9bf0ac8e9c76593f689e0cc86
2011-12-06 08:39:18 -08:00
Jean-Baptiste Queru
c5819d427d Merge 35765066 from ics-mr1-plus-aosp
Change-Id: Ibaeb49dc20f3c736417d5cb68769e7b501a61632
2011-12-06 08:35:08 -08:00
The Android Automerger
04c3d4d709 merge in ics-release history after reset to master 2011-12-06 06:59:14 -08:00
Bruce Beare
6d77a81456 am cb835cd7: am cb1df916: string: Fix wrong comparison semantics
* commit 'cb835cd77c8e60b4a9fb8a54a06d4fd4039ae1b0':
  string: Fix wrong comparison semantics
2011-12-05 22:13:21 -08:00
Bruce Beare
35765066b9 am e4a21c89: signal: Align the sigset_t size passed to from user space to kernel.
* commit 'e4a21c89a8b24b32f7a2637b45522dfa59f2aaa4':
  signal: Align the sigset_t size passed to from user space to kernel.
2011-12-05 22:12:08 -08:00
Bruce Beare
cb835cd77c am cb1df916: string: Fix wrong comparison semantics
* commit 'cb1df9161666db2a312814752de67fc623149a9b':
  string: Fix wrong comparison semantics
2011-12-05 22:12:07 -08:00
Bruce Beare
e4a21c89a8 signal: Align the sigset_t size passed to from user space to kernel.
Pass kernel space sigset_t size to __rt_sigprocmask to workaround
the miss-match of NSIG/sigset_t definition between kernel and bionic.

Note: Patch originally from Google...
Change-Id: I4840fdc56d0b90d7ce2334250f04a84caffcba2a
Signed-off-by: Chenyang Du <chenyang.du@intel.com>
Signed-off-by: Bruce Beare <bruce.j.beare@intel.com>
2011-12-05 18:37:33 -08:00
Bruce Beare
cb1df91616 string: Fix wrong comparison semantics
Chars are signed for x86 -- correct the comparison semantics.

Change-Id: I2049e98eb063c0b4e83ea973d3fcae49c6817dde
Author: Liubov Dmitrieva <liubov.dmitrieva@intel.com>
Signed-off-by: Bruce Beare <bruce.j.beare@intel.com>
2011-12-05 18:37:10 -08:00
Bruce Beare
aed4a4c90b am 75039baf: am 89d3fdca: MALLOC_DEBUG: enable the option libc.debug.malloc = 10
* commit '75039bafde8e6f03caffa9d6aa7142a09ba50952':
  MALLOC_DEBUG: enable the option libc.debug.malloc = 10
2011-12-05 17:02:20 -08:00
Bruce Beare
75039bafde am 89d3fdca: MALLOC_DEBUG: enable the option libc.debug.malloc = 10
* commit '89d3fdcae26980bf81a4622c3c83e48ead4c1c3a':
  MALLOC_DEBUG: enable the option libc.debug.malloc = 10
2011-12-05 17:01:13 -08:00
Nick Kralevich
253b763160 get rid of unused "main" function.
confuses gdb.

Change-Id: I1c64357ce122fe5a2564ee96bb4caa32b733f6ea
2011-12-05 16:09:30 -08:00
Bruce Beare
89d3fdcae2 MALLOC_DEBUG: enable the option libc.debug.malloc = 10
Fix the compile warning to let the libc.debug.malloc=10 works well
Due to unsuitable value comparison, which cause compiler optimize the
code of comparing two digits.

Change-Id: I0bedd596c9ca2ba308fb008da20ecb328d8548f5
Signed-off-by: Bruce Beare <bruce.j.beare@intel.com>
Author: liu chuansheng <chuansheng.liu@intel.com>
2011-12-05 14:58:55 -08:00
The Android Automerger
5e7783097a merge in ics-release history after reset to master 2011-12-01 06:59:15 -08:00
Jack Ren
bec5dec947 am 0c3d21e6: am e480fc83: bionic: fix pthread_{create, exit}/signal race condition
* commit '0c3d21e63c6e75ae73aaf2b8d64af0bd8caa6beb':
  bionic: fix pthread_{create, exit}/signal race condition
2011-11-30 10:50:59 -08:00
Jack Ren
338a06f4bc am 621df526: am 31e72bc3: bionic: fix __get_tls( ) crash issue
* commit '621df52644cc19001688c0964ad425c5ed6c8990':
  bionic: fix __get_tls( ) crash issue
2011-11-30 10:50:58 -08:00
Zhenghua Wang
0e0bd58631 am 1ad08626: am 897815a1: bionic: add machine type check
* commit '1ad08626a143dc684e92f56754c7176cc4914ce8':
  bionic: add machine type check
2011-11-30 10:50:57 -08:00
The Android Automerger
d999c93401 merge in ics-release history after reset to master 2011-11-30 06:59:12 -08:00
Jack Ren
0c3d21e63c am e480fc83: bionic: fix pthread_{create, exit}/signal race condition
* commit 'e480fc83b2887388d469eb3bf58c86c610f5b082':
  bionic: fix pthread_{create, exit}/signal race condition
2011-11-29 22:42:32 -08:00
Jack Ren
621df52644 am 31e72bc3: bionic: fix __get_tls( ) crash issue
* commit '31e72bc3289acdd85b0b745fbf64c5949ca33432':
  bionic: fix __get_tls( ) crash issue
2011-11-29 22:42:31 -08:00
Zhenghua Wang
1ad08626a1 am 897815a1: bionic: add machine type check
* commit '897815a1feff230be3ea42655a77dcbb9a8dcca9':
  bionic: add machine type check
2011-11-29 22:42:30 -08:00
Jack Ren
e480fc83b2 bionic: fix pthread_{create, exit}/signal race condition
(1) in pthread_create:
    If the one signal is received before esp is subtracted by 16 and
    __thread_entry( ) is called, the stack will be cleared by kernel
    when it tries to contruct the signal stack frame. That will cause
    that __thread_entry will get a wrong tls pointer from the stack
    which leads to the segment fault when trying to access tls content.

(2) in pthread_exit
    After pthread_exit called system call unmap(), its stack will be
    freed.  If one signal is received at that time, there is no stack
    available for it.

Fixed by subtracting the child's esp by 16 before the clone system
call and by blocking signal handling before pthread_exit is started.

Author: Jack Ren <jack.ren@intel.com>
Signed-off-by: Bruce Beare <bruce.j.beare@intel.com>
2011-11-29 17:09:51 -08:00
Jack Ren
31e72bc328 bionic: fix __get_tls( ) crash issue
When running the stress test of pthread create/destroy, a crash may
oocur in __get_tls(). That is caused by the race condition with __set_tls( ):

Author: Jack Ren <jack.ren@intel.com>
Signed-off-by: Bruce Beare <bruce.j.beare@intel.com>
2011-11-29 17:09:15 -08:00
Zhenghua Wang
897815a1fe bionic: add machine type check
android linker doesn't check machine type, it may load some
libraries which it doesn't support sometimes.

Author: Zhenghua Wang <zhenghua.wang@intel.com>
Signed-off-by: Bruce Beare <bruce.j.beare@intel.com>
2011-11-29 17:01:08 -08:00
Robert Greenwalt
e796d39d80 Merge "Request both v4 and v6 dns when on secondary net" 2011-11-29 15:48:48 -08:00
Nick Kralevich
495f16cbac update capabilities.h
Pull in an updated version of capabilities.h from the linux
kernel.

This file was generated using the following command:

cd bionic/libc/kernel/
./tools/clean_header.py -u ../../../external/kernel-headers/original/linux/capability.h

Change-Id: I43c8f014954f543858006f24e60a2e69955349da
2011-11-28 13:42:50 -08:00
The Android Automerger
86ad80b6be merge in ics-release history after reset to master 2011-11-28 12:23:08 -08:00
David 'Digit' Turner
f1a39dce60 libc: Fix typo that broke NDK compatibility.
The function must be named __atomic_cmpxchg, not __android_cmpxchg.
This typo broke existing prebuilt binaries (they couldn't be loaded
at runtime anymore).

Change-Id: I25ca7d18329817f0056e616a0409113269ad7b1f
2011-11-23 14:38:36 +01:00
Robert Greenwalt
ca6fe7bebe Request both v4 and v6 dns when on secondary net
We can't easily tell the protocol family of the secondary network,
so try both and trust that the carrier has configured dns servers
according to the protocols supported on its network.

bug:5468224
Change-Id: If4f017573d313a6ad8354574076de6d63d43b444
2011-11-22 15:24:44 -08:00
David 'Digit' Turner
de44d0b2bd Merge "libc: provide atomic operations will full barriers for NDK apps." 2011-11-22 02:10:06 -08:00
Jeff Brown
95a17848d3 Merge "Add tgkill syscall." 2011-11-21 13:13:26 -08:00
Jeff Brown
10c8ce59a4 Add tgkill syscall.
Use tgkill instead of tkill to implement pthread_kill.
This is safer in the event that the thread has already terminated
and its id has been reused by a different process.

Change-Id: Ied715e11d7eadeceead79f33db5e2b5722954ac9
2011-11-18 16:40:48 -08:00
The Android Open Source Project
f638339d09 Reconcile with ics-mr1-release
Change-Id: I5bf77ac8b8c77cf7a075c6f0ffa99fa696ce13d3
2011-11-18 15:42:18 -08:00
Nick Kralevich
5f64df4bc3 ASLR: enable pthread stack location randomization
Allow the kernel to choose a memory location to put the
thread stack, rather than hard coding 0x10000000

Change-Id: Ib1f37cf0273d4977e8d274fbdab9431ec1b7cb4f
2011-11-18 10:07:12 -08:00
The Android Automerger
71b9eedbea merge in ics-release history after reset to master 2011-11-17 06:59:15 -08:00
Nick Kralevich
7e2daefe6c Merge "Make the linker relocatable." 2011-11-16 10:43:56 -08:00
David 'Digit' Turner
0fec6b9d88 libc: provide atomic operations will full barriers for NDK apps.
__atomic_cmpxchg and other related atomic operations did not
provide memory barriers, which can be a problem for non-platform
code that links against them when it runs on multi-core devices.

This patch does two things to fix this:

- It modifies the existing implementation of the functions
  that are exported by the C library to always provide
  full memory barriers. We need to keep them exported by
  the C library to prevent breaking existing application
  machine code.

- It also modifies <sys/atomics.h> to only export
  always-inlined versions of the functions, to ensure that
  any application code compiled against the new header will
  not rely on the platform version of the functions.

  This ensure that said machine code will run properly on
  all multi-core devices.

This is based on the GCC built-in sync primitives.

The end result should be only slightly slower than the
previous implementation.

Note that the platform code does not use these functions
at all. A previous patch completely removed their usage in
the pthread and libstdc++ code.

+ rename arch-arm/bionic/atomics_arm.S to futex_arm.S
+ rename arch-x86/bionic/atomics_x86.S to futex_x86.S
+ remove arch-x86/include/sys/atomics.h which already
  provided inlined functions to the x86 platform.

Change-Id: I752a594475090cf37fa926bb38209c2175dda539
2011-11-16 17:37:15 +01:00
David 'Digit' Turner
b385229837 Merge "libc: speed-up flockfile()/funlockfile()" 2011-11-16 07:31:31 -08:00
David Turner
90c4c1e82b Merge "bionic: Do not use <sys/atomics.h> for platform code." 2011-11-16 07:29:59 -08:00
David 'Digit' Turner
e31bfae2ba bionic: Do not use <sys/atomics.h> for platform code.
We're going to modify the __atomic_xxx implementation to provide
full memory barriers, to avoid problems for NDK machine code that
link to these functions.

First step is to remove their usage from our platform code.
We now use inlined versions of the same functions for a slight
performance boost.

+ remove obsolete atomics_x86.c (was never compiled)

NOTE: This improvement was benchmarked on various devices.
      Comparing a pthread mutex lock + atomic increment + unlock
      we get:

  - ARMv7 emulator, running on a 2.4 GHz Xeon:
       before: 396 ns    after: 288 ns

  - x86 emulator in KVM mode on same machine:
       before: 27 ns     after: 27 ns

  - Google Nexus S, in ARMv7 mode (single-core):
       before: 82 ns     after: 76 ns

  - Motorola Xoom, in ARMv7 mode (multi-core):
       before: 121 ns    after: 120 ns

The code has also been rebuilt in ARMv5TE mode for correctness.

Change-Id: Ic1dc72b173d59b2e7af901dd70d6a72fb2f64b17
2011-11-16 16:28:10 +01:00
The Android Automerger
a938409c0e merge in ics-release history after reset to master 2011-11-16 06:59:17 -08:00
The Android Automerger
a89c28b091 merge in ics-mr1-release history after reset to ics-mr1 2011-11-16 06:45:21 -08:00
Eino-Ville Talvala
fd7d5acdeb am 0d9f87a3: Add auto-exposure/auto-white balance lock support to soc2030 image sensor.
* commit '0d9f87a3b71057cf804b2d7aa8589e3bf94eab28':
  Add auto-exposure/auto-white balance lock support to soc2030 image sensor.
2011-11-15 18:25:18 -08:00
Eino-Ville Talvala
87426ed37a am 0d9f87a3: Add auto-exposure/auto-white balance lock support to soc2030 image sensor.
* commit '0d9f87a3b71057cf804b2d7aa8589e3bf94eab28':
  Add auto-exposure/auto-white balance lock support to soc2030 image sensor.
2011-11-15 16:45:26 -08:00
David 'Digit' Turner
8180b08fb2 linker: Fix the computation of si->base
The computation of si->base assumed that the first entry in the
program header table is a PT_PHDR. This results in the dynamic
linker crashing with a SIGSEGV/MAPERR when trying to load some
of the NDK unit test programs, which happen to have an EXIDX
header first, followed byu a PHDR one.

This patch fixes the computation by parsing the program header
table, looking explicitely for the PHDR entry. This fixes the
load of the NDK unit test programs, and doesn't affect system
libraries.

Change-Id: Id18ea6037dbe950b5abbbce816c2960321f0b81d
2011-11-15 17:17:28 +01:00
The Android Automerger
2f3309c9e3 merge in ics-release history after reset to master 2011-11-15 06:59:11 -08:00
David 'Digit' Turner
9831ad3ce6 libc: speed-up flockfile()/funlockfile()
For Honeycomb, we added proper file thread-safety for
all FILE* operations. However, we did implement that by
using an out-of-band hash table to map FILE* pointers
to phtread_mutex_t mutexes, because we couldn't change
the size of 'struct _sFILE' without breaking the ABI.

It turns out that our BSD-derived code already has
some support code to extend FILE* objects, so use it
instead. See libc/stdio/fileext.h

This patch gets rid of the hash table, and put the
mutex directly into the sFILE extension.

Change-Id: If1c3fe0a0a89da49c568e9a7560b7827737ff4d0
2011-11-15 13:16:42 +01:00
Nick Kralevich
4b469eae40 Merge "generate PIC code." 2011-11-14 15:12:43 -08:00
David 'Digit' Turner
9bf330b567 libc: fix the pthread_sigmask implementation
The old code didn't work because the kernel expects a 64-bit sigset_t
while the one provided by our ABI is only 32-bit. This is originally
due to the fact that the kernel headers themselves define sigset_t
as a 32-bit type when __KERNEL__ is not defined (apparently to cater
to libc5 or some similarly old C library).

We can't modify the size of sigset_t without breaking the NDK ABI,
so instead perform runtime translation during the call.

Change-Id: Ibfdc3cbceaff864af7a05ca193aa050047b4773f
2011-11-14 22:57:24 +01:00
Nick Kralevich
468319ce4f Make the linker relocatable.
Previously, the linker always loaded itself into the same
location in memory, which inhibited the effectiveness of Android's
ASLR implementation. Modify the linker code so it can be relocatable
and link itself at runtime.

Change-Id: Ia80273d7a00ff648b4da545f4b69debee6343968
2011-11-11 18:01:53 -08:00
Nick Kralevich
0aa8289c6f generate PIC code.
Change-Id: I6740c30e2782ae203aa7ddaeaf3b233e90de9c4d
2011-11-11 17:28:59 -08:00
The Android Automerger
16e818f90b merge in ics-release history after reset to master 2011-11-06 06:59:20 -08:00
Nick Kralevich
7939908c83 linker: set LOCAL_NO_CRT := true
Use LOCAL_NO_CRT to prevent linking against crtbegin.o, rather than
messing with build rules. This also prevents linking against crtend.o,
which isn't needed for the linker.

Change-Id: I0c5b9999be7e8676560fe145c1c033ffce8db4d1
2011-11-04 10:22:55 -07:00
Nick Kralevich
8e8a7b1f0f Revert "Make the linker relocatable."
This reverts commit 994e9a5ed1.

Broke x86 build.
2011-11-03 09:25:06 -07:00
Nick Kralevich
994e9a5ed1 Make the linker relocatable.
Previously, the linker always loaded itself into the same
location in memory, which inhibited the effectiveness of Android's
ASLR implementation. Modify the linker code so it can be relocatable
and link itself at runtime.

Change-Id: I90d064743abdd29450ac0482ed28752b2196286c
2011-11-02 16:20:06 -07:00
The Android Automerger
9bf1daaaf9 merge in ics-release history after reset to master 2011-11-01 06:59:13 -07:00
Elliott Hughes
29992cf978 Merge "Update to tzdata2011n." 2011-10-31 14:43:50 -07:00
Elliott Hughes
f3dbdbe269 Update to tzdata2011n.
There are three changes of note - most urgently, Cuba (America/Havana)
has extended summer time by two weeks, now to end on Nov 13, rather than
the (already past) Oct 30.   Second, the Pridnestrovian Moldavian Republic
(Europe/Tiraspol) decided not to split from the rest of Moldova after
all, and consequently that zone has been removed (again) and reinstated
in the "backward" file as a link to Europe/Chisinau.   And third, the
end date for Fiji's summer time this summer was moved forward from the
earlier planned Feb 26, to Jan 22.

Apart from that, Moldova (MD) returns to a single entry in zone.tab
(and the incorrect syntax that was in the 2011m version of that file
is so fixed - it would have been fixed in a different way had this
change not happened - that's the "missing" sccs version id).

Change-Id: I7a0fba88d1fc6face649648013aaf2b111c29d7f
2011-10-31 14:11:32 -07:00
The Android Open Source Project
31f0610798 Reconcile with ics-mr1-release
Change-Id: Ifc8b7e46968eb77bb47eb85274aa7ab35ed36925
2011-10-31 13:19:03 -07:00
Eino-Ville Talvala
0d9f87a3b7 Add auto-exposure/auto-white balance lock support to soc2030 image
sensor.

Bug: 4980604
Change-Id: I1be07a23573b70eeddd9ecb2370605713aea3d03
2011-10-31 11:42:18 -07:00
Ed Heyl
143970a5b0 keep previous history after reset to mr1 plus aah changes (ics-aah-wip) 2011-10-28 19:05:43 +00:00
Ed Heyl
125207c307 undo reset to ics-mr1 until we have a better method 2011-10-26 21:53:16 +00:00
Ed Heyl
c8be370b34 reset to ics-mr1, but keep history 2011-10-26 18:50:08 +00:00
The Android Automerger
98873f6540 merge in ics-release history after reset to master 2011-10-25 07:14:09 -07:00
Elliott Hughes
a5c0d72bfb am bcb2edac: Update to tzdata2011m.
* commit 'bcb2edac654962758c6d7d8d3e0e4cdcb75c89fc':
  Update to tzdata2011m.
2011-10-24 11:24:28 -07:00
Elliott Hughes
bcb2edac65 Update to tzdata2011m.
Fixes for Europe/Tiraspol (Moldova) and all four Ukrainian zones.

Also show the MD5 of the downloaded data, for comparison against the MD5
given in the announcement mails. (There's a plan to move to proper signing,
but that's not implemented on their end yet.)

Change-Id: I845e6f125c0f54298abadc643adfeca2eff4827a
2011-10-24 10:52:14 -07:00
Nick Kralevich
9ab38c67eb am d9ad6234: Add linker support for PIE
* commit 'd9ad62343c2db6b66a5fa597c9b20a6faabd7a9a':
  Add linker support for PIE
2011-10-24 08:45:00 -07:00
Nick Kralevich
d9ad62343c Add linker support for PIE
Modify the dynamic linker so that executables can be loaded
at locations other than 0x00000000.

Modify crtbegin* so that non-PIC compilant "thumb interwork
veneers" are not created by the linker.

Bug: 5323301
Change-Id: Iece0272e2b708c79034f302c20160e1fe9029588
2011-10-22 13:19:23 -07:00
The Android Automerger
d717f5170f merge in ics-release history after reset to master 2011-10-13 06:59:20 -07:00
Jesse Wilson
c66f220c44 am b0641d4a: Merge "Use ENTRY and EXIT macros for strcmp, memcpy, atexit."
* commit 'b0641d4a446fa98c72fd6252e5a5ca7e44c41f1f':
  Use ENTRY and EXIT macros for strcmp, memcpy, atexit.
2011-10-12 17:43:06 -07:00
Jesse Wilson
b0641d4a44 Merge "Use ENTRY and EXIT macros for strcmp, memcpy, atexit." 2011-10-12 07:51:53 -07:00
The Android Automerger
df331f5f9b merge in ics-release history after reset to master 2011-10-11 05:32:11 -07:00
Evgeniy Stepanov
487b613e57 Use ENTRY and EXIT macros for strcmp, memcpy, atexit.
Without this change strcmp size is zero (not set), and it gets
ignored by Valgrind. Changes to memcpy and atexit don't affect the
generated binary in any way.

Change-Id: I05818cb5951f75901dc8c0eef02807a2e83a9231
2011-10-11 12:12:05 +04:00
Elliott Hughes
f5c6dc8b7c am faa7c1d2: Update to tzdata2011l.
* commit 'faa7c1d29f9ed0b3eb252bb0bd43e7596eed5d9c':
  Update to tzdata2011l.
2011-10-10 14:51:37 -07:00
The Android Automerger
bf8f6bb820 merge in ics-release history after reset to master 2011-09-30 06:44:15 -07:00
David 'Digit' Turner
b7001bce52 am 0a1b306f: am 32ca348e: am ce0d646c: resolved conflicts for merge of 6cda7b62 to gingerbread-plus-aosp
* commit '0a1b306fe1e86b4d218506d2d3d3e72df8f795ba':
  Bionic: x86: Fix libm macro definitions
2011-09-30 05:46:33 -07:00
Lorenzo Colitti
74cf48f0c1 am 229ab1a3: Merge "Send both A and AAAA queries if all probes fail."
* commit '229ab1a33ea79fcea42302fbe9680a6c1047325f':
  Send both A and AAAA queries if all probes fail.
2011-09-29 10:53:51 -07:00
Lorenzo Colitti
b99c197b27 am 4638822f: Merge "Revert "Use framework hints to determine dns query type.""
* commit '4638822fc07aae8cc08600c85c16183ed8d5ef79':
  Revert "Use framework hints to determine dns query type."
2011-09-29 10:53:50 -07:00
The Android Automerger
cd17f88010 merge in ics-release history after reset to master 2011-09-28 17:56:54 -07:00
Mathias Agopian
451159035a am bda5da07: fix prototype of dladdr
* commit 'bda5da074eab4bdf374e1f4a19d480c62c72f5ff':
  fix prototype of dladdr
2011-09-28 15:18:12 -07:00
The Android Automerger
c902908999 merge in ics-release history after reset to master 2011-09-27 06:59:11 -07:00
Elliott Hughes
3abc9d98c9 am 00964912: Update to tzdata2011k.
* commit '00964912745f0bb7e081f84ddcc74940f973149f':
  Update to tzdata2011k.
2011-09-26 11:23:50 -07:00
The Android Automerger
0c7245213d merge in ics-release history after reset to master 2011-09-25 06:59:15 -07:00
Robert Greenwalt
3ec1bd2c7a am 924c8785: am 8af58f0f: Use framework hints to determine dns query type.
* commit '924c8785f0b0822ab23a8a8917d312b7c5f63243':
  Use framework hints to determine dns query type.
2011-09-22 23:44:57 -07:00
The Android Automerger
d98f3e9f71 merge in ics-release history after reset to master 2011-09-18 06:59:17 -07:00
JP Abgrall
26bee12899 am 77160041: am 3884bfe9: libc: popen: work around data corruption
* commit '771600415f41b9075b83dcf1e5395d2292ea05b2':
  libc: popen: work around data corruption
2011-09-17 16:33:55 -07:00
Glenn Kasten
370bbc5dea am d53cae0e: Add non-NDK internal API __pthread_gettid
* commit 'd53cae0e45dafdb3a83ccc3675051c0aee532111':
  Add non-NDK internal API __pthread_gettid
2011-09-16 14:45:24 -07:00
The Android Automerger
6e47ab1345 merge in ics-release history after reset to master 2011-09-15 06:33:15 -07:00
Erik Gilling
d0e629a68e am b8ef90d6: update linux/fb.h
* commit 'b8ef90d67950c5d4e04f95c30e164e924f41f70a':
  update linux/fb.h
2011-09-14 12:08:54 -07:00
The Android Automerger
ae25dc08c1 merge in ics-release history after reset to master 2011-09-13 06:33:13 -07:00
Elliott Hughes
268bec521c am 5da3ed17: Merge "Update to tzdata2011j."
* commit '5da3ed177c52cdd8344b86f9b95b08b6aa473210':
  Update to tzdata2011j.
2011-09-12 11:22:57 -07:00
Erik Gilling
6ce10804d5 update kernel video/dsscomp.h
Change-Id: Ifc4f96e3a9c3435c0b0ee80ac9da295b4e9463a1
Signed-off-by: Erik Gilling <konkers@android.com>
2011-09-07 17:49:09 -07:00
Erik Gilling
fa6128ad17 am 763230ae: update kernel video/dsscomp.h
* commit '763230ae5509da3ec83cde5bf6ce54dd728a0adf':
  update kernel video/dsscomp.h
2011-09-07 12:55:18 -07:00
The Android Automerger
81a6894b0a merge in ics-release history after reset to master 2011-09-05 06:33:11 -07:00
Robert Greenwalt
2d461c7c00 am 7f84da69: Add some logging of dns cache operations
* commit '7f84da69f86ed9daf610c8d1129392ba3f7c4405':
  Add some logging of dns cache operations
2011-09-02 13:03:41 -07:00
The Android Automerger
94387eae69 merge in ics-release history after reset to master 2011-08-31 06:33:08 -07:00
The Android Automerger
918ad3ecfd merge in ics-release history after reset to master 2011-08-30 13:42:36 -07:00
The Android Automerger
fd3fc8bd27 merge in ics-release history after reset to master 2011-08-30 12:45:01 -07:00
David 'Digit' Turner
b0d9c83041 am 96e5facc: am 91966c30: am 0acdbe08: am 89ea107d: Merge "linker: allow debugging of constructors"
* commit '96e5faccdc5616bb6d4a55d50a0e6148f99d943b':
  linker: allow debugging of constructors
2011-08-30 09:52:46 -07:00
David 'Digit' Turner
a0223a888f am 09b36dc7: am 35aebd36: am c7f5c8e2: am 0f7d9df1: Merge "libc: fix typo in kernel helper script"
* commit '09b36dc7a939c68b519fc0f46d6dad25c5f7637c':
  libc: fix typo in kernel helper script
2011-08-30 09:52:44 -07:00
Nick Kralevich
3b242f82b5 am 38bccb27: linker.h: don\'t change the soinfo structure
* commit '38bccb271f121fc06eaa0d8fbd3c982bc44c36b7':
  linker.h: don't change the soinfo structure
2011-08-29 16:33:46 -07:00
Elliott Hughes
999f7711cd am b0bbbff6: Update to tzdata2011i.
* commit 'b0bbbff6060b382d2c4607f026e182adb67d0cc0':
  Update to tzdata2011i.
2011-08-29 09:19:49 -07:00
Erik Gilling
7a796df91d am 4f346524: Merge "update video/dsscomp.h"
* commit '4f3465240a9f0a7ba913188acb048483aef9d6b9':
  update video/dsscomp.h
2011-08-25 13:09:49 -07:00
Mike Lockwood
39ac5c2714 am 0b33d998: Add linux/leds-an30259a.h
* commit '0b33d9982e68991efb5035d126516391113b0baa':
  Add linux/leds-an30259a.h
2011-08-25 13:07:25 -07:00
David 'Digit' Turner
19726f59d7 am 58246b70: libc: Add __aeabi_f2uiz to libgcc_compat.c
* commit '58246b7067b4e1a0b3ce48ccd94331f6fd8fa7cc':
  libc: Add __aeabi_f2uiz to libgcc_compat.c
2011-08-22 10:58:08 -07:00
Jing Yu
d3f2d49f3a am d50225ad: Disable sincos optimization for sincos calls.
* commit 'd50225ad20b4510892dc5f2306b64f04bab6e711':
  Disable sincos optimization for sincos calls.
2011-08-17 15:18:52 -07:00
David Turner
68990d19e4 am 6dcf0d73: am 3dc94305: am 17a40ffb: am c57fd963: Merge "NDK: x86 header file has incorrect definition for ptrdiff_t"
* commit '6dcf0d73a69e01a9ef1d4d2f1e61cd114c0851a5':
  NDK: x86 header file has incorrect definition for ptrdiff_t
2011-08-09 13:39:42 -07:00
David Turner
9ac3e4377f am 3afafd46: am 951e8381: am 3906a9c1: am f5aa1382: Merge "x86 libc: Fix the range to check the error"
* commit '3afafd46f3e0c820e3d0a1b13cceddbeea1b5966':
  x86 libc: Fix the range to check the error
2011-08-09 13:39:40 -07:00
Andy McFadden
af60b29097 am 8363448f: Merge "Log signal info at time of receipt"
* commit '8363448fb594707e1d1bb5664963c549890dc84d':
  Log signal info at time of receipt
2011-08-05 15:05:36 -07:00
Iliyan Malchev
fadfe40155 am 5598077d: bionic: update sanitized kernel header dsscomp.h
* commit '5598077d35f349a88549c6d4fe27458c9577edc9':
  bionic: update sanitized kernel header dsscomp.h
2011-08-04 17:18:08 -07:00
David 'Digit' Turner
dda5d14a6b am 83eb46c5: am a64990f3: am f03fb955: am 023c4988: Merge "libc: x86: Fixed size_t definition."
* commit '83eb46c59df8f54d7b73aaf67c8110aecfa25009':
  libc: x86: Fixed size_t definition.
2011-08-04 11:19:39 -07:00
Iliyan Malchev
2abf4606f9 am 3a5d668e: bionic: add clean kernel header dsscomp.h
* commit '3a5d668e012eb27c33ecea7159d24209d45c5baa':
  bionic: add clean kernel header dsscomp.h
2011-08-03 21:03:50 -07:00
Iliyan Malchev
a11bb504ec am 7b79d1ed: bionic: add processed kernel header rpmsg_omx.h
* commit '7b79d1ed88158ca43e2c307f4d9801280d4a8849':
  bionic: add processed kernel header rpmsg_omx.h
2011-08-03 18:11:18 -07:00
David Turner
d34ff3cb96 am ae3c9783: am bc9d1fe7: am 4685acbd: am 9efda5b7: Merge "typo in libc/stdio/wcio.h"
* commit 'ae3c9783f286f07e794fb67a458b0c9dc2becc29':
  typo in libc/stdio/wcio.h
2011-08-03 17:45:26 -07:00
Robert Greenwalt
a4f633ff2a am 5a09973f: am 663e0579: am dfec555c: am bcf861f2: Merge "Don\'t call freeaddrinfo with a NULL ptr."
* commit '5a09973fa51aec83f934c95bf7b0b35ae4b3a017':
  Don't call freeaddrinfo with a NULL ptr.
2011-07-29 12:32:33 -07:00
JP Abgrall
c8b9ba7d41 am 0ade879a: (-s ours) am 4e5f0d41: (-s ours) am 821bea02: Merge "DO NOT MERGE: libc: enable IPTOS_MINCOST, fixup gethostbyaddr() proto." into honeycomb-LTE
* commit '0ade879a502ac4a0c2da80a7f5e456cddef4fefd':
  DO NOT MERGE: libc: enable IPTOS_MINCOST, fixup gethostbyaddr() proto.
2011-07-27 09:25:52 -07:00
JP Abgrall
88f6fa70d7 am 26619dfb: (-s ours) am cec4e990: (-s ours) am 30517a93: Merge "DO NOT MERGE: Update netlink-related kernel includes" into honeycomb-LTE
* commit '26619dfbb8c1f470407745837818b2654eb6a28f':
  DO NOT MERGE: Update netlink-related kernel includes
2011-07-27 09:25:50 -07:00
Anders Fredlund
dd16182b4b Remove expired dns cache entries before removing oldest
A suggestion how to make a smarter delete function when the cache
is full. First look through the entire cache and remove all entries
which have expired. If none use the old solution and just remove
the last entry in the MRU list.

Change-Id: I5f997ab35290a55dc6e1ddf37d725759edf83d36
2011-05-20 08:12:37 +02:00
1863 changed files with 87372 additions and 40832 deletions

View File

@@ -1,6 +0,0 @@
Bionic support for SuperH
-------------------------
Bionic support for SuperH architecture is written by
Shin-ichiro KAWASAKI <shinichiro.kawasaki.mg@hitachi.com>
and Contributed to Android by Hitachi, Ltd. and Renesas Solutions Corp.

View File

@@ -1,10 +0,0 @@
# Copyright 2010 Google Inc. All Rights Reserved.
#Fri Jul 16 10:03:08 PDT 2010
currentVersion=Unknown
version=Unknown
isNative=true
feedurl=http\://www.openbsd.org/security.html
name=openbsd
keywords=openbsd
onDevice=true
homepage=http\://openbsd.org

View File

@@ -9,7 +9,6 @@ libc_common_src_files := \
unistd/abort.c \
unistd/alarm.c \
unistd/brk.c \
unistd/creat.c \
unistd/daemon.c \
unistd/eventfd.c \
unistd/exec.c \
@@ -18,7 +17,6 @@ libc_common_src_files := \
unistd/fstatfs.c \
unistd/ftime.c \
unistd/ftok.c \
unistd/getcwd.c \
unistd/getdtablesize.c \
unistd/gethostname.c \
unistd/getopt_long.c \
@@ -31,7 +29,6 @@ libc_common_src_files := \
unistd/killpg.c \
unistd/lseek64.c \
unistd/mmap.c \
unistd/nice.c \
unistd/open.c \
unistd/openat.c \
unistd/opendir.c \
@@ -64,7 +61,6 @@ libc_common_src_files := \
unistd/sigwait.c \
unistd/sleep.c \
unistd/statfs.c \
unistd/strsignal.c \
unistd/syslog.c \
unistd/system.c \
unistd/tcgetpgrp.c \
@@ -140,6 +136,11 @@ libc_common_src_files := \
stdio/vsscanf.c \
stdio/wbuf.c \
stdio/wsetup.c \
stdio/__fgets_chk.c \
stdio/__snprintf_chk.c \
stdio/__sprintf_chk.c \
stdio/__vsnprintf_chk.c \
stdio/__vsprintf_chk.c \
stdlib/_rand48.c \
stdlib/assert.c \
stdlib/atexit.c \
@@ -189,8 +190,6 @@ libc_common_src_files := \
string/strcoll.c \
string/strcspn.c \
string/strdup.c \
string/strerror.c \
string/strerror_r.c \
string/strlcat.c \
string/strlcpy.c \
string/strncat.c \
@@ -204,7 +203,16 @@ libc_common_src_files := \
string/strstr.c \
string/strtok.c \
string/strtotimeval.c \
string/strxfrm.c \
string/__memcpy_chk.c \
string/__memmove_chk.c \
string/__memset_chk.c \
string/__strcat_chk.c \
string/__strcpy_chk.c \
string/__strlcat_chk.c \
string/__strlcpy_chk.c \
string/__strlen_chk.c \
string/__strncat_chk.c \
string/__strncpy_chk.c \
wchar/wcpcpy.c \
wchar/wcpncpy.c \
wchar/wcscasecmp.c \
@@ -249,6 +257,7 @@ libc_common_src_files := \
tzcode/strftime.c \
tzcode/strptime.c \
bionic/__set_errno.c \
bionic/bionic_clone.c \
bionic/cpuacct.c \
bionic/arc4random.c \
bionic/basename.c \
@@ -262,6 +271,7 @@ libc_common_src_files := \
bionic/fdprintf.c \
bionic/fork.c \
bionic/fts.c \
bionic/getcwd.cpp \
bionic/if_nametoindex.c \
bionic/if_indextoname.c \
bionic/ioctl.c \
@@ -278,9 +288,12 @@ libc_common_src_files := \
bionic/sched_cpucount.c \
bionic/semaphore.c \
bionic/sha1.c \
bionic/ssp.c \
bionic/stubs.c \
bionic/strerror.cpp \
bionic/strerror_r.cpp \
bionic/strsignal.cpp \
bionic/stubs.cpp \
bionic/system_properties.c \
bionic/tdestroy.c \
bionic/time64.c \
bionic/thread_atexit.c \
bionic/utime.c \
@@ -315,10 +328,21 @@ libc_common_src_files := \
netbsd/nameser/ns_netint.c \
netbsd/nameser/ns_print.c \
netbsd/nameser/ns_samedomain.c \
regex/regcomp.c \
regex/regerror.c \
regex/regexec.c \
regex/regfree.c \
libc_upstream_netbsd_src_files := \
upstream-netbsd/libc/compat-43/creat.c \
upstream-netbsd/libc/gen/ftw.c \
upstream-netbsd/libc/gen/nftw.c \
upstream-netbsd/libc/gen/nice.c \
upstream-netbsd/libc/gen/psignal.c \
upstream-netbsd/libc/regex/regcomp.c \
upstream-netbsd/libc/regex/regerror.c \
upstream-netbsd/libc/regex/regexec.c \
upstream-netbsd/libc/regex/regfree.c \
upstream-netbsd/libc/stdlib/tdelete.c \
upstream-netbsd/libc/stdlib/tfind.c \
upstream-netbsd/libc/stdlib/tsearch.c \
upstream-netbsd/libc/string/strxfrm.c \
# The following files are common, but must be compiled
# with different C flags when building a static C library.
@@ -341,18 +365,19 @@ libc_static_common_src_files := \
# =========================================================
ifeq ($(TARGET_ARCH),arm)
libc_common_src_files += \
bionic/bionic_clone.c \
arch-arm/bionic/__get_pc.S \
arch-arm/bionic/__get_sp.S \
arch-arm/bionic/_exit_with_stack_teardown.S \
arch-arm/bionic/_setjmp.S \
arch-arm/bionic/atomics_arm.S \
arch-arm/bionic/abort_arm.S \
arch-arm/bionic/atomics_arm.c \
arch-arm/bionic/clone.S \
arch-arm/bionic/eabi.c \
arch-arm/bionic/ffs.S \
arch-arm/bionic/futex_arm.S \
arch-arm/bionic/kill.S \
arch-arm/bionic/libgcc_compat.c \
arch-arm/bionic/tkill.S \
arch-arm/bionic/tgkill.S \
arch-arm/bionic/memcmp.S \
arch-arm/bionic/memcmp16.S \
arch-arm/bionic/memcpy.S \
@@ -387,16 +412,16 @@ libc_arch_static_src_files := \
libc_arch_dynamic_src_files := \
arch-arm/bionic/exidx_dynamic.c
else # !arm
endif # arm
ifeq ($(TARGET_ARCH),x86)
libc_common_src_files += \
arch-x86/bionic/__get_sp.S \
arch-x86/bionic/__get_tls.c \
arch-x86/bionic/__set_tls.c \
arch-x86/bionic/atomics_x86.S \
arch-x86/bionic/clone.S \
arch-x86/bionic/_exit_with_stack_teardown.S \
arch-x86/bionic/futex_x86.S \
arch-x86/bionic/setjmp.S \
arch-x86/bionic/_setjmp.S \
arch-x86/bionic/sigsetjmp.S \
@@ -420,68 +445,71 @@ libc_common_src_files += \
libc_static_common_src_files += \
bionic/pthread.c \
# this is needed for static versions of libc
libc_arch_static_src_files := \
arch-x86/bionic/dl_iterate_phdr_static.c
bionic/dl_iterate_phdr_static.c
libc_arch_dynamic_src_files :=
else # !x86
endif # x86
ifeq ($(TARGET_ARCH),mips)
libc_common_src_files += \
arch-mips/bionic/__get_sp.S \
arch-mips/bionic/__get_tls.c \
arch-mips/bionic/__set_tls.c \
arch-mips/bionic/_exit_with_stack_teardown.S \
arch-mips/bionic/_setjmp.S \
arch-mips/bionic/futex_mips.S \
arch-mips/bionic/bzero.S \
arch-mips/bionic/cacheflush.c \
arch-mips/bionic/clone.S \
arch-mips/bionic/ffs.S \
arch-mips/bionic/memcmp16.S \
arch-mips/bionic/memmove.c \
arch-mips/bionic/pipe.S \
arch-mips/bionic/setjmp.S \
arch-mips/bionic/sigsetjmp.S \
arch-mips/bionic/vfork.S
libc_common_src_files += \
arch-mips/string/memset.S \
arch-mips/string/memcpy.S \
arch-mips/string/mips_strlen.c
ifeq ($(TARGET_ARCH),sh)
libc_common_src_files += \
arch-sh/bionic/__get_pc.S \
arch-sh/bionic/__get_sp.S \
arch-sh/bionic/_exit_with_stack_teardown.S \
arch-sh/bionic/_setjmp.S \
arch-sh/bionic/atomics_sh.c \
arch-sh/bionic/atomic_cmpxchg.S \
arch-sh/bionic/clone.S \
arch-sh/bionic/pipe.S \
arch-sh/bionic/memcpy.S \
arch-sh/bionic/memset.S \
arch-sh/bionic/bzero.S \
arch-sh/bionic/setjmp.S \
arch-sh/bionic/sigsetjmp.S \
arch-sh/bionic/syscall.S \
arch-sh/bionic/memmove.S \
arch-sh/bionic/__set_tls.c \
arch-sh/bionic/__get_tls.c \
arch-sh/bionic/ffs.S \
string/bcopy.c \
string/strcmp.c \
string/strncmp.c \
string/memcmp.c \
string/strlen.c \
string/strcmp.c \
string/strcpy.c \
string/strncmp.c
libc_common_src_files += \
bionic/pthread-atfork.c \
bionic/pthread-rwlocks.c \
bionic/pthread-timers.c \
bionic/ptrace.c \
unistd/socketcalls.c
bionic/ptrace.c
libc_static_common_src_files += \
bionic/pthread.c \
bionic/pthread.c
endif # sh
libc_arch_static_src_files := \
bionic/dl_iterate_phdr_static.c
endif # !x86
endif # !arm
libc_arch_dynamic_src_files :=
endif # mips
# Define some common cflags
# ========================================================
libc_common_cflags := \
-DWITH_ERRLIST \
-DANDROID_CHANGES \
-DUSE_LOCKS \
-DREALLOC_ZERO_BYTES_FREES \
-D_LIBC=1 \
-DSOFTFLOAT \
-DFLOATING_POINT \
-DINET6 \
-I$(LOCAL_PATH)/private \
-DUSE_DL_PREFIX \
-DPOSIX_MISTAKE \
-DLOG_ON_HEAP_ERROR \
-DWITH_ERRLIST \
-DANDROID_CHANGES \
-D_LIBC=1 \
-DFLOATING_POINT \
-DINET6 \
-I$(LOCAL_PATH)/private \
-DPOSIX_MISTAKE \
-DLOG_ON_HEAP_ERROR \
-std=gnu99 \
-Wall -Wextra
# these macro definitions are required to implement the
# 'timezone' and 'daylight' global variables, as well as
@@ -495,7 +523,15 @@ ifeq ($(strip $(DEBUG_BIONIC_LIBC)),true)
libc_common_cflags += -DDEBUG
endif
# To customize dlmalloc's alignment, set BOARD_MALLOC_ALIGNMENT in
# the appropriate BoardConfig.mk file.
#
ifneq ($(BOARD_MALLOC_ALIGNMENT),)
libc_common_cflags += -DMALLOC_ALIGNMENT=$(BOARD_MALLOC_ALIGNMENT)
endif
ifeq ($(TARGET_ARCH),arm)
libc_common_cflags += -DSOFTFLOAT
libc_common_cflags += -fstrict-aliasing
libc_crt_target_cflags := -mthumb-interwork
#
@@ -508,16 +544,38 @@ ifeq ($(TARGET_ARCH),arm)
ifeq ($(ARCH_ARM_HAVE_TLS_REGISTER),true)
libc_common_cflags += -DHAVE_ARM_TLS_REGISTER
endif
else # !arm
ifeq ($(TARGET_ARCH),x86)
libc_crt_target_cflags := -m32
# Enable recent IA friendly memory routines (such as for Atom)
# These will not work on the earlier x86 machines
libc_common_cflags += -mtune=i686 -DUSE_SSSE3 -DUSE_SSE2
endif # x86
#
# Define HAVE_32_BYTE_CACHE_LINES to indicate to C
# library it should use to 32-byte version of memcpy, and not
# the 64-byte version.
#
ifeq ($(ARCH_ARM_HAVE_32_BYTE_CACHE_LINES),true)
libc_common_cflags += -DHAVE_32_BYTE_CACHE_LINE
endif
ifeq ($(ARCH_ARM_USE_NON_NEON_MEMCPY),true)
libc_common_cflags += -DARCH_ARM_USE_NON_NEON_MEMCPY
endif
endif # !arm
ifeq ($(TARGET_ARCH),x86)
libc_common_cflags += -DSOFTFLOAT
libc_crt_target_cflags :=
ifeq ($(ARCH_X86_HAVE_SSE2),true)
libc_crt_target_cflags += -DUSE_SSE2=1
endif
ifeq ($(ARCH_X86_HAVE_SSSE3),true)
libc_crt_target_cflags += -DUSE_SSSE3=1
endif
endif # x86
ifeq ($(TARGET_ARCH),mips)
ifneq ($(ARCH_MIPS_HAS_FPU),true)
libc_common_cflags += -DSOFTFLOAT
endif
libc_common_cflags += -fstrict-aliasing
libc_crt_target_cflags := $(TARGET_GLOBAL_CFLAGS)
endif # mips
# Define ANDROID_SMP appropriately.
ifeq ($(TARGET_CPU_SMP),true)
libc_common_cflags += -DANDROID_SMP=1
@@ -525,82 +583,145 @@ else
libc_common_cflags += -DANDROID_SMP=0
endif
# Needed to access private/__dso_handle.S from
# crtbegin_xxx.S and crtend_xxx.S
#
libc_crt_target_cflags += -I$(LOCAL_PATH)/private
ifeq ($(TARGET_ARCH),arm)
libc_crt_target_cflags += -DCRT_LEGACY_WORKAROUND
endif
# crtbrand.c needs <stdint.h> and a #define for the platform SDK version.
libc_crt_target_cflags += \
-I$(LOCAL_PATH)/include \
-DPLATFORM_SDK_VERSION=$(PLATFORM_SDK_VERSION)
# Define some common includes
# ========================================================
libc_common_c_includes := \
$(LOCAL_PATH)/stdlib \
$(LOCAL_PATH)/string \
$(LOCAL_PATH)/stdio
$(LOCAL_PATH)/stdio \
external/safe-iop/include
# Needed to access private/__dso_handle.S from
# Needed to access private/__dso_handle.h from
# crtbegin_xxx.S and crtend_xxx.S
#
libc_crt_target_cflags += -I$(LOCAL_PATH)/private
libc_crt_target_cflags += \
-I$(LOCAL_PATH)/private \
-I$(LOCAL_PATH)/arch-$(TARGET_ARCH)/include
# Define the libc run-time (crt) support object files that must be built,
# which are needed to build all other objects (shared/static libs and
# executables)
# ==========================================================================
ifneq ($(filter arm x86,$(TARGET_ARCH)),)
# ARM and x86 need crtbegin_so/crtend_so.
# ARM, MIPS, and x86 all need crtbegin_so/crtend_so.
#
# For x86, the .init section must point to a function that calls all
# entries in the .ctors section. (on ARM this is done through the
# .init_array section instead).
#
# For both platforms, the .fini_array section must point to a function
# For all the platforms, the .fini_array section must point to a function
# that will call __cxa_finalize(&__dso_handle) in order to ensure that
# static C++ destructors are properly called on dlclose().
#
libc_crt_target_so_cflags := $(libc_crt_target_cflags)
ifeq ($(TARGET_ARCH),x86)
# This flag must be added for x86 targets, but not for ARM
libc_crt_target_so_cflags += -fPIC
ifeq ($(TARGET_ARCH),arm)
libc_crtbegin_extension := c
libc_crt_target_so_cflags :=
endif
GEN := $(TARGET_OUT_STATIC_LIBRARIES)/crtbegin_so.o
$(GEN): $(LOCAL_PATH)/arch-$(TARGET_ARCH)/bionic/crtbegin_so.S
ifeq ($(TARGET_ARCH),mips)
libc_crtbegin_extension := S
libc_crt_target_so_cflags := -fPIC
endif
ifeq ($(TARGET_ARCH),x86)
libc_crtbegin_extension := S
libc_crt_target_so_cflags := -fPIC
endif
ifeq ($(libc_crtbegin_extension),)
$(error $(TARGET_ARCH) not supported)
endif
libc_crt_target_so_cflags += $(libc_crt_target_cflags)
libc_crt_target_crtbegin_file := $(LOCAL_PATH)/arch-$(TARGET_ARCH)/bionic/crtbegin.$(libc_crtbegin_extension)
libc_crt_target_crtbegin_so_file := $(LOCAL_PATH)/arch-$(TARGET_ARCH)/bionic/crtbegin_so.$(libc_crtbegin_extension)
# See the comment in crtbrand.c for the reason why we need to generate
# crtbrand.s before generating crtbrand.o.
GEN := $(TARGET_OUT_INTERMEDIATE_LIBRARIES)/crtbrand.s
$(GEN): $(LOCAL_PATH)/bionic/crtbrand.c
@mkdir -p $(dir $@)
$(TARGET_CC) $(libc_crt_target_so_cflags) -o $@ -c $<
$(hide) $(TARGET_CC) $(libc_crt_target_so_cflags) -S \
-MD -MF $(@:%.s=%.d) -o $@ $<
$(hide) sed -i -e '/\.note\.ABI-tag/s/progbits/note/' $@
$(call transform-d-to-p-args,$(@:%.s=%.d),$(@:%.s=%.P))
-include $(GEN:%.s=%.P)
ALL_GENERATED_SOURCES += $(GEN)
GEN := $(TARGET_OUT_STATIC_LIBRARIES)/crtend_so.o
GEN := $(TARGET_OUT_INTERMEDIATE_LIBRARIES)/crtbrand.o
$(GEN): $(TARGET_OUT_INTERMEDIATE_LIBRARIES)/crtbrand.s
@mkdir -p $(dir $@)
$(hide) $(TARGET_CC) $(libc_crt_target_so_cflags) -o $@ -c $<
ALL_GENERATED_SOURCES += $(GEN)
GEN := $(TARGET_OUT_INTERMEDIATE_LIBRARIES)/crtbegin_so.o
$(GEN): $(libc_crt_target_crtbegin_so_file)
@mkdir -p $(dir $@)
$(hide) $(TARGET_CC) $(libc_crt_target_so_cflags) \
-MD -MF $(@:%.o=%.d) -o $@ -c $<
$(transform-d-to-p)
-include $(GEN:%.o=%.P)
ALL_GENERATED_SOURCES += $(GEN)
GEN := $(TARGET_OUT_INTERMEDIATE_LIBRARIES)/crtend_so.o
$(GEN): $(LOCAL_PATH)/arch-$(TARGET_ARCH)/bionic/crtend_so.S
@mkdir -p $(dir $@)
$(TARGET_CC) $(libc_crt_target_so_cflags) -o $@ -c $<
$(hide) $(TARGET_CC) $(libc_crt_target_so_cflags) \
-MD -MF $(@:%.o=%.d) -o $@ -c $<
$(transform-d-to-p)
-include $(GEN:%.o=%.P)
ALL_GENERATED_SOURCES += $(GEN)
# The following two are installed to device
GEN := $(TARGET_OUT_SHARED_LIBRARIES)/crtbegin_so.o
$(GEN): $(TARGET_OUT_INTERMEDIATE_LIBRARIES)/crtbegin_so.o
$(hide) mkdir -p $(dir $@) && cp -f $< $@
ALL_GENERATED_SOURCES += $(GEN)
GEN := $(TARGET_OUT_SHARED_LIBRARIES)/crtend_so.o
$(GEN): $(TARGET_OUT_INTERMEDIATE_LIBRARIES)/crtend_so.o
$(hide) mkdir -p $(dir $@) && cp -f $< $@
ALL_GENERATED_SOURCES += $(GEN)
endif # TARGET_ARCH == x86 || TARGET_ARCH == arm
GEN := $(TARGET_OUT_STATIC_LIBRARIES)/crtbegin_static.o
$(GEN): $(LOCAL_PATH)/arch-$(TARGET_ARCH)/bionic/crtbegin_static.S
GEN := $(TARGET_OUT_INTERMEDIATE_LIBRARIES)/crtbegin_static1.o
$(GEN): $(libc_crt_target_crtbegin_file)
@mkdir -p $(dir $@)
$(TARGET_CC) $(libc_crt_target_cflags) -o $@ -c $<
$(hide) $(TARGET_CC) $(libc_crt_target_cflags) \
-MD -MF $(@:%.o=%.d) -o $@ -c $<
$(transform-d-to-p)
-include $(GEN:%.o=%.P)
ALL_GENERATED_SOURCES += $(GEN)
GEN := $(TARGET_OUT_STATIC_LIBRARIES)/crtbegin_dynamic.o
$(GEN): $(LOCAL_PATH)/arch-$(TARGET_ARCH)/bionic/crtbegin_dynamic.S
GEN := $(TARGET_OUT_INTERMEDIATE_LIBRARIES)/crtbegin_static.o
$(GEN): $(TARGET_OUT_INTERMEDIATE_LIBRARIES)/crtbegin_static1.o $(TARGET_OUT_INTERMEDIATE_LIBRARIES)/crtbrand.o
@mkdir -p $(dir $@)
$(TARGET_CC) $(libc_crt_target_cflags) -o $@ -c $<
$(hide) $(TARGET_LD) -r -o $@ $^
ALL_GENERATED_SOURCES += $(GEN)
GEN := $(TARGET_OUT_INTERMEDIATE_LIBRARIES)/crtbegin_dynamic1.o
$(GEN): $(libc_crt_target_crtbegin_file)
@mkdir -p $(dir $@)
$(hide) $(TARGET_CC) $(libc_crt_target_cflags) \
-MD -MF $(@:%.o=%.d) -o $@ -c $<
$(transform-d-to-p)
-include $(GEN:%.o=%.P)
ALL_GENERATED_SOURCES += $(GEN)
GEN := $(TARGET_OUT_INTERMEDIATE_LIBRARIES)/crtbegin_dynamic.o
$(GEN): $(TARGET_OUT_INTERMEDIATE_LIBRARIES)/crtbegin_dynamic1.o $(TARGET_OUT_INTERMEDIATE_LIBRARIES)/crtbrand.o
@mkdir -p $(dir $@)
$(hide) $(TARGET_LD) -r -o $@ $^
ALL_GENERATED_SOURCES += $(GEN)
# We rename crtend.o to crtend_android.o to avoid a
# name clash between gcc and bionic.
GEN := $(TARGET_OUT_STATIC_LIBRARIES)/crtend_android.o
GEN := $(TARGET_OUT_INTERMEDIATE_LIBRARIES)/crtend_android.o
$(GEN): $(LOCAL_PATH)/arch-$(TARGET_ARCH)/bionic/crtend.S
@mkdir -p $(dir $@)
$(TARGET_CC) $(libc_crt_target_cflags) -o $@ -c $<
$(hide) $(TARGET_CC) $(libc_crt_target_cflags) \
-MD -MF $(@:%.o=%.d) -o $@ -c $<
$(transform-d-to-p)
-include $(GEN:%.o=%.P)
ALL_GENERATED_SOURCES += $(GEN)
@@ -608,18 +729,60 @@ ALL_GENERATED_SOURCES += $(GEN)
# "WITH_MALLOC_CHECK_LIBC_A := true" to buildspec.mk
WITH_MALLOC_CHECK_LIBC_A := $(strip $(WITH_MALLOC_CHECK_LIBC_A))
# ========================================================
# libbionic_ssp.a - stack protector code
# ========================================================
#
# The stack protector code needs to be compiled
# with -fno-stack-protector, since it modifies the
# stack canary.
include $(CLEAR_VARS)
LOCAL_SRC_FILES := bionic/ssp.c
LOCAL_CFLAGS := $(libc_common_cflags) -fno-stack-protector
LOCAL_C_INCLUDES := $(libc_common_c_includes)
LOCAL_MODULE := libbionic_ssp
LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk
LOCAL_SYSTEM_SHARED_LIBRARIES :=
include $(BUILD_STATIC_LIBRARY)
# ========================================================
# libc_netbsd.a - upstream NetBSD C library code
# ========================================================
#
# These files are built with the netbsd-compat.h header file
# automatically included.
include $(CLEAR_VARS)
LOCAL_SRC_FILES := $(libc_upstream_netbsd_src_files)
LOCAL_CFLAGS := \
$(libc_common_cflags) \
-I$(LOCAL_PATH)/upstream-netbsd \
-include upstream-netbsd/netbsd-compat.h
LOCAL_C_INCLUDES := $(libc_common_c_includes)
LOCAL_MODULE := libc_netbsd
LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk
LOCAL_SYSTEM_SHARED_LIBRARIES :=
include $(BUILD_STATIC_LIBRARY)
# ========================================================
# libc_common.a
# ========================================================
include $(CLEAR_VARS)
LOCAL_SRC_FILES := $(libc_common_src_files)
LOCAL_CFLAGS := $(libc_common_cflags)
ifeq ($(TARGET_ARCH),arm)
LOCAL_CFLAGS += -DCRT_LEGACY_WORKAROUND
endif
LOCAL_C_INCLUDES := $(libc_common_c_includes)
LOCAL_MODULE := libc_common
LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk
LOCAL_WHOLE_STATIC_LIBRARIES := libbionic_ssp libc_netbsd
LOCAL_SYSTEM_SHARED_LIBRARIES :=
include $(BUILD_STATIC_LIBRARY)
@@ -647,6 +810,7 @@ LOCAL_CFLAGS := $(libc_common_cflags) \
-DLIBC_STATIC
LOCAL_MODULE := libc_nomalloc
LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk
LOCAL_WHOLE_STATIC_LIBRARIES := libc_common
LOCAL_SYSTEM_SHARED_LIBRARIES :=
@@ -662,13 +826,14 @@ LOCAL_SRC_FILES := \
$(libc_arch_static_src_files) \
$(libc_static_common_src_files) \
bionic/dlmalloc.c \
bionic/malloc_debug_common.c \
bionic/malloc_debug_common.cpp \
bionic/libc_init_static.c
LOCAL_CFLAGS := $(libc_common_cflags) \
-DLIBC_STATIC
LOCAL_C_INCLUDES := $(libc_common_c_includes)
LOCAL_MODULE := libc
LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk
LOCAL_WHOLE_STATIC_LIBRARIES := libc_common
LOCAL_SYSTEM_SHARED_LIBRARIES :=
@@ -680,17 +845,36 @@ include $(BUILD_STATIC_LIBRARY)
# ========================================================
include $(CLEAR_VARS)
LOCAL_CFLAGS := $(libc_common_cflags)
# pthread deadlock prediction:
# set -DPTHREAD_DEBUG -DPTHREAD_DEBUG_ENABLED=1 to enable support for
# pthread deadlock prediction.
# Since this code is experimental it is disabled by default.
# see libc/bionic/pthread_debug.c for details
LOCAL_CFLAGS := $(libc_common_cflags) -DPTHREAD_DEBUG -DPTHREAD_DEBUG_ENABLED=0
LOCAL_C_INCLUDES := $(libc_common_c_includes)
LOCAL_SRC_FILES := \
$(libc_arch_dynamic_src_files) \
$(libc_static_common_src_files) \
bionic/dlmalloc.c \
bionic/malloc_debug_common.c \
bionic/malloc_debug_common.cpp \
bionic/pthread_debug.c \
bionic/libc_init_dynamic.c
ifeq ($(TARGET_ARCH),arm)
LOCAL_NO_CRT := true
LOCAL_CFLAGS += -DCRT_LEGACY_WORKAROUND
LOCAL_SRC_FILES := \
arch-arm/bionic/crtbegin_so.c \
arch-arm/bionic/atexit_legacy.c \
$(LOCAL_SRC_FILES) \
arch-arm/bionic/crtend_so.S
endif
LOCAL_MODULE:= libc
LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk
# WARNING: The only library libc.so should depend on is libdl.so! If you add other libraries,
# make sure to add -Wl,--exclude-libs=libgcc.a to the LOCAL_LDFLAGS for those libraries. This
@@ -727,11 +911,15 @@ LOCAL_CFLAGS := \
LOCAL_C_INCLUDES := $(libc_common_c_includes)
LOCAL_SRC_FILES := \
bionic/malloc_debug_leak.c
bionic/malloc_debug_leak.cpp \
bionic/malloc_debug_check.cpp \
bionic/malloc_debug_check_mapinfo.cpp \
bionic/malloc_debug_stacktrace.cpp
LOCAL_MODULE:= libc_malloc_debug_leak
LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk
LOCAL_SHARED_LIBRARIES := libc
LOCAL_SHARED_LIBRARIES := libc libdl
LOCAL_WHOLE_STATIC_LIBRARIES := libc_common
LOCAL_SYSTEM_SHARED_LIBRARIES :=
LOCAL_ALLOW_UNDEFINED_SYMBOLS := true
@@ -754,11 +942,12 @@ LOCAL_CFLAGS := \
LOCAL_C_INCLUDES := $(libc_common_c_includes)
LOCAL_SRC_FILES := \
bionic/malloc_debug_qemu.c
bionic/malloc_debug_qemu.cpp
LOCAL_MODULE:= libc_malloc_debug_qemu
LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk
LOCAL_SHARED_LIBRARIES := libc
LOCAL_SHARED_LIBRARIES := libc libdl
LOCAL_WHOLE_STATIC_LIBRARIES := libc_common
LOCAL_SYSTEM_SHARED_LIBRARIES :=

View File

@@ -1,441 +0,0 @@
# This file is used to build the Bionic library with the Jam build
# tool. For info, see www.perforce.com/jam/jam.html
#
BIONIC_TOP ?= $(DOT) ;
DEBUG = 1 ;
# pattern used for automatic heade inclusion detection
HDRPATTERN = "^[ ]*#[ ]*include[ ]*[<\"]([^\">]*)[\">].*$" ;
# debugging support, simply define the DEBUG variable to activate verbose output
rule Debug
{
if $(DEBUG) {
Echo $(1) ;
}
}
# return all elements from $(1) that are not in $(2)
rule Filter list : filter
{
local result = ;
local item ;
for item in $(list) {
if ! $(item) in $(filter) {
result += $(item) ;
}
}
return $(result) ;
}
# reverse a list of elements
rule Reverse list
{
local result = ;
local item ;
for item in $(list) {
result = $(item) $(result) ;
}
return $(result) ;
}
# decompose a path into a list of elements
rule PathDecompose dir
{
local result ;
while $(dir:D)
{
if ! $(dir:BS) { # for rooted paths like "/foo"
break ;
}
result = $(dir:BS) $(result) ;
dir = $(dir:D) ;
}
result = $(dir) $(result) ;
return $(result) ;
}
# simply a file path, i.e. get rid of . or .. when possible
rule _PathSimplify dir
{
local result = ;
local dir2 d ;
dir = [ PathDecompose $(dir) ] ;
# get rid of any single dot
dir2 = ;
for d in $(dir) {
if $(d) = "." {
continue ;
}
dir2 += $(d) ;
}
# get rid of .. when possible
for d in $(dir2) {
if $(d) = ".." && $(result) {
result = $(result[2-]) ;
}
else
result = $(d) $(result) ;
}
# now invert the result
result = [ Reverse $(result) ] ;
if ! $(result) {
result = "." ;
}
return $(result:J="/") ;
}
rule PathSimplify dirs
{
local result ;
local d ;
for d in $(dirs) {
result += [ _PathSimplify $(d) ] ;
}
return $(result) ;
}
# retrieve list of subdirectories
rule ListSubDirs paths
{
local result = ;
local entry ;
for entry in [ Glob $(paths) : * ] {
if ! $(entry:S) {
result += $(entry) ;
}
}
return [ PathSimplify $(result) ] ;
}
# retrieve list of sources in a given directory
rule ListSources path
{
return [ Glob $(path) : *.S *.c ] ;
}
# find the prebuilt directory
#
if ! $(TOP) {
Echo "Please define TOP as the root of your device build tree" ;
Exit ;
}
Debug "OS is" $(OS) ;
Debug "CPU is" $(CPU) ;
if $(OS) = LINUX
{
PREBUILT = $(TOP)/prebuilt/Linux ;
}
else if $(OS) = MACOSX
{
switch $(CPU) {
case i386 : PREBUILT = $(TOP)/prebuilt/darwin-x86 ; break ;
case ppc : PREBUILT = $(TOP)/prebuilt/darwin-ppc ; break ;
case * : Echo "unsupported CPU" "$(CPU) !!" ;
Echo "Please contact digit@google.com for help" ;
Exit ;
}
}
else
{
Echo "Unsupported operating system" $(OS) ;
Echo "Please contact digit@google.com for help" ;
Exit ;
}
Debug "TOP is" $(TOP) ;
Debug "PREBUILT is" $(PREBUILT) ;
# check architectures and setup toolchain variables
#
SUPPORTED_ARCHS = x86 arm ;
ARCH ?= $(SUPPORTED_ARCHS) ;
if ! $(ARCH) in $(SUPPORTED_ARCHS) {
Echo "The variable ARCH contains an unsupported value, use one or more of these instead" ;
Echo "separated by spaces:" $(SUPPORTED_ARCHS) ;
Exit ;
}
x86_TOOLSET_PREFIX ?= "" ;
arm_TOOLSET_PREFIX ?= $(TOP)/prebuilt/Linux/toolchain-4.1.1/bin/arm-elf- ;
for arch in $(ARCH) {
CC_$(arch) = $($(arch)_TOOLSET_PREFIX)gcc ;
C++_$(arch) = $($(arch)_TOOLSET_PREFIX)g++ ;
AR_$(arch) = $($(arch)_TOOLSET_PREFIX)ar ;
}
# the list of arch-independent source subdirectories
BIONIC_SRC_SUBDIRS = string ;
BIONIC_x86_SUBDIRS = ;
BIONIC_arm_SUBDIRS = ;
CFLAGS = -O0 -g -W ;
# find sources in a given list of subdirectories
rule FindSources dirs
{
local dir ;
for dir in $(dirs)
{
local LOCAL_SRC NO_LOCAL_SRC ;
if [ Glob $(dir) : rules.jam ] {
include $(dir)/rules.jam ;
if $(LOCAL_SRC) {
_sources = $(LOCAL_SRC) ;
}
else {
_sources = [ Glob $(dir) : *.S *.c ] ;
_sources = $(_sources:BS) ;
}
if $(NO_LOCAL_SRC) {
_sources = [ Filter $(_sources) : $(NO_LOCAL_SRC) ] ;
}
sources += $(dir)/$(_sources) ;
}
else
sources += [ ListSources $(dir) ] ;
}
}
# Compile a given object file from a source
rule Compile object : source
{
Depends $(object) : $(source) ;
Depends bionic : $(object) ;
Clean clean : $(object) ;
MakeLocate $(object) : $(OUT) ;
CC on $(object) = $(CC_$(arch)) ;
CFLAGS on $(object) = $(CFLAGS) ;
INCLUDES on $(object) = $(INCLUDES) ;
DEFINES on $(object) = $(DEFINES) ;
HDRRULE on $(>) = HdrRule ;
HDRSCAN on $(>) = $(HDRPATTERN) ;
HDRSEARCH on $(>) = $(INCLUDES) ;
HDRGRIST on $(>) = $(HDRGRIST) ;
}
actions Compile
{
$(CC) -c -o $(1) $(CFLAGS) -I$(INCLUDES) -D$(DEFINES) $(2)
}
rule RmTemps
{
Temporary $(2) ;
}
actions quietly updated piecemeal together RmTemps
{
rm -f $(2)
}
actions Archive
{
$(AR) ru $(1) $(2)
}
rule Library library : objects
{
local obj ;
if ! $(library:S) {
library = $(library:S=.a) ;
}
library = $(library:G=<$(arch)>) ;
Depends all : $(library) ;
if ! $(library:D) {
MakeLocate $(library) $(library)($(objects:BS)) : $(OUT) ;
}
Depends $(library) : $(library)($(objects:BS)) ;
for obj in $(objects) {
Depends $(library)($(obj:BS)) : $(obj) ;
}
Clean clean : $(library) ;
AR on $(library) = $(AR_$(arch)) ;
Archive $(library) : $(objects) ;
RmTemps $(library) : $(objects) ;
}
rule ProcessDir
{
local CFLAGS = $(CFLAGS) ;
local DEFINES = $(DEFINES) ;
local INCLUDES = $(INCLUDES) ;
local local_rules = [ Glob $(1) : rules.jam ] ;
local source sources ;
if $(local_rules) {
local LOCAL_CFLAGS LOCAL_DEFINES LOCAL_INCLUDES LOCAL_SRC NO_LOCAL_SRC ;
include $(local_rules) ;
CFLAGS += $(LOCAL_CFLAGS) ;
DEFINES += $(LOCAL_DEFINES) ;
INCLUDES += $(LOCAL_INCLUDES) ;
if $(LOCAL_SRC) {
sources = $(LOCAL_SRC) ;
}
else {
sources = [ Glob $(1) : *.S *.c ] ;
sources = $(sources:BS) ;
}
if $(NO_LOCAL_SRC) {
sources = [ Filter $(sources) : $(NO_LOCAL_SRC) ] ;
}
sources = $(1)/$(sources) ;
}
else
sources = [ Glob $(1) : *.S *.c ] ;
for source in $(sources) {
local name = $(source:B) ;
if $(source:S) = ".S" {
# record the list of assembler sources
ASSEMBLER_SOURCES += $(name) ;
}
else if $(source:S) = ".c" && $(name) in $(ASSEMBLER_SOURCES) {
# skip C source file if corresponding assembler exists
continue ;
}
objname = <$(arch)>$(name).o ;
Compile $(objname) : $(source) ;
ALL_OBJECTS += $(objname) ;
}
}
rule ProcessDirs
{
local dir ;
for dir in $(1) {
ProcessDir $(dir) ;
}
}
INCLUDES_x86 = /usr/src/linux/include ;
INCLUDES_arm = ../kernel_headers
include/arch/arm
include/bits32
;
INCLUDES = include stdio string stdlib .
../msun/include
;
DEFINES = ANDROID_CHANGES
USE_LOCKS
REALLOC_ZERO_BYTES_FREES
_LIBC=1
SOFTFLOAT
FLOATING_POINT
NEED_PSELECT=1
ANDROID
;
CFLAGS_x86 = ;
for arch in $(ARCH)
{
local ARCH_DIR = $(BIONIC_TOP)/arch-$(arch) ;
local INCLUDES = $(INCLUDES_$(arch)) $(ARCH_DIR)/include $(INCLUDES) ;
local DEFINES = $(DEFINES_$(arch)) $(DEFINES) ARCH=$(arch) ;
local CFLAGS = $(CFLAGS) $(CFLAGS_$(arch)) ;
local OUT = out/$(arch) ;
local ASSEMBLER_SOURCES ALL_OBJECTS ;
ProcessDirs [ ListSubDirs $(ARCH_DIR) ] ;
ProcessDirs stdlib stdio unistd string tzcode inet ;
ProcessDirs [ ListSubDirs netbsd ] ;
ProcessDirs bionic ;
Library bionic : $(ALL_OBJECTS) ;
}
BIONIC_SEARCH = $(BIONIC_TOP)/include ;
# /HdrRule source : headers ;
#
# Arranges the proper dependencies when the file _source_ includes the files
# _headers_ through the #include C preprocessor directive
#
# this rule is not intendend to be called explicitely. It is called
# automatically during header scanning on sources handled by the @Object
# rule (e.g. sources in @Main or @Library rules)
#
rule HdrRule
{
# HdrRule source : headers ;
# N.B. This rule is called during binding, potentially after
# the fate of many targets has been determined, and must be
# used with caution: don't add dependencies to unrelated
# targets, and don't set variables on $(<).
# Tell Jam that anything depending on $(<) also depends on $(>),
# set SEARCH so Jam can find the headers, but then say we don't
# care if we can't actually find the headers (they may have been
# within ifdefs),
local s = $(>:G=$(HDRGRIST:E)) ;
Includes $(<) : $(s) ;
SEARCH on $(s) = $(HDRSEARCH) ;
NoCare $(s) ;
# Propagate on $(<) to $(>)
HDRSEARCH on $(s) = $(HDRSEARCH) ;
HDRSCAN on $(s) = $(HDRSCAN) ;
HDRRULE on $(s) = $(HDRRULE) ;
HDRGRIST on $(s) = $(HDRGRIST) ;
}

File diff suppressed because it is too large Load Diff

View File

@@ -1,10 +1,10 @@
# this file is used to list all the syscalls that will be supported by
# the Bionic C library. It is used to automatically generate the syscall
# stubs, the list of syscall constants (__NR_xxxx) and the content of <linux/_unitsd.h>
# stubs, the list of syscall constants (__NR_xxxx) and the content of <linux/_unistd.h>
#
# each non comment line has the following format:
#
# return_type func_name[:syscall_name[:call_id]]([parameter_list]) (#syscall_number|stub)
# return_type func_name[:syscall_name[:call_id]]([parameter_list]) (syscall_number|"stub")
#
# note that:
# - syscall_name correspond to the name of the syscall, which may differ from
@@ -22,18 +22,18 @@
# assembler template for the syscall; it's up to the bionic implementation to provide
# a relevant C stub
#
# - additionally, if the syscall number is different amoung ARM, x86 and SuperH, use:
# return_type funcname[:syscall_name](parameters) arm_number,x86_number,superh_number
# - additionally, if the syscall number is different amoung ARM, and x86, MIPS use:
# return_type funcname[:syscall_name](parameters) arm_number,x86_number,mips_number
#
# the file is processed by a python script named gensyscalls.py
#
# process management
void _exit:exit_group (int) 248,252
void _exit_thread:exit (int) 1
void _exit:exit_group (int) 248,252,246
void _exit_thread:exit (int) 1
pid_t __fork:fork (void) 2
pid_t _waitpid:waitpid (pid_t, int*, int, struct rusage*) -1,7
int __waitid:waitid(int, pid_t, struct siginfo_t*, int,void*) 280,284
pid_t _waitpid:waitpid (pid_t, int*, int, struct rusage*) -1,7,7
int __waitid:waitid(int, pid_t, struct siginfo_t*, int,void*) 280,284,278
# NOTE: this system call is never called directly, but we list it there
# to have __NR_clone properly defined.
@@ -42,70 +42,90 @@ pid_t __sys_clone:clone (int, void*, int*, void*, int*) 120
int execve (const char*, char* const*, char* const*) 11
int __setuid:setuid32 (uid_t) 213
uid_t getuid:getuid32 () 199
gid_t getgid:getgid32 () 200
uid_t geteuid:geteuid32 () 201
gid_t getegid:getegid32 () 202
uid_t getresuid:getresuid32 () 209
gid_t getresgid:getresgid32 () 211
pid_t gettid() 224
int getgroups:getgroups32(int, gid_t *) 205
int __setuid:setuid32 (uid_t) 213,213,-1
int __setuid:setuid (uid_t) -1,-1,23
uid_t getuid:getuid32 () 199,199,-1
uid_t getuid:getuid () -1,-1,24
gid_t getgid:getgid32 () 200,200,-1
gid_t getgid:getgid () -1,-1,47
uid_t geteuid:geteuid32 () 201,201,-1
uid_t geteuid:geteuid () -1,-1,49
gid_t getegid:getegid32 () 202,202,-1
gid_t getegid:getegid () -1,-1,50
uid_t getresuid:getresuid32 (uid_t *ruid, uid_t *euid, uid_t *suid) 209,209,-1
uid_t getresuid:getresuid (uid_t *ruid, uid_t *euid, uid_t *suid) -1,-1,186
gid_t getresgid:getresgid32 (gid_t *rgid, gid_t *egid, gid_t *sgid) 211,211,-1
gid_t getresgid:getresgid (gid_t *rgid, gid_t *egid, gid_t *sgid) -1,-1,191
pid_t gettid() 224,224,222
ssize_t readahead(int, off64_t, size_t) 225,225,223
int getgroups:getgroups32(int, gid_t *) 205,205,-1
int getgroups:getgroups(int, gid_t *) -1,-1,80
pid_t getpgid(pid_t) 132
pid_t getppid() 64
pid_t getppid() 64
pid_t getsid(pid_t) 147
pid_t setsid() 66
int setgid:setgid32(gid_t) 214
int setgid:setgid32(gid_t) 214,214,-1
int setgid:setgid(gid_t) -1,-1,46
int seteuid:seteuid32(uid_t) stub
int __setreuid:setreuid32(uid_t, uid_t) 203
int __setresuid:setresuid32(uid_t, uid_t, uid_t) 208
int setresgid:setresgid32(gid_t, gid_t, gid_t) 210
int __setreuid:setreuid32(uid_t, uid_t) 203,203,-1
int __setreuid:setreuid(uid_t, uid_t) -1,-1,70
int __setresuid:setresuid32(uid_t, uid_t, uid_t) 208,208,-1
int __setresuid:setresuid(uid_t, uid_t, uid_t) -1,-1,185
int setresgid:setresgid32(gid_t, gid_t, gid_t) 210,210,-1
int setresgid:setresgid(gid_t, gid_t, gid_t) -1,-1,190
void* __brk:brk(void*) 45
# see comments in arch-arm/bionic/kill.S to understand why we don't generate an ARM stub for kill/tkill
int kill(pid_t, int) -1,37
int tkill(pid_t tid, int sig) -1,238
int kill(pid_t, int) -1,37,37
int tkill(pid_t tid, int sig) -1,238,236
int tgkill(pid_t tgid, pid_t tid, int sig) -1,270,266
int __ptrace:ptrace(int request, int pid, void* addr, void* data) 26
int __set_thread_area:set_thread_area(void* user_desc) -1,243
int __set_thread_area:set_thread_area(void* user_desc) -1,243,283
int __getpriority:getpriority(int, int) 96
int setpriority(int, int, int) 97
int setrlimit(int resource, const struct rlimit *rlp) 75
int getrlimit:ugetrlimit(int resource, struct rlimit *rlp) 191
int getrlimit:ugetrlimit(int resource, struct rlimit *rlp) 191,191,-1
int getrlimit:getrlimit(int resource, struct rlimit *rlp) -1,-1,76
int getrusage(int who, struct rusage* r_usage) 77
int setgroups:setgroups32(int, const gid_t *) 206
int setgroups:setgroups32(int, const gid_t *) 206,206,-1
int setgroups:setgroups(int, const gid_t *) -1,-1,81
pid_t getpgrp(void) stub
int setpgid(pid_t, pid_t) 57
pid_t vfork(void) 190,-1,190
int setregid:setregid32(gid_t, gid_t) 204
pid_t vfork(void) 190,-1,-1
int setregid:setregid32(gid_t, gid_t) 204,204,-1
int setregid:setregid(gid_t, gid_t) -1,-1,71
int chroot(const char *) 61
# IMPORTANT: Even though <sys/prctl.h> declares prctl(int,...), the syscall stub must take 6 arguments
# to match the kernel implementation.
int prctl(int option, unsigned int arg2, unsigned int arg3, unsigned int arg4, unsigned int arg5) 172
int capget(cap_user_header_t header, cap_user_data_t data) 184
int capset(cap_user_header_t header, const cap_user_data_t data) 185
int sigaltstack(const stack_t*, stack_t*) 186
int prctl(int option, unsigned int arg2, unsigned int arg3, unsigned int arg4, unsigned int arg5) 172,172,192
int capget(cap_user_header_t header, cap_user_data_t data) 184,184,204
int capset(cap_user_header_t header, const cap_user_data_t data) 185,185,205
int sigaltstack(const stack_t*, stack_t*) 186,186,206
int acct(const char* filepath) 51
# file descriptors
ssize_t read (int, void*, size_t) 3
ssize_t write (int, const void*, size_t) 4
ssize_t pread64 (int, void *, size_t, off64_t) 180
ssize_t pwrite64 (int, void *, size_t, off64_t) 181
ssize_t pread64 (int, void *, size_t, off64_t) 180,180,200
ssize_t pwrite64 (int, void *, size_t, off64_t) 181,181,201
int __open:open (const char*, int, mode_t) 5
int __openat:openat (int, const char*, int, mode_t) 322,295
int __openat:openat (int, const char*, int, mode_t) 322,295,288
int close (int) 6
int creat(const char*, mode_t) stub
off_t lseek(int, off_t, int) 19
int __llseek:_llseek (int, unsigned long, unsigned long, loff_t*, int) 140
pid_t getpid () 20
void * mmap(void *, size_t, int, int, int, long) stub
void * __mmap2:mmap2(void*, size_t, int, int, int, long) 192
void * __mmap2:mmap2(void*, size_t, int, int, int, long) 192,192,210
int munmap(void *, size_t) 91
void * mremap(void *, size_t, size_t, unsigned long) 163
void * mremap(void *, size_t, size_t, unsigned long) 163,163,167
int msync(const void *, size_t, int) 144
int mprotect(const void *, size_t, int) 125
int madvise(const void *, size_t, int) 220,219
int mlock(const void *addr, size_t len) 150
int munlock(const void *addr, size_t len) 151
int mincore(void* start, size_t length, unsigned char* vec) 219,218
int madvise(const void *, size_t, int) 220,219,218
int mlock(const void *addr, size_t len) 150,150,154
int munlock(const void *addr, size_t len) 151,151,155
int mlockall(int flags) 152,152,156
int munlockall() 153,153,157
int mincore(void* start, size_t length, unsigned char* vec) 219,218,217
int __ioctl:ioctl(int, int, void *) 54
int readv(int, const struct iovec *, int) 145
int writev(int, const struct iovec *, int) 146
@@ -114,95 +134,114 @@ int flock(int, int) 143
int fchmod(int, mode_t) 94
int dup(int) 41
int pipe(int *) 42,42,-1
int pipe2(int *, int) 359,331
int pipe2(int *, int) 359,331,328
int dup2(int, int) 63
int select:_newselect(int, struct fd_set *, struct fd_set *, struct fd_set *, struct timeval *) 142
int ftruncate(int, off_t) 93
int ftruncate64(int, off64_t) 194
int getdents:getdents64(unsigned int, struct dirent *, unsigned int) 217,220
int ftruncate64(int, off64_t) 194,194,212
int getdents:getdents64(unsigned int, struct dirent *, unsigned int) 217,220,219
int fsync(int) 118
int fdatasync(int) 148
int fchown:fchown32(int, uid_t, gid_t) 207
int fdatasync(int) 148,148,152
int fchown:fchown32(int, uid_t, gid_t) 207,207,-1
int fchown:fchown(int, uid_t, gid_t) -1,-1,95
void sync(void) 36
int __fcntl64:fcntl64(int, int, void *) 221
int __fstatfs64:fstatfs64(int, size_t, struct statfs *) 267,269
ssize_t sendfile(int out_fd, int in_fd, off_t *offset, size_t count) 187
int fstatat:fstatat64(int dirfd, const char *path, struct stat *buf, int flags) 327,300
int mkdirat(int dirfd, const char *pathname, mode_t mode) 323,296
int fchownat(int dirfd, const char *path, uid_t owner, gid_t group, int flags) 325,298
int fchmodat(int dirfd, const char *path, mode_t mode, int flags) 333,306
int renameat(int olddirfd, const char *oldpath, int newdirfd, const char *newpath) 329,302
int __fcntl64:fcntl64(int, int, void *) 221,221,220
int __fstatfs64:fstatfs64(int, size_t, struct statfs *) 267,269,256
ssize_t sendfile(int out_fd, int in_fd, off_t *offset, size_t count) 187,187,207
int fstatat:fstatat64(int dirfd, const char *path, struct stat *buf, int flags) 327,300,293
int mkdirat(int dirfd, const char *pathname, mode_t mode) 323,296,289
int fchownat(int dirfd, const char *path, uid_t owner, gid_t group, int flags) 325,298,291
int fchmodat(int dirfd, const char *path, mode_t mode, int flags) 333,306,299
int renameat(int olddirfd, const char *oldpath, int newdirfd, const char *newpath) 329,302,295
int fsetxattr(int, const char *, const void *, size_t, int) 228,228,226
ssize_t fgetxattr(int, const char *, void *, size_t) 231,231,229
ssize_t flistxattr(int, char *, size_t) 234,234,232
int fremovexattr(int, const char *) 237,237,235
# file system
int link (const char*, const char*) 9
int unlink (const char*) 10
int unlinkat (int, const char *, int) 328,301
int unlinkat (int, const char *, int) 328,301,294
int chdir (const char*) 12
int mknod (const char*, mode_t, dev_t) 14
int chmod (const char*,mode_t) 15
int chown:chown32(const char *, uid_t, gid_t) 212
int lchown:lchown32 (const char*, uid_t, gid_t) 198
int chown:chown32(const char *, uid_t, gid_t) 212,212,-1
int chown:chown(const char *, uid_t, gid_t) -1,-1,202
int lchown:lchown32 (const char*, uid_t, gid_t) 198,198,-1
int lchown:lchown (const char*, uid_t, gid_t) -1,-1,16
int mount (const char*, const char*, const char*, unsigned long, const void*) 21
int umount(const char*) stub
int umount2 (const char*, int) 52
int fstat:fstat64(int, struct stat*) 197
int stat:stat64(const char *, struct stat *) 195
int lstat:lstat64(const char *, struct stat *) 196
int fstat:fstat64(int, struct stat*) 197,197,215
int stat:stat64(const char *, struct stat *) 195,195,213
int lstat:lstat64(const char *, struct stat *) 196,196,214
int mkdir(const char *, mode_t) 39
int readlink(const char *, char *, size_t) 85
int rmdir(const char *) 40
int rename(const char *, const char *) 38
int __getcwd:getcwd(char * buf, size_t size) 183
int __getcwd:getcwd(char * buf, size_t size) 183,183,203
int access(const char *, int) 33
int faccessat(int, const char *, int, int) 334,307,300
int symlink(const char *, const char *) 83
int fchdir(int) 133
int truncate(const char*, off_t) 92
int __statfs64:statfs64(const char *, size_t, struct statfs *) 266,268
int setxattr(const char *, const char *, const void *, size_t, int) 226,226,224
int lsetxattr(const char *, const char *, const void *, size_t, int) 227,227,225
ssize_t getxattr(const char *, const char *, void *, size_t) 229,229,227
ssize_t lgetxattr(const char *, const char *, void *, size_t) 230,230,228
ssize_t listxattr(const char *, char *, size_t) 232,232,230
ssize_t llistxattr(const char *, char *, size_t) 233,233,231
int removexattr(const char *, const char *) 235,235,233
int lremovexattr(const char *, const char *) 236,236,234
int __statfs64:statfs64(const char *, size_t, struct statfs *) 266,268,255
long unshare(unsigned long) 337,310,303
# time
int pause () 29
int gettimeofday(struct timeval*, struct timezone*) 78
int settimeofday(const struct timeval*, const struct timezone*) 79
clock_t times(struct tms *) 43
int nanosleep(const struct timespec *, struct timespec *) 162
int clock_gettime(clockid_t clk_id, struct timespec *tp) 263,265
int clock_settime(clockid_t clk_id, const struct timespec *tp) 262,264
int clock_getres(clockid_t clk_id, struct timespec *res) 264,266
int clock_nanosleep(const struct timespec *req, struct timespec *rem) 265,267
int nanosleep(const struct timespec *, struct timespec *) 162,162,166
int clock_gettime(clockid_t clk_id, struct timespec *tp) 263,265,263
int clock_settime(clockid_t clk_id, const struct timespec *tp) 262,264,262
int clock_getres(clockid_t clk_id, struct timespec *res) 264,266,264
int clock_nanosleep(clockid_t clock_id, int flags, const struct timespec *req, struct timespec *rem) 265,267,265
int getitimer(int, const struct itimerval *) 105
int setitimer(int, const struct itimerval *, struct itimerval *) 104
int __timer_create:timer_create(clockid_t clockid, struct sigevent *evp, timer_t *timerid) 257,259
int __timer_settime:timer_settime(timer_t, int, const struct itimerspec*, struct itimerspec*) 258,260
int __timer_gettime:timer_gettime(timer_t, struct itimerspec*) 259,261
int __timer_getoverrun:timer_getoverrun(timer_t) 260,262
int __timer_delete:timer_delete(timer_t) 261,263
int utimes(const char*, const struct timeval tvp[2]) 269, 271
int utimensat(int, const char *, const struct timespec times[2], int) 348, 320, 320
int __timer_create:timer_create(clockid_t clockid, struct sigevent *evp, timer_t *timerid) 257,259,257
int __timer_settime:timer_settime(timer_t, int, const struct itimerspec*, struct itimerspec*) 258,260,258
int __timer_gettime:timer_gettime(timer_t, struct itimerspec*) 259,261,259
int __timer_getoverrun:timer_getoverrun(timer_t) 260,262,260
int __timer_delete:timer_delete(timer_t) 261,263,261
int utimes(const char*, const struct timeval tvp[2]) 269,271,267
int utimensat(int, const char *, const struct timespec times[2], int) 348,320,316
# signals
int sigaction(int, const struct sigaction *, struct sigaction *) 67
int sigprocmask(int, const sigset_t *, sigset_t *) 126
int __sigsuspend:sigsuspend(int unused1, int unused2, unsigned mask) 72
int __rt_sigaction:rt_sigaction (int sig, const struct sigaction *act, struct sigaction *oact, size_t sigsetsize) 174
int __rt_sigprocmask:rt_sigprocmask (int how, const sigset_t *set, sigset_t *oset, size_t sigsetsize) 175
int __rt_sigtimedwait:rt_sigtimedwait(const sigset_t *set, struct siginfo_t *info, struct timespec_t *timeout, size_t sigset_size) 177
int __sigsuspend:sigsuspend(int unused1, int unused2, unsigned mask) 72,72,-1
int __sigsuspend:sigsuspend(const sigset_t *mask) -1,-1,72
int __rt_sigaction:rt_sigaction (int sig, const struct sigaction *act, struct sigaction *oact, size_t sigsetsize) 174,174,194
int __rt_sigprocmask:rt_sigprocmask (int how, const sigset_t *set, sigset_t *oset, size_t sigsetsize) 175,175,195
int __rt_sigtimedwait:rt_sigtimedwait(const sigset_t *set, struct siginfo_t *info, struct timespec_t *timeout, size_t sigset_size) 177,177,197
int sigpending(sigset_t *) 73
# sockets
int socket(int, int, int) 281,-1
int socketpair(int, int, int, int*) 288,-1
int bind(int, struct sockaddr *, int) 282,-1
int connect(int, struct sockaddr *, socklen_t) 283,-1
int listen(int, int) 284,-1
int accept(int, struct sockaddr *, socklen_t *) 285,-1
int getsockname(int, struct sockaddr *, socklen_t *) 286,-1
int getpeername(int, struct sockaddr *, socklen_t *) 287,-1
int sendto(int, const void *, size_t, int, const struct sockaddr *, socklen_t) 290,-1
int recvfrom(int, void *, size_t, unsigned int, struct sockaddr *, socklen_t *) 292,-1
int shutdown(int, int) 293,-1
int setsockopt(int, int, int, const void *, socklen_t) 294,-1
int getsockopt(int, int, int, void *, socklen_t *) 295,-1
int sendmsg(int, const struct msghdr *, unsigned int) 296,-1
int recvmsg(int, struct msghdr *, unsigned int) 297,-1
int socket(int, int, int) 281,-1,183
int socketpair(int, int, int, int*) 288,-1,184
int bind(int, struct sockaddr *, int) 282,-1,169
int connect(int, struct sockaddr *, socklen_t) 283,-1,170
int listen(int, int) 284,-1,174
int accept(int, struct sockaddr *, socklen_t *) 285,-1,168
int getsockname(int, struct sockaddr *, socklen_t *) 286,-1,172
int getpeername(int, struct sockaddr *, socklen_t *) 287,-1,171
int sendto(int, const void *, size_t, int, const struct sockaddr *, socklen_t) 290,-1,180
int recvfrom(int, void *, size_t, unsigned int, struct sockaddr *, socklen_t *) 292,-1,176
int shutdown(int, int) 293,-1,182
int setsockopt(int, int, int, const void *, socklen_t) 294,-1,181
int getsockopt(int, int, int, void *, socklen_t *) 295,-1,173
int sendmsg(int, const struct msghdr *, unsigned int) 296,-1,179
int recvmsg(int, struct msghdr *, unsigned int) 297,-1,177
# sockets for x86. These are done as an "indexed" call to socketcall syscall.
int socket:socketcall:1 (int, int, int) -1,102,-1
@@ -221,25 +260,22 @@ int getsockopt:socketcall:15(int, int, int, void *, socklen_t *) -1
int sendmsg:socketcall:16(int, const struct msghdr *, unsigned int) -1,102,-1
int recvmsg:socketcall:17(int, struct msghdr *, unsigned int) -1,102,-1
# sockets for sh.
int __socketcall:socketcall(int, unsigned long*) -1,-1,102
# scheduler & real-time
int sched_setscheduler(pid_t pid, int policy, const struct sched_param *param) 156
int sched_getscheduler(pid_t pid) 157
int sched_yield(void) 158
int sched_setparam(pid_t pid, const struct sched_param *param) 154
int sched_getparam(pid_t pid, struct sched_param *param) 155
int sched_get_priority_max(int policy) 159
int sched_get_priority_min(int policy) 160
int sched_rr_get_interval(pid_t pid, struct timespec *interval) 161
int sched_setaffinity(pid_t pid, size_t setsize, const cpu_set_t* set) 241
int __sched_getaffinity:sched_getaffinity(pid_t pid, size_t setsize, cpu_set_t* set) 242
int __getcpu:getcpu(unsigned *cpu, unsigned *node, void *unused) 345,318,318
int sched_setscheduler(pid_t pid, int policy, const struct sched_param *param) 156,156,160
int sched_getscheduler(pid_t pid) 157,157,161
int sched_yield(void) 158,158,162
int sched_setparam(pid_t pid, const struct sched_param *param) 154,154,158
int sched_getparam(pid_t pid, struct sched_param *param) 155,155,159
int sched_get_priority_max(int policy) 159,159,163
int sched_get_priority_min(int policy) 160,160,164
int sched_rr_get_interval(pid_t pid, struct timespec *interval) 161,161,165
int sched_setaffinity(pid_t pid, size_t setsize, const cpu_set_t* set) 241,241,239
int __sched_getaffinity:sched_getaffinity(pid_t pid, size_t setsize, cpu_set_t* set) 242,242,240
int __getcpu:getcpu(unsigned *cpu, unsigned *node, void *unused) 345,318,312
# io priorities
int ioprio_set(int which, int who, int ioprio) 314,289,288
int ioprio_get(int which, int who) 315,290,289
int ioprio_set(int which, int who, int ioprio) 314,289,314
int ioprio_get(int which, int who) 315,290,315
# other
int uname(struct utsname *) 122
@@ -251,23 +287,29 @@ int init_module(void *, unsigned long, const char *) 128
int delete_module(const char*, unsigned int) 129
int klogctl:syslog(int, char *, int) 103
int sysinfo(struct sysinfo *) 116
int personality(unsigned long) 136
long perf_event_open(struct perf_event_attr *attr_uptr, pid_t pid, int cpu, int group_fd, unsigned long flags) 364
# futex
int futex(void *, int, int, void *, void *, int) 240
int futex(void *, int, int, void *, void *, int) 240,240,238
# epoll
int epoll_create(int size) 250,254
int epoll_ctl(int epfd, int op, int fd, struct epoll_event *event) 251,255
int epoll_wait(int epfd, struct epoll_event *events, int max, int timeout) 252,256
int epoll_create(int size) 250,254,248
int epoll_ctl(int epfd, int op, int fd, struct epoll_event *event) 251,255,249
int epoll_wait(int epfd, struct epoll_event *events, int max, int timeout) 252,256,250
int inotify_init(void) 316,291,290
int inotify_add_watch(int, const char *, unsigned int) 317,292,291
int inotify_rm_watch(int, unsigned int) 318,293,292
int inotify_init(void) 316,291,284
int inotify_add_watch(int, const char *, unsigned int) 317,292,285
int inotify_rm_watch(int, unsigned int) 318,293,286
int poll(struct pollfd *, unsigned int, long) 168
int poll(struct pollfd *, unsigned int, long) 168,168,188
int eventfd:eventfd2(unsigned int, int) 356,328
int eventfd:eventfd2(unsigned int, int) 356,328,325
# ARM-specific ARM_NR_BASE == 0x0f0000 == 983040
int __set_tls:ARM_set_tls(void*) 983045,-1
int cacheflush:ARM_cacheflush(long start, long end, long flags) 983042,-1
int __set_tls:ARM_set_tls(void*) 983045,-1,-1
int cacheflush:ARM_cacheflush(long start, long end, long flags) 983042,-1,-1
# MIPS-specific
int _flush_cache:cacheflush(char *addr, const int nbytes, const int op) -1,-1,147
int syscall(int number,...) -1,-1,0

View File

@@ -0,0 +1,42 @@
/*
* Copyright (C) 2012 The Android Open Source Project
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
#include <machine/asm.h>
/*
* Coding the abort function in assembly so that registers are guaranteed to
* be preserved properly regardless of GCC's assumption on the "noreturn"
* attribute. When the registers are not properly preserved we won't be able
* to unwind the stack all the way to the bottom to fully reveal the call
* sequence when the crash happens.
*/
ENTRY(abort)
.save {r3, r14}
stmfd sp!, {r3, r14}
blx PIC_SYM(_C_LABEL(__libc_android_abort), PLT)
END(abort)

View File

@@ -1,5 +1,5 @@
/*
* Copyright (C) 2008 The Android Open Source Project
* Copyright (C) 2012 The Android Open Source Project
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -25,11 +25,11 @@
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
#include <unistd.h>
extern int __getcwd(char * buf, size_t size);
extern void *__dso_handle;
char *getcwd(char *buf, size_t size)
__attribute__ ((visibility ("hidden")))
int atexit(void (*func)(void))
{
return ( __getcwd(buf, size) < 0 ) ? NULL : buf;
return (__cxa_atexit((void (*)(void *))func, (void *)0, &__dso_handle));
}

View File

@@ -0,0 +1,60 @@
/*
* Copyright (c) 2012 The Android Open Source Project
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
#include <sys/types.h>
#include <private/logd.h>
#include <stdio.h>
/*
* This source file should only be included by libc.so, its purpose is
* to support legacy ARM binaries by exporting a publicly visible
* implementation of atexit().
*/
extern int __cxa_atexit(void (*func)(void *), void *arg, void *dso);
/*
* Register a function to be performed at exit.
*/
int
atexit(void (*func)(void))
{
/*
* Exit functions queued by this version of atexit will not be called
* on dlclose(), and when they are called (at program exit), the
* calling library may have been dlclose()'d, causing the program to
* crash.
*/
static char const warning[] =
"WARNING: generic atexit() called from legacy shared library\n";
__libc_android_log_print(ANDROID_LOG_WARN, "libc", warning);
fprintf(stderr, warning);
return (__cxa_atexit((void (*)(void *))func, NULL, NULL));
}

View File

@@ -1,236 +0,0 @@
/*
* Copyright (C) 2008 The Android Open Source Project
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
#include <sys/linux-syscalls.h>
#include <machine/asm.h>
#include <machine/cpu-features.h>
#define FUTEX_WAIT 0
#define FUTEX_WAKE 1
#if defined(__ARM_HAVE_LDREX_STREX)
/*
* ===========================================================================
* ARMv6+ implementation
* ===========================================================================
*/
/* r0(addr) -> r0(old) */
ENTRY(__atomic_dec)
mov r1, r0 @ copy addr so we don't clobber it
1: ldrex r0, [r1] @ load current value into r0
sub r2, r0, #1 @ generate new value into r2
strex r3, r2, [r1] @ try to store new value; result in r3
cmp r3, #0 @ success?
bxeq lr @ yes, return
b 1b @ no, retry
END(__atomic_dec)
/* r0(addr) -> r0(old) */
ENTRY(__atomic_inc)
mov r1, r0
1: ldrex r0, [r1]
add r2, r0, #1
strex r3, r2, [r1]
cmp r3, #0
bxeq lr
b 1b
END(__atomic_inc)
/* r0(old) r1(new) r2(addr) -> r0(zero_if_succeeded) */
ENTRY(__atomic_cmpxchg)
1: mov ip, #2 @ ip=2 means "new != old"
ldrex r3, [r2] @ load current value into r3
teq r0, r3 @ new == old?
strexeq ip, r1, [r2] @ yes, try store, set ip to 0 or 1
teq ip, #1 @ strex failure?
beq 1b @ yes, retry
mov r0, ip @ return 0 on success, 2 on failure
bx lr
END(__atomic_cmpxchg)
/* r0(new) r1(addr) -> r0(old) */
ENTRY(__atomic_swap)
1: ldrex r2, [r1]
strex r3, r0, [r1]
teq r3, #0
bne 1b
mov r0, r2
bx lr
END(__atomic_swap)
#else /*not defined __ARM_HAVE_LDREX_STREX*/
/*
* ===========================================================================
* Pre-ARMv6 implementation
* ===========================================================================
*/
/* int __kernel_cmpxchg(int oldval, int newval, int* ptr) */
.equ kernel_cmpxchg, 0xFFFF0FC0
.equ kernel_atomic_base, 0xFFFF0FFF
/* r0(addr) -> r0(old) */
ENTRY(__atomic_dec)
.save {r4, lr}
stmdb sp!, {r4, lr}
mov r2, r0
1: @ atomic_dec
ldr r0, [r2]
mov r3, #kernel_atomic_base
add lr, pc, #4
sub r1, r0, #1
add pc, r3, #(kernel_cmpxchg - kernel_atomic_base)
bcc 1b
add r0, r1, #1
ldmia sp!, {r4, lr}
bx lr
END(__atomic_dec)
/* r0(addr) -> r0(old) */
ENTRY(__atomic_inc)
.save {r4, lr}
stmdb sp!, {r4, lr}
mov r2, r0
1: @ atomic_inc
ldr r0, [r2]
mov r3, #kernel_atomic_base
add lr, pc, #4
add r1, r0, #1
add pc, r3, #(kernel_cmpxchg - kernel_atomic_base)
bcc 1b
sub r0, r1, #1
ldmia sp!, {r4, lr}
bx lr
END(__atomic_inc)
/* r0(old) r1(new) r2(addr) -> r0(zero_if_succeeded) */
ENTRY(__atomic_cmpxchg)
.save {r4, lr}
stmdb sp!, {r4, lr}
mov r4, r0 /* r4 = save oldvalue */
1: @ atomic_cmpxchg
mov r3, #kernel_atomic_base
add lr, pc, #4
mov r0, r4 /* r0 = oldvalue */
add pc, r3, #(kernel_cmpxchg - kernel_atomic_base)
bcs 2f /* swap was made. we're good, return. */
ldr r3, [r2] /* swap not made, see if it's because *ptr!=oldvalue */
cmp r3, r4
beq 1b
2: @ atomic_cmpxchg
ldmia sp!, {r4, lr}
bx lr
END(__atomic_cmpxchg)
/* r0(new) r1(addr) -> r0(old) */
ENTRY(__atomic_swap)
swp r0, r0, [r1]
bx lr
END(__atomic_swap)
#endif /*not defined __ARM_HAVE_LDREX_STREX*/
/* __futex_wait(*ftx, val, *timespec) */
/* __futex_wake(*ftx, counter) */
/* __futex_syscall3(*ftx, op, val) */
/* __futex_syscall4(*ftx, op, val, *timespec) */
.global __futex_wait
.type __futex_wait, %function
.global __futex_wake
.type __futex_wake, %function
.global __futex_syscall3
.type __futex_syscall3, %function
.global __futex_syscall4
.type __futex_syscall4, %function
#if __ARM_EABI__
ENTRY(__futex_syscall3)
stmdb sp!, {r4, r7}
.save {r4, r7}
ldr r7, =__NR_futex
swi #0
ldmia sp!, {r4, r7}
bx lr
END(__futex_syscall3)
ENTRY(__futex_wait)
stmdb sp!, {r4, r7}
.save {r4, r7}
mov r3, r2
mov r2, r1
mov r1, #FUTEX_WAIT
ldr r7, =__NR_futex
swi #0
ldmia sp!, {r4, r7}
bx lr
END(__futex_wait)
ENTRY(__futex_wake)
.save {r4, r7}
stmdb sp!, {r4, r7}
mov r2, r1
mov r1, #FUTEX_WAKE
ldr r7, =__NR_futex
swi #0
ldmia sp!, {r4, r7}
bx lr
END(__futex_wake)
#else
ENTRY(__futex_syscall3)
swi #__NR_futex
bx lr
END(__futex_syscall3)
ENTRY(__futex_wait)
mov r3, r2
mov r2, r1
mov r1, #FUTEX_WAIT
swi #__NR_futex
bx lr
END(__futex_wait)
ENTRY(__futex_wake)
mov r2, r1
mov r1, #FUTEX_WAKE
swi #__NR_futex
bx lr
END(__futex_wake)
#endif
ENTRY(__futex_syscall4)
b __futex_syscall3
END(__futex_syscall4)

View File

@@ -0,0 +1,87 @@
/*
* Copyright (C) 2011 The Android Open Source Project
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
/* The purpose of this file is to export a small set of atomic-related
* functions from the C library, to ensure binary ABI compatibility for
* the NDK.
*
* These functions were initially exposed by the NDK through <sys/atomics.h>,
* which was unfortunate because their implementation didn't provide any
* memory barriers at all.
*
* This wasn't a problem for the platform code that used them, because it
* used explicit barrier instructions around them. On the other hand, it means
* that any NDK-generated machine code that linked against them would not
* perform correctly when running on multi-core devices.
*
* To fix this, the platform code was first modified to not use any of these
* functions (everything is now inlined through assembly statements, see
* libc/private/bionic_arm_inline.h and the headers it includes.
*
* The functions here are thus only for the benefit of NDK applications,
* and now includes full memory barriers to prevent any random memory ordering
* issue from cropping.
*
* Note that we also provide an updated <sys/atomics.h> header that defines
* always_inlined versions of the functions that use the GCC builtin
* intrinsics to perform the same thing.
*
* NOTE: There is no need for a similar file for non-ARM platforms.
*/
/* DO NOT INCLUDE <sys/atomics.h> HERE ! */
int
__atomic_cmpxchg(int old, int _new, volatile int *ptr)
{
/* We must return 0 on success */
return __sync_val_compare_and_swap(ptr, old, _new) != old;
}
int
__atomic_swap(int _new, volatile int *ptr)
{
int prev;
do {
prev = *ptr;
} while (__sync_val_compare_and_swap(ptr, prev, _new) != prev);
return prev;
}
int
__atomic_dec(volatile int *ptr)
{
return __sync_fetch_and_sub (ptr, 1);
}
int
__atomic_inc(volatile int *ptr)
{
return __sync_fetch_and_add (ptr, 1);
}

View File

@@ -30,8 +30,7 @@
ENTRY(__pthread_clone)
@ insert the args onto the new stack
str r0, [r1, #-4]
str r3, [r1, #-8]
stmdb r1!, {r0, r3}
@ do the system call
@ get flags
@@ -60,8 +59,7 @@ ENTRY(__pthread_clone)
@ to the C __thread_entry function which does some setup and then
@ calls the thread's start function
ldr r0, [sp, #-4]
ldr r1, [sp, #-8]
pop {r0, r1}
mov r2, sp @ __thread_entry needs the TLS pointer
b __thread_entry

View File

@@ -0,0 +1,68 @@
/*
* Copyright (C) 2012 The Android Open Source Project
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
typedef struct
{
void (**preinit_array)(void);
void (**init_array)(void);
void (**fini_array)(void);
} structors_array_t;
extern int main(int argc, char **argv, char **env);
extern void __libc_init(
unsigned int *elfdata,
void (*onexit)(void),
int (*slingshot)(int, char**, char**),
structors_array_t const * const structors
);
__attribute__ ((section (".preinit_array")))
void (*__PREINIT_ARRAY__)(void) = (void (*)(void)) -1;
__attribute__ ((section (".init_array")))
void (*__INIT_ARRAY__)(void) = (void (*)(void)) -1;
__attribute__ ((section (".fini_array")))
void (*__FINI_ARRAY__)(void) = (void (*)(void)) -1;
__attribute__((visibility("hidden")))
void _start() {
structors_array_t array;
void *elfdata;
array.preinit_array = &__PREINIT_ARRAY__;
array.init_array = &__INIT_ARRAY__;
array.fini_array = &__FINI_ARRAY__;
elfdata = __builtin_frame_address(0) + sizeof(void *);
__libc_init(elfdata, (void *) 0, &main, &array);
}
#include "__dso_handle.h"
#include "atexit.h"

View File

@@ -0,0 +1,58 @@
/*
* Copyright (C) 2012 The Android Open Source Project
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
extern void __cxa_finalize(void *);
extern void *__dso_handle;
__attribute__((visibility("hidden"),destructor))
void __on_dlclose() {
__cxa_finalize(&__dso_handle);
}
/* CRT_LEGACY_WORKAROUND should only be defined when building
* this file as part of the platform's C library.
*
* The C library already defines a function named 'atexit()'
* for backwards compatibility with older NDK-generated binaries.
*
* For newer ones, 'atexit' is actually embedded in the C
* runtime objects that are linked into the final ELF
* binary (shared library or executable), and will call
* __cxa_atexit() in order to un-register any atexit()
* handler when a library is unloaded.
*
* This function must be global *and* hidden. Only the
* code inside the same ELF binary should be able to access it.
*/
#ifdef CRT_LEGACY_WORKAROUND
#include "__dso_handle.h"
#else
#include "__dso_handle_so.h"
#include "atexit.h"
#endif

View File

@@ -35,6 +35,6 @@
.section .fini_array, "aw"
.long 0
.section .ctors, "aw"
.long 0
#if defined(__linux__) && defined(__ELF__)
.section .note.GNU-stack,"",%progbits
#endif

View File

@@ -26,13 +26,6 @@
* SUCH DAMAGE.
*/
/* This is the same than crtend.S except that a shared library
* cannot have a .preinit_array
*/
.section .init_array, "aw"
.long 0
.section .fini_array, "aw"
.long 0
#if defined(__linux__) && defined(__ELF__)
.section .note.GNU-stack,"",%progbits
#endif

View File

@@ -30,22 +30,6 @@
extern int __cxa_atexit(void (*)(void*), void*, void* );
/* Temporary hack: this variable should not be part of the C library
* itself, but placed in the .bss section of each executable or
* shared library instead.
*
* We keep it here temporarily until the build system has been
* modified properly to use crtbegin_so.S and crtend_so.S when
* generating shared libraries.
*
* It must be a 'weak' symbol to avoid conflicts with the definitions
* that have been moved to crtbegin_static.S and crtbegin_dynamic.S
*
* For the record, it is used for static C++ object construction
* and destruction. See http://www.codesourcery.com/public/cxx-abi/abi.html#dso-dtor
*/
void* __attribute__((weak)) __dso_handle;
/* The "C++ ABI for ARM" document states that static C++ constructors,
* which are called from the .init_array, should manually call
* __aeabi_atexit() to register static destructors explicitely.

View File

@@ -25,12 +25,8 @@
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
typedef long unsigned int *_Unwind_Ptr;
/* Stubbed out in libdl and defined in the dynamic linker.
* Same semantics as __gnu_Unwind_Find_exidx().
*/
extern _Unwind_Ptr dl_unwind_find_exidx(_Unwind_Ptr pc, int *pcount);
#include <link.h>
/* For a given PC, find the .so that it belongs to.
* Returns the base address of the .ARM.exidx section

View File

@@ -25,7 +25,8 @@
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
typedef long unsigned int *_Unwind_Ptr;
#include <link.h>
/* Find the .ARM.exidx section (which in the case of a static executable
* can be identified through its start and end symbols), and return its

View File

@@ -0,0 +1,112 @@
/*
* Copyright (C) 2008 The Android Open Source Project
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
#include <sys/linux-syscalls.h>
#include <machine/asm.h>
#include <machine/cpu-features.h>
#define FUTEX_WAIT 0
#define FUTEX_WAKE 1
/* __futex_wait(*ftx, val, *timespec) */
/* __futex_wake(*ftx, counter) */
/* __futex_syscall3(*ftx, op, val) */
/* __futex_syscall4(*ftx, op, val, *timespec) */
.global __futex_wait
.type __futex_wait, %function
.global __futex_wake
.type __futex_wake, %function
.global __futex_syscall3
.type __futex_syscall3, %function
.global __futex_syscall4
.type __futex_syscall4, %function
#if __ARM_EABI__
ENTRY(__futex_syscall3)
stmdb sp!, {r4, r7}
.save {r4, r7}
ldr r7, =__NR_futex
swi #0
ldmia sp!, {r4, r7}
bx lr
END(__futex_syscall3)
ENTRY(__futex_wait)
stmdb sp!, {r4, r7}
.save {r4, r7}
mov r3, r2
mov r2, r1
mov r1, #FUTEX_WAIT
ldr r7, =__NR_futex
swi #0
ldmia sp!, {r4, r7}
bx lr
END(__futex_wait)
ENTRY(__futex_wake)
.save {r4, r7}
stmdb sp!, {r4, r7}
mov r2, r1
mov r1, #FUTEX_WAKE
ldr r7, =__NR_futex
swi #0
ldmia sp!, {r4, r7}
bx lr
END(__futex_wake)
#else
ENTRY(__futex_syscall3)
swi #__NR_futex
bx lr
END(__futex_syscall3)
ENTRY(__futex_wait)
mov r3, r2
mov r2, r1
mov r1, #FUTEX_WAIT
swi #__NR_futex
bx lr
END(__futex_wait)
ENTRY(__futex_wake)
mov r2, r1
mov r1, #FUTEX_WAKE
swi #__NR_futex
bx lr
END(__futex_wake)
#endif
ENTRY(__futex_syscall4)
b __futex_syscall3
END(__futex_syscall4)

View File

@@ -66,7 +66,7 @@
* any native shared library generated with it should now be safe from that
* problem. On the other hand, existing shared libraries distributed with
* applications that were generated with a previous version of the NDK
* still need all 1.5/1.6 helper functions in libc.so and libn.so
* still need all 1.5/1.6 helper functions in libc.so and libm.so
*
* After 3.2, the toolchain was updated again, adding __aeabi_f2uiz to the
* list of requirements. Technically, this is due to mis-linked NDK libraries
@@ -113,6 +113,8 @@
XX(__aeabi_l2d) \
XX(__aeabi_l2f) \
XX(__aeabi_lmul) \
XX(__aeabi_llsl) \
XX(__aeabi_llsr) \
XX(__aeabi_ui2d) \
XX(__aeabi_ui2f) \
XX(__aeabi_ul2d) \

View File

@@ -29,33 +29,33 @@
#include <machine/cpu-features.h>
#include <machine/asm.h>
#if defined(__ARM_NEON__)
#if defined(__ARM_NEON__) && !defined(ARCH_ARM_USE_NON_NEON_MEMCPY)
.text
.fpu neon
.global memcpy
.type memcpy, %function
.align 4
#ifdef HAVE_32_BYTE_CACHE_LINE
/* a prefetch distance of 2 cache-lines */
#define CACHE_LINE_SIZE 32
#define PREFETCH_DISTANCE (CACHE_LINE_SIZE*2)
#else
/* a prefetch distance of 4 cache-lines works best experimentally */
#define CACHE_LINE_SIZE 64
#define PREFETCH_DISTANCE (CACHE_LINE_SIZE*4)
#endif
memcpy:
.fnstart
ENTRY(memcpy)
.save {r0, lr}
stmfd sp!, {r0, lr}
/* start preloading as early as possible */
pld [r1, #(CACHE_LINE_SIZE*0)]
stmfd sp!, {r0, lr}
pld [r1, #(CACHE_LINE_SIZE*1)]
/* do we have at least 16-bytes to copy (needed for alignment below) */
cmp r2, #16
blo 5f
/* align destination to half cache-line for the write-buffer */
/* align destination to cache-line for the write-buffer */
rsb r3, r0, #0
ands r3, r3, #0xF
beq 0f
@@ -84,6 +84,26 @@ memcpy:
pld [r1, #(CACHE_LINE_SIZE*0)]
pld [r1, #(CACHE_LINE_SIZE*1)]
#ifdef HAVE_32_BYTE_CACHE_LINE
/* make sure we have at least 32 bytes to copy */
subs r2, r2, #32
blo 4f
/* preload all the cache lines we need.
* NOTE: the number of pld below depends on PREFETCH_DISTANCE,
* ideally would would increase the distance in the main loop to
* avoid the goofy code below. In practice this doesn't seem to make
* a big difference.
*/
pld [r1, #(PREFETCH_DISTANCE)]
1: /* The main loop copies 32 bytes at a time */
vld1.8 {d0 - d3}, [r1]!
pld [r1, #(PREFETCH_DISTANCE)]
subs r2, r2, #32
vst1.8 {d0 - d3}, [r0, :128]!
bhs 1b
#else
/* make sure we have at least 64 bytes to copy */
subs r2, r2, #64
blo 2f
@@ -117,7 +137,7 @@ memcpy:
subs r2, r2, #32
vst1.8 {d0 - d3}, [r0, :128]!
bhs 3b
#endif
4: /* less than 32 left */
add r2, r2, #32
tst r2, #0x10

View File

@@ -28,13 +28,10 @@
*/
#include <machine/cpu-features.h>
#include <machine/asm.h>
.text
.global strcmp
.type strcmp, %function
.align 4
#ifdef __ARMEB__
#define SHFT2LSB lsl
#define SHFT2LSBEQ lsleq
@@ -54,8 +51,7 @@
#define magic1(REG) REG
#define magic2(REG) REG, lsl #7
strcmp:
.fnstart
ENTRY(strcmp)
PLD(r0, #0)
PLD(r1, #0)
eor r2, r0, r1
@@ -136,7 +132,6 @@ strcmp:
#endif
ldr r4, [sp], #4
bx lr
.fnend
.Lstrcmp_unaligned:
wp1 .req r0
@@ -319,3 +314,4 @@ strcmp:
ldr r4, [sp], #4
ldr r5, [sp], #4
bx lr
END(strcmp)

View File

@@ -25,37 +25,27 @@
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
/* unlike our auto-generated syscall stubs, this code saves lr
on the stack, as well as a few other registers. this makes
our stack unwinder happy, when we generate debug stack
traces after the C library or other parts of the system
abort due to a fatal runtime error (e.g. detection
of a corrupted malloc heap).
*/
# Implement static C++ destructors when the shared
# library is unloaded through dlclose().
#
# A call to this function must be the first entry
# in the .fini_array. See 3.3.5.3.C of C++ ABI
# standard.
#
__on_dlclose:
adr r0, 0f
ldr r0, [r0]
b __cxa_finalize
#include <sys/linux-syscalls.h>
#include <machine/asm.h>
0:
.long __dso_handle
.section .init_array, "aw"
.globl __INIT_ARRAY__
__INIT_ARRAY__:
.long -1
.section .fini_array, "aw"
.globl __FINI_ARRAY__
__FINI_ARRAY__:
.long -1
.long __on_dlclose
#ifdef CRT_LEGACY_WORKAROUND
#include "__dso_handle.S"
#else
#include "__dso_handle_so.S"
#ifndef __NR_tgkill
#define __NR_tgkill 268
#endif
#include "atexit.S"
ENTRY(tgkill)
stmfd sp!, {r4-r7, ip, lr}
ldr r7, =__NR_tgkill
swi #0
ldmfd sp!, {r4-r7, ip, lr}
movs r0, r0
bxpl lr
b __set_syscall_errno
END(tgkill)

View File

@@ -97,6 +97,12 @@
#define ASENTRY_NP(y) _ENTRY(_ASM_LABEL(y))
#define ASEND(y) _END(_ASM_LABEL(y))
#ifdef __ELF__
#define ENTRY_PRIVATE(y) ENTRY(y); .hidden _C_LABEL(y)
#else
#define ENTRY_PRIVATE(y) ENTRY(y)
#endif
#define ASMSTR .asciz
#if defined(__ELF__) && defined(PIC)

View File

@@ -14,9 +14,11 @@ syscall_src += arch-arm/syscalls/getegid.S
syscall_src += arch-arm/syscalls/getresuid.S
syscall_src += arch-arm/syscalls/getresgid.S
syscall_src += arch-arm/syscalls/gettid.S
syscall_src += arch-arm/syscalls/readahead.S
syscall_src += arch-arm/syscalls/getgroups.S
syscall_src += arch-arm/syscalls/getpgid.S
syscall_src += arch-arm/syscalls/getppid.S
syscall_src += arch-arm/syscalls/getsid.S
syscall_src += arch-arm/syscalls/setsid.S
syscall_src += arch-arm/syscalls/setgid.S
syscall_src += arch-arm/syscalls/__setreuid.S
@@ -57,6 +59,8 @@ syscall_src += arch-arm/syscalls/mprotect.S
syscall_src += arch-arm/syscalls/madvise.S
syscall_src += arch-arm/syscalls/mlock.S
syscall_src += arch-arm/syscalls/munlock.S
syscall_src += arch-arm/syscalls/mlockall.S
syscall_src += arch-arm/syscalls/munlockall.S
syscall_src += arch-arm/syscalls/mincore.S
syscall_src += arch-arm/syscalls/__ioctl.S
syscall_src += arch-arm/syscalls/readv.S
@@ -84,6 +88,10 @@ syscall_src += arch-arm/syscalls/mkdirat.S
syscall_src += arch-arm/syscalls/fchownat.S
syscall_src += arch-arm/syscalls/fchmodat.S
syscall_src += arch-arm/syscalls/renameat.S
syscall_src += arch-arm/syscalls/fsetxattr.S
syscall_src += arch-arm/syscalls/fgetxattr.S
syscall_src += arch-arm/syscalls/flistxattr.S
syscall_src += arch-arm/syscalls/fremovexattr.S
syscall_src += arch-arm/syscalls/link.S
syscall_src += arch-arm/syscalls/unlink.S
syscall_src += arch-arm/syscalls/unlinkat.S
@@ -103,10 +111,20 @@ syscall_src += arch-arm/syscalls/rmdir.S
syscall_src += arch-arm/syscalls/rename.S
syscall_src += arch-arm/syscalls/__getcwd.S
syscall_src += arch-arm/syscalls/access.S
syscall_src += arch-arm/syscalls/faccessat.S
syscall_src += arch-arm/syscalls/symlink.S
syscall_src += arch-arm/syscalls/fchdir.S
syscall_src += arch-arm/syscalls/truncate.S
syscall_src += arch-arm/syscalls/setxattr.S
syscall_src += arch-arm/syscalls/lsetxattr.S
syscall_src += arch-arm/syscalls/getxattr.S
syscall_src += arch-arm/syscalls/lgetxattr.S
syscall_src += arch-arm/syscalls/listxattr.S
syscall_src += arch-arm/syscalls/llistxattr.S
syscall_src += arch-arm/syscalls/removexattr.S
syscall_src += arch-arm/syscalls/lremovexattr.S
syscall_src += arch-arm/syscalls/__statfs64.S
syscall_src += arch-arm/syscalls/unshare.S
syscall_src += arch-arm/syscalls/pause.S
syscall_src += arch-arm/syscalls/gettimeofday.S
syscall_src += arch-arm/syscalls/settimeofday.S
@@ -169,6 +187,8 @@ syscall_src += arch-arm/syscalls/init_module.S
syscall_src += arch-arm/syscalls/delete_module.S
syscall_src += arch-arm/syscalls/klogctl.S
syscall_src += arch-arm/syscalls/sysinfo.S
syscall_src += arch-arm/syscalls/personality.S
syscall_src += arch-arm/syscalls/perf_event_open.S
syscall_src += arch-arm/syscalls/futex.S
syscall_src += arch-arm/syscalls/epoll_create.S
syscall_src += arch-arm/syscalls/epoll_ctl.S

View File

@@ -0,0 +1,14 @@
/* autogenerated by gensyscalls.py */
#include <machine/asm.h>
#include <sys/linux-syscalls.h>
ENTRY(faccessat)
.save {r4, r7}
stmfd sp!, {r4, r7}
ldr r7, =__NR_faccessat
swi #0
ldmfd sp!, {r4, r7}
movs r0, r0
bxpl lr
b __set_syscall_errno
END(faccessat)

View File

@@ -0,0 +1,14 @@
/* autogenerated by gensyscalls.py */
#include <machine/asm.h>
#include <sys/linux-syscalls.h>
ENTRY(fgetxattr)
.save {r4, r7}
stmfd sp!, {r4, r7}
ldr r7, =__NR_fgetxattr
swi #0
ldmfd sp!, {r4, r7}
movs r0, r0
bxpl lr
b __set_syscall_errno
END(fgetxattr)

View File

@@ -0,0 +1,14 @@
/* autogenerated by gensyscalls.py */
#include <machine/asm.h>
#include <sys/linux-syscalls.h>
ENTRY(flistxattr)
.save {r4, r7}
stmfd sp!, {r4, r7}
ldr r7, =__NR_flistxattr
swi #0
ldmfd sp!, {r4, r7}
movs r0, r0
bxpl lr
b __set_syscall_errno
END(flistxattr)

View File

@@ -0,0 +1,14 @@
/* autogenerated by gensyscalls.py */
#include <machine/asm.h>
#include <sys/linux-syscalls.h>
ENTRY(fremovexattr)
.save {r4, r7}
stmfd sp!, {r4, r7}
ldr r7, =__NR_fremovexattr
swi #0
ldmfd sp!, {r4, r7}
movs r0, r0
bxpl lr
b __set_syscall_errno
END(fremovexattr)

View File

@@ -0,0 +1,16 @@
/* autogenerated by gensyscalls.py */
#include <machine/asm.h>
#include <sys/linux-syscalls.h>
ENTRY(fsetxattr)
mov ip, sp
.save {r4, r5, r6, r7}
stmfd sp!, {r4, r5, r6, r7}
ldmfd ip, {r4, r5, r6}
ldr r7, =__NR_fsetxattr
swi #0
ldmfd sp!, {r4, r5, r6, r7}
movs r0, r0
bxpl lr
b __set_syscall_errno
END(fsetxattr)

View File

@@ -0,0 +1,14 @@
/* autogenerated by gensyscalls.py */
#include <machine/asm.h>
#include <sys/linux-syscalls.h>
ENTRY(getsid)
.save {r4, r7}
stmfd sp!, {r4, r7}
ldr r7, =__NR_getsid
swi #0
ldmfd sp!, {r4, r7}
movs r0, r0
bxpl lr
b __set_syscall_errno
END(getsid)

View File

@@ -0,0 +1,14 @@
/* autogenerated by gensyscalls.py */
#include <machine/asm.h>
#include <sys/linux-syscalls.h>
ENTRY(getxattr)
.save {r4, r7}
stmfd sp!, {r4, r7}
ldr r7, =__NR_getxattr
swi #0
ldmfd sp!, {r4, r7}
movs r0, r0
bxpl lr
b __set_syscall_errno
END(getxattr)

View File

@@ -0,0 +1,14 @@
/* autogenerated by gensyscalls.py */
#include <machine/asm.h>
#include <sys/linux-syscalls.h>
ENTRY(lgetxattr)
.save {r4, r7}
stmfd sp!, {r4, r7}
ldr r7, =__NR_lgetxattr
swi #0
ldmfd sp!, {r4, r7}
movs r0, r0
bxpl lr
b __set_syscall_errno
END(lgetxattr)

View File

@@ -0,0 +1,14 @@
/* autogenerated by gensyscalls.py */
#include <machine/asm.h>
#include <sys/linux-syscalls.h>
ENTRY(listxattr)
.save {r4, r7}
stmfd sp!, {r4, r7}
ldr r7, =__NR_listxattr
swi #0
ldmfd sp!, {r4, r7}
movs r0, r0
bxpl lr
b __set_syscall_errno
END(listxattr)

View File

@@ -0,0 +1,14 @@
/* autogenerated by gensyscalls.py */
#include <machine/asm.h>
#include <sys/linux-syscalls.h>
ENTRY(llistxattr)
.save {r4, r7}
stmfd sp!, {r4, r7}
ldr r7, =__NR_llistxattr
swi #0
ldmfd sp!, {r4, r7}
movs r0, r0
bxpl lr
b __set_syscall_errno
END(llistxattr)

View File

@@ -0,0 +1,14 @@
/* autogenerated by gensyscalls.py */
#include <machine/asm.h>
#include <sys/linux-syscalls.h>
ENTRY(lremovexattr)
.save {r4, r7}
stmfd sp!, {r4, r7}
ldr r7, =__NR_lremovexattr
swi #0
ldmfd sp!, {r4, r7}
movs r0, r0
bxpl lr
b __set_syscall_errno
END(lremovexattr)

View File

@@ -0,0 +1,16 @@
/* autogenerated by gensyscalls.py */
#include <machine/asm.h>
#include <sys/linux-syscalls.h>
ENTRY(lsetxattr)
mov ip, sp
.save {r4, r5, r6, r7}
stmfd sp!, {r4, r5, r6, r7}
ldmfd ip, {r4, r5, r6}
ldr r7, =__NR_lsetxattr
swi #0
ldmfd sp!, {r4, r5, r6, r7}
movs r0, r0
bxpl lr
b __set_syscall_errno
END(lsetxattr)

View File

@@ -0,0 +1,14 @@
/* autogenerated by gensyscalls.py */
#include <machine/asm.h>
#include <sys/linux-syscalls.h>
ENTRY(mlockall)
.save {r4, r7}
stmfd sp!, {r4, r7}
ldr r7, =__NR_mlockall
swi #0
ldmfd sp!, {r4, r7}
movs r0, r0
bxpl lr
b __set_syscall_errno
END(mlockall)

View File

@@ -0,0 +1,14 @@
/* autogenerated by gensyscalls.py */
#include <machine/asm.h>
#include <sys/linux-syscalls.h>
ENTRY(munlockall)
.save {r4, r7}
stmfd sp!, {r4, r7}
ldr r7, =__NR_munlockall
swi #0
ldmfd sp!, {r4, r7}
movs r0, r0
bxpl lr
b __set_syscall_errno
END(munlockall)

View File

@@ -0,0 +1,16 @@
/* autogenerated by gensyscalls.py */
#include <machine/asm.h>
#include <sys/linux-syscalls.h>
ENTRY(perf_event_open)
mov ip, sp
.save {r4, r5, r6, r7}
stmfd sp!, {r4, r5, r6, r7}
ldmfd ip, {r4, r5, r6}
ldr r7, =__NR_perf_event_open
swi #0
ldmfd sp!, {r4, r5, r6, r7}
movs r0, r0
bxpl lr
b __set_syscall_errno
END(perf_event_open)

View File

@@ -0,0 +1,14 @@
/* autogenerated by gensyscalls.py */
#include <machine/asm.h>
#include <sys/linux-syscalls.h>
ENTRY(personality)
.save {r4, r7}
stmfd sp!, {r4, r7}
ldr r7, =__NR_personality
swi #0
ldmfd sp!, {r4, r7}
movs r0, r0
bxpl lr
b __set_syscall_errno
END(personality)

View File

@@ -0,0 +1,16 @@
/* autogenerated by gensyscalls.py */
#include <machine/asm.h>
#include <sys/linux-syscalls.h>
ENTRY(readahead)
mov ip, sp
.save {r4, r5, r6, r7}
stmfd sp!, {r4, r5, r6, r7}
ldmfd ip, {r4, r5, r6}
ldr r7, =__NR_readahead
swi #0
ldmfd sp!, {r4, r5, r6, r7}
movs r0, r0
bxpl lr
b __set_syscall_errno
END(readahead)

View File

@@ -0,0 +1,14 @@
/* autogenerated by gensyscalls.py */
#include <machine/asm.h>
#include <sys/linux-syscalls.h>
ENTRY(removexattr)
.save {r4, r7}
stmfd sp!, {r4, r7}
ldr r7, =__NR_removexattr
swi #0
ldmfd sp!, {r4, r7}
movs r0, r0
bxpl lr
b __set_syscall_errno
END(removexattr)

View File

@@ -0,0 +1,16 @@
/* autogenerated by gensyscalls.py */
#include <machine/asm.h>
#include <sys/linux-syscalls.h>
ENTRY(setxattr)
mov ip, sp
.save {r4, r5, r6, r7}
stmfd sp!, {r4, r5, r6, r7}
ldmfd ip, {r4, r5, r6}
ldr r7, =__NR_setxattr
swi #0
ldmfd sp!, {r4, r5, r6, r7}
movs r0, r0
bxpl lr
b __set_syscall_errno
END(setxattr)

View File

@@ -0,0 +1,14 @@
/* autogenerated by gensyscalls.py */
#include <machine/asm.h>
#include <sys/linux-syscalls.h>
ENTRY(unshare)
.save {r4, r7}
stmfd sp!, {r4, r7}
ldr r7, =__NR_unshare
swi #0
ldmfd sp!, {r4, r7}
movs r0, r0
bxpl lr
b __set_syscall_errno
END(unshare)

View File

@@ -1,5 +1,5 @@
/*
* Copyright (C) 2009 The Android Open Source Project
* Copyright (C) 2008 The Android Open Source Project
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -25,12 +25,15 @@
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
.text
.type __get_sp, @function
.globl __get_sp
.align 4
.text
/* void *__get_sp(void) */
.type __get_sp, @function
.global __get_sp
.align 4
.ent __get_sp
__get_sp:
rts
mov r15, r0
move $v0, $sp
j $ra
.end __get_sp

View File

@@ -1,5 +1,5 @@
/*
* Copyright (C) 2009 The Android Open Source Project
* Copyright (C) 2008 The Android Open Source Project
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -25,13 +25,13 @@
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
/* see the implementation of __set_tls and pthread.c to understand this
* code. Basically, the content of fs:[0] always is a pointer to the base
* address of the tls region
*/
void *__get_tls(void)
void* __get_tls(void)
{
void *tls;
asm volatile("stc gbr, %0" : "=r"(tls));
return tls;
register void *tls asm("v1");
asm (".set push\n\t"
".set mips32r2\n\t"
"rdhwr %0,$29\n\t"
".set pop"
: "=r"(tls));
return tls;
}

View File

@@ -1,5 +1,5 @@
/*
* Copyright (C) 2009 The Android Open Source Project
* Copyright (C) 2008 The Android Open Source Project
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -27,11 +27,9 @@
*/
#include <pthread.h>
/*
* Simply set tls address into GBR.
*/
extern int __set_thread_area(void *u_info);
int __set_tls(void *ptr)
{
asm volatile("ldc %0, gbr" : /* no output */ : "r" (ptr));
return 0;
return __set_thread_area(ptr);
}

View File

@@ -0,0 +1,51 @@
/*
* Copyright (C) 2008 The Android Open Source Project
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
#include <asm/unistd.h>
.text
/* void _exit_with_stack_teardown(void * stackBase, int stackSize, int retCode) */
.type _exit_with_stack_teardown, @function
.global _exit_with_stack_teardown
.align 4
.ent _exit_with_stack_teardown
_exit_with_stack_teardown:
move $s0,$a2 /* preserve retCode for exit() call */
li $v0,__NR_munmap
syscall /* the stack is destroyed by this call */
move $a0,$s0
li $v0,__NR_exit
syscall
/* exit() should never return, cause a crash if it does */
move $a0,$0
lw $a0,($a0)
.end _exit_with_stack_teardown

View File

@@ -0,0 +1,188 @@
/* $OpenBSD: _setjmp.S,v 1.4 2005/08/07 16:40:15 espie Exp $ */
/*
* Copyright (c) 2002 Opsycon AB (www.opsycon.se / www.opsycon.com)
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. Neither the name of Opsycon AB nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS
* OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
*/
#include <machine/asm.h>
#include <machine/regnum.h>
#include <machine/signal.h>
/*
* _setjmp, _longjmp (not restoring signal state)
*
* XXX FPSET should probably be taken from SR setting. hmmm...
* GPOFF and FRAMESIZE must be the same for both _setjmp and _longjmp!
*
*/
FRAMESZ= MKFSIZ(0,4)
GPOFF= FRAMESZ-2*REGSZ
#define FPREG64_S(FPR, OFF, BASE) \
swc1 FPR, OFF(BASE) ; \
mfhc1 t0, FPR ; \
sw t0, OFF+4(BASE) ;
#define FPREG64_L(FPR, OFF, BASE) \
lw t0, OFF+4(BASE) ; \
lw t1, OFF(BASE) ; \
mtc1 t1, FPR ; \
mthc1 t0, FPR ; \
LEAF(_setjmp, FRAMESZ)
PTR_SUBU sp, FRAMESZ
SETUP_GP64(GPOFF, _setjmp)
SAVE_GP(GPOFF)
.set noreorder
#if defined(__mips64)
dli v0, 0xACEDBADE # sigcontext magic number
#else
li v0, 0xACEDBADE # sigcontext magic number
#endif
REG_S v0, SC_REGS+ZERO*REGSZ(a0)
REG_S s0, SC_REGS+S0*REGSZ(a0)
REG_S s1, SC_REGS+S1*REGSZ(a0)
REG_S s2, SC_REGS+S2*REGSZ(a0)
REG_S s3, SC_REGS+S3*REGSZ(a0)
REG_S s4, SC_REGS+S4*REGSZ(a0)
REG_S s5, SC_REGS+S5*REGSZ(a0)
REG_S s6, SC_REGS+S6*REGSZ(a0)
REG_S s7, SC_REGS+S7*REGSZ(a0)
REG_S s8, SC_REGS+S8*REGSZ(a0)
REG_L v0, GPOFF(sp)
REG_S v0, SC_REGS+GP*REGSZ(a0)
PTR_ADDU v0, sp, FRAMESZ
REG_S v0, SC_REGS+SP*REGSZ(a0)
REG_S ra, SC_PC(a0)
#if !defined(SOFTFLOAT)
li v0, 1 # be nice if we could tell
REG_S v0, SC_FPUSED(a0) # sc_fpused = 1
cfc1 v0, $31
#if _MIPS_FPSET == 32
FPREG64_S($f20, SC_FPREGS+((F20-F0)*REGSZ_FP), a0)
FPREG64_S($f21, SC_FPREGS+((F21-F0)*REGSZ_FP), a0)
FPREG64_S($f22, SC_FPREGS+((F22-F0)*REGSZ_FP), a0)
FPREG64_S($f23, SC_FPREGS+((F23-F0)*REGSZ_FP), a0)
FPREG64_S($f24, SC_FPREGS+((F24-F0)*REGSZ_FP), a0)
FPREG64_S($f25, SC_FPREGS+((F25-F0)*REGSZ_FP), a0)
FPREG64_S($f26, SC_FPREGS+((F26-F0)*REGSZ_FP), a0)
FPREG64_S($f27, SC_FPREGS+((F27-F0)*REGSZ_FP), a0)
FPREG64_S($f28, SC_FPREGS+((F28-F0)*REGSZ_FP), a0)
FPREG64_S($f29, SC_FPREGS+((F29-F0)*REGSZ_FP), a0)
FPREG64_S($f30, SC_FPREGS+((F30-F0)*REGSZ_FP), a0)
FPREG64_S($f31, SC_FPREGS+((F31-F0)*REGSZ_FP), a0)
#else
swc1 $f20, SC_FPREGS+((F20-F0)*REGSZ_FP)(a0)
swc1 $f21, SC_FPREGS+((F21-F0)*REGSZ_FP)(a0)
swc1 $f22, SC_FPREGS+((F22-F0)*REGSZ_FP)(a0)
swc1 $f23, SC_FPREGS+((F23-F0)*REGSZ_FP)(a0)
swc1 $f24, SC_FPREGS+((F24-F0)*REGSZ_FP)(a0)
swc1 $f25, SC_FPREGS+((F25-F0)*REGSZ_FP)(a0)
swc1 $f26, SC_FPREGS+((F26-F0)*REGSZ_FP)(a0)
swc1 $f27, SC_FPREGS+((F27-F0)*REGSZ_FP)(a0)
swc1 $f28, SC_FPREGS+((F28-F0)*REGSZ_FP)(a0)
swc1 $f29, SC_FPREGS+((F29-F0)*REGSZ_FP)(a0)
swc1 $f30, SC_FPREGS+((F30-F0)*REGSZ_FP)(a0)
swc1 $f31, SC_FPREGS+((F31-F0)*REGSZ_FP)(a0)
#endif
REG_S v0, SC_FPREGS+((FSR-F0)*REGSZ)(a0)
#endif /* !SOFTFLOAT */
RESTORE_GP64
PTR_ADDU sp, FRAMESZ
j ra
move v0, zero
END(_setjmp)
LEAF(_longjmp, FRAMESZ)
PTR_SUBU sp, FRAMESZ
SETUP_GP64(GPOFF, _longjmp)
SAVE_GP(GPOFF)
.set noreorder
REG_L v0, SC_REGS+ZERO*REGSZ(a0)
bne v0, 0xACEDBADE, botch # jump if error
REG_L ra, SC_PC(a0)
REG_L v0, SC_FPREGS+((FSR-F0)*REGSZ)(a0)
REG_L s0, SC_REGS+S0*REGSZ(a0)
REG_L s1, SC_REGS+S1*REGSZ(a0)
REG_L s2, SC_REGS+S2*REGSZ(a0)
REG_L s3, SC_REGS+S3*REGSZ(a0)
REG_L s4, SC_REGS+S4*REGSZ(a0)
REG_L s5, SC_REGS+S5*REGSZ(a0)
REG_L s6, SC_REGS+S6*REGSZ(a0)
REG_L s7, SC_REGS+S7*REGSZ(a0)
REG_L s8, SC_REGS+S8*REGSZ(a0)
REG_L gp, SC_REGS+GP*REGSZ(a0)
REG_L sp, SC_REGS+SP*REGSZ(a0)
#if !defined(SOFTFLOAT)
ctc1 v0, $31
#if _MIPS_FPSET == 32
FPREG64_L($f20, SC_FPREGS+((F20-F0)*REGSZ_FP), a0)
FPREG64_L($f21, SC_FPREGS+((F21-F0)*REGSZ_FP), a0)
FPREG64_L($f22, SC_FPREGS+((F22-F0)*REGSZ_FP), a0)
FPREG64_L($f23, SC_FPREGS+((F23-F0)*REGSZ_FP), a0)
FPREG64_L($f24, SC_FPREGS+((F24-F0)*REGSZ_FP), a0)
FPREG64_L($f25, SC_FPREGS+((F25-F0)*REGSZ_FP), a0)
FPREG64_L($f26, SC_FPREGS+((F26-F0)*REGSZ_FP), a0)
FPREG64_L($f27, SC_FPREGS+((F27-F0)*REGSZ_FP), a0)
FPREG64_L($f28, SC_FPREGS+((F28-F0)*REGSZ_FP), a0)
FPREG64_L($f29, SC_FPREGS+((F29-F0)*REGSZ_FP), a0)
FPREG64_L($f30, SC_FPREGS+((F30-F0)*REGSZ_FP), a0)
FPREG64_L($f31, SC_FPREGS+((F31-F0)*REGSZ_FP), a0)
#else
lwc1 $f20, SC_FPREGS+((F20-F0)*REGSZ_FP)(a0)
lwc1 $f21, SC_FPREGS+((F21-F0)*REGSZ_FP)(a0)
lwc1 $f22, SC_FPREGS+((F22-F0)*REGSZ_FP)(a0)
lwc1 $f23, SC_FPREGS+((F23-F0)*REGSZ_FP)(a0)
lwc1 $f24, SC_FPREGS+((F24-F0)*REGSZ_FP)(a0)
lwc1 $f25, SC_FPREGS+((F25-F0)*REGSZ_FP)(a0)
lwc1 $f26, SC_FPREGS+((F26-F0)*REGSZ_FP)(a0)
lwc1 $f27, SC_FPREGS+((F27-F0)*REGSZ_FP)(a0)
lwc1 $f28, SC_FPREGS+((F28-F0)*REGSZ_FP)(a0)
lwc1 $f29, SC_FPREGS+((F29-F0)*REGSZ_FP)(a0)
lwc1 $f30, SC_FPREGS+((F30-F0)*REGSZ_FP)(a0)
lwc1 $f31, SC_FPREGS+((F31-F0)*REGSZ_FP)(a0)
#endif
#endif /* !SOFTFLOAT */
bne a1, zero, 1f
nop
li a1, 1 # never return 0!
1:
j ra
move v0, a1
botch:
jal longjmperror
nop
jal abort
nop
RESTORE_GP64
PTR_ADDU sp, FRAMESZ
END(_longjmp)

View File

@@ -25,10 +25,19 @@
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
#include <unistd.h>
#include <fcntl.h>
int creat(const char* pathname, mode_t mode)
{
return open(pathname, O_WRONLY|O_TRUNC|O_CREAT, mode);
}
.text
.globl atexit
.hidden atexit
.type atexit, @function
.align 4
.ent atexit
atexit:
.set noreorder
.cpload $t9
.set reorder
la $t9, __cxa_atexit
move $a1, $0
la $a2, __dso_handle
j $t9
.size atexit, .-atexit
.end atexit

View File

@@ -1,5 +1,5 @@
/*
* Copyright (C) 2009 The Android Open Source Project
* Copyright (C) 2008 The Android Open Source Project
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -25,5 +25,21 @@
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
#define BZERO
#include "memset.S"
.text
/*
* void bzero(void *s, size_t n);
*/
.type bzero, @function
.global bzero
.align 4
.ent bzero
.set noreorder
bzero:
.cpload $t9
move $a2,$a1
la $t9,memset
j $t9
move $a1,$zero
.end bzero

View File

@@ -0,0 +1,101 @@
/*
* Copyright (C) 2008 The Android Open Source Project
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
#include <unistd.h>
#include <sys/cachectl.h>
#ifdef DEBUG
#include <logd.h>
#define XLOG(...) \
__libc_android_log_print(ANDROID_LOG_DEBUG,"libc-cacheflush",__VA_ARGS__)
#endif
/*
* Linux historically defines a cacheflush(3) routine for MIPS
* with this signature:
* int cacheflush(char *addr, int nbytes, int cache);
*
* Android defines an alternate cacheflush routine which exposes the
* ARM system call interface:
* int cacheflush (long start, long end, long flags)
*
* This is an attempt to maintain compatibility between the historical MIPS
* usage for software previously ported to MIPS and Android specific
* uses of cacheflush()
*
* Use the gcc __clear_cache builtin if possible. This will generate inline synci
* instructions if available or call _flush_cache(start, len, BCACHE) directly
*/
#if defined (__GNUC__)
#define GCC_VERSION ((__GNUC__*10000) + __GNUC_MINOR__*100 + __GNUC_PATCHLEVEL__)
#endif
/* This is the Android signature */
int cacheflush (long start, long end, long flags)
{
if (end < start) {
/*
* It looks like this is really MIPS style cacheflush call
* start => addr
* end => nbytes
*/
#ifdef DEBUG
static int warned = 0;
if (!warned) {
XLOG("called with (start,len) instead of (start,end)");
warned = 1;
}
#endif
end += start;
}
#if !defined(ARCH_MIPS_USE_FLUSHCACHE_SYSCALL) && \
defined(GCC_VERSION) && (GCC_VERSION >= 40300)
#if (__mips_isa_rev >= 2) && (GCC_VERSION < 40403)
/*
* Modify "start" and "end" to avoid GCC 4.3.0-4.4.2 bug in
* mips_expand_synci_loop that may execute synci one more time.
* "start" points to the first byte of the cache line.
* "end" points to the last byte of the line before the last cache line.
* Because size is always a multiple of 4, this is safe to set
* "end" to the last byte.
*/
{
int lineSize;
asm("rdhwr %0, $1" : "=r" (lineSize));
start = start & (-lineSize);
end = (end & (-lineSize)) - 1;
}
#endif
__builtin___clear_cache((char *)start, (char *)end);
#else
_flush_cache((char *)start, end-start, BCACHE);
#endif
return 0;
}

View File

@@ -0,0 +1,145 @@
/*
* Copyright (C) 2008 The Android Open Source Project
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
#include <linux/sched.h>
#include <sys/linux-syscalls.h>
#include <linux/errno.h>
.text
.type __pthread_clone, @function
.global __pthread_clone
.align 4
.ent __pthread_clone
/*
* int __pthread_clone(int (*fn)(void*), void *child_stack,
* int flags, void *arg);
*/
__pthread_clone:
.set noreorder
.cpload $t9
.set reorder
# set up child stack
subu $a1,16
sw $a0,0($a1) # fn
sw $a3,4($a1) # arg
# sw $a1+16,8($a1) # tls
/*
* int sys_clone(int flags, void *child_stack, int *parent_tidptr,
* struct user_desc *newtls, int *child_tidptr);
*/
move $a0,$a2 # flags
# move $a1,$a1 # child_stack
move $a2,$0 # parent_tidptr
move $a3,$0 # user_desc
and $a0,~(CLONE_CHILD_SETTID | CLONE_CHILD_CLEARTID)
# make sure the kernel doesn't access child_tidptr
li $v0,__NR_clone
syscall
bnez $a3,.L__error
beqz $v0,.L__thread_start
j $ra
.L__thread_start:
lw $a0,0($sp) # fn
lw $a1,4($sp) # arg
addu $a2,$sp,16 # tls
# void __thread_entry(int (*func)(void*), void *arg, void *tls)
la $t9, __thread_entry
j $t9
.L__error:
move $a0,$v0
la $t9,__set_errno
j $t9
.end __pthread_clone
#
# This function is defined as:
#
# pid_t __bionic_clone( int flags, void *child_stack,
# pid_t *pid, void *tls, pid_t *ctid,
# int (*fn)(void *), void* arg );
#
# NOTE: This is not the same signature than the GLibc
# __clone function here !! Placing 'fn' and 'arg'
# at the end of the parameter list makes the
# implementation much simpler.
#
.text
.type __bionic_clone, @function
.global __bionic_clone
.align 4
.ent __bionic_clone
__bionic_clone:
.set noreorder
.cpload $t9
.set reorder
# set up child stack
subu $a1,16
lw $t0,20($sp) # fn
lw $t1,24($sp) # arg
sw $t0,0($a1) # fn
sw $t1,4($a1) # arg
# remainder of arguments are correct for clone system call
li $v0,__NR_clone
syscall
bnez $a3,.L__error_bc
beqz $v0,.L__thread_start_bc
j $ra
.L__thread_start_bc:
lw $a0,0($sp) # fn
lw $a1,4($sp) # arg
# void __bionic_clone_entry(int (*func)(void*), void *arg)
la $t9,__bionic_clone_entry
j $t9
.L__error_bc:
move $a0,$v0
la $t9,__set_errno
j $t9
.end __bionic_clone

View File

@@ -27,7 +27,8 @@
*/
.text
.align 4
.type _start,#function
.type __start,@function
.globl __start
.globl _start
# this is the small startup code that is first run when
@@ -43,47 +44,103 @@
# - address of an "onexit" function, not used on any
# platform supported by Bionic
#
# - address of the "main" function of the program. We
# can't hard-code it in the adr pseudo instruction
# so we use a tiny trampoline that will get relocated
# by the dynamic linker before this code runs
# - address of the "main" function of the program.
#
# - address of the constructor list
#
_start:
mov r0, sp
mov r1, #0
adr r2, 0f
adr r3, 1f
b __libc_init
0: b main
.ent __start
__start:
_start:
bal 1f
1:
.set noreorder
.cpload $ra
.set reorder
1: .long __PREINIT_ARRAY__
.long __INIT_ARRAY__
.long __FINI_ARRAY__
.long __CTOR_LIST__
move $a0, $sp
move $a1, $0
la $a2, main
la $a3, 1f
subu $sp, 32
la $t9, __libc_init
j $t9
.end __start
1: .long __PREINIT_ARRAY__
.long __INIT_ARRAY__
.long __FINI_ARRAY__
.section .preinit_array, "aw"
.type __PREINIT_ARRAY__, @object
.globl __PREINIT_ARRAY__
__PREINIT_ARRAY__:
.long -1
.section .init_array, "aw"
.type __INIT_ARRAY__, @object
.globl __INIT_ARRAY__
__INIT_ARRAY__:
.long -1
.section .fini_array, "aw"
.type __FINI_ARRAY__, @object
.globl __FINI_ARRAY__
__FINI_ARRAY__:
.long -1
.long __do_global_dtors_aux
.section .ctors, "aw"
.globl __CTOR_LIST__
__CTOR_LIST__:
.long -1
.abicalls
.text
.align 2
.set nomips16
.ent __do_global_dtors_aux
.type __do_global_dtors_aux, @function
__do_global_dtors_aux:
.frame $sp,32,$31 # vars= 0, regs= 1/0, args= 16, gp= 8
.mask 0x80000000,-4
.fmask 0x00000000,0
.set noreorder
.cpload $25
.set nomacro
addiu $sp,$sp,-32
sw $31,28($sp)
.cprestore 16
lw $2,%got(completed.1269)($28)
lbu $2,%lo(completed.1269)($2)
bne $2,$0,$L8
nop
$L4:
lw $2,%got(__cxa_finalize)($28)
beq $2,$0,$L6
nop
lw $2,%got(__dso_handle)($28)
lw $4,0($2)
lw $25,%call16(__cxa_finalize)($28)
.reloc 1f,R_MIPS_JALR,__cxa_finalize
1: jalr $25
nop
lw $28,16($sp)
$L6:
lw $2,%got(completed.1269)($28)
li $3,1 # 0x1
sb $3,%lo(completed.1269)($2)
$L8:
lw $31,28($sp)
addiu $sp,$sp,32
j $31
nop
.set macro
.set reorder
.end __do_global_dtors_aux
.size __do_global_dtors_aux, .-__do_global_dtors_aux
.local completed.1269
.comm completed.1269,1,1
.weak __cxa_finalize
#include "__dso_handle.S"
#include "atexit.S"

View File

@@ -25,64 +25,70 @@
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
.text
.align 4
.type _start,#function
.globl _start
# this is the small startup code that is first run when
# any executable that is dynamically-linked with Bionic
# runs.
#
# it's purpose is to call __libc_init with appropriate
# arguments, which are:
#
# - the address of the raw data block setup by the Linux
# kernel ELF loader
#
# - address of an "onexit" function, not used on any
# platform supported by Bionic
#
# - address of the "main" function of the program. We
# can't hard-code it in the adr pseudo instruction
# so we use a tiny trampoline that will get relocated
# by the dynamic linker before this code runs
#
# - address of the constructor list
#
_start:
mov r0, sp
mov r1, #0
adr r2, 0f
adr r3, 1f
b __libc_init
0: b main
1: .long __PREINIT_ARRAY__
.long __INIT_ARRAY__
.long __FINI_ARRAY__
.long __CTOR_LIST__
.section .preinit_array, "aw"
.globl __PREINIT_ARRAY__
__PREINIT_ARRAY__:
.long -1
.section .init_array, "aw"
.type __INIT_ARRAY__, @object
.globl __INIT_ARRAY__
__INIT_ARRAY__:
.long -1
.section .fini_array, "aw"
.type __FINI_ARRAY__, @object
.globl __FINI_ARRAY__
__FINI_ARRAY__:
.long -1
.long __do_global_dtors_aux
.section .ctors, "aw"
.globl __CTOR_LIST__
__CTOR_LIST__:
.long -1
.abicalls
.text
.align 2
.set nomips16
.ent __do_global_dtors_aux
.type __do_global_dtors_aux, @function
__do_global_dtors_aux:
.frame $sp,32,$31 # vars= 0, regs= 1/0, args= 16, gp= 8
.mask 0x80000000,-4
.fmask 0x00000000,0
.set noreorder
.cpload $25
.set nomacro
addiu $sp,$sp,-32
sw $31,28($sp)
.cprestore 16
lw $2,%got(completed.1269)($28)
lbu $2,%lo(completed.1269)($2)
bne $2,$0,$L8
nop
#include "__dso_handle.S"
$L4:
lw $2,%got(__cxa_finalize)($28)
beq $2,$0,$L6
nop
lw $2,%got(__dso_handle)($28)
lw $4,0($2)
lw $25,%call16(__cxa_finalize)($28)
.reloc 1f,R_MIPS_JALR,__cxa_finalize
1: jalr $25
nop
lw $28,16($sp)
$L6:
lw $2,%got(completed.1269)($28)
li $3,1 # 0x1
sb $3,%lo(completed.1269)($2)
$L8:
lw $31,28($sp)
addiu $sp,$sp,32
j $31
nop
.set macro
.set reorder
.end __do_global_dtors_aux
.size __do_global_dtors_aux, .-__do_global_dtors_aux
.local completed.1269
.comm completed.1269,1,1
.weak __cxa_finalize
#include "__dso_handle_so.S"
#include "atexit.S"

View File

@@ -1,5 +1,5 @@
/*
* Copyright (C) 2009 The Android Open Source Project
* Copyright (C) 2008 The Android Open Source Project
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -25,15 +25,13 @@
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
.section .preinit_array, "aw"
.long 0
.section .preinit_array, "aw"
.long 0
.section .init_array, "aw"
.long 0
.section .init_array, "aw"
.long 0
.section .fini_array, "aw"
.long 0
.section .fini_array, "aw"
.long 0
.section .ctors, "aw"
.long 0

View File

@@ -0,0 +1,5 @@
.section .init_array, "aw"
.long 0
.section .fini_array, "aw"
.long 0

View File

@@ -0,0 +1,92 @@
/* $NetBSD: ffs.S,v 1.5 2003/04/05 23:08:52 bjh21 Exp $ */
/*
* Copyright (c) 2001 Christopher Gilbert
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. The name of the company nor the name of the author may be used to
* endorse or promote products derived from this software without specific
* prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
* IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
* INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
/*
* ffs - find first set bit, this algorithm isolates the first set
* bit, then multiplies the number by 0x0450fbaf which leaves the top
* 6 bits as an index into the table. This algorithm should be a win
* over the checking each bit in turn as per the C compiled version.
*
* This is the ffs algorithm devised by d.seal and posted to comp.sys.arm on
* 16 Feb 1994.
*/
.text
.ent ffs
.type ffs, @function
.global ffs
.align 4
.set noreorder
ffs:
#if (__mips==32)
subu $t0,$0,$a0
and $a0,$t0
clz $t0,$a0
li $v0,32
j $ra
subu $v0,$t0
#else
/* Size of the ffs routine in bytes
* This is used to index .L_ffs_table from $t9
* FIXME: there must be a better way to do this
*/
#define FFSSIZE 12*4
subu $t0,$0,$a0
and $a0,$t0
/*
* now a0 has at most one set bit, call this X
* if X = 0, all further instructions are skipped
*/
sll $t0,$a0,4 /* t0 = X * 0x00000010 */
or $a0,$t0 /* a0 = X * 0x00000011 */
sll $t0,$a0,6 /* t0 = X * 0x00000440 */
or $a0,$t0 /* a0 = X * 0x00000451 */
sll $t0,$a0,16 /* t0 = X * 0x04510000 */
subu $a0,$t0,$a0 /* a0 = X * 0x0450fbaf */
/* now lookup in table indexed on top 6 bits of a0 */
srl $a0,25
addu $t9,$a0
j $ra
lbu $v0,FFSSIZE($t9)
.L_ffs_table:
/* 0 1 2 3 4 5 6 7 */
.byte 0, 1, 2, 13, 3, 7, 0, 14 /* 0- 7 */
.byte 4, 0, 8, 0, 0, 0, 0, 15 /* 8-15 */
.byte 11, 5, 0, 0, 9, 0, 0, 26 /* 16-23 */
.byte 0, 0, 0, 0, 0, 22, 28, 16 /* 24-31 */
.byte 32, 12, 6, 0, 0, 0, 0, 0 /* 32-39 */
.byte 10, 0, 0, 25, 0, 0, 21, 27 /* 40-47 */
.byte 31, 0, 0, 0, 0, 24, 0, 20 /* 48-55 */
.byte 30, 0, 23, 19, 29, 18, 17, 0 /* 56-63 */
#endif
.end ffs

View File

@@ -0,0 +1,142 @@
/*
* Copyright (C) 2008 The Android Open Source Project
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
#include <asm/unistd.h>
#define FUTEX_WAIT 0
#define FUTEX_WAKE 1
/*
* __futex_wait(*ftx, val, *timespec)
* futex_syscall(*ftx, op, val, *timespec, *addr2, val3)
*/
.type __futex_wait, @function
.global __futex_wait
.align 4
.ent __futex_wait
__futex_wait:
subu $sp,4*6
sw $0,20($sp) /* val3 */
sw $0,16($sp) /* addr2 */
move $a3,$a2 /* timespec */
move $a2,$a1 /* val */
li $a1,FUTEX_WAIT /* op */
# move $a0,$a0 /* ftx */
li $v0,__NR_futex
syscall
.set noreorder
bnez $a3, 1f /* Check for error */
neg $v0 /* Negate error number if it's valid */
move $v0,$0 /* Otherwise return 0 */
1:
.set reorder
addu $sp,4*6
j $ra
.end __futex_wait
/*
* int __futex_wake(volatile void *ftx, int count)
* int futex_syscall(*ftx, op, val, *timespec, *addr2, val3)
*/
.type __futex_wake, @function
.globl __futex_wake
.align 4
.ent __futex_wake
__futex_wake:
subu $sp,4*6
sw $0,20($sp) /* val3 */
sw $0,16($sp) /* addr2 */
move $a3,$0 /* timespec */
move $a2,$a1 /* val */
li $a1,FUTEX_WAKE /* op */
# move $a0,$a0 /* ftx */
li $v0,__NR_futex
syscall
.set noreorder
bnez $a3, 1f /* Check for error */
neg $v0 /* Negate error number if it's valid */
move $v0,$0 /* Otherwise return 0 */
1:
.set reorder
addu $sp,4*6
j $ra
.end __futex_wake
/* __futex_syscall3(*ftx, op, val)
* futex_syscall(*ftx, op, val, *timespec, *addr2, val3)
*/
.type __futex_syscall3, @function
.global __futex_syscall3
.align 4
.ent __futex_syscall3
__futex_syscall3:
subu $sp,4*6
sw $0,20($sp) /* val3 */
sw $0,16($sp) /* addr2 */
move $a3,$0 /* timespec */
# move $a2,$a2 /* val */
# li $a1,$a1 /* op */
# move $a0,$a0 /* ftx */
li $v0,__NR_futex
syscall
.set noreorder
bnez $a3, 1f /* Check for error */
neg $v0 /* Negate error number if it's valid */
move $v0,$0 /* Otherwise return 0 */
1:
.set reorder
addu $sp,4*6
j $ra
.end __futex_syscall3
/* __futex_syscall4(*ftx, op, val)
* futex_syscall(*ftx, op, val, *timespec, *addr2, val3)
*/
.type __futex_syscall4, @function
.global __futex_syscall4
.align 4
.ent __futex_syscall4
__futex_syscall4:
subu $sp,4*6
sw $0,20($sp) /* val3 */
sw $0,16($sp) /* addr2 */
# move $a3,$a3 /* timespec */
# move $a2,$a2 /* val */
# li $a1,$a1 /* op */
# move $a0,$a0 /* ftx */
li $v0,__NR_futex
syscall
.set noreorder
bnez $a3, 1f /* Check for error */
neg $v0 /* Negate error number if it's valid */
move $v0,$0 /* Otherwise return 0 */
1:
.set reorder
addu $sp,4*6
j $ra
.end __futex_syscall4

View File

@@ -0,0 +1,55 @@
/*
* Copyright (C) 2008 The Android Open Source Project
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
.text
/*
* u4 __memcmp16(const u2* s0, const u2* s1, size_t count);
*/
.type __memcmp16, @function
.global __memcmp16
.align 4
.ent __memcmp16
__memcmp16:
li $t0,0
li $t1,0
beqz $a2,done /* 0 length string */
beq $a0,$a1,done /* strings are identical */
/* Unoptimised... */
1: lhu $t0,0($a0)
lhu $t1,0($a1)
addu $a1,2
bne $t0,$t1,done
addu $a0,2
subu $a2,1
bnez $a2,1b
done:
subu $v0,$t0,$t1
j $ra
.end __memcmp16

View File

@@ -25,14 +25,20 @@
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
#include <signal.h>
#include <string.h>
#include <strings.h>
char*
strsignal(int sig)
void *memmove(void *dst, const void *src, size_t n)
{
if ((unsigned)sig < NSIG)
return (char*) sys_siglist[sig];
else
return "Invalid signal number";
const char *p = src;
char *q = dst;
/* We can use the optimized memcpy if the destination is completely below the
* source (i.e. q + n <= p), or if it is completely over it (i.e. q >= p+n).
*/
if (__builtin_expect((q + n < p) || (q >= p + n), 1)) {
return memcpy(dst, src, n);
} else {
bcopy(src, dst, n);
return dst;
}
}

View File

@@ -0,0 +1,60 @@
/*
* Copyright (C) 2008 The Android Open Source Project
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
/*
* The MIPS pipe syscall returns results in two registers, which
* we have to copy into the supplied array. This prevents us from
* using an auto-generated stub.
*/
#include <asm/unistd.h>
.text
/* int pipe(int[]) */
.type pipe,@function
.global pipe
.align 4
.ent pipe
pipe:
.set noreorder
.cpload $t9
li $v0,__NR_pipe
syscall /* syscall returns results in v0,v1 */
bnez $a3, 1f /* check errno */
nop
sw $v0, 0($a0)
sw $v1, 4($a0)
j $ra
move $v0, $zero
1:
la $t9, __set_errno
j $t9
move $a0, $v0 /* delay slot, prepare args for __set_errno */
.end pipe

View File

@@ -0,0 +1,211 @@
/* $OpenBSD: setjmp.S,v 1.5 2005/08/07 16:40:15 espie Exp $ */
/*
* Copyright (c) 2001-2002 Opsycon AB (www.opsycon.se / www.opsycon.com)
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. Neither the name of Opsycon AB nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS
* OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
*/
#include <machine/asm.h>
#include <machine/regnum.h>
#include <machine/signal.h>
/*
* setjmp, longjmp implementation for libc. this code depends
* on the layout of the struct sigcontext in machine/signal.h.
*
*/
FRAMESZ= MKFSIZ(2,6)
A1OFF= FRAMESZ-4*REGSZ
A0OFF= FRAMESZ-3*REGSZ
GPOFF= FRAMESZ-2*REGSZ
RAOFF= FRAMESZ-1*REGSZ
#define FPREG64_S(FPR, OFF, BASE) \
swc1 FPR, OFF(BASE) ; \
mfhc1 t0, FPR ; \
sw t0, OFF+4(BASE) ;
#define FPREG64_L(FPR, OFF, BASE) \
lw t0, OFF+4(BASE) ; \
lw t1, OFF(BASE) ; \
mtc1 t1, FPR ; \
mthc1 t0, FPR ; \
NON_LEAF(setjmp, FRAMESZ, ra)
.mask 0x80000000, RAOFF
PTR_SUBU sp, FRAMESZ # allocate stack frame
SETUP_GP64(GPOFF, setjmp)
SAVE_GP(GPOFF)
.set reorder
REG_S ra, RAOFF(sp) # save state
REG_S a0, A0OFF(sp)
move a0, zero # get current signal mask
jal sigblock
REG_L v1, A0OFF(sp) # v1 = jmpbuf
REG_S v0, SC_MASK(v1) # save sc_mask = sigblock(0)
REG_L a0, A0OFF(sp) # restore jmpbuf
REG_L ra, RAOFF(sp)
REG_S ra, SC_PC(a0) # sc_pc = return address
#if defined(__mips64)
dli v0, 0xACEDBADE # sigcontext magic number
#else
li v0, 0xACEDBADE # sigcontext magic number
#endif
REG_S v0, SC_REGS+ZERO*REGSZ(a0)
REG_S s0, SC_REGS+S0*REGSZ(a0)
REG_S s1, SC_REGS+S1*REGSZ(a0)
REG_S s2, SC_REGS+S2*REGSZ(a0)
REG_S s3, SC_REGS+S3*REGSZ(a0)
REG_S s4, SC_REGS+S4*REGSZ(a0)
REG_S s5, SC_REGS+S5*REGSZ(a0)
REG_S s6, SC_REGS+S6*REGSZ(a0)
REG_S s7, SC_REGS+S7*REGSZ(a0)
REG_S s8, SC_REGS+S8*REGSZ(a0)
REG_L v0, GPOFF(sp)
REG_S v0, SC_REGS+GP*REGSZ(a0)
PTR_ADDU v0, sp, FRAMESZ
REG_S v0, SC_REGS+SP*REGSZ(a0)
#if !defined(SOFTFLOAT)
li v0, 1 # be nice if we could tell
REG_S v0, SC_FPUSED(a0) # sc_fpused = 1
cfc1 v0, $31
#if _MIPS_FPSET == 32
FPREG64_S($f20, SC_FPREGS+((F20-F0)*REGSZ_FP), a0)
FPREG64_S($f21, SC_FPREGS+((F21-F0)*REGSZ_FP), a0)
FPREG64_S($f22, SC_FPREGS+((F22-F0)*REGSZ_FP), a0)
FPREG64_S($f23, SC_FPREGS+((F23-F0)*REGSZ_FP), a0)
FPREG64_S($f24, SC_FPREGS+((F24-F0)*REGSZ_FP), a0)
FPREG64_S($f25, SC_FPREGS+((F25-F0)*REGSZ_FP), a0)
FPREG64_S($f26, SC_FPREGS+((F26-F0)*REGSZ_FP), a0)
FPREG64_S($f27, SC_FPREGS+((F27-F0)*REGSZ_FP), a0)
FPREG64_S($f28, SC_FPREGS+((F28-F0)*REGSZ_FP), a0)
FPREG64_S($f29, SC_FPREGS+((F29-F0)*REGSZ_FP), a0)
FPREG64_S($f30, SC_FPREGS+((F30-F0)*REGSZ_FP), a0)
FPREG64_S($f31, SC_FPREGS+((F31-F0)*REGSZ_FP), a0)
#else
swc1 $f20, SC_FPREGS+((F20-F0)*REGSZ_FP)(a0)
swc1 $f21, SC_FPREGS+((F21-F0)*REGSZ_FP)(a0)
swc1 $f22, SC_FPREGS+((F22-F0)*REGSZ_FP)(a0)
swc1 $f23, SC_FPREGS+((F23-F0)*REGSZ_FP)(a0)
swc1 $f24, SC_FPREGS+((F24-F0)*REGSZ_FP)(a0)
swc1 $f25, SC_FPREGS+((F25-F0)*REGSZ_FP)(a0)
swc1 $f26, SC_FPREGS+((F26-F0)*REGSZ_FP)(a0)
swc1 $f27, SC_FPREGS+((F27-F0)*REGSZ_FP)(a0)
swc1 $f28, SC_FPREGS+((F28-F0)*REGSZ_FP)(a0)
swc1 $f29, SC_FPREGS+((F29-F0)*REGSZ_FP)(a0)
swc1 $f30, SC_FPREGS+((F30-F0)*REGSZ_FP)(a0)
swc1 $f31, SC_FPREGS+((F31-F0)*REGSZ_FP)(a0)
#endif
REG_S v0, SC_FPREGS+((FSR-F0)*REGSZ)(a0)
#endif /* !SOFTFLOAT */
move v0, zero
RESTORE_GP64
PTR_ADDU sp, FRAMESZ
j ra
botch:
jal longjmperror
jal abort
RESTORE_GP64
PTR_ADDU sp, FRAMESZ
END(setjmp)
LEAF(longjmp, FRAMESZ)
PTR_SUBU sp, FRAMESZ
SETUP_GP64(GPOFF, longjmp)
SAVE_GP(GPOFF)
.set reorder
sw a1, A1OFF(sp)
sw a0, A0OFF(sp)
lw a0, SC_MASK(a0)
jal sigsetmask
lw a0, A0OFF(sp)
lw a1, A1OFF(sp)
.set noreorder
REG_L v0, SC_REGS+ZERO*REGSZ(a0)
bne v0, 0xACEDBADE, botch # jump if error
REG_L ra, SC_PC(a0)
REG_L s0, SC_REGS+S0*REGSZ(a0)
REG_L s1, SC_REGS+S1*REGSZ(a0)
REG_L s2, SC_REGS+S2*REGSZ(a0)
REG_L s3, SC_REGS+S3*REGSZ(a0)
REG_L s4, SC_REGS+S4*REGSZ(a0)
REG_L s5, SC_REGS+S5*REGSZ(a0)
REG_L s6, SC_REGS+S6*REGSZ(a0)
REG_L s7, SC_REGS+S7*REGSZ(a0)
REG_L s8, SC_REGS+S8*REGSZ(a0)
REG_L gp, SC_REGS+GP*REGSZ(a0)
REG_L sp, SC_REGS+SP*REGSZ(a0)
#if !defined(SOFTFLOAT)
REG_L v0, SC_FPREGS+((FSR-F0)*REGSZ)(a0)
ctc1 v0, $31
#if _MIPS_FPSET == 32
FPREG64_L($f20, SC_FPREGS+((F20-F0)*REGSZ_FP), a0)
FPREG64_L($f21, SC_FPREGS+((F21-F0)*REGSZ_FP), a0)
FPREG64_L($f22, SC_FPREGS+((F22-F0)*REGSZ_FP), a0)
FPREG64_L($f23, SC_FPREGS+((F23-F0)*REGSZ_FP), a0)
FPREG64_L($f24, SC_FPREGS+((F24-F0)*REGSZ_FP), a0)
FPREG64_L($f25, SC_FPREGS+((F25-F0)*REGSZ_FP), a0)
FPREG64_L($f26, SC_FPREGS+((F26-F0)*REGSZ_FP), a0)
FPREG64_L($f27, SC_FPREGS+((F27-F0)*REGSZ_FP), a0)
FPREG64_L($f28, SC_FPREGS+((F28-F0)*REGSZ_FP), a0)
FPREG64_L($f29, SC_FPREGS+((F29-F0)*REGSZ_FP), a0)
FPREG64_L($f30, SC_FPREGS+((F30-F0)*REGSZ_FP), a0)
FPREG64_L($f31, SC_FPREGS+((F31-F0)*REGSZ_FP), a0)
#else
lwc1 $f20, SC_FPREGS+((F20-F0)*REGSZ_FP)(a0)
lwc1 $f21, SC_FPREGS+((F21-F0)*REGSZ_FP)(a0)
lwc1 $f22, SC_FPREGS+((F22-F0)*REGSZ_FP)(a0)
lwc1 $f23, SC_FPREGS+((F23-F0)*REGSZ_FP)(a0)
lwc1 $f24, SC_FPREGS+((F24-F0)*REGSZ_FP)(a0)
lwc1 $f25, SC_FPREGS+((F25-F0)*REGSZ_FP)(a0)
lwc1 $f26, SC_FPREGS+((F26-F0)*REGSZ_FP)(a0)
lwc1 $f27, SC_FPREGS+((F27-F0)*REGSZ_FP)(a0)
lwc1 $f28, SC_FPREGS+((F28-F0)*REGSZ_FP)(a0)
lwc1 $f29, SC_FPREGS+((F29-F0)*REGSZ_FP)(a0)
lwc1 $f30, SC_FPREGS+((F30-F0)*REGSZ_FP)(a0)
lwc1 $f31, SC_FPREGS+((F31-F0)*REGSZ_FP)(a0)
#endif
#endif /* !SOFTFLOAT */
bne a1, zero, 1f
nop
li a1, 1 # never return 0!
1:
j ra
move v0, a1
END(longjmp)

View File

@@ -0,0 +1,77 @@
/* $OpenBSD: sigsetjmp.S,v 1.5 2005/08/07 16:40:15 espie Exp $ */
/*-
* Copyright (c) 1991, 1993, 1995,
* The Regents of the University of California. All rights reserved.
*
* This code is derived from software contributed to Berkeley by
* Havard Eidnes.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
#include <machine/asm.h>
#include <machine/regnum.h>
#include <machine/setjmp.h>
/*
* trampolines for sigsetjmp and siglongjmp save and restore mask.
*
*/
FRAMESZ= MKFSIZ(1,1)
GPOFF= FRAMESZ-2*REGSZ
LEAF(sigsetjmp, FRAMESZ)
PTR_SUBU sp, FRAMESZ
SETUP_GP64(GPOFF, sigsetjmp)
.set reorder
REG_S a1, (_JBLEN*REGSZ)(a0) # save "savemask"
bne a1, 0x0, 1f # do saving of signal mask?
LA t9, _setjmp
RESTORE_GP64
PTR_ADDU sp, FRAMESZ
jr t9
1: LA t9, setjmp
RESTORE_GP64
PTR_ADDU sp, FRAMESZ
jr t9
END(sigsetjmp)
LEAF(siglongjmp, FRAMESZ)
PTR_SUBU sp, FRAMESZ
SETUP_GP64(GPOFF, siglongjmp)
.set reorder
REG_L t0, (_JBLEN*REGSZ)(a0) # get "savemask"
bne t0, 0x0, 1f # restore signal mask?
LA t9, _longjmp
RESTORE_GP64
PTR_ADDU sp, FRAMESZ
jr t9
1:
LA t9, longjmp
RESTORE_GP64
PTR_ADDU sp, FRAMESZ
jr t9
END(siglongjmp)

View File

@@ -0,0 +1,56 @@
/*
* Copyright (C) 2008 The Android Open Source Project
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
#include <asm/unistd.h>
.text
/* int vfork() implemented using clone() */
.type vfork, @function
.global vfork
.align 4
.ent vfork
vfork:
.set noreorder
.cpload $t9
li $a0, 0x4112 /* CLONE_VM | CLONE_VFORK | SIGCHLD */
move $a1, $sp
li $v0, __NR_clone
syscall
bnez $a3,1f
nop
j $ra
nop
1:
la $t9,__set_errno
j $t9
move $a0,$v0
.end vfork

View File

@@ -0,0 +1,77 @@
/* $OpenBSD: endian.h,v 1.5 2006/02/27 23:35:59 miod Exp $ */
/*
* Copyright (c) 2001-2002 Opsycon AB (www.opsycon.se / www.opsycon.com)
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS
* OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
*/
#ifndef _MIPS64_ENDIAN_H_
#define _MIPS64_ENDIAN_H_
#if defined(__MIPSEL__)
#define _BYTE_ORDER _LITTLE_ENDIAN
#endif
#if defined(__MIPSEB__)
#define _BYTE_ORDER _BIG_ENDIAN
#endif
#if !defined(_BYTE_ORDER) && !defined(lint)
#error "__MIPSEL__ or __MIPSEB__ must be defined to define BYTE_ORDER!!!"
#endif
#ifdef __GNUC__
#if defined(__mips_isa_rev) && (__mips_isa_rev >= 2)
#define __swap16md(x) ({ \
register uint16_t _x = (x); \
register uint16_t _r; \
__asm volatile ("wsbh %0, %1" : "=r" (_r) : "r" (_x)); \
_r; \
})
#define __swap32md(x) ({ \
register uint32_t _x = (x); \
register uint32_t _r; \
__asm volatile ("wsbh %0, %1; rotr %0, %0, 16" : "=r" (_r) : "r" (_x)); \
_r; \
})
#define __swap64md(x) ({ \
uint64_t _swap64md_x = (x); \
(uint64_t) __swap32md(_swap64md_x >> 32) | \
(uint64_t) __swap32md(_swap64md_x & 0xffffffff) << 32; \
})
/* Tell sys/endian.h we have MD variants of the swap macros. */
#define MD_SWAP
#endif /* __mips32r2__ */
#endif /* __GNUC__ */
#include <sys/endian.h>
#define __STRICT_ALIGNMENT
#endif /* _MIPS64_ENDIAN_H_ */

View File

@@ -1,4 +1,4 @@
/* $OpenBSD: _types.h,v 1.6 2008/07/21 20:50:55 martynas Exp $ */
/* $OpenBSD: _types.h,v 1.5 2008/07/21 20:50:54 martynas Exp $ */
/*-
* Copyright (c) 1990, 1993
@@ -32,14 +32,16 @@
* @(#)ansi.h 8.2 (Berkeley) 1/4/94
*/
#ifndef _SH__TYPES_H_
#define _SH__TYPES_H_
#ifndef _MIPS64__TYPES_H_
#define _MIPS64__TYPES_H_
#if defined(_KERNEL)
typedef struct label_t {
int val[9];
} label_t;
#endif
/*
* We need to handle the various ISA levels for sizes.
*/
#define _MIPS_ISA_MIPS1 1 /* R2000/R3000 */
#define _MIPS_ISA_MIPS2 2 /* R4000/R6000 */
#define _MIPS_ISA_MIPS3 3 /* R4000 */
#define _MIPS_ISA_MIPS4 4 /* TFP (R1x000) */
/* 7.18.1.1 Exact-width integer types */
typedef __signed char __int8_t;
@@ -82,7 +84,13 @@ typedef __int64_t __intmax_t;
typedef __uint64_t __uintmax_t;
/* Register size */
typedef __uint32_t __register_t;
#if (_MIPS_ISA == _MIPS_ISA_MIPS3 || _MIPS_ISA == _MIPS_ISA_MIPS4)
typedef __int64_t __register_t;
typedef __int64_t f_register_t; /* XXX */
#else
typedef __int32_t __register_t;
typedef __int32_t f_register_t; /* XXX */
#endif
/* VM system types */
typedef unsigned long __vaddr_t;
@@ -97,18 +105,14 @@ typedef double __double_t;
typedef float __float_t;
typedef long long __off_t;
typedef long __ptrdiff_t;
#if 0
/* cut it off for Android-SH */
typedef unsigned long __size_t;
#endif
/*typedef unsigned long __size_t;*/
typedef long __ssize_t;
typedef int __time_t;
typedef int __timer_t;
#if defined(__GNUC__) && __GNUC__ >= 3
typedef __builtin_va_list __va_list;
#else
struct __va_list_tag;
typedef struct __va_list_tag * __va_list;
typedef char * __va_list;
#endif
/* Wide character support types */
@@ -120,7 +124,22 @@ typedef int __rune_t;
typedef void * __wctrans_t;
typedef void * __wctype_t;
/* Feature test macros */
#define __HAVE_GENERIC_SOFT_INTERRUPTS
#ifdef __MIPSEB__
#define _BYTE_ORDER _BIG_ENDIAN
#else
#define _BYTE_ORDER _LITTLE_ENDIAN
#endif
#endif /* _SH__TYPES_H_ */
#if defined(_KERNEL)
typedef struct label_t {
__register_t val[14];
} label_t;
#endif
/* XXX check why this still has to be defined. pmap.c issue? */
#define __SWAP_BROKEN
/* Feature test macros */
#define __HAVE_TIMECOUNTER
#endif /* _MIPS64__TYPES_H_ */

View File

@@ -0,0 +1,305 @@
/* $OpenBSD: asm.h,v 1.7 2004/10/20 12:49:15 pefo Exp $ */
/*
* Copyright (c) 2001-2002 Opsycon AB (www.opsycon.se / www.opsycon.com)
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS
* OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
*/
#ifndef _MIPS64_ASM_H
#define _MIPS64_ASM_H
#include <machine/regdef.h>
#ifdef NEED_OLD_RM7KFIX
#define ITLBNOPFIX nop;nop;nop;nop;nop;nop;nop;nop;nop;nop;
#else
#define ITLBNOPFIX nop;nop;nop;nop
#endif
#define _MIPS_ISA_MIPS1 1 /* R2000/R3000 */
#define _MIPS_ISA_MIPS2 2 /* R4000/R6000 */
#define _MIPS_ISA_MIPS3 3 /* R4000 */
#define _MIPS_ISA_MIPS4 4 /* TFP (R1x000) */
#ifdef __linux__
#define _MIPS_ISA_MIPS5 5
#define _MIPS_ISA_MIPS32 6
#define _MIPS_ISA_MIPS64 7
#else
#define _MIPS_ISA_MIPS32 32 /* MIPS32 */
#endif
#if !defined(ABICALLS) && !defined(_NO_ABICALLS)
#define ABICALLS .abicalls
#endif
#if defined(ABICALLS) && !defined(_KERNEL)
ABICALLS
#endif
#define _C_LABEL(x) x /* XXX Obsolete but keep for a while */
#if !defined(__MIPSEL__) && !defined(__MIPSEB__)
#error "__MIPSEL__ or __MIPSEB__ must be defined"
#endif
/*
* Define how to access unaligned data word
*/
#if defined(__MIPSEL__)
#define LWLO lwl
#define LWHI lwr
#define SWLO swl
#define SWHI swr
#define LDLO ldl
#define LDHI ldr
#define SDLO sdl
#define SDHI sdr
#endif
#if defined(__MIPSEB__)
#define LWLO lwr
#define LWHI lwl
#define SWLO swr
#define SWHI swl
#define LDLO ldr
#define LDHI ldl
#define SDLO sdr
#define SDHI sdl
#endif
/*
* Define programming environment for ABI.
*/
#if defined(ABICALLS) && !defined(_KERNEL) && !defined(_STANDALONE)
#ifndef _MIPS_SIM
#define _MIPS_SIM 1
#define _ABIO32 1
#endif
#ifndef _MIPS_ISA
#define _MIPS_ISA 2
#define _MIPS_ISA_MIPS2 2
#endif
#if (_MIPS_SIM == _ABIO32) || (_MIPS_SIM == _ABI32)
#define NARGSAVE 4
#define SETUP_GP \
.set noreorder; \
.cpload t9; \
.set reorder;
#define SAVE_GP(x) \
.cprestore x
#define SETUP_GP64(gpoff, name)
#define RESTORE_GP64
#endif
#if (_MIPS_SIM == _ABI64) || (_MIPS_SIM == _ABIN32)
#define NARGSAVE 0
#define SETUP_GP
#define SAVE_GP(x)
#define SETUP_GP64(gpoff, name) \
.cpsetup t9, gpoff, name
#define RESTORE_GP64 \
.cpreturn
#endif
#define MKFSIZ(narg,locals) (((narg+locals)*REGSZ+31)&(~31))
#else /* defined(ABICALLS) && !defined(_KERNEL) */
#define NARGSAVE 4
#define SETUP_GP
#define SAVE_GP(x)
#define ALIGNSZ 16 /* Stack layout alignment */
#define FRAMESZ(sz) (((sz) + (ALIGNSZ-1)) & ~(ALIGNSZ-1))
#endif
/*
* Basic register operations based on selected ISA
*/
#if (_MIPS_ISA == _MIPS_ISA_MIPS1 || _MIPS_ISA == _MIPS_ISA_MIPS2 || _MIPS_ISA == _MIPS_ISA_MIPS32)
#define REGSZ 4 /* 32 bit mode register size */
#define LOGREGSZ 2 /* log rsize */
#define REG_S sw
#define REG_L lw
#define CF_SZ 24 /* Call frame size */
#define CF_ARGSZ 16 /* Call frame arg size */
#define CF_RA_OFFS 20 /* Call ra save offset */
#endif
#if (_MIPS_ISA == _MIPS_ISA_MIPS3 || _MIPS_ISA == _MIPS_ISA_MIPS4)
#define REGSZ 8 /* 64 bit mode register size */
#define LOGREGSZ 3 /* log rsize */
#define REG_S sd
#define REG_L ld
#define CF_SZ 48 /* Call frame size (multiple of ALIGNSZ) */
#define CF_ARGSZ 32 /* Call frame arg size */
#define CF_RA_OFFS 40 /* Call ra save offset */
#endif
#define REGSZ_FP 8 /* 64 bit FP register size */
#ifndef __LP64__
#define PTR_L lw
#define PTR_S sw
#define PTR_SUB sub
#define PTR_ADD add
#define PTR_SUBU subu
#define PTR_ADDU addu
#define LI li
#define LA la
#define PTR_SLL sll
#define PTR_SRL srl
#define PTR_VAL .word
#else
#define PTR_L ld
#define PTR_S sd
#define PTR_ADD dadd
#define PTR_SUB dsub
#define PTR_SUBU dsubu
#define PTR_ADDU daddu
#define LI dli
#define LA dla
#define PTR_SLL dsll
#define PTR_SRL dsrl
#define PTR_VAL .dword
#endif
/*
* Define -pg profile entry code.
*/
#if defined(XGPROF) || defined(XPROF)
#define MCOUNT \
PTR_SUBU sp, sp, 32; \
SAVE_GP(16); \
sw ra, 28(sp); \
sw gp, 24(sp); \
.set noat; \
.set noreorder; \
move AT, ra; \
jal _mcount; \
PTR_SUBU sp, sp, 8; \
lw ra, 28(sp); \
PTR_ADDU sp, sp, 32; \
.set reorder; \
.set at;
#else
#define MCOUNT
#endif
/*
* LEAF(x, fsize)
*
* Declare a leaf routine.
*/
#define LEAF(x, fsize) \
.align 3; \
.globl x; \
.ent x, 0; \
x: ; \
.frame sp, fsize, ra; \
SETUP_GP \
MCOUNT
#define ALEAF(x) \
.globl x; \
x:
/*
* NLEAF(x)
*
* Declare a non-profiled leaf routine.
*/
#define NLEAF(x, fsize) \
.align 3; \
.globl x; \
.ent x, 0; \
x: ; \
.frame sp, fsize, ra; \
SETUP_GP
/*
* NON_LEAF(x)
*
* Declare a non-leaf routine (a routine that makes other C calls).
*/
#define NON_LEAF(x, fsize, retpc) \
.align 3; \
.globl x; \
.ent x, 0; \
x: ; \
.frame sp, fsize, retpc; \
SETUP_GP \
MCOUNT
/*
* NNON_LEAF(x)
*
* Declare a non-profiled non-leaf routine
* (a routine that makes other C calls).
*/
#define NNON_LEAF(x, fsize, retpc) \
.align 3; \
.globl x; \
.ent x, 0; \
x: ; \
.frame sp, fsize, retpc \
SETUP_GP
/*
* END(x)
*
* Mark end of a procedure.
*/
#define END(x) \
.end x
/*
* Macros to panic and printf from assembly language.
*/
#define PANIC(msg) \
LA a0, 9f; \
jal panic; \
nop ; \
MSG(msg)
#define PRINTF(msg) \
la a0, 9f; \
jal printf; \
nop ; \
MSG(msg)
#define MSG(msg) \
.rdata; \
9: .asciiz msg; \
.text
#define ASMSTR(str) \
.asciiz str; \
.align 3
#endif /* !_MIPS_ASM_H */

View File

@@ -0,0 +1,47 @@
/* $OpenBSD: cdefs.h,v 1.4 2006/01/10 00:04:04 millert Exp $ */
/*
* Copyright (c) 2002-2003 Opsycon AB (www.opsycon.se / www.opsycon.com)
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS
* OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
*/
#ifndef _MIPS_CDEFS_H_
#define _MIPS_CDEFS_H_
#if defined(lint)
#define __indr_reference(sym,alias) __lint_equal__(sym,alias)
#define __warn_references(sym,msg)
#define __weak_alias(alias,sym) __lint_equal__(sym,alias)
#elif defined(__GNUC__) && defined(__STDC__)
#define __weak_alias(alias,sym) \
__asm__(".weak " __STRING(alias) " ; " \
__STRING(alias) " = " __STRING(sym))
#define __warn_references(sym,msg) \
__asm__(".section .gnu.warning." __STRING(sym) \
" ; .ascii \"" msg "\" ; .text")
#define __indr_references(sym,msg) /* nothing */
#endif
#endif /* !_MIPS_CDEFS_H_ */

View File

@@ -0,0 +1,188 @@
/* $OpenBSD: exec.h,v 1.1 2004/10/18 19:05:36 grange Exp $ */
/*
* Copyright (c) 1996-2004 Per Fogelstrom, Opsycon AB
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS
* OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
*/
#ifndef _MIPS64_EXEC_H_
#define _MIPS64_EXEC_H_
#define __LDPGSZ 4096
/*
* Define what exec "formats" we should handle.
*/
#define NATIVE_EXEC_ELF
#define NATIVE_ELFSIZE 64
#define EXEC_SCRIPT
/*
* If included from sys/exec.h define kernels ELF format.
*/
#ifdef __LP64__
#define ARCH_ELFSIZE 64
#define DB_ELFSIZE 64
#define ELF_TARG_CLASS ELFCLASS64
#else
#define ARCH_ELFSIZE 32
#define DB_ELFSIZE 32
#define ELF_TARG_CLASS ELFCLASS32
#endif
#if defined(__MIPSEB__)
#define ELF_TARG_DATA ELFDATA2MSB
#else
#define ELF_TARG_DATA ELFDATA2LSB
#endif
#define ELF_TARG_MACH EM_MIPS
#define _NLIST_DO_ELF
#if defined(_LP64)
#define _KERN_DO_ELF64
#if defined(COMPAT_O32)
#define _KERN_DO_ELF
#endif
#else
#define _KERN_DO_ELF
#endif
/* Information taken from MIPS ABI supplemental */
/* Architecture dependent Segment types - p_type */
#define PT_MIPS_REGINFO 0x70000000 /* Register usage information */
/* Architecture dependent d_tag field for Elf32_Dyn. */
#define DT_MIPS_RLD_VERSION 0x70000001 /* Runtime Linker Interface ID */
#define DT_MIPS_TIME_STAMP 0x70000002 /* Timestamp */
#define DT_MIPS_ICHECKSUM 0x70000003 /* Cksum of ext. str. and com. sizes */
#define DT_MIPS_IVERSION 0x70000004 /* Version string (string tbl index) */
#define DT_MIPS_FLAGS 0x70000005 /* Flags */
#define DT_MIPS_BASE_ADDRESS 0x70000006 /* Segment base address */
#define DT_MIPS_CONFLICT 0x70000008 /* Adr of .conflict section */
#define DT_MIPS_LIBLIST 0x70000009 /* Address of .liblist section */
#define DT_MIPS_LOCAL_GOTNO 0x7000000a /* Number of local .GOT entries */
#define DT_MIPS_CONFLICTNO 0x7000000b /* Number of .conflict entries */
#define DT_MIPS_LIBLISTNO 0x70000010 /* Number of .liblist entries */
#define DT_MIPS_SYMTABNO 0x70000011 /* Number of .dynsym entries */
#define DT_MIPS_UNREFEXTNO 0x70000012 /* First external DYNSYM */
#define DT_MIPS_GOTSYM 0x70000013 /* First GOT entry in .dynsym */
#define DT_MIPS_HIPAGENO 0x70000014 /* Number of GOT page table entries */
#define DT_MIPS_RLD_MAP 0x70000016 /* Address of debug map pointer */
#define DT_PROCNUM (DT_MIPS_RLD_MAP - DT_LOPROC + 1)
/*
* Legal values for e_flags field of Elf32_Ehdr.
*/
#define EF_MIPS_NOREORDER 0x00000001 /* .noreorder was used */
#define EF_MIPS_PIC 0x00000002 /* Contains PIC code */
#define EF_MIPS_CPIC 0x00000004 /* Uses PIC calling sequence */
#define EF_MIPS_ABI2 0x00000020 /* -n32 on Irix 6 */
#define EF_MIPS_32BITMODE 0x00000100 /* 64 bit in 32 bit mode... */
#define EF_MIPS_ARCH 0xf0000000 /* MIPS architecture level */
#define E_MIPS_ARCH_1 0x00000000
#define E_MIPS_ARCH_2 0x10000000
#define E_MIPS_ARCH_3 0x20000000
#define E_MIPS_ARCH_4 0x30000000
#define EF_MIPS_ABI 0x0000f000 /* ABI level */
#define E_MIPS_ABI_NONE 0x00000000 /* ABI level not set */
#define E_MIPS_ABI_O32 0x00001000
#define E_MIPS_ABI_O64 0x00002000
#define E_MIPS_ABI_EABI32 0x00004000
#define E_MIPS_ABI_EABI64 0x00004000
/*
* Mips special sections.
*/
#define SHN_MIPS_ACOMMON 0xff00 /* Allocated common symbols */
#define SHN_MIPS_SCOMMON 0xff03 /* Small common symbols */
#define SHN_MIPS_SUNDEFINED 0xff04 /* Small undefined symbols */
/*
* Legal values for sh_type field of Elf32_Shdr.
*/
#define SHT_MIPS_LIBLIST 0x70000000 /* Shared objects used in link */
#define SHT_MIPS_CONFLICT 0x70000002 /* Conflicting symbols */
#define SHT_MIPS_GPTAB 0x70000003 /* Global data area sizes */
#define SHT_MIPS_UCODE 0x70000004 /* Reserved for SGI/MIPS compilers */
#define SHT_MIPS_DEBUG 0x70000005 /* MIPS ECOFF debugging information */
#define SHT_MIPS_REGINFO 0x70000006 /* Register usage information */
/*
* Legal values for sh_flags field of Elf32_Shdr.
*/
#define SHF_MIPS_GPREL 0x10000000 /* Must be part of global data area */
#if 0
/*
* Entries found in sections of type SHT_MIPS_GPTAB.
*/
typedef union {
struct {
Elf32_Word gt_current_g_value; /* -G val used in compilation */
Elf32_Word gt_unused; /* Not used */
} gt_header; /* First entry in section */
struct {
Elf32_Word gt_g_value; /* If this val were used for -G */
Elf32_Word gt_bytes; /* This many bytes would be used */
} gt_entry; /* Subsequent entries in section */
} Elf32_gptab;
/*
* Entry found in sections of type SHT_MIPS_REGINFO.
*/
typedef struct {
Elf32_Word ri_gprmask; /* General registers used */
Elf32_Word ri_cprmask[4]; /* Coprocessor registers used */
Elf32_Sword ri_gp_value; /* $gp register value */
} Elf32_RegInfo;
#endif
/*
* Mips relocations.
*/
#define R_MIPS_NONE 0 /* No reloc */
#define R_MIPS_16 1 /* Direct 16 bit */
#define R_MIPS_32 2 /* Direct 32 bit */
#define R_MIPS_REL32 3 /* PC relative 32 bit */
#define R_MIPS_26 4 /* Direct 26 bit shifted */
#define R_MIPS_HI16 5 /* High 16 bit */
#define R_MIPS_LO16 6 /* Low 16 bit */
#define R_MIPS_GPREL16 7 /* GP relative 16 bit */
#define R_MIPS_LITERAL 8 /* 16 bit literal entry */
#define R_MIPS_GOT16 9 /* 16 bit GOT entry */
#define R_MIPS_PC16 10 /* PC relative 16 bit */
#define R_MIPS_CALL16 11 /* 16 bit GOT entry for function */
#define R_MIPS_GPREL32 12 /* GP relative 32 bit */
#define R_MIPS_64 18
#define R_MIPS_REL32_64 ((R_MIPS_64 << 8) | R_MIPS_REL32)
#endif /* !_MIPS64_EXEC_H_ */

View File

@@ -1,4 +1,4 @@
/* $OpenBSD: ieee.h,v 1.2 2006/11/10 20:29:36 otto Exp $ */
/* $OpenBSD: ieee.h,v 1.4 2010/01/23 19:11:21 miod Exp $ */
/*
* Copyright (c) 1992, 1993
@@ -78,31 +78,68 @@
#define SNG_FRACBITS 23
#define DBL_EXPBITS 11
#define DBL_FRACHBITS 20
#define DBL_FRACLBITS 32
#define DBL_FRACBITS 52
#define EXT_EXPBITS 15
#define EXT_FRACHBITS 16
#define EXT_FRACHMBITS 32
#define EXT_FRACLMBITS 32
#define EXT_FRACLBITS 32
#define EXT_FRACBITS 112
#define EXT_IMPLICIT_NBIT
#define EXT_TO_ARRAY32(p, a) do { \
(a)[0] = (uint32_t)(p)->ext_fracl; \
(a)[1] = (uint32_t)(p)->ext_fraclm; \
(a)[2] = (uint32_t)(p)->ext_frachm; \
(a)[3] = (uint32_t)(p)->ext_frach; \
} while(0)
struct ieee_single {
#ifdef __MIPSEB__
u_int sng_sign:1;
u_int sng_exp:8;
u_int sng_frac:23;
#else
u_int sng_frac:23;
u_int sng_exp:8;
u_int sng_sign:1;
#endif
};
struct ieee_double {
#ifdef __MIPSEB__
u_int dbl_sign:1;
u_int dbl_exp:11;
u_int dbl_frach:20;
u_int dbl_fracl;
#else
u_int dbl_fracl;
u_int dbl_frach:20;
u_int dbl_exp:11;
u_int dbl_sign:1;
#endif
};
struct ieee_ext {
#ifdef __MIPSEB__
u_int ext_sign:1;
u_int ext_exp:15;
u_int ext_frach:16;
u_int ext_frachm;
u_int ext_fraclm;
u_int ext_fracl;
#else
u_int ext_fracl;
u_int ext_fraclm;
u_int ext_frachm;
u_int ext_frach:16;
u_int ext_exp:15;
u_int ext_sign:1;
#endif
};
/*

View File

@@ -0,0 +1,8 @@
/* $OpenBSD: internal_types.h,v 1.1 2004/08/06 20:56:02 pefo Exp $ */
/* Public domain */
#ifndef _MIPS64_INTERNAL_TYPES_H_
#define _MIPS64_INTERNAL_TYPES_H_
/* Machine special type definitions */
#endif

View File

@@ -1,5 +1,5 @@
/*
* Copyright (C) 2009 The Android Open Source Project
* Copyright (C) 2008 The Android Open Source Project
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -25,8 +25,8 @@
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
#ifndef _ARCH_SH_KERNEL_H
#define _ARCH_SH_KERNEL_H
#ifndef _ARCH_MIPS_KERNEL_H
#define _ARCH_MIPS_KERNEL_H
/* this file contains kernel-specific definitions that were optimized out of
our processed kernel headers, but still useful nonetheless... */
@@ -39,4 +39,4 @@ typedef unsigned long __kernel_fsblkcnt_t;
typedef unsigned long __kernel_fsfilcnt_t;
typedef unsigned int __kernel_id_t;
#endif /* _ARCH_SH_KERNEL_H */
#endif /* _ARCH_MIPS_KERNEL_H */

View File

@@ -0,0 +1,62 @@
/* $OpenBSD: limits.h,v 1.5 2007/05/07 20:51:07 kettenis Exp $ */
/*
* Copyright (c) 1988, 1993
* The Regents of the University of California. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* @(#)limits.h 8.3 (Berkeley) 1/4/94
*/
#ifndef _MIPS_LIMITS_H_
#define _MIPS_LIMITS_H_
#include <sys/cdefs.h>
#define MB_LEN_MAX 6 /* Allow 31 bit UTF2 */
#ifndef SIZE_MAX
#define SIZE_MAX ULONG_MAX /* max value for a size_t */
#endif
#define SSIZE_MAX LONG_MAX /* max value for a ssize_t */
#if __BSD_VISIBLE
#define SIZE_T_MAX ULONG_MAX /* max value for a size_t (historic) */
/* Quads and longs are the same on mips64 */
#define UQUAD_MAX (ULONG_MAX) /* max value for a uquad_t */
#define QUAD_MAX (LONG_MAX) /* max value for a quad_t */
#define QUAD_MIN (LONG_MIN) /* min value for a quad_t */
#endif /* __BSD_VISIBLE */
#define LONGLONG_BIT 64
#define LONGLONG_MIN (-9223372036854775807LL-1)
#define LONGLONG_MAX 9223372036854775807LL
#define ULONGLONG_MAX 18446744073709551615ULL
#endif /* !_MIPS_LIMITS_H_ */

View File

@@ -0,0 +1,92 @@
/* $OpenBSD: regdef.h,v 1.3 2005/08/07 07:29:44 miod Exp $ */
/*
* Copyright (c) 1992, 1993
* The Regents of the University of California. All rights reserved.
*
* This code is derived from software contributed to Berkeley by
* Ralph Campbell. This file is derived from the MIPS RISC
* Architecture book by Gerry Kane.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* @(#)regdef.h 8.1 (Berkeley) 6/10/93
*/
#ifndef _MIPS_REGDEF_H_
#define _MIPS_REGDEF_H_
#define zero $0 /* always zero */
#define AT $at /* assembler temp */
#define v0 $2 /* return value */
#define v1 $3
#define a0 $4 /* argument registers */
#define a1 $5
#define a2 $6
#define a3 $7
#if defined(__mips_n32) || defined(__mips_n64)
#define a4 $8 /* expanded register arguments */
#define a5 $9
#define a6 $10
#define a7 $11
#define ta0 $8 /* alias */
#define ta1 $9
#define ta2 $10
#define ta3 $11
#define t0 $12 /* temp registers (not saved across subroutine calls) */
#define t1 $13
#define t2 $14
#define t3 $15
#else
#define t0 $8 /* temp registers (not saved across subroutine calls) */
#define t1 $9
#define t2 $10
#define t3 $11
#define t4 $12
#define t5 $13
#define t6 $14
#define t7 $15
#define ta0 $12 /* alias */
#define ta1 $13
#define ta2 $14
#define ta3 $15
#endif
#define s0 $16 /* saved across subroutine calls (callee saved) */
#define s1 $17
#define s2 $18
#define s3 $19
#define s4 $20
#define s5 $21
#define s6 $22
#define s7 $23
#define t8 $24 /* two more temp registers */
#define t9 $25
#define k0 $26 /* kernel temporary */
#define k1 $27
#define gp $28 /* global pointer */
#define sp $29 /* stack pointer */
#define s8 $30 /* one more callee saved */
#define ra $31 /* return address */
#endif /* !_MIPS_REGDEF_H_ */

View File

@@ -0,0 +1,119 @@
/* $OpenBSD: regnum.h,v 1.3 2004/08/10 20:28:13 deraadt Exp $ */
/*
* Copyright (c) 2001-2002 Opsycon AB (www.opsycon.se / www.opsycon.com)
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS
* OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
*/
#ifndef _MIPS64_REGNUM_H_
#define _MIPS64_REGNUM_H_
/*
* Location of the saved registers relative to ZERO.
* Usage is p->p_regs[XX].
*/
#define ZERO 0
#define AST 1
#define V0 2
#define V1 3
#define A0 4
#define A1 5
#define A2 6
#define A3 7
#define T0 8
#define T1 9
#define T2 10
#define T3 11
#define T4 12
#define T5 13
#define T6 14
#define T7 15
#define S0 16
#define S1 17
#define S2 18
#define S3 19
#define S4 20
#define S5 21
#define S6 22
#define S7 23
#define T8 24
#define T9 25
#define K0 26
#define K1 27
#define GP 28
#define SP 29
#define S8 30
#define RA 31
#define SR 32
#define PS SR /* alias for SR */
#define MULLO 33
#define MULHI 34
#define BADVADDR 35
#define CAUSE 36
#define PC 37
#define IC 38
#define CPL 39
#define NUMSAVEREGS 40 /* Number of registers saved in trap */
#define FPBASE NUMSAVEREGS
#define F0 (FPBASE+0)
#define F1 (FPBASE+1)
#define F2 (FPBASE+2)
#define F3 (FPBASE+3)
#define F4 (FPBASE+4)
#define F5 (FPBASE+5)
#define F6 (FPBASE+6)
#define F7 (FPBASE+7)
#define F8 (FPBASE+8)
#define F9 (FPBASE+9)
#define F10 (FPBASE+10)
#define F11 (FPBASE+11)
#define F12 (FPBASE+12)
#define F13 (FPBASE+13)
#define F14 (FPBASE+14)
#define F15 (FPBASE+15)
#define F16 (FPBASE+16)
#define F17 (FPBASE+17)
#define F18 (FPBASE+18)
#define F19 (FPBASE+19)
#define F20 (FPBASE+20)
#define F21 (FPBASE+21)
#define F22 (FPBASE+22)
#define F23 (FPBASE+23)
#define F24 (FPBASE+24)
#define F25 (FPBASE+25)
#define F26 (FPBASE+26)
#define F27 (FPBASE+27)
#define F28 (FPBASE+28)
#define F29 (FPBASE+29)
#define F30 (FPBASE+30)
#define F31 (FPBASE+31)
#define FSR (FPBASE+32)
#define NUMFPREGS 33
#define NREGS (NUMSAVEREGS + NUMFPREGS)
#endif /* !_MIPS64_REGNUM_H_ */

View File

@@ -0,0 +1,10 @@
/* $OpenBSD: setjmp.h,v 1.2 2004/08/10 21:10:56 pefo Exp $ */
/* Public domain */
#ifndef _MIPS_SETJMP_H_
#define _MIPS_SETJMP_H_
#define _JBLEN 157 /* size, in longs, of a jmp_buf */
#endif /* !_MIPS_SETJMP_H_ */

View File

@@ -0,0 +1,147 @@
/* $OpenBSD: signal.h,v 1.8 2006/01/09 18:18:37 millert Exp $ */
/*
* Copyright (c) 1992, 1993
* The Regents of the University of California. All rights reserved.
*
* This code is derived from software contributed to Berkeley by
* Ralph Campbell.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* @(#)signal.h 8.1 (Berkeley) 6/10/93
*/
#ifndef _MIPS_SIGNAL_H_
#define _MIPS_SIGNAL_H_
#include <sys/cdefs.h>
#if !defined(__LANGUAGE_ASSEMBLY)
#include <sys/types.h>
/*
* Machine-dependent signal definitions
*/
typedef int sig_atomic_t;
#if __BSD_VISIBLE || __XPG_VISIBLE >= 420
/*
* Information pushed on stack when a signal is delivered.
* This is used by the kernel to restore state following
* execution of the signal handler. It is also made available
* to the handler to allow it to restore state properly if
* a non-standard exit is performed.
*/
#if defined(__ANDROID__)
/*
* The Linux and OpenBSD sigcontext structures are slightly different
* This is the Linux O32 ABI compatible sigcontext
*/
struct sigcontext {
unsigned int sc_regmask;
unsigned int sc_status;
unsigned long long sc_pc;
unsigned long long sc_regs[32];
unsigned long long sc_fpregs[32];
unsigned int sc_acx;
unsigned int sc_fpc_csr;
unsigned int sc_fpc_eir;
unsigned int sc_used_math;
unsigned int sc_dsp;
unsigned long long sc_mdhi;
unsigned long long sc_mdlo;
unsigned long sc_hi1;
unsigned long sc_lo1;
unsigned long sc_hi2;
unsigned long sc_lo2;
unsigned long sc_hi3;
unsigned long sc_lo3;
};
#else
struct sigcontext {
long sc_onstack; /* sigstack state to restore */
long sc_mask; /* signal mask to restore */
__register_t sc_pc; /* pc at time of signal */
__register_t sc_regs[32]; /* processor regs 0 to 31 */
__register_t mullo; /* mullo and mulhi registers... */
__register_t mulhi; /* mullo and mulhi registers... */
f_register_t sc_fpregs[33]; /* fp regs 0 to 31 and csr */
long sc_fpused; /* fp has been used */
long sc_fpc_eir; /* floating point exception instruction reg */
long xxx[8]; /* XXX reserved */
};
#endif
#endif /* __BSD_VISIBLE || __XPG_VISIBLE >= 420 */
#else /* __LANGUAGE_ASSEMBLY */
#ifdef __ANDROID__
#define SC_REGMASK (0*REGSZ)
#define SC_STATUS (1*REGSZ)
#define SC_PC (2*REGSZ)
#define SC_REGS (SC_PC+8)
#define SC_FPREGS (SC_REGS+32*8)
#define SC_ACX (SC_FPREGS+32*REGSZ_FP)
#define SC_FPC_CSR (SC_ACX+1*REGSZ)
#define SC_FPC_EIR (SC_ACX+2*REGSZ)
#define SC_USED_MATH (SC_ACX+3*REGSZ)
#define SC_DSP (SC_ACX+4*REGSZ)
#define SC_MDHI (SC_ACX+5*REGSZ)
#define SC_MDLO (SC_MDHI+8)
#define SC_HI1 (SC_MDLO+8)
#define SC_LO1 (SC_HI1+1*REGSZ)
#define SC_HI2 (SC_HI1+2*REGSZ)
#define SC_LO2 (SC_HI1+3*REGSZ)
#define SC_HI3 (SC_HI1+4*REGSZ)
#define SC_LO3 (SC_HI1+5*REGSZ)
/* OpenBSD compatibility */
#define SC_MASK SC_REGMASK
#define SC_FPUSED SC_USED_MATH
#else
#define SC_ONSTACK (0 * REGSZ)
#define SC_MASK (1 * REGSZ)
#define SC_PC (2 * REGSZ)
#define SC_REGS (3 * REGSZ)
#define SC_MULLO (35 * REGSZ)
#define SC_MULHI (36 * REGSZ)
#define SC_FPREGS (37 * REGSZ)
#define SC_FPUSED (70 * REGSZ)
#define SC_FPC_EIR (71 * REGSZ)
#endif /* __ANDROID__ */
#endif /* __LANGUAGE_ASSEMBLY */
#endif /* !_MIPS_SIGNAL_H_ */

View File

@@ -0,0 +1,423 @@
/*
* Copyright (c) 2009
* MIPS Technologies, Inc., California.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. Neither the name of the MIPS Technologies, Inc., nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE MIPS TECHNOLOGIES, INC. ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE MIPS TECHNOLOGIES, INC. BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
/************************************************************************
*
* memcpy.S
* Version: "043009"
*
************************************************************************/
/************************************************************************
* Include files
************************************************************************/
#include "machine/asm.h"
/*
* This routine could be optimized for MIPS64. The current code only
* uses MIPS32 instructions.
*/
#if defined(__MIPSEB__)
# define LWHI lwl /* high part is left in big-endian */
# define SWHI swl /* high part is left in big-endian */
# define LWLO lwr /* low part is right in big-endian */
# define SWLO swr /* low part is right in big-endian */
#endif
#if defined(__MIPSEL__)
# define LWHI lwr /* high part is right in little-endian */
# define SWHI swr /* high part is right in little-endian */
# define LWLO lwl /* low part is left in big-endian */
# define SWLO swl /* low part is left in big-endian */
#endif
LEAF(memcpy,0)
.set noreorder
.set noat
/*
* Below we handle the case where memcpy is called with overlapping src and dst.
* Although memcpy is not required to handle this case, some parts of Android like Skia
* rely on such usage. We call memmove to handle such cases.
*/
subu t0,a0,a1
sra AT,t0,31
xor t1,t0,AT
subu t0,t1,AT
sltu AT,t0,a2
beq AT,zero,.Lmemcpy
la t9,memmove
jr t9
nop
.Lmemcpy:
slti AT,a2,8
bne AT,zero,.Llast8
move v0,a0 # memcpy returns the dst pointer
# Test if the src and dst are word-aligned, or can be made word-aligned
xor t8,a1,a0
andi t8,t8,0x3 # t8 is a0/a1 word-displacement
bne t8,zero,.Lunaligned
negu a3,a0
andi a3,a3,0x3 # we need to copy a3 bytes to make a0/a1 aligned
beq a3,zero,.Lchk16w # when a3=0 then the dst (a0) is word-aligned
subu a2,a2,a3 # now a2 is the remining bytes count
LWHI t8,0(a1)
addu a1,a1,a3
SWHI t8,0(a0)
addu a0,a0,a3
# Now the dst/src are mutually word-aligned with word-aligned addresses
.Lchk16w:
andi t8,a2,0x3f # any whole 64-byte chunks?
# t8 is the byte count after 64-byte chunks
beq a2,t8,.Lchk8w # if a2==t8, no 64-byte chunks
# There will be at most 1 32-byte chunk after it
subu a3,a2,t8 # subtract from a2 the reminder
# Here a3 counts bytes in 16w chunks
addu a3,a0,a3 # Now a3 is the final dst after 64-byte chunks
addu t0,a0,a2 # t0 is the "past the end" address
# When in the loop we exercise "pref 30,x(a0)", the a0+x should not be past
# the "t0-32" address
# This means: for x=128 the last "safe" a0 address is "t0-160"
# Alternatively, for x=64 the last "safe" a0 address is "t0-96"
# In the current version we will use "pref 30,128(a0)", so "t0-160" is the limit
subu t9,t0,160 # t9 is the "last safe pref 30,128(a0)" address
pref 0,0(a1) # bring the first line of src, addr 0
pref 0,32(a1) # bring the second line of src, addr 32
pref 0,64(a1) # bring the third line of src, addr 64
pref 30,32(a0) # safe, as we have at least 64 bytes ahead
# In case the a0 > t9 don't use "pref 30" at all
sgtu v1,a0,t9
bgtz v1,.Lloop16w # skip "pref 30,64(a0)" for too short arrays
nop
# otherwise, start with using pref30
pref 30,64(a0)
.Lloop16w:
pref 0,96(a1)
lw t0,0(a1)
bgtz v1,.Lskip_pref30_96 # skip "pref 30,96(a0)"
lw t1,4(a1)
pref 30,96(a0) # continue setting up the dest, addr 96
.Lskip_pref30_96:
lw t2,8(a1)
lw t3,12(a1)
lw t4,16(a1)
lw t5,20(a1)
lw t6,24(a1)
lw t7,28(a1)
pref 0,128(a1) # bring the next lines of src, addr 128
sw t0,0(a0)
sw t1,4(a0)
sw t2,8(a0)
sw t3,12(a0)
sw t4,16(a0)
sw t5,20(a0)
sw t6,24(a0)
sw t7,28(a0)
lw t0,32(a1)
bgtz v1,.Lskip_pref30_128 # skip "pref 30,128(a0)"
lw t1,36(a1)
pref 30,128(a0) # continue setting up the dest, addr 128
.Lskip_pref30_128:
lw t2,40(a1)
lw t3,44(a1)
lw t4,48(a1)
lw t5,52(a1)
lw t6,56(a1)
lw t7,60(a1)
pref 0, 160(a1) # bring the next lines of src, addr 160
sw t0,32(a0)
sw t1,36(a0)
sw t2,40(a0)
sw t3,44(a0)
sw t4,48(a0)
sw t5,52(a0)
sw t6,56(a0)
sw t7,60(a0)
addiu a0,a0,64 # adding 64 to dest
sgtu v1,a0,t9
bne a0,a3,.Lloop16w
addiu a1,a1,64 # adding 64 to src
move a2,t8
# Here we have src and dest word-aligned but less than 64-bytes to go
.Lchk8w:
pref 0, 0x0(a1)
andi t8,a2,0x1f # is there a 32-byte chunk?
# the t8 is the reminder count past 32-bytes
beq a2,t8,.Lchk1w # when a2=t8, no 32-byte chunk
nop
lw t0,0(a1)
lw t1,4(a1)
lw t2,8(a1)
lw t3,12(a1)
lw t4,16(a1)
lw t5,20(a1)
lw t6,24(a1)
lw t7,28(a1)
addiu a1,a1,32
sw t0,0(a0)
sw t1,4(a0)
sw t2,8(a0)
sw t3,12(a0)
sw t4,16(a0)
sw t5,20(a0)
sw t6,24(a0)
sw t7,28(a0)
addiu a0,a0,32
.Lchk1w:
andi a2,t8,0x3 # now a2 is the reminder past 1w chunks
beq a2,t8,.Llast8
subu a3,t8,a2 # a3 is count of bytes in 1w chunks
addu a3,a0,a3 # now a3 is the dst address past the 1w chunks
# copying in words (4-byte chunks)
.LwordCopy_loop:
lw t3,0(a1) # the first t3 may be equal t0 ... optimize?
addiu a1,a1,4
addiu a0,a0,4
bne a0,a3,.LwordCopy_loop
sw t3,-4(a0)
# For the last (<8) bytes
.Llast8:
blez a2,.Lleave
addu a3,a0,a2 # a3 is the last dst address
.Llast8loop:
lb v1,0(a1)
addiu a1,a1,1
addiu a0,a0,1
bne a0,a3,.Llast8loop
sb v1,-1(a0)
.Lleave:
j ra
nop
#
# UNALIGNED case
#
.Lunaligned:
# got here with a3="negu a0"
andi a3,a3,0x3 # test if the a0 is word aligned
beqz a3,.Lua_chk16w
subu a2,a2,a3 # bytes left after initial a3 bytes
LWHI v1,0(a1)
LWLO v1,3(a1)
addu a1,a1,a3 # a3 may be here 1, 2 or 3
SWHI v1,0(a0)
addu a0,a0,a3 # below the dst will be word aligned (NOTE1)
.Lua_chk16w:
andi t8,a2,0x3f # any whole 64-byte chunks?
# t8 is the byte count after 64-byte chunks
beq a2,t8,.Lua_chk8w # if a2==t8, no 64-byte chunks
# There will be at most 1 32-byte chunk after it
subu a3,a2,t8 # subtract from a2 the reminder
# Here a3 counts bytes in 16w chunks
addu a3,a0,a3 # Now a3 is the final dst after 64-byte chunks
addu t0,a0,a2 # t0 is the "past the end" address
subu t9,t0,160 # t9 is the "last safe pref 30,128(a0)" address
pref 0,0(a1) # bring the first line of src, addr 0
pref 0,32(a1) # bring the second line of src, addr 32
pref 0,64(a1) # bring the third line of src, addr 64
pref 30,32(a0) # safe, as we have at least 64 bytes ahead
# In case the a0 > t9 don't use "pref 30" at all
sgtu v1,a0,t9
bgtz v1,.Lua_loop16w # skip "pref 30,64(a0)" for too short arrays
nop
# otherwise, start with using pref30
pref 30,64(a0)
.Lua_loop16w:
pref 0,96(a1)
LWHI t0,0(a1)
LWLO t0,3(a1)
LWHI t1,4(a1)
bgtz v1,.Lua_skip_pref30_96
LWLO t1,7(a1)
pref 30,96(a0) # continue setting up the dest, addr 96
.Lua_skip_pref30_96:
LWHI t2,8(a1)
LWLO t2,11(a1)
LWHI t3,12(a1)
LWLO t3,15(a1)
LWHI t4,16(a1)
LWLO t4,19(a1)
LWHI t5,20(a1)
LWLO t5,23(a1)
LWHI t6,24(a1)
LWLO t6,27(a1)
LWHI t7,28(a1)
LWLO t7,31(a1)
pref 0,128(a1) # bring the next lines of src, addr 128
sw t0,0(a0)
sw t1,4(a0)
sw t2,8(a0)
sw t3,12(a0)
sw t4,16(a0)
sw t5,20(a0)
sw t6,24(a0)
sw t7,28(a0)
LWHI t0,32(a1)
LWLO t0,35(a1)
LWHI t1,36(a1)
bgtz v1,.Lua_skip_pref30_128
LWLO t1,39(a1)
pref 30,128(a0) # continue setting up the dest, addr 128
.Lua_skip_pref30_128:
LWHI t2,40(a1)
LWLO t2,43(a1)
LWHI t3,44(a1)
LWLO t3,47(a1)
LWHI t4,48(a1)
LWLO t4,51(a1)
LWHI t5,52(a1)
LWLO t5,55(a1)
LWHI t6,56(a1)
LWLO t6,59(a1)
LWHI t7,60(a1)
LWLO t7,63(a1)
pref 0, 160(a1) # bring the next lines of src, addr 160
sw t0,32(a0)
sw t1,36(a0)
sw t2,40(a0)
sw t3,44(a0)
sw t4,48(a0)
sw t5,52(a0)
sw t6,56(a0)
sw t7,60(a0)
addiu a0,a0,64 # adding 64 to dest
sgtu v1,a0,t9
bne a0,a3,.Lua_loop16w
addiu a1,a1,64 # adding 64 to src
move a2,t8
# Here we have src and dest word-aligned but less than 64-bytes to go
.Lua_chk8w:
pref 0, 0x0(a1)
andi t8,a2,0x1f # is there a 32-byte chunk?
# the t8 is the reminder count
beq a2,t8,.Lua_chk1w # when a2=t8, no 32-byte chunk
nop
LWHI t0,0(a1)
LWLO t0,3(a1)
LWHI t1,4(a1)
LWLO t1,7(a1)
LWHI t2,8(a1)
LWLO t2,11(a1)
LWHI t3,12(a1)
LWLO t3,15(a1)
LWHI t4,16(a1)
LWLO t4,19(a1)
LWHI t5,20(a1)
LWLO t5,23(a1)
LWHI t6,24(a1)
LWLO t6,27(a1)
LWHI t7,28(a1)
LWLO t7,31(a1)
addiu a1,a1,32
sw t0,0(a0)
sw t1,4(a0)
sw t2,8(a0)
sw t3,12(a0)
sw t4,16(a0)
sw t5,20(a0)
sw t6,24(a0)
sw t7,28(a0)
addiu a0,a0,32
.Lua_chk1w:
andi a2,t8,0x3 # now a2 is the reminder past 1w chunks
beq a2,t8,.Lua_smallCopy
subu a3,t8,a2 # a3 is count of bytes in 1w chunks
addu a3,a0,a3 # now a3 is the dst address past the 1w chunks
# copying in words (4-byte chunks)
.Lua_wordCopy_loop:
LWHI v1,0(a1)
LWLO v1,3(a1)
addiu a1,a1,4
addiu a0,a0,4 # note: dst=a0 is word aligned here, see NOTE1
bne a0,a3,.Lua_wordCopy_loop
sw v1,-4(a0)
# Now less than 4 bytes (value in a2) left to copy
.Lua_smallCopy:
beqz a2,.Lleave
addu a3,a0,a2 # a3 is the last dst address
.Lua_smallCopy_loop:
lb v1,0(a1)
addiu a1,a1,1
addiu a0,a0,1
bne a0,a3,.Lua_smallCopy_loop
sb v1,-1(a0)
j ra
nop
.set at
.set reorder
END(memcpy)
/************************************************************************
* Implementation : Static functions
************************************************************************/

View File

@@ -0,0 +1,323 @@
/*
* Copyright (c) 2009
* MIPS Technologies, Inc., California.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. Neither the name of the MIPS Technologies, Inc., nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE MIPS TECHNOLOGIES, INC. ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE MIPS TECHNOLOGIES, INC. BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
/************************************************************************
*
* memset.S, version "64h" with 1 cache line horizon for "pref 30" and 14 nops
* Version: "043009"
*
************************************************************************/
/************************************************************************
* Include files
************************************************************************/
#include "machine/asm.h"
/*
* This routine could be optimized for MIPS64. The current code only
* uses MIPS32 instructions.
*/
#if defined(__MIPSEB__)
# define SWHI swl /* high part is left in big-endian */
# define SWLO swr /* low part is right in big-endian */
#endif
#if defined(__MIPSEL__)
# define SWHI swr /* high part is right in little-endian */
# define SWLO swl /* low part is left in little-endian */
#endif
#if !(defined(XGPROF) || defined(XPROF))
#undef SETUP_GP
#define SETUP_GP
#endif
#ifdef NDEBUG
#define DBG #
#else
#define DBG
#endif
/*
* void _memset16(uint16_t* dst, uint16_t value, size_t size);
*/
LEAF(_memset16,0)
.set noreorder
DBG /* Check parameters */
DBG andi t0,a0,1 # a0 must be halfword aligned
DBG tne t0,zero
DBG andi t2,a2,1 # a2 must be even
DBG tne t2,zero
#ifdef FIXARGS
# ensure count is even
#if (__mips==32) && (__mips_isa_rev>=2)
ins a2,zero,0,1
#else
ori a2,1
xori a2,1
#endif
#endif
#if (__mips==32) && (__mips_isa_rev>=2)
ins a1,a1,16,16
#else
andi a1,0xffff
sll t3,a1,16
or a1,t3
#endif
beqz a2,.Ldone
andi t1,a0,2
beqz t1,.Lalignok
addu t0,a0,a2 # t0 is the "past the end" address
sh a1,0(a0) # store one halfword to get aligned
addu a0,2
subu a2,2
.Lalignok:
slti t1,a2,4 # .Laligned for 4 or more bytes
beqz t1,.Laligned
sne t1,a2,2 # one more halfword?
bnez t1,.Ldone
nop
sh a1,0(a0)
.Ldone:
j ra
nop
.set reorder
END(_memset16)
/*
* void _memset32(uint32_t* dst, uint32_t value, size_t size);
*/
LEAF(_memset32,0)
.set noreorder
DBG /* Check parameters */
DBG andi t0,a0,3 # a0 must be word aligned
DBG tne t0,zero
DBG andi t2,a2,3 # a2 must be a multiple of 4 bytes
DBG tne t2,zero
#ifdef FIXARGS
# ensure count is a multiple of 4
#if (__mips==32) && (__mips_isa_rev>=2)
ins $a2,$0,0,2
#else
ori a2,3
xori a2,3
#endif
#endif
bnez a2,.Laligned # any work to do?
addu t0,a0,a2 # t0 is the "past the end" address
j ra
nop
.set reorder
END(_memset32)
LEAF(memset,0)
.set noreorder
.set noat
addu t0,a0,a2 # t0 is the "past the end" address
slti AT,a2,4 # is a2 less than 4?
bne AT,zero,.Llast4 # if yes, go to last4
move v0,a0 # memset returns the dst pointer
beq a1,zero,.Lset0
subu v1,zero,a0
# smear byte into 32 bit word
#if (__mips==32) && (__mips_isa_rev>=2)
ins a1, a1, 8, 8 # Replicate fill byte into half-word.
ins a1, a1, 16, 16 # Replicate fill byte into word.
#else
and a1,0xff
sll AT,a1,8
or a1,AT
sll AT,a1,16
or a1,AT
#endif
.Lset0:
andi v1,v1,0x3 # word-unaligned address?
beq v1,zero,.Laligned # v1 is the unalignment count
subu a2,a2,v1
SWHI a1,0(a0)
addu a0,a0,v1
# Here we have the "word-aligned" a0 (until the "last4")
.Laligned:
andi t8,a2,0x3f # any 64-byte chunks?
# t8 is the byte count past 64-byte chunks
beq a2,t8,.Lchk8w # when a2==t8, no 64-byte chunks
# There will be at most 1 32-byte chunk then
subu a3,a2,t8 # subtract from a2 the reminder
# Here a3 counts bytes in 16w chunks
addu a3,a0,a3 # Now a3 is the final dst after 64-byte chunks
# Find out, if there are any 64-byte chunks after which will be still at least
# 96 bytes left. The value "96" is calculated as needed buffer for
# "pref 30,64(a0)" prefetch, which can be used as "pref 30,0(a0)" after
# incrementing "a0" by 64.
# For "a2" below 160 there will be no such "pref 30 safe" 64-byte chunk.
#
sltiu v1,a2,160
bgtz v1,.Lloop16w_nopref30 # skip "pref 30,0(a0)"
subu t7,a2,96 # subtract "pref 30 unsafe" region
# below we have at least 1 64-byte chunk which is "pref 30 safe"
andi t6,t7,0x3f # t6 is past "64-byte safe chunks" reminder
subu t5,t7,t6 # subtract from t7 the reminder
# Here t5 counts bytes in 16w "safe" chunks
addu t4,a0,t5 # Now t4 is the dst after 64-byte "safe" chunks
# Don't use "pref 30,0(a0)" for a0 in a "middle" of a cache line
# pref 30,0(a0)
# Here we are in the region, where it is safe to use "pref 30,64(a0)"
.Lloop16w:
addiu a0,a0,64
pref 30,-32(a0) # continue setting up the dest, addr 64-32
sw a1,-64(a0)
sw a1,-60(a0)
sw a1,-56(a0)
sw a1,-52(a0)
sw a1,-48(a0)
sw a1,-44(a0)
sw a1,-40(a0)
sw a1,-36(a0)
nop
nop # the extra nop instructions help to balance
nop # cycles needed for "store" + "fill" + "evict"
nop # For 64byte store there are needed 8 fill
nop # and 8 evict cycles, i.e. at least 32 instr.
nop
nop
pref 30,0(a0) # continue setting up the dest, addr 64-0
sw a1,-32(a0)
sw a1,-28(a0)
sw a1,-24(a0)
sw a1,-20(a0)
sw a1,-16(a0)
sw a1,-12(a0)
sw a1,-8(a0)
sw a1,-4(a0)
nop
nop
nop
nop # NOTE: adding 14 nop-s instead of 12 nop-s
nop # gives better results for "fast" memory
nop
bne a0,t4,.Lloop16w
nop
beq a0,a3,.Lchk8w # maybe no more 64-byte chunks?
nop # this "delayed slot" is useless ...
.Lloop16w_nopref30: # there could be up to 3 "64-byte nopref30" chunks
addiu a0,a0,64
sw a1,-64(a0)
sw a1,-60(a0)
sw a1,-56(a0)
sw a1,-52(a0)
sw a1,-48(a0)
sw a1,-44(a0)
sw a1,-40(a0)
sw a1,-36(a0)
sw a1,-32(a0)
sw a1,-28(a0)
sw a1,-24(a0)
sw a1,-20(a0)
sw a1,-16(a0)
sw a1,-12(a0)
sw a1,-8(a0)
bne a0,a3,.Lloop16w_nopref30
sw a1,-4(a0)
.Lchk8w: # t8 here is the byte count past 64-byte chunks
andi t7,t8,0x1f # is there a 32-byte chunk?
# the t7 is the reminder count past 32-bytes
beq t8,t7,.Lchk1w # when t8==t7, no 32-byte chunk
move a2,t7
sw a1,0(a0)
sw a1,4(a0)
sw a1,8(a0)
sw a1,12(a0)
sw a1,16(a0)
sw a1,20(a0)
sw a1,24(a0)
sw a1,28(a0)
addiu a0,a0,32
.Lchk1w:
andi t8,a2,0x3 # now t8 is the reminder past 1w chunks
beq a2,t8,.Llast4aligned
subu a3,a2,t8 # a3 is the count of bytes in 1w chunks
addu a3,a0,a3 # now a3 is the dst address past the 1w chunks
# copying in words (4-byte chunks)
.LwordCopy_loop:
addiu a0,a0,4
bne a0,a3,.LwordCopy_loop
sw a1,-4(a0)
# store last 0-3 bytes
# this will repeat the last store if the memset finishes on a word boundary
.Llast4aligned:
j ra
SWLO a1,-1(t0)
.Llast4:
beq a0,t0,.Llast4e
.Llast4l:
addiu a0,a0,1
bne a0,t0,.Llast4l
sb a1,-1(a0)
.Llast4e:
j ra
nop
.set at
.set reorder
END(memset)
/************************************************************************
* Implementation : Static functions
************************************************************************/

View File

@@ -0,0 +1,148 @@
/*
* Copyright (c) 2010 MIPS Technologies, Inc.
*
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer
* in the documentation and/or other materials provided with
* the distribution.
* * Neither the name of MIPS Technologies Inc. nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef __MIPS_STRING_OPS_H
#define __MIPS_STRING_OPS_H
/* This definition of the byte bitfields uses the
assumption that the layout of the bitfields is
equivalent to the layout in memory. Generally,
for the MIPS ABIs, this is true. If you compile
the strcmp.c file with -DSMOKE_TEST_NEW_STRCMP,
this assumption will be tested.
Also, regardless of char signedness, ANSI C dictates that
strcmp() treats each character as unsigned char. For
strlen and the like, signedness doesn't matter.
Also, this code assumes that there are 8-bits per 'char'. */
#if __mips64
typedef struct bits
{
unsigned B0:8, B1:8, B2:8, B3:8, B4:8, B5:8, B6:8, B7:8;
} bits_t;
#else
typedef struct bits
{
unsigned B0:8, B1:8, B2:8, B3:8;
} bits_t;
#endif
#ifndef _ULW
/* for MIPS GCC, there is no unaligned builtins - so this code forces
the compiler to treat the pointer access as unaligned. */
struct ulw
{
unsigned b;
} __attribute__ ((packed));
#define _ULW(__x) ((struct ulw *) ((char *)(&__x)))->b;
#endif
/* This union assumes that small structures can be in registers. If
not, then memory accesses will be done - not optimal, but ok. */
typedef union
{
unsigned v;
bits_t b;
} bitfields_t;
#ifndef detect_zero
/* __mips_dsp, __mips_dspr2, and __mips64 are predefined by
the compiler, based on command line options. */
#if (__mips_dsp || __mips_dspr2) && !__mips64
#define __mips_using_dsp 1
/* DSP 4-lane (8 unsigned bits per line) subtract and saturate
* Intrinsic operation. How this works:
* Given a 4-byte string of "ABC\0", subtract this as
* an unsigned integer from 0x01010101:
* 0x01010101
* - 0x41424300
* -----------
( 0xbfbebe01 <-- answer without saturation
* 0x00000001 <-- answer with saturation
* When this 4-lane vector is treated as an unsigned int value,
* a non-zero answer indicates the presence of a zero in the
* original 4-byte argument. */
typedef signed char v4i8 __attribute__ ((vector_size (4)));
#define detect_zero(__x,__y,__01s,__80s)\
((unsigned) __builtin_mips_subu_s_qb((v4i8) __01s,(v4i8) __x))
/* sets all 4 lanes to requested byte. */
#define set_byte_lanes(__x) ((unsigned) __builtin_mips_repl_qb(__x))
/* sets all 4 lanes to 0x01. */
#define def_and_set_01(__x) unsigned __x = (unsigned) __builtin_mips_repl_qb(0x01)
/* sets all 4 lanes to 0x80. Not needed when subu_s.qb used. */
#define def_and_set_80(__x) /* do nothing */
#else
/* this version, originally published in the 80's, uses
a reverse-carry-set like determination of the zero byte.
The steps are, for __x = 0x31ff0001:
__x - _01s = 0x30fdff00
~__x = 0xce00fffe
((__x - _01s) & ~__x) = 0x0000ff00
x & _80s = 0x00008000 <- byte 3 was zero
Some implementaions naively assume that characters are
always 7-bit unsigned ASCII. With that assumption, the
"& ~x" is usually discarded. Since character strings
are 8-bit, the and is needed to catch the case of
a false positive when the byte is 0x80. */
#define detect_zero(__x,__y,_01s,_80s)\
((unsigned) (((__x) - _01s) & ~(__x)) & _80s)
#if __mips64
#define def_and_set_80(__x) unsigned __x = 0x8080808080808080ul
#define def_and_set_01(__x) unsigned __x = 0x0101010101010101ul
#else
#define def_and_set_80(__x) unsigned __x = 0x80808080ul
#define def_and_set_01(__x) unsigned __x = 0x01010101ul
#endif
#endif
#endif
/* dealing with 'void *' conversions without using extra variables. */
#define get_byte(__x,__idx) (((unsigned char *) (__x))[__idx])
#define set_byte(__x,__idx,__fill) ((unsigned char *) (__x))[__idx] = (__fill)
#define get_word(__x,__idx) (((unsigned *) (__x))[__idx])
#define set_word(__x,__idx,__fill) ((unsigned *) (__x))[__idx] = (__fill)
#define inc_ptr_as(__type,__x,__inc) __x = (void *) (((__type) __x) + (__inc))
#define cvt_ptr_to(__type,__x) ((__type) (__x))
#endif

View File

@@ -0,0 +1,223 @@
/*
* Copyright (c) 2010 MIPS Technologies, Inc.
*
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer
* in the documentation and/or other materials provided with
* the distribution.
* * Neither the name of MIPS Technologies Inc. nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "mips-string-ops.h"
#define do_strlen_word(__av) {\
if (detect_zero(x,x,_01s,_80s)) break;\
x = __av;\
cnt += sizeof (unsigned);\
}
#define do_strlen_byte(__x) {\
if ((bx.b.B##__x) == 0) break;\
++cnt;\
}
#if SMOKE_TEST_MIPS_STRLEN
#define strlen my_strlen
#endif
int
strlen (const void *_a)
{
int cnt = 0;
unsigned x;
/* align the string to word boundary so we can do word at a time. */
if ((cvt_ptr_to (unsigned, _a) & (sizeof (unsigned) - 1)) != 0)
{
if ((cvt_ptr_to (unsigned, _a) & 1) != 0)
{
if (get_byte (_a, 0) == 0)
return cnt;
/* set bit 1 so 2-bytes are checked and incremented. */
inc_ptr_as (char *, _a, 1);
++cnt;
}
if ((cvt_ptr_to (unsigned, _a) & 2) != 0)
{
if (get_byte (_a, 0) == 0)
return cnt + 0;
if (get_byte (_a, 1) == 0)
return cnt + 1;
inc_ptr_as (char *, _a, 2);
cnt += 2;
}
}
#if __mips64
#error strlen: mips64 check for 4-byte alignment not implemented.
#endif
if (1)
{
def_and_set_01 (_01s);
def_and_set_80 (_80s);
/* as advantagous as it is to performance, this code cannot pre-load
the following word, nor can it prefetch the next line at the start
of the loop since the string can be at the end of a page with the
following page unmapped. There are tests in the suite to catch
any attempt to go beyond the current word. */
x = get_word (_a, 0);
while (1)
{
/* doing 8 words should cover most strings. */
do_strlen_word (get_word (_a, 1));
do_strlen_word (get_word (_a, 2));
do_strlen_word (get_word (_a, 3));
do_strlen_word (get_word (_a, 4));
do_strlen_word (get_word (_a, 5));
do_strlen_word (get_word (_a, 6));
do_strlen_word (get_word (_a, 7));
do_strlen_word (get_word (_a, 8));
inc_ptr_as (unsigned *, _a, 8);
}
}
while (1)
{
/* pull apart the last word processed and find the zero. */
bitfields_t bx;
bx.v = x;
#if __mips64
do_strlen_byte (0);
do_strlen_byte (1);
do_strlen_byte (2);
do_strlen_byte (3);
do_strlen_byte (4);
do_strlen_byte (5);
do_strlen_byte (6);
#else
do_strlen_byte (0);
do_strlen_byte (1);
do_strlen_byte (2);
#endif
/* last byte is zero */
break;
}
return cnt;
}
#undef do_strlen_byte
#undef do_strlen_word
#if SMOKE_TEST_MIPS_STRLEN
#include <stdio.h>
char str1[] = "DHRYSTONE PROGRAM, 1'ST STRING";
char str2[] = "DHRYSTONE PROGRAM, 2'ST STRING";
char str3[] = "another string";
char str4[] = "another";
char str5[] = "somes tring";
char str6[] = "somes_tring";
char str7[16], str8[16];
static char *
chk (unsigned mine, unsigned libs, int *errors)
{
static char answer[1024];
char *result = mine == libs ? "PASS" : "FAIL";
sprintf (answer, "new_strlen=%d: lib_strlen=%d: %s!", mine, libs, result);
if (mine != libs)
(*errors)++;
return answer;
}
int
main (int argc, char **argv)
{
int errors = 0;
/* set -1 in one position */
str6[5] = 0xff;
/* set zero in same position with junk in following 3 */
str7[0] = str8[0] = 0;
str7[1] = 0xff;
str7[2] = 'a';
str7[3] = 2;
str8[1] = 's';
str8[2] = -2;
str8[3] = 0;
fprintf (stderr, "========== mips_strlen%s test...\n",
argv[0] ? argv[0] : "unknown strlen");
#define P(__x,__y) {\
int a = my_strlen(__x + __y);\
int b = (strlen)(__x + __y) /* library version */;\
fprintf(stderr,"%s+%d: %s\n",#__x,__y,chk(a,b,&errors));\
}
P (str1, 0);
P (str1, 1);
P (str1, 2);
P (str1, 3);
P (str2, 0);
P (str2, 1);
P (str2, 2);
P (str2, 3);
P (str3, 0);
P (str3, 1);
P (str3, 2);
P (str3, 3);
P (str4, 0);
P (str4, 1);
P (str4, 2);
P (str4, 3);
P (str5, 0);
P (str5, 1);
P (str5, 2);
P (str5, 3);
P (str6, 0);
P (str6, 1);
P (str6, 2);
P (str6, 3);
P (str7, 0);
P (str7, 1);
P (str7, 2);
P (str7, 3);
P (str8, 0);
P (str8, 1);
P (str8, 2);
P (str8, 3);
return errors;
}
#endif

205
libc/arch-mips/syscalls.mk Normal file
View File

@@ -0,0 +1,205 @@
# auto-generated by gensyscalls.py, do not touch
syscall_src :=
syscall_src += arch-mips/syscalls/_exit.S
syscall_src += arch-mips/syscalls/_exit_thread.S
syscall_src += arch-mips/syscalls/__fork.S
syscall_src += arch-mips/syscalls/_waitpid.S
syscall_src += arch-mips/syscalls/__waitid.S
syscall_src += arch-mips/syscalls/__sys_clone.S
syscall_src += arch-mips/syscalls/execve.S
syscall_src += arch-mips/syscalls/__setuid.S
syscall_src += arch-mips/syscalls/getuid.S
syscall_src += arch-mips/syscalls/getgid.S
syscall_src += arch-mips/syscalls/geteuid.S
syscall_src += arch-mips/syscalls/getegid.S
syscall_src += arch-mips/syscalls/getresuid.S
syscall_src += arch-mips/syscalls/getresgid.S
syscall_src += arch-mips/syscalls/gettid.S
syscall_src += arch-mips/syscalls/readahead.S
syscall_src += arch-mips/syscalls/getgroups.S
syscall_src += arch-mips/syscalls/getpgid.S
syscall_src += arch-mips/syscalls/getppid.S
syscall_src += arch-mips/syscalls/getsid.S
syscall_src += arch-mips/syscalls/setsid.S
syscall_src += arch-mips/syscalls/setgid.S
syscall_src += arch-mips/syscalls/__setreuid.S
syscall_src += arch-mips/syscalls/__setresuid.S
syscall_src += arch-mips/syscalls/setresgid.S
syscall_src += arch-mips/syscalls/__brk.S
syscall_src += arch-mips/syscalls/kill.S
syscall_src += arch-mips/syscalls/tkill.S
syscall_src += arch-mips/syscalls/tgkill.S
syscall_src += arch-mips/syscalls/__ptrace.S
syscall_src += arch-mips/syscalls/__set_thread_area.S
syscall_src += arch-mips/syscalls/__getpriority.S
syscall_src += arch-mips/syscalls/setpriority.S
syscall_src += arch-mips/syscalls/setrlimit.S
syscall_src += arch-mips/syscalls/getrlimit.S
syscall_src += arch-mips/syscalls/getrusage.S
syscall_src += arch-mips/syscalls/setgroups.S
syscall_src += arch-mips/syscalls/setpgid.S
syscall_src += arch-mips/syscalls/setregid.S
syscall_src += arch-mips/syscalls/chroot.S
syscall_src += arch-mips/syscalls/prctl.S
syscall_src += arch-mips/syscalls/capget.S
syscall_src += arch-mips/syscalls/capset.S
syscall_src += arch-mips/syscalls/sigaltstack.S
syscall_src += arch-mips/syscalls/acct.S
syscall_src += arch-mips/syscalls/read.S
syscall_src += arch-mips/syscalls/write.S
syscall_src += arch-mips/syscalls/pread64.S
syscall_src += arch-mips/syscalls/pwrite64.S
syscall_src += arch-mips/syscalls/__open.S
syscall_src += arch-mips/syscalls/__openat.S
syscall_src += arch-mips/syscalls/close.S
syscall_src += arch-mips/syscalls/lseek.S
syscall_src += arch-mips/syscalls/__llseek.S
syscall_src += arch-mips/syscalls/getpid.S
syscall_src += arch-mips/syscalls/__mmap2.S
syscall_src += arch-mips/syscalls/munmap.S
syscall_src += arch-mips/syscalls/mremap.S
syscall_src += arch-mips/syscalls/msync.S
syscall_src += arch-mips/syscalls/mprotect.S
syscall_src += arch-mips/syscalls/madvise.S
syscall_src += arch-mips/syscalls/mlock.S
syscall_src += arch-mips/syscalls/munlock.S
syscall_src += arch-mips/syscalls/mlockall.S
syscall_src += arch-mips/syscalls/munlockall.S
syscall_src += arch-mips/syscalls/mincore.S
syscall_src += arch-mips/syscalls/__ioctl.S
syscall_src += arch-mips/syscalls/readv.S
syscall_src += arch-mips/syscalls/writev.S
syscall_src += arch-mips/syscalls/__fcntl.S
syscall_src += arch-mips/syscalls/flock.S
syscall_src += arch-mips/syscalls/fchmod.S
syscall_src += arch-mips/syscalls/dup.S
syscall_src += arch-mips/syscalls/pipe2.S
syscall_src += arch-mips/syscalls/dup2.S
syscall_src += arch-mips/syscalls/select.S
syscall_src += arch-mips/syscalls/ftruncate.S
syscall_src += arch-mips/syscalls/ftruncate64.S
syscall_src += arch-mips/syscalls/getdents.S
syscall_src += arch-mips/syscalls/fsync.S
syscall_src += arch-mips/syscalls/fdatasync.S
syscall_src += arch-mips/syscalls/fchown.S
syscall_src += arch-mips/syscalls/sync.S
syscall_src += arch-mips/syscalls/__fcntl64.S
syscall_src += arch-mips/syscalls/__fstatfs64.S
syscall_src += arch-mips/syscalls/sendfile.S
syscall_src += arch-mips/syscalls/fstatat.S
syscall_src += arch-mips/syscalls/mkdirat.S
syscall_src += arch-mips/syscalls/fchownat.S
syscall_src += arch-mips/syscalls/fchmodat.S
syscall_src += arch-mips/syscalls/renameat.S
syscall_src += arch-mips/syscalls/fsetxattr.S
syscall_src += arch-mips/syscalls/fgetxattr.S
syscall_src += arch-mips/syscalls/flistxattr.S
syscall_src += arch-mips/syscalls/fremovexattr.S
syscall_src += arch-mips/syscalls/link.S
syscall_src += arch-mips/syscalls/unlink.S
syscall_src += arch-mips/syscalls/unlinkat.S
syscall_src += arch-mips/syscalls/chdir.S
syscall_src += arch-mips/syscalls/mknod.S
syscall_src += arch-mips/syscalls/chmod.S
syscall_src += arch-mips/syscalls/chown.S
syscall_src += arch-mips/syscalls/lchown.S
syscall_src += arch-mips/syscalls/mount.S
syscall_src += arch-mips/syscalls/umount2.S
syscall_src += arch-mips/syscalls/fstat.S
syscall_src += arch-mips/syscalls/stat.S
syscall_src += arch-mips/syscalls/lstat.S
syscall_src += arch-mips/syscalls/mkdir.S
syscall_src += arch-mips/syscalls/readlink.S
syscall_src += arch-mips/syscalls/rmdir.S
syscall_src += arch-mips/syscalls/rename.S
syscall_src += arch-mips/syscalls/__getcwd.S
syscall_src += arch-mips/syscalls/access.S
syscall_src += arch-mips/syscalls/faccessat.S
syscall_src += arch-mips/syscalls/symlink.S
syscall_src += arch-mips/syscalls/fchdir.S
syscall_src += arch-mips/syscalls/truncate.S
syscall_src += arch-mips/syscalls/setxattr.S
syscall_src += arch-mips/syscalls/lsetxattr.S
syscall_src += arch-mips/syscalls/getxattr.S
syscall_src += arch-mips/syscalls/lgetxattr.S
syscall_src += arch-mips/syscalls/listxattr.S
syscall_src += arch-mips/syscalls/llistxattr.S
syscall_src += arch-mips/syscalls/removexattr.S
syscall_src += arch-mips/syscalls/lremovexattr.S
syscall_src += arch-mips/syscalls/__statfs64.S
syscall_src += arch-mips/syscalls/unshare.S
syscall_src += arch-mips/syscalls/pause.S
syscall_src += arch-mips/syscalls/gettimeofday.S
syscall_src += arch-mips/syscalls/settimeofday.S
syscall_src += arch-mips/syscalls/times.S
syscall_src += arch-mips/syscalls/nanosleep.S
syscall_src += arch-mips/syscalls/clock_gettime.S
syscall_src += arch-mips/syscalls/clock_settime.S
syscall_src += arch-mips/syscalls/clock_getres.S
syscall_src += arch-mips/syscalls/clock_nanosleep.S
syscall_src += arch-mips/syscalls/getitimer.S
syscall_src += arch-mips/syscalls/setitimer.S
syscall_src += arch-mips/syscalls/__timer_create.S
syscall_src += arch-mips/syscalls/__timer_settime.S
syscall_src += arch-mips/syscalls/__timer_gettime.S
syscall_src += arch-mips/syscalls/__timer_getoverrun.S
syscall_src += arch-mips/syscalls/__timer_delete.S
syscall_src += arch-mips/syscalls/utimes.S
syscall_src += arch-mips/syscalls/utimensat.S
syscall_src += arch-mips/syscalls/sigaction.S
syscall_src += arch-mips/syscalls/sigprocmask.S
syscall_src += arch-mips/syscalls/__sigsuspend.S
syscall_src += arch-mips/syscalls/__rt_sigaction.S
syscall_src += arch-mips/syscalls/__rt_sigprocmask.S
syscall_src += arch-mips/syscalls/__rt_sigtimedwait.S
syscall_src += arch-mips/syscalls/sigpending.S
syscall_src += arch-mips/syscalls/socket.S
syscall_src += arch-mips/syscalls/socketpair.S
syscall_src += arch-mips/syscalls/bind.S
syscall_src += arch-mips/syscalls/connect.S
syscall_src += arch-mips/syscalls/listen.S
syscall_src += arch-mips/syscalls/accept.S
syscall_src += arch-mips/syscalls/getsockname.S
syscall_src += arch-mips/syscalls/getpeername.S
syscall_src += arch-mips/syscalls/sendto.S
syscall_src += arch-mips/syscalls/recvfrom.S
syscall_src += arch-mips/syscalls/shutdown.S
syscall_src += arch-mips/syscalls/setsockopt.S
syscall_src += arch-mips/syscalls/getsockopt.S
syscall_src += arch-mips/syscalls/sendmsg.S
syscall_src += arch-mips/syscalls/recvmsg.S
syscall_src += arch-mips/syscalls/sched_setscheduler.S
syscall_src += arch-mips/syscalls/sched_getscheduler.S
syscall_src += arch-mips/syscalls/sched_yield.S
syscall_src += arch-mips/syscalls/sched_setparam.S
syscall_src += arch-mips/syscalls/sched_getparam.S
syscall_src += arch-mips/syscalls/sched_get_priority_max.S
syscall_src += arch-mips/syscalls/sched_get_priority_min.S
syscall_src += arch-mips/syscalls/sched_rr_get_interval.S
syscall_src += arch-mips/syscalls/sched_setaffinity.S
syscall_src += arch-mips/syscalls/__sched_getaffinity.S
syscall_src += arch-mips/syscalls/__getcpu.S
syscall_src += arch-mips/syscalls/ioprio_set.S
syscall_src += arch-mips/syscalls/ioprio_get.S
syscall_src += arch-mips/syscalls/uname.S
syscall_src += arch-mips/syscalls/__wait4.S
syscall_src += arch-mips/syscalls/umask.S
syscall_src += arch-mips/syscalls/__reboot.S
syscall_src += arch-mips/syscalls/__syslog.S
syscall_src += arch-mips/syscalls/init_module.S
syscall_src += arch-mips/syscalls/delete_module.S
syscall_src += arch-mips/syscalls/klogctl.S
syscall_src += arch-mips/syscalls/sysinfo.S
syscall_src += arch-mips/syscalls/personality.S
syscall_src += arch-mips/syscalls/perf_event_open.S
syscall_src += arch-mips/syscalls/futex.S
syscall_src += arch-mips/syscalls/epoll_create.S
syscall_src += arch-mips/syscalls/epoll_ctl.S
syscall_src += arch-mips/syscalls/epoll_wait.S
syscall_src += arch-mips/syscalls/inotify_init.S
syscall_src += arch-mips/syscalls/inotify_add_watch.S
syscall_src += arch-mips/syscalls/inotify_rm_watch.S
syscall_src += arch-mips/syscalls/poll.S
syscall_src += arch-mips/syscalls/eventfd.S
syscall_src += arch-mips/syscalls/_flush_cache.S
syscall_src += arch-mips/syscalls/syscall.S

View File

@@ -0,0 +1,22 @@
/* autogenerated by gensyscalls.py */
#include <sys/linux-syscalls.h>
.text
.globl __brk
.align 4
.ent __brk
__brk:
.set noreorder
.cpload $t9
li $v0, __NR_brk
syscall
bnez $a3, 1f
move $a0, $v0
j $ra
nop
1:
la $t9,__set_errno
j $t9
nop
.set reorder
.end __brk

View File

@@ -0,0 +1,22 @@
/* autogenerated by gensyscalls.py */
#include <sys/linux-syscalls.h>
.text
.globl __fcntl
.align 4
.ent __fcntl
__fcntl:
.set noreorder
.cpload $t9
li $v0, __NR_fcntl
syscall
bnez $a3, 1f
move $a0, $v0
j $ra
nop
1:
la $t9,__set_errno
j $t9
nop
.set reorder
.end __fcntl

View File

@@ -0,0 +1,22 @@
/* autogenerated by gensyscalls.py */
#include <sys/linux-syscalls.h>
.text
.globl __fcntl64
.align 4
.ent __fcntl64
__fcntl64:
.set noreorder
.cpload $t9
li $v0, __NR_fcntl64
syscall
bnez $a3, 1f
move $a0, $v0
j $ra
nop
1:
la $t9,__set_errno
j $t9
nop
.set reorder
.end __fcntl64

View File

@@ -0,0 +1,22 @@
/* autogenerated by gensyscalls.py */
#include <sys/linux-syscalls.h>
.text
.globl __fork
.align 4
.ent __fork
__fork:
.set noreorder
.cpload $t9
li $v0, __NR_fork
syscall
bnez $a3, 1f
move $a0, $v0
j $ra
nop
1:
la $t9,__set_errno
j $t9
nop
.set reorder
.end __fork

View File

@@ -0,0 +1,22 @@
/* autogenerated by gensyscalls.py */
#include <sys/linux-syscalls.h>
.text
.globl __fstatfs64
.align 4
.ent __fstatfs64
__fstatfs64:
.set noreorder
.cpload $t9
li $v0, __NR_fstatfs64
syscall
bnez $a3, 1f
move $a0, $v0
j $ra
nop
1:
la $t9,__set_errno
j $t9
nop
.set reorder
.end __fstatfs64

View File

@@ -0,0 +1,22 @@
/* autogenerated by gensyscalls.py */
#include <sys/linux-syscalls.h>
.text
.globl __getcpu
.align 4
.ent __getcpu
__getcpu:
.set noreorder
.cpload $t9
li $v0, __NR_getcpu
syscall
bnez $a3, 1f
move $a0, $v0
j $ra
nop
1:
la $t9,__set_errno
j $t9
nop
.set reorder
.end __getcpu

View File

@@ -0,0 +1,22 @@
/* autogenerated by gensyscalls.py */
#include <sys/linux-syscalls.h>
.text
.globl __getcwd
.align 4
.ent __getcwd
__getcwd:
.set noreorder
.cpload $t9
li $v0, __NR_getcwd
syscall
bnez $a3, 1f
move $a0, $v0
j $ra
nop
1:
la $t9,__set_errno
j $t9
nop
.set reorder
.end __getcwd

View File

@@ -0,0 +1,22 @@
/* autogenerated by gensyscalls.py */
#include <sys/linux-syscalls.h>
.text
.globl __getpriority
.align 4
.ent __getpriority
__getpriority:
.set noreorder
.cpload $t9
li $v0, __NR_getpriority
syscall
bnez $a3, 1f
move $a0, $v0
j $ra
nop
1:
la $t9,__set_errno
j $t9
nop
.set reorder
.end __getpriority

View File

@@ -0,0 +1,22 @@
/* autogenerated by gensyscalls.py */
#include <sys/linux-syscalls.h>
.text
.globl __ioctl
.align 4
.ent __ioctl
__ioctl:
.set noreorder
.cpload $t9
li $v0, __NR_ioctl
syscall
bnez $a3, 1f
move $a0, $v0
j $ra
nop
1:
la $t9,__set_errno
j $t9
nop
.set reorder
.end __ioctl

View File

@@ -0,0 +1,22 @@
/* autogenerated by gensyscalls.py */
#include <sys/linux-syscalls.h>
.text
.globl __llseek
.align 4
.ent __llseek
__llseek:
.set noreorder
.cpload $t9
li $v0, __NR__llseek
syscall
bnez $a3, 1f
move $a0, $v0
j $ra
nop
1:
la $t9,__set_errno
j $t9
nop
.set reorder
.end __llseek

View File

@@ -0,0 +1,22 @@
/* autogenerated by gensyscalls.py */
#include <sys/linux-syscalls.h>
.text
.globl __mmap2
.align 4
.ent __mmap2
__mmap2:
.set noreorder
.cpload $t9
li $v0, __NR_mmap2
syscall
bnez $a3, 1f
move $a0, $v0
j $ra
nop
1:
la $t9,__set_errno
j $t9
nop
.set reorder
.end __mmap2

View File

@@ -0,0 +1,22 @@
/* autogenerated by gensyscalls.py */
#include <sys/linux-syscalls.h>
.text
.globl __open
.align 4
.ent __open
__open:
.set noreorder
.cpload $t9
li $v0, __NR_open
syscall
bnez $a3, 1f
move $a0, $v0
j $ra
nop
1:
la $t9,__set_errno
j $t9
nop
.set reorder
.end __open

View File

@@ -0,0 +1,22 @@
/* autogenerated by gensyscalls.py */
#include <sys/linux-syscalls.h>
.text
.globl __openat
.align 4
.ent __openat
__openat:
.set noreorder
.cpload $t9
li $v0, __NR_openat
syscall
bnez $a3, 1f
move $a0, $v0
j $ra
nop
1:
la $t9,__set_errno
j $t9
nop
.set reorder
.end __openat

Some files were not shown because too many files have changed in this diff Show More