Compare commits

..

632 Commits

Author SHA1 Message Date
The Android Automerger
d146e8e4e9 merge in jb-mr2-release history after reset to jb-mr2-dev 2013-05-13 05:55:12 -07:00
Elliott Hughes
738370d938 Don't fail to run DT_INIT and DT_INIT_ARRAY constructors if a shared library has DT_PREINIT_ARRAY constructors.
The GNU dynamic linker silently ignores a DT_PREINIT_ARRAY section
in a shared library. We had ineffectual code that tried to report
an error, which I tried to fix but got wrong --- my version still
wouldn't report the error to the caller, but would prevent us from
continuing to call constructors.

Bug: 8825226

(cherry picked from commit 8147d3c284)

Change-Id: Iad8e7e3743d1a5e6bd1d44ef40b1ab3499cb64f2
2013-05-09 15:53:30 -07:00
Ben Cheng
262b7384e4 Adjust PC value in ARM stack trace.
-2 for Thumb BLX(2) or -4 for the rest.

Change-Id: Ie59351a0012c2267309f63f0462fdba4698846fe
2013-05-08 11:21:53 -07:00
The Android Automerger
46de17d26d merge in jb-mr2-release history after reset to jb-mr2-dev 2013-04-25 05:55:12 -07:00
Elliott Hughes
389b5c1ee5 Upgrade to tzdata2013c.
From the release notes:

  Changes affecting current and future time stamps:

    Palestine observed DST starting March 29, 2013.  (Thanks to
    Steffen Thorsen.)  From 2013 on, Gaza and Hebron both observe DST,
    with the predicted rules being the last Thursday in March at 24:00
    to the first Friday on or after September 21 at 01:00.

    Assume that the recent change to Paraguay's DST rules is permanent,
    by moving the end of DST to the 4th Sunday in March every year.
    (Thanks to Carlos Raúl Perasso.)

  Changes affecting past time stamps:

    Fix some historical data for Palestine to agree with that of
    timeanddate.com, as follows:

          The spring 2008 change in Gaza and Hebron was on 00:00 Mar 28, not
          00:00 Apr 1.

          The fall 2009 change in Gaza and Hebron on Sep 4 was at 01:00, not
          02:00.

          The spring 2010 change in Hebron was 00:00 Mar 26, not 00:01 Mar 27.

          The spring 2011 change in Gaza was 00:01 Apr 1, not 12:01 Apr 2.

          The spring 2011 change in Hebron on Apr 1 was at 00:01, not 12:01.

          The fall 2011 change in Hebron on Sep 30 was at 00:00, not 03:00.

    Fix times of habitation for Macquarie to agree with the Tasmania
    Parks & Wildlife Service history, which indicates that permanent
    habitation was 1899-1919 and 1948 on.

  Changing affecting metadata only:

    Macquarie Island is politically part of Australia, not Antarctica.
    (Thanks to Tobias Conradi.)

    Sort Macquarie more-consistently with other parts of Australia.
    (Thanks to Tim Parenti.)

(cherry picked from commit 2379088a90)

Change-Id: I77d0ceebdba3489da0069f5792e930adc5810d34
2013-04-23 18:22:31 -07:00
The Android Automerger
637d50e6c0 merge in jb-mr2-release history after reset to jb-mr2-dev 2013-04-11 05:55:13 -07:00
Eric Laurent
ccaa0fa6e9 sound: Add ALSA compressed API headers
Added the following headers for ALSA compressed
user space API:
- sound/compress_offload.h
- sound/compress_params.h

Change-Id: I9584c12acdadf31546d2921393b93d491e54a8d3
2013-04-09 09:37:44 -07:00
The Android Automerger
d4cc0b8a61 merge in jb-mr2-release history after reset to jb-mr2-dev 2013-04-08 05:55:25 -07:00
Elliott Hughes
7b4d77e400 Make abort messages available to debuggerd.
This adds __libc_fatal, cleans up the internal logging code a bit more,
and switches suitable callers over to __libc_fatal. In addition to logging,
__libc_fatal stashes the message somewhere that the debuggerd signal handler
can find it before calling abort.

In the debuggerd signal handler, we pass this address to debuggerd so that
it can come back with ptrace to read the message and present it to the user.

Bug: 8531731

(cherry picked from commit 0d787c1fa1)

Change-Id: I5daeeaa36c1fc23f7f437d73a19808d9d558dd4d
2013-04-05 15:57:53 -07:00
The Android Automerger
ddbe8a23a8 merge in jb-mr2-release history after reset to jb-mr2-dev 2013-04-04 05:55:10 -07:00
Kito Cheng
9b84824dfd Prevent name conflict for eventfd.cpp and eventfd.s when building libc.a
- eventfd.cpp and eventfd.s will output to the same file when building libc.a
   out/target/product/*/obj/STATIC_LIBRARIES/libc_intermediates/WHOLE/libc_common_objs/eventfd.o
 - And then `eventfd` will undefined when statically linked to libc.

Also add a unit test.

(cherry-pick of 8baa929d5d3bcf63381cf78ba76168c80c303f5e.)

Change-Id: Icd0eb0f4ce0511fb9ec00a504d491afd47d744d3
2013-04-03 11:14:20 -07:00
Elliott Hughes
a69103ffe4 Fix the SYSCALLS.TXT documentation and remove a dead script.
We use the system call constants from the kernel header files now,
so there's no need to check that they've been correctly transcribed
into SYSCALLS.TXT.

This is a work in progress. I've added TODOs to SYSCALLS.TXT explaining
what's left to do.

(cherry-pick of a51916b58b2d211bcf8ffdbe9cf7faa58e57382f.)

Change-Id: I4484acd946b1f548ac3d95327e58add9f98246ab
2013-04-03 11:13:31 -07:00
The Android Automerger
90e19c328f merge in jb-mr2-release history after reset to jb-mr2-dev 2013-04-03 06:02:06 -07:00
Elliott Hughes
1fe1137576 Stop using unreasonable numbers of map entries.
(cherry-pick of 4ace92c62ada583b220836d76de2cfcb78d4d48d.)

Bug: 8460659
Change-Id: I1a9dc30cbf6a7a2c68cb3d8000921e9178eedb85
2013-04-02 17:48:35 -07:00
The Android Automerger
ea01edd2d4 merge in jb-mr2-release history after reset to jb-mr2-dev 2013-04-02 09:18:11 -07:00
Lorenzo Colitti
309e107f01 Merge "Update getaddrinfo to RFC6724" into jb-mr2-dev 2013-04-02 00:49:29 +00:00
The Android Automerger
a66f6570c1 merge in jb-mr2-release history after reset to jb-mr2-dev 2013-04-01 05:55:14 -07:00
Lorenzo Colitti
e919b116d3 Update getaddrinfo to RFC6724
Currently, our getaddrinfo implementation does not conform to
any IETF standard. It follows draft-ietf-6man-rfc3484-revise-01,
but that draft has expired. Update the policy table to RFC6724.

Bug: 8276725
Change-Id: I03c63abfcad9b2f3a3bab2718bd2fc6440531843
2013-04-01 19:15:43 +09:00
Elliott Hughes
96449b3dc1 Extra logging in pthread_create.
pthread_create returns EAGAIN when it can't allocate a pthread_internal_t,
when it can't allocate a stack for the new thread, or when clone(2) fails
because there are too many threads. It's useful to be able to know why your
pthread_create just failed, so add some logging.

Bug: 8470684

(cherry picked from commit cfa089df23)

Change-Id: Ibfc98a84c1817a931f9ae4c2b88762f0edfb6b79
2013-03-29 16:58:33 -07:00
Nick Kralevich
b24b6e1419 Merge "resolv_cache: hide some libc private functions" into jb-mr2-dev 2013-03-29 23:53:40 +00:00
Nick Kralevich
c01274c4aa resolv_cache: hide some libc private functions
Don't export unnecessary symbols to third party apps.

Bug: 8401049
Change-Id: Ide5abd6ed13e756a85bd1277d93da74d1419addb
2013-03-29 13:56:05 -07:00
Jean-Baptiste Queru
d02dd19d51 am 267290b3: am 74b324ac: Merge "Update processed linux/fs.h header file"
* commit '267290b340bee74e5ebbbc60f8c5a9b2a5453957':
  Update processed linux/fs.h header file
2013-03-28 08:59:25 -07:00
Jean-Baptiste Queru
267290b340 am 74b324ac: Merge "Update processed linux/fs.h header file"
* commit '74b324ac09db35d29d16695e9b9c1f0601599812':
  Update processed linux/fs.h header file
2013-03-28 08:57:23 -07:00
The Android Automerger
8398f82ddd merge in jb-mr2-release history after reset to jb-mr2-dev 2013-03-28 05:55:13 -07:00
Ken Sumrall
887049e46b Merge "Update processed linux/fs.h header file" into jb-mr2-dev 2013-03-27 21:15:29 +00:00
The Android Automerger
6147c2941e merge in jb-mr2-release history after reset to jb-mr2-dev 2013-03-26 05:55:11 -07:00
Elliott Hughes
da2c158645 am 8a6abe38: am bd014c2e: Merge "Remove some dead script code and fix a script comment."
* commit '8a6abe380d2ba513bb714e54a74f4289089cbc18':
  Remove some dead script code and fix a script comment.
2013-03-25 14:36:24 -07:00
Elliott Hughes
8a6abe380d am bd014c2e: Merge "Remove some dead script code and fix a script comment."
* commit 'bd014c2e4246d6e64a6523c73b9a72f379255526':
  Remove some dead script code and fix a script comment.
2013-03-25 14:34:06 -07:00
Elliott Hughes
999dff0ef3 am a850ad4c: am e51d75a9: Merge "Clarify the dlmalloc USAGE_ERROR."
* commit 'a850ad4cf44e998e24f43df723b6928e42f8294d':
  Clarify the dlmalloc USAGE_ERROR.
2013-03-25 14:05:54 -07:00
Elliott Hughes
a850ad4cf4 am e51d75a9: Merge "Clarify the dlmalloc USAGE_ERROR."
* commit 'e51d75a9acef86008f4d64cf482bbc65e24dc66c':
  Clarify the dlmalloc USAGE_ERROR.
2013-03-25 14:03:38 -07:00
Dima Zavin
369f92349f Merge "libc/arm: add cortex-a7 cpu variant" into jb-mr2-dev 2013-03-25 19:42:28 +00:00
Elliott Hughes
c82b339a7d am 3c1504d9: am 48f25cef: Merge "Stop generating <sys/linux-syscalls.h>."
* commit '3c1504d9d7d529b8281a447dc69af3ecf6b5ec83':
  Stop generating <sys/linux-syscalls.h>.
2013-03-25 10:24:42 -07:00
Elliott Hughes
9386a33ea0 am 93f3811b: am a4075118: Merge "Unhide __set_errno for backwards compatibility."
* commit '93f3811b744b2100d0f259916876965c242cd3d9':
  Unhide __set_errno for backwards compatibility.
2013-03-25 10:24:42 -07:00
Elliott Hughes
3c1504d9d7 am 48f25cef: Merge "Stop generating <sys/linux-syscalls.h>."
* commit '48f25cef45f8f68567d528a5d833ed45cb760bec':
  Stop generating <sys/linux-syscalls.h>.
2013-03-25 10:22:43 -07:00
Elliott Hughes
93f3811b74 am a4075118: Merge "Unhide __set_errno for backwards compatibility."
* commit 'a40751185f3a7245f73afb45382c23f71dbbcfc3':
  Unhide __set_errno for backwards compatibility.
2013-03-25 10:22:43 -07:00
The Android Automerger
af66ca6b19 merge in jb-mr2-release history after reset to jb-mr2-dev 2013-03-25 05:55:24 -07:00
Dima Zavin
0c973d7049 libc/arm: add cortex-a7 cpu variant
Change-Id: I541d665805ea69ca96bb6a5f4d50e56287f8c08c
Signed-off-by: Dima Zavin <dima@android.com>
2013-03-23 01:38:22 -07:00
Elliott Hughes
ba61bb55c4 am a3fe475c: am c019345a: Merge "Use the correct names for the __ARM_NR_* syscalls."
* commit 'a3fe475c9ff444f45eb3c4dd7fd462326dfdb13d':
  Use the correct names for the __ARM_NR_* syscalls.
2013-03-22 15:09:13 -07:00
Elliott Hughes
a3fe475c9f am c019345a: Merge "Use the correct names for the __ARM_NR_* syscalls."
* commit 'c019345a3a0f3ee8561e595917b75d6419ee4cc8':
  Use the correct names for the __ARM_NR_* syscalls.
2013-03-22 15:07:06 -07:00
Elliott Hughes
e0e5b2f6e7 am 65163750: am c37dd599: Merge "Fix builds where _FORTIFY_SOURCE is off."
* commit '65163750b11c814d6a75940ab1ede1e907b14d81':
  Fix builds where _FORTIFY_SOURCE is off.
2013-03-22 11:20:22 -07:00
Elliott Hughes
65163750b1 am c37dd599: Merge "Fix builds where _FORTIFY_SOURCE is off."
* commit 'c37dd599561ac07a895bc435d818f000054a498d':
  Fix builds where _FORTIFY_SOURCE is off.
2013-03-22 11:18:26 -07:00
Elliott Hughes
b826ebf41e am 85598626: am 34895c1b: Merge "Replace unnecessary ARM uses of <sys/linux-syscalls.h> with <asm/unistd.h>."
* commit '85598626f4ca7914d996371ce0471ab154aa7585':
  Replace unnecessary ARM uses of <sys/linux-syscalls.h> with <asm/unistd.h>.
2013-03-22 11:11:34 -07:00
Elliott Hughes
85598626f4 am 34895c1b: Merge "Replace unnecessary ARM uses of <sys/linux-syscalls.h> with <asm/unistd.h>."
* commit '34895c1bdfa5df48ee9a7b4368b6def403f24cf1':
  Replace unnecessary ARM uses of <sys/linux-syscalls.h> with <asm/unistd.h>.
2013-03-22 10:59:57 -07:00
Elliott Hughes
b44f9600a3 am b80a05fa: am 5c5f303e: Merge "Replace unnecessary MIPS uses of <sys/linux-syscalls.h> with <asm/unistd.h>."
* commit 'b80a05fa678b287f46dc596353d285a9a7d09fbc':
  Replace unnecessary MIPS uses of <sys/linux-syscalls.h> with <asm/unistd.h>.
2013-03-22 09:43:28 -07:00
Elliott Hughes
a0dcecc53e am bc0d7f73: am e7cb795c: Merge "Replace unnecessary x86 uses of <sys/linux-syscalls.h> with <asm/unistd.h>."
* commit 'bc0d7f736c2c66868844f2b5c9e6507d3e7a7982':
  Replace unnecessary x86 uses of <sys/linux-syscalls.h> with <asm/unistd.h>.
2013-03-22 09:43:28 -07:00
Elliott Hughes
b80a05fa67 am 5c5f303e: Merge "Replace unnecessary MIPS uses of <sys/linux-syscalls.h> with <asm/unistd.h>."
* commit '5c5f303e4c661a71ae8e4c7fd99fc7674360321e':
  Replace unnecessary MIPS uses of <sys/linux-syscalls.h> with <asm/unistd.h>.
2013-03-22 09:41:46 -07:00
Elliott Hughes
bc0d7f736c am e7cb795c: Merge "Replace unnecessary x86 uses of <sys/linux-syscalls.h> with <asm/unistd.h>."
* commit 'e7cb795cb639ef4e04b0417ebf4b16b12ea5dc4e':
  Replace unnecessary x86 uses of <sys/linux-syscalls.h> with <asm/unistd.h>.
2013-03-22 09:41:46 -07:00
Ken Sumrall
d74a0ffba8 Update processed linux/fs.h header file
Need to get the defintion of the FITRIM ioctl().  Also need
to update the blk_types.h header file as fs.h includes it.

Change-Id: I617622b620925942dc5aead9e49f8e17d17e5d74
2013-03-22 02:12:46 -07:00
Elliott Hughes
ddda044a81 am 5686bb30: am 3323628d: Merge "The SYS_ constants should cover all __NR_ values."
* commit '5686bb300304f5de0597f356c6da72b8a090a647':
  The SYS_ constants should cover all __NR_ values.
2013-03-21 22:54:49 -07:00
Elliott Hughes
5686bb3003 am 3323628d: Merge "The SYS_ constants should cover all __NR_ values."
* commit '3323628d635d3973965ee458c1fee7d8ab45136f':
  The SYS_ constants should cover all __NR_ values.
2013-03-21 22:53:44 -07:00
Elliott Hughes
c8ded7c6b1 am a3167257: am babb72dc: Merge "Fix pthread_setname_np\'s behavior on invalid pthread_ts."
* commit 'a316725740ac123de65e225f5bfbf99450f66e6b':
  Fix pthread_setname_np's behavior on invalid pthread_ts.
2013-03-21 22:22:49 -07:00
Elliott Hughes
a316725740 am babb72dc: Merge "Fix pthread_setname_np\'s behavior on invalid pthread_ts."
* commit 'babb72dc292a567674f6d7d2ccf7f63edaf77b80':
  Fix pthread_setname_np's behavior on invalid pthread_ts.
2013-03-21 22:20:53 -07:00
Elliott Hughes
1e40ace49e am a596aa6a: am 26c815c4: Merge "Drop magic number in strrchr and strchr"
* commit 'a596aa6abfdd8ecdb4bcdd9bcad24a19adcf7525':
  Drop magic number in strrchr and strchr
2013-03-21 19:58:23 -07:00
Elliott Hughes
17a0d1915f am 01c0e19e: am 612333f6: Merge "Don\'t #define SYS_ constants unless they make sense for the current architecture."
* commit '01c0e19e426df5620c5ca822ab546907dbf1fa7d':
  Don't #define SYS_ constants unless they make sense for the current architecture.
2013-03-21 19:58:22 -07:00
Elliott Hughes
a596aa6abf am 26c815c4: Merge "Drop magic number in strrchr and strchr"
* commit '26c815c489197259e3692d4a1e35463989f7c7a3':
  Drop magic number in strrchr and strchr
2013-03-21 19:56:39 -07:00
Elliott Hughes
01c0e19e42 am 612333f6: Merge "Don\'t #define SYS_ constants unless they make sense for the current architecture."
* commit '612333f671a59d98fad6f594f5bf657dbd6c9c4d':
  Don't #define SYS_ constants unless they make sense for the current architecture.
2013-03-21 19:56:38 -07:00
Elliott Hughes
3077d88347 am c48968d2: am 4453c51c: Merge "Drop unnecessary execution permission for .cpp/.c/.h"
* commit 'c48968d268820ee64986f738e227910b29290eab':
  Drop unnecessary execution permission for .cpp/.c/.h
2013-03-21 19:40:15 -07:00
Elliott Hughes
c48968d268 am 4453c51c: Merge "Drop unnecessary execution permission for .cpp/.c/.h"
* commit '4453c51c8269457b337578f809670d0fdb755132':
  Drop unnecessary execution permission for .cpp/.c/.h
2013-03-21 19:38:53 -07:00
Elliott Hughes
5c9a25cc23 am f977d2dc: am 800ad824: Merge "Provide glibc-compatible SYS_* aliases for the __NR_* constants."
* commit 'f977d2dc1dce28a517329e8b4990ebee696faec1':
  Provide glibc-compatible SYS_* aliases for the __NR_* constants.
2013-03-21 18:51:51 -07:00
Elliott Hughes
f977d2dc1d am 800ad824: Merge "Provide glibc-compatible SYS_* aliases for the __NR_* constants."
* commit '800ad8249a398e94d039b6f6597e2a51558e41dd':
  Provide glibc-compatible SYS_* aliases for the __NR_* constants.
2013-03-21 18:49:24 -07:00
Elliott Hughes
c9edc07977 am 39e2a408: am 6eb978c9: Merge "Expose wait4 as wait4 rather than __wait4."
* commit '39e2a408a64bd24fb0fe7f5eb444b55af1160480':
  Expose wait4 as wait4 rather than __wait4.
2013-03-21 16:19:29 -07:00
Elliott Hughes
39e2a408a6 am 6eb978c9: Merge "Expose wait4 as wait4 rather than __wait4."
* commit '6eb978c9bf02d2bcdece2826577cc65900030690':
  Expose wait4 as wait4 rather than __wait4.
2013-03-21 16:18:22 -07:00
The Android Automerger
3e036b0c99 merge in jb-mr2-release history after reset to jb-mr2-dev 2013-03-21 05:55:07 -07:00
Christopher Ferris
f46e14544b am 9088af19: am 86c31849: Merge "Create arch specific versions of strcmp."
* commit '9088af19b45d1b7339b982c92ef9113337f5d2c6':
  Create arch specific versions of strcmp.
2013-03-20 15:33:54 -07:00
Christopher Ferris
9088af19b4 am 86c31849: Merge "Create arch specific versions of strcmp."
* commit '86c318497270c80a3791b4cd9835367653636377':
  Create arch specific versions of strcmp.
2013-03-20 15:29:06 -07:00
The Android Automerger
ed12f36a09 merge in jb-mr2-release history after reset to jb-mr2-dev 2013-03-18 05:55:24 -07:00
Elliott Hughes
d7dc414afd am 987fc5a3: am adeec096: Merge "Hide various symbols that shouldn\'t be exposed."
* commit '987fc5a3c4046831dc9e6c252e99a9c694bbd9ee':
  Hide various symbols that shouldn't be exposed.
2013-03-15 17:09:17 -07:00
Elliott Hughes
987fc5a3c4 am adeec096: Merge "Hide various symbols that shouldn\'t be exposed."
* commit 'adeec096292a3ad63767f13af04836249ecbc075':
  Hide various symbols that shouldn't be exposed.
2013-03-15 17:07:45 -07:00
Elliott Hughes
12ea800566 am 5f829205: am c1416647: Merge "Clean up internal libc logging."
* commit '5f8292050fc07f4bf9e70f37a807ad028e3cfc87':
  Clean up internal libc logging.
2013-03-15 16:36:37 -07:00
Elliott Hughes
5f8292050f am c1416647: Merge "Clean up internal libc logging."
* commit 'c14166477e7fd22693eab194d37624c2f7506ce4':
  Clean up internal libc logging.
2013-03-15 16:34:05 -07:00
Elliott Hughes
744df77d47 am 2e7b8d63: am f861bc5c: Merge "Don\'t search off the end of the index for bad Olson ids."
* commit '2e7b8d6399fdea6e43dd07f353346324d2bf4ec4':
  Don't search off the end of the index for bad Olson ids.
2013-03-15 12:56:32 -07:00
Elliott Hughes
e1b0db1392 am 50d42294: am e23ed8c6: Merge "Remove useless workaround for HTC RIL bugs."
* commit '50d42294bdc983e05eca0fb0099bbb9f634fd5e3':
  Remove useless workaround for HTC RIL bugs.
2013-03-15 11:46:05 -07:00
Elliott Hughes
50d42294bd am e23ed8c6: Merge "Remove useless workaround for HTC RIL bugs."
* commit 'e23ed8c6441389a79c6504295184f7249e01a197':
  Remove useless workaround for HTC RIL bugs.
2013-03-15 11:43:50 -07:00
Elliott Hughes
9ede4549fe am f8d689bc: am 4d696eb4: Merge "Fix a bug in ZoneCompactor that meant the zonetab offset was wrong."
* commit 'f8d689bc56976f8bd37b306053154a0e9d17fb1d':
  Fix a bug in ZoneCompactor that meant the zonetab offset was wrong.
2013-03-14 17:42:42 -07:00
Elliott Hughes
f8d689bc56 am 4d696eb4: Merge "Fix a bug in ZoneCompactor that meant the zonetab offset was wrong."
* commit '4d696eb49d24590a6d6d25657b5bc0103e2d90ba':
  Fix a bug in ZoneCompactor that meant the zonetab offset was wrong.
2013-03-14 17:40:26 -07:00
Christopher Ferris
f85fc022f5 am f694ed1c: am d30b9f09: Merge "Remove unused arm defines."
* commit 'f694ed1cdbfd2d26cdc2a008b67bfd3451522c8f':
  Remove unused arm defines.
2013-03-14 16:36:45 -07:00
Christopher Ferris
f694ed1cdb am d30b9f09: Merge "Remove unused arm defines."
* commit 'd30b9f0912b4763f0d98bdee23064015223ec03f':
  Remove unused arm defines.
2013-03-14 16:32:21 -07:00
Elliott Hughes
c9358706c6 am 2e7b8d63: am f861bc5c: Merge "Don\'t search off the end of the index for bad Olson ids."
* commit '2e7b8d6399fdea6e43dd07f353346324d2bf4ec4':
  Don't search off the end of the index for bad Olson ids.
2013-03-14 15:30:13 -07:00
Elliott Hughes
2e7b8d6399 am f861bc5c: Merge "Don\'t search off the end of the index for bad Olson ids."
* commit 'f861bc5cc3e17322e49f89deea61f278aaefbe76':
  Don't search off the end of the index for bad Olson ids.
2013-03-14 15:17:09 -07:00
The Android Automerger
45508566d1 merge in jb-mr2-release history after reset to jb-mr2-dev 2013-03-13 05:55:08 -07:00
Elliott Hughes
f557e90b34 am 2f44c05b: am ec706c24: Merge "Use the kernel\'s MAX_ERRNO in the syscall stubs."
* commit '2f44c05bc54073aa6decfc5d933b7e77e7ce5768':
  Use the kernel's MAX_ERRNO in the syscall stubs.
2013-03-12 17:55:54 -07:00
Elliott Hughes
2f44c05bc5 am ec706c24: Merge "Use the kernel\'s MAX_ERRNO in the syscall stubs."
* commit 'ec706c24acb4d1db6a583a57b76adfb9250d39eb':
  Use the kernel's MAX_ERRNO in the syscall stubs.
2013-03-12 17:54:00 -07:00
Christopher Ferris
b0b974c10c am 2a66ccf1: am 980508b0: Merge "Break bionic implementations into arch versions."
* commit '2a66ccf1bb4dd0183b65264cb8107ba70748f626':
  Break bionic implementations into arch versions.
2013-03-12 15:40:22 -07:00
Christopher Ferris
2a66ccf1bb am 980508b0: Merge "Break bionic implementations into arch versions."
* commit '980508b0ead3ee01e99e93635c57eb76d1aba62d':
  Break bionic implementations into arch versions.
2013-03-12 15:39:38 -07:00
Elliott Hughes
b4d6f28cc3 am a3214c65: am 94a34010: Merge "Support large errno values on ARM."
* commit 'a3214c65620827628a87849a5fbad5a4ef97eeb1':
  Support large errno values on ARM.
2013-03-12 12:18:49 -07:00
Elliott Hughes
a3214c6562 am 94a34010: Merge "Support large errno values on ARM."
* commit '94a34010c1f989032c0a4dc7a7a68d069ca23b1e':
  Support large errno values on ARM.
2013-03-12 12:17:15 -07:00
Elliott Hughes
746f128602 am 5d998b4a: am f21aa3b6: Merge "Use more types than just \'unsigned\' in the linker."
* commit '5d998b4a21aab09da750e8e43cb608f5ee6b1f3d':
  Use more types than just 'unsigned' in the linker.
2013-03-12 12:03:06 -07:00
Elliott Hughes
5d998b4a21 am f21aa3b6: Merge "Use more types than just \'unsigned\' in the linker."
* commit 'f21aa3b61ebc6b1a7c34265699f40bd9b5af7952':
  Use more types than just 'unsigned' in the linker.
2013-03-12 12:00:55 -07:00
Elliott Hughes
e9cdce33f3 am 3c9afb5e: am 6b4c77f8: Merge "Use Elf32_Addr instead of unsigned in linker"
* commit '3c9afb5e17eaa2ed5a12d71a1a09fe85f06fcb48':
  Use Elf32_Addr instead of unsigned in linker
2013-03-12 10:40:56 -07:00
Elliott Hughes
3c9afb5e17 am 6b4c77f8: Merge "Use Elf32_Addr instead of unsigned in linker"
* commit '6b4c77f854c079138d552608b9df5fa3035f0fcc':
  Use Elf32_Addr instead of unsigned in linker
2013-03-12 10:38:46 -07:00
The Android Automerger
24ec903cd8 merge in jb-mr2-release history after reset to jb-mr2-dev 2013-03-12 05:55:15 -07:00
Elliott Hughes
8c73f69cf4 am 36cb88b7: am 53630c0e: Merge "Cache the most-recently used timezone for mktime_tz and localtime_tz."
* commit '36cb88b70c39e507e9017f0bd7121da57e568744':
  Cache the most-recently used timezone for mktime_tz and localtime_tz.
2013-03-11 18:46:23 -07:00
Elliott Hughes
36cb88b70c am 53630c0e: Merge "Cache the most-recently used timezone for mktime_tz and localtime_tz."
* commit '53630c0e5bb6f845ba633e8dedc08b827f7b5d0c':
  Cache the most-recently used timezone for mktime_tz and localtime_tz.
2013-03-11 18:44:19 -07:00
Jean-Baptiste Queru
a60f381814 am b2525ba8: am 7915b22e: am a4b20d71: am b8e1033c: (-s ours) am e5412a9a: (-s ours) Reconcile with jb-mr1-release - do not merge
* commit 'b2525ba8a0f91594df17e893d036c416a109b012':
2013-03-11 12:35:36 -07:00
Jean-Baptiste Queru
b2525ba8a0 am 7915b22e: am a4b20d71: am b8e1033c: (-s ours) am e5412a9a: (-s ours) Reconcile with jb-mr1-release - do not merge
* commit '7915b22e8f70b80a9fc2c41f9734194c58b546fc':
2013-03-11 12:30:58 -07:00
Jean-Baptiste Queru
7915b22e8f am a4b20d71: am b8e1033c: (-s ours) am e5412a9a: (-s ours) Reconcile with jb-mr1-release - do not merge
* commit 'a4b20d712b9c6cbc562529d3a41bf8ea1515562a':
2013-03-11 12:28:17 -07:00
Elliott Hughes
60ac09bdb2 am 6d6f5e61: am 4b032ee9: Merge "Let bionic use the correct definition of ssize_t."
* commit '6d6f5e618e054e79d80a02f2c3f76ce0fd73bb2a':
  Let bionic use the correct definition of ssize_t.
2013-03-11 12:27:58 -07:00
Jean-Baptiste Queru
a4b20d712b am b8e1033c: (-s ours) am e5412a9a: (-s ours) Reconcile with jb-mr1-release - do not merge
* commit 'b8e1033c5b5813cb97d19645075591a357e9f04a':
2013-03-11 12:22:41 -07:00
Jean-Baptiste Queru
b8e1033c5b am e5412a9a: (-s ours) Reconcile with jb-mr1-release - do not merge
* commit 'e5412a9a9597433ae2540b390269c514c46402f1':
2013-03-11 12:19:03 -07:00
Jean-Baptiste Queru
e5412a9a95 Reconcile with jb-mr1-release - do not merge 2013-03-11 12:15:11 -07:00
Elliott Hughes
bf32ffcf02 am 0b765862: am 62c5cd07: Merge "Upgrade to tzdata2013b."
* commit '0b765862e134e87174ddf9bdfa32528392f85e96':
  Upgrade to tzdata2013b.
2013-03-11 11:29:24 -07:00
Elliott Hughes
6d6f5e618e am 4b032ee9: Merge "Let bionic use the correct definition of ssize_t."
* commit '4b032ee9b94137e41ee54e9bb3bcf0ba5ad43cbc':
  Let bionic use the correct definition of ssize_t.
2013-03-11 11:07:29 -07:00
Elliott Hughes
0b765862e1 am 62c5cd07: Merge "Upgrade to tzdata2013b."
* commit '62c5cd0781e95c1c50b63c37a9a87bc158e64d38':
  Upgrade to tzdata2013b.
2013-03-11 09:57:53 -07:00
The Android Automerger
e767b0f555 merge in jb-mr2-release history after reset to jb-mr2-dev 2013-03-11 05:55:24 -07:00
Elliott Hughes
8a01572272 resolved conflicts for merge of 4706606c to jb-mr2-dev
Change-Id: Ibf6340df901c870cd05a2ab56536ad23b6fd491c
2013-03-07 13:19:20 -08:00
Elliott Hughes
4706606c88 am 809eed1d: Merge "Regenerate NOTICE files."
* commit '809eed1dedb833af1aba56c6a1d059123b43049a':
  Regenerate NOTICE files.
2013-03-07 12:02:00 -08:00
The Android Automerger
a312b02e85 merge in jb-mr2-release history after reset to jb-mr2-dev 2013-03-07 05:55:07 -08:00
Elliott Hughes
0a2ee4750a am ad7c275e: am c9f80814: Merge "Upgrade to current NetBSD popen/pclose."
* commit 'ad7c275e45088e1f13656b97dabbe911fff83664':
  Upgrade to current NetBSD popen/pclose.
2013-03-07 01:04:52 +00:00
Elliott Hughes
ad7c275e45 am c9f80814: Merge "Upgrade to current NetBSD popen/pclose."
* commit 'c9f80814259a81dce12ba35d1750fa2b23fef48d':
  Upgrade to current NetBSD popen/pclose.
2013-03-06 17:03:28 -08:00
Brian Carlstrom
c7b9f954a5 am 91392116: am 33031fed: Merge "Fix typo of DT_NEEDED for DT_NULL"
* commit '91392116ff859b2e7656ded729b8c758107241aa':
  Fix typo of DT_NEEDED for DT_NULL
2013-03-07 00:12:13 +00:00
Brian Carlstrom
91392116ff am 33031fed: Merge "Fix typo of DT_NEEDED for DT_NULL"
* commit '33031fed84e24fb7791f123df45abc1a3812ac59':
  Fix typo of DT_NEEDED for DT_NULL
2013-03-06 16:11:07 -08:00
Elliott Hughes
9c0c056bed am 6b1aa1b1: am db794197: Merge "Fix debug malloc."
* commit '6b1aa1b16bc2cf8ba17e33fca4ffc399368b356c':
  Fix debug malloc.
2013-03-06 23:24:59 +00:00
Elliott Hughes
6b1aa1b16b am db794197: Merge "Fix debug malloc."
* commit 'db794197cc880e3805bcefbea780476a359066c2':
  Fix debug malloc.
2013-03-06 15:22:24 -08:00
Elliott Hughes
bac72abae4 am 50a2cd86: am 0b4a85bf: Merge "Fix TIMING/STATS/COUNT_PAGES dynamic linker build"
* commit '50a2cd865e7cc8c72d926548ed5d64e269003055':
  Fix TIMING/STATS/COUNT_PAGES dynamic linker build
2013-03-06 17:44:43 +00:00
Elliott Hughes
50a2cd865e am 0b4a85bf: Merge "Fix TIMING/STATS/COUNT_PAGES dynamic linker build"
* commit '0b4a85bf1e11e28f66d0f101f9e7d4c51a0bb31c':
  Fix TIMING/STATS/COUNT_PAGES dynamic linker build
2013-03-06 09:41:56 -08:00
The Android Automerger
f5fc5d467c merge in jb-mr2-release history after reset to jb-mr2-dev 2013-03-06 05:55:11 -08:00
Brian Carlstrom
2527a8b5a6 am 9043202b: am 20958207: Merge "Fix MIPS linker build"
* commit '9043202b5bb8e0725b0302e9da9d3a57c837e798':
  Fix MIPS linker build
2013-03-06 09:18:59 +00:00
Brian Carlstrom
9043202b5b am 20958207: Merge "Fix MIPS linker build"
* commit '20958207d5f9d36cc6f6b3edc4ff899c73b72b02':
  Fix MIPS linker build
2013-03-06 01:17:27 -08:00
Elliott Hughes
c1a5d20d08 am 9a0b658c: am c41dcad0: Merge "More linker cleanup."
* commit '9a0b658c9c1f8f4492f61a75909e5ca2f05c3ac1':
  More linker cleanup.
2013-03-06 06:44:06 +00:00
Elliott Hughes
9a0b658c9c am c41dcad0: Merge "More linker cleanup."
* commit 'c41dcad040ede2975ea63e383a8a3d36e3642d56':
  More linker cleanup.
2013-03-05 22:42:33 -08:00
Brian Carlstrom
8c65a1e466 am a2517de3: am 036f9097: Merge "Minor linker cleanup, primarily to use Elf32_Dyn"
* commit 'a2517de3844d95b5f00a4666b8dae00ef893ac24':
  Minor linker cleanup, primarily to use Elf32_Dyn
2013-03-06 01:22:25 +00:00
Brian Carlstrom
a2517de384 am 036f9097: Merge "Minor linker cleanup, primarily to use Elf32_Dyn"
* commit '036f909720fd0d56dbd04b9a761fb1d0714980b0':
  Minor linker cleanup, primarily to use Elf32_Dyn
2013-03-05 17:20:35 -08:00
Elliott Hughes
97a8217ae1 am 3f7b1cd3: am be21fe7a: Merge "Upgrade to tzdata2013a."
* commit '3f7b1cd3acf9990efea9f75559b2f873ab3838fe':
  Upgrade to tzdata2013a.
2013-03-05 22:23:45 +00:00
Elliott Hughes
3f7b1cd3ac am be21fe7a: Merge "Upgrade to tzdata2013a."
* commit 'be21fe7a5947e24f9f0db90f8e16c54766d1237a':
  Upgrade to tzdata2013a.
2013-03-05 14:22:01 -08:00
Ben Cheng
6ad68558ed am e5e6e17c: am 133d97e4: Merge "Add stack unwinding directives to memcpy."
* commit 'e5e6e17c5bd06e097c5bb4da9a23b5e293309ab9':
  Add stack unwinding directives to memcpy.
2013-03-05 21:20:42 +00:00
Ben Cheng
e5e6e17c5b am 133d97e4: Merge "Add stack unwinding directives to memcpy."
* commit '133d97e4b07a733787fb85692ad8427fdc3d1d22':
  Add stack unwinding directives to memcpy.
2013-03-05 13:17:23 -08:00
Elliott Hughes
c96ad9bcd2 am 7b69ac53: am cf9a9604: Merge "Switch to upstream-freebsd for the unmolested wchar code."
* commit '7b69ac535abca0e7867524e68f5a3581cc367de8':
  Switch to upstream-freebsd for the unmolested wchar code.
2013-03-05 20:28:28 +00:00
Elliott Hughes
7b69ac535a am cf9a9604: Merge "Switch to upstream-freebsd for the unmolested wchar code."
* commit 'cf9a9604adb27600c79ca236578a8be89168202f':
  Switch to upstream-freebsd for the unmolested wchar code.
2013-03-05 12:27:09 -08:00
The Android Automerger
5b5aa0317c merge in jb-mr2-release history after reset to jb-mr2-dev 2013-03-05 05:55:15 -08:00
Elliott Hughes
81e0f35acc am 2125c155: am d392e044: Merge "Move realpath.c to upstream-freebsd."
* commit '2125c15506cbe9e4062d72ebb723d164e9c01c1f':
  Move realpath.c to upstream-freebsd.
2013-03-04 23:56:56 +00:00
Elliott Hughes
2125c15506 am d392e044: Merge "Move realpath.c to upstream-freebsd."
* commit 'd392e044c7a03ff1c0903c3512d00955bc7de473':
  Move realpath.c to upstream-freebsd.
2013-03-04 08:25:58 -08:00
The Android Automerger
2ec68f6833 merge in jb-mr2-release history after reset to jb-mr2-dev 2013-03-04 05:55:08 -08:00
Christopher Ferris
29cc4946ac Merge "Remove unused arm defines. DO NOT MERGE" into jb-mr2-dev 2013-03-02 01:16:00 +00:00
Christopher Ferris
947b3ab02b Remove unused arm defines. DO NOT MERGE
The defines HAVE_32_BYTE_CACHE_LINES and ARCH_ARM_USE_NON_NEON_MEMCPY
are not used by any code. The previous memcpy code that used these
has been split into different architecture versions to avoid the need
for them.

Bug: 8005082

(cherry picked from commit 6e1a5cf31b)

Change-Id: I69654d47db1458136782b5504290f620e924ee75
2013-03-01 16:54:56 -08:00
Ben Cheng
b9ef7f4e12 am 52b3aed7: am c5c6cb3f: am 66273ac2: Merge "Adding strcmp tuned for Cortex-A15."
* commit '52b3aed7982e9d68aad0652f54d5ee180ddf1c5a':
  Adding strcmp tuned for Cortex-A15.
2013-03-01 18:28:25 +00:00
Ben Cheng
ae280bcdbe am 55fc93a9: am 8f149da0: am b3b1ab62: Merge "Adding memcpy tuned for Cortex-A15."
* commit '55fc93a90961022e38ef0bb63bcb81d2b4e5aef6':
  Adding memcpy tuned for Cortex-A15.
2013-03-01 18:28:25 +00:00
Nick Kralevich
04190c53e3 am cc646773: am 305a9995: am 8fa924e5: Merge "unistd.h: don\'t include sys/capability.h"
* commit 'cc64677342209d38f88138c03d3ded0e1d61637c':
  unistd.h: don't include sys/capability.h
2013-03-01 18:28:24 +00:00
Ben Cheng
52b3aed798 am c5c6cb3f: am 66273ac2: Merge "Adding strcmp tuned for Cortex-A15."
* commit 'c5c6cb3f13642386e08acf687b4bc39f568bad0c':
  Adding strcmp tuned for Cortex-A15.
2013-03-01 10:26:52 -08:00
Ben Cheng
55fc93a909 am 8f149da0: am b3b1ab62: Merge "Adding memcpy tuned for Cortex-A15."
* commit '8f149da08dc3125824e168f8d29613be80b2085c':
  Adding memcpy tuned for Cortex-A15.
2013-03-01 10:26:52 -08:00
Nick Kralevich
cc64677342 am 305a9995: am 8fa924e5: Merge "unistd.h: don\'t include sys/capability.h"
* commit '305a999589a8dfde077589106853522d483d24d2':
  unistd.h: don't include sys/capability.h
2013-03-01 10:26:51 -08:00
Christopher Ferris
7c83a1ed81 Break bionic implementations into arch versions. DO NOT MERGE
Move arch specific code for arm, mips, x86 into separate
makefiles.
In addition, add different arm cpu versions of memcpy/memset.

Bug: 8005082

(cherry picked from commit acdde8c1cf)

Change-Id: I0108d432af9f6283ae99adfc92a3399e5ab3e31d
2013-02-28 17:45:16 -08:00
Elliott Hughes
730da15840 Avoid changing the C++ ABI with ssize_t.
Bug: 8253769
Change-Id: Ia325003ed6e59da553e2bdde7c43515bc191b8ba
2013-02-28 15:21:51 -08:00
Elliott Hughes
04766565d3 am 9c102ccf: am 7fe8229b: am 9c1912c4: Merge "Avoid changing the C++ ABI with ssize_t."
* commit '9c102ccf9517637f9d293b4e52f9a40573d8fc1d':
  Avoid changing the C++ ABI with ssize_t.
2013-02-28 19:46:19 +00:00
Elliott Hughes
9c102ccf95 am 7fe8229b: am 9c1912c4: Merge "Avoid changing the C++ ABI with ssize_t."
* commit '7fe8229b49ea091d769b63052247ca12280975eb':
  Avoid changing the C++ ABI with ssize_t.
2013-02-28 11:44:20 -08:00
Nick Kralevich
30f1622a34 am 82f4cc5d: am 58b997c8: am f5f906c1: Merge "libc: create sys/capability.h"
* commit '82f4cc5de495c6cc3d3736ab075ccd05285beabc':
  libc: create sys/capability.h
2013-02-26 21:55:28 +00:00
Nick Kralevich
82f4cc5de4 am 58b997c8: am f5f906c1: Merge "libc: create sys/capability.h"
* commit '58b997c8121455ecb9aa1b80d7c796115149ec2a':
  libc: create sys/capability.h
2013-02-26 13:51:26 -08:00
Elliott Hughes
aa13eaa934 am d9cb6988: am 406968b2: am c0e9ddd0: Merge "Reimplement scandir(3)."
* commit 'd9cb69881a062c615a8009be0a70270c70eb35da':
  Reimplement scandir(3).
2013-02-25 22:58:44 +00:00
Elliott Hughes
d9cb69881a am 406968b2: am c0e9ddd0: Merge "Reimplement scandir(3)."
* commit '406968b2444bf29e449acebdfb7ff174abd1e0ad':
  Reimplement scandir(3).
2013-02-25 14:56:51 -08:00
Elliott Hughes
92ce5cc4bc am ed1068c8: am 7b8bf681: am f6bb5bf4: Merge "Add the glibc-compatible names to <sys/endian.h>."
* commit 'ed1068c86ea0380e4b4909252367ffacc812ad57':
  Add the glibc-compatible names to <sys/endian.h>.
2013-02-22 14:09:30 -08:00
Elliott Hughes
ed1068c86e am 7b8bf681: am f6bb5bf4: Merge "Add the glibc-compatible names to <sys/endian.h>."
* commit '7b8bf68133cda6c5ff9207248b563c2f6297e22a':
  Add the glibc-compatible names to <sys/endian.h>.
2013-02-22 14:06:12 -08:00
Elliott Hughes
726642cfa5 am dd843914: am 440bc83d: am 7b2c6385: Merge "Fix <memory.h> to be a synonym for <string.h> like in glibc."
* commit 'dd8439141aeac6dc3a64e25f313d08833e1d85f5':
  Fix <memory.h> to be a synonym for <string.h> like in glibc.
2013-02-22 12:16:14 -08:00
Elliott Hughes
dd8439141a am 440bc83d: am 7b2c6385: Merge "Fix <memory.h> to be a synonym for <string.h> like in glibc."
* commit '440bc83d924fa616614b4b426da66c2893048887':
  Fix <memory.h> to be a synonym for <string.h> like in glibc.
2013-02-22 12:12:45 -08:00
Nick Kralevich
bcedca25d3 am 41fb968c: am cadc8583: am bc0e7ee1: Merge "libc: add sys/signal.h for compatibility"
* commit '41fb968c4268d080b0be4493876672efc4a71e16':
  libc: add sys/signal.h for compatibility
2013-02-22 11:59:38 -08:00
Nick Kralevich
41fb968c42 am cadc8583: am bc0e7ee1: Merge "libc: add sys/signal.h for compatibility"
* commit 'cadc858329a5929911eff5f9a208229112e36a93':
  libc: add sys/signal.h for compatibility
2013-02-22 11:56:39 -08:00
Nick Kralevich
5d36baee95 Merge "gethostbyname: fix crash" 2013-02-22 19:32:37 +00:00
Nick Kralevich
bfe0640e41 Don't pass pid to dnsproxyd
dnsproxyd can already determine our pid by looking at our
socket connection. It's dangerous (and unneeded) to pass it
ourselves.

Change-Id: I2596d02e361b302259ddb084be2fb75be59889c5
2013-02-21 21:34:11 -08:00
Nick Kralevich
a6b24b7afb gethostbyname: fix crash
When an app doesn't have the internet permission, android_open_proxy
returns NULL, causing a segfault when calling fprintf. Fixed.

Change-Id: I598855350ed0db3cc88e5ae3b400145418a3a615
2013-02-21 20:12:42 -08:00
Elliott Hughes
7dfc6a3cd1 am e974e951: am 2a5b57db: am 580a7073: Merge "Stop advertising rindex(3), which is both deprecated and unimplemented."
* commit 'e974e951606d2efbad4bafe5edbd09c13d875f6a':
  Stop advertising rindex(3), which is both deprecated and unimplemented.
2013-02-21 18:01:17 -08:00
Elliott Hughes
e974e95160 am 2a5b57db: am 580a7073: Merge "Stop advertising rindex(3), which is both deprecated and unimplemented."
* commit '2a5b57db8c711b6f33581a68cfb7b82298ad988c':
  Stop advertising rindex(3), which is both deprecated and unimplemented.
2013-02-21 17:57:53 -08:00
Nick Kralevich
d470955eb5 am 72e983d6: am 398f46dd: am a0259b42: Merge "libc: remove bcmp prototype"
* commit '72e983d62828e1db5049800b7edef5a1b0cbbcbd':
  libc: remove bcmp prototype
2013-02-21 17:45:27 -08:00
Nick Kralevich
72e983d628 am 398f46dd: am a0259b42: Merge "libc: remove bcmp prototype"
* commit '398f46dd92fbb72e2a275cddccffdfde384bb3b4':
  libc: remove bcmp prototype
2013-02-21 17:42:07 -08:00
Elliott Hughes
448f1f08c2 am caeb0bf5: am 719d46f8: am a9ff09d1: Merge "Fix raise(3) so it works in signal handlers."
* commit 'caeb0bf53c8299d53f246573392fd688cae8a625':
  Fix raise(3) so it works in signal handlers.
2013-02-21 15:19:55 -08:00
Elliott Hughes
caeb0bf53c am 719d46f8: am a9ff09d1: Merge "Fix raise(3) so it works in signal handlers."
* commit '719d46f8ac4f2af89f8e8927db8c460b91622417':
  Fix raise(3) so it works in signal handlers.
2013-02-21 14:21:13 -08:00
Jean-Baptiste Queru
55779c4316 am aa96db5b: (-s ours) am 818b1423: (-s ours) Fix mako builds. Do not merge.
* commit 'aa96db5ba0a39d8fac0925871632031d21e1ab3e':
  Fix mako builds. Do not merge.
2013-02-20 14:03:19 -08:00
Jean-Baptiste Queru
aa96db5ba0 am 818b1423: (-s ours) Fix mako builds. Do not merge.
* commit '818b1423d228e478245a1b0d2fe687606ea1741c':
  Fix mako builds. Do not merge.
2013-02-20 14:00:43 -08:00
Ed Heyl
37d6d8e933 Merge remote-tracking branch 'goog/jb-mr2-release' 2013-02-20 13:47:20 -08:00
The Android Automerger
44f8f7b86a merge in jb-mr2-release history after reset to master 2013-02-20 05:55:13 -08:00
Elliott Hughes
cae2173952 am ccd40316: Merge "use architecture-specific ssize_t definition"
* commit 'ccd403161cdcc88a0ffcaecd1bc707e2d4c88a1c':
  use architecture-specific ssize_t definition
2013-02-19 14:37:19 -08:00
Elliott Hughes
77272874f8 am 593abb7b: Merge "stdlib: atexit: include <sys/cdefs.h>"
* commit '593abb7b593a34d501c90512953a7368add6d185':
  stdlib: atexit: include <sys/cdefs.h>
2013-02-19 14:19:33 -08:00
Elliott Hughes
5593d50c72 am eeecff72: Merge "Fix pthreads functions that should return ESRCH."
* commit 'eeecff7293efd6becf3b07b8d24cada3d820c894':
  Fix pthreads functions that should return ESRCH.
2013-02-19 13:46:37 -08:00
Elliott Hughes
6f55284103 am b5862d4d: Merge "Update linker README."
* commit 'b5862d4d8a1246dc1e21695cf3bacafefedf0428':
  Update linker README.
2013-02-19 11:39:40 -08:00
The Android Automerger
82232f0e6b merge in jb-mr2-release history after reset to master 2013-02-19 09:50:40 -08:00
Elliott Hughes
4174337525 am 7f67f78a: Merge "dalvik is big enough and ugly enough to handle System.arraycopy itself."
* commit '7f67f78ad5c3da689997edd8fbb5afb6e5fc6355':
  dalvik is big enough and ugly enough to handle System.arraycopy itself.
2013-02-15 17:00:58 -08:00
Elliott Hughes
6af19237b7 am 39804dcd: Merge "Fix the pthread_setname_np test."
* commit '39804dcde6c1c596285432b28cdb09382ce59663':
  Fix the pthread_setname_np test.
2013-02-15 14:48:05 -08:00
Elliott Hughes
15c401d4ac am 3e3b239d: Merge "Fix the stack protector death test."
# Via Elliott Hughes (1) and Gerrit Code Review (1)
* commit '3e3b239d2be0c5a92e91385f4f10b8f7da8d2837':
  Fix the stack protector death test.
2013-02-14 18:22:16 -08:00
Elliott Hughes
56a007c157 am 0a2cb815: Merge "Simplify __stack_chk_fail, and fix it so we get debuggerd stack traces."
# Via Elliott Hughes (1) and Gerrit Code Review (1)
* commit '0a2cb815974ea96af664fa966079966a08916722':
  Simplify __stack_chk_fail, and fix it so we get debuggerd stack traces.
2013-02-14 15:59:15 -08:00
Nick Kralevich
f93de61e7b am b128f49f: Merge "bionic: Add securebits.h"
# Via Gerrit Code Review (1) and Nick Kralevich (1)
* commit 'b128f49fd58beecc5287ddff6366a97e5aa2e468':
  bionic: Add securebits.h
2013-02-14 15:05:22 -08:00
Elliott Hughes
7331af73f2 am c2d26ce7: Merge "Turn on -Werror for ssp.cpp."
# Via Elliott Hughes (1) and Gerrit Code Review (1)
* commit 'c2d26ce7452e69b9492cd28b7c0271866798658b':
  Turn on -Werror for ssp.cpp.
2013-02-14 11:23:48 -08:00
Nick Kralevich
dfa1e59b7d am fe33fc79: Merge "fix compiler warning."
# Via Gerrit Code Review (1) and Nick Kralevich (1)
* commit 'fe33fc790a16d85ce4109a4575d6fdcd88d42023':
  fix compiler warning.
2013-02-14 09:59:09 -08:00
The Android Automerger
8561261b5e merge in jb-mr2-release history after reset to master 2013-02-14 05:55:17 -08:00
Elliott Hughes
2346559cb4 am 6b97c7dc: Merge "ffs was not being built for x86."
# Via Elliott Hughes (1) and Gerrit Code Review (1)
* commit '6b97c7dc0376577276abbdacc52e5cc11cf8a7fd':
  ffs was not being built for x86.
2013-02-13 17:08:07 -08:00
Elliott Hughes
4c897b692d am 97f2ec50: Merge "Stop using the local gcc."
# Via Elliott Hughes (1) and Gerrit Code Review (1)
* commit '97f2ec50a7993d2db7ef4511a251e6823f5dba10':
  Stop using the local gcc.
2013-02-13 17:08:07 -08:00
Elliott Hughes
5ca3e4a349 am 95b1ea1b: Merge "Add a bunch more missing ENDs to assembler routines."
# Via Elliott Hughes (1) and Gerrit Code Review (1)
* commit '95b1ea1bb3c93369d96045420b91b7617992d8bd':
  Add a bunch more missing ENDs to assembler routines.
2013-02-13 15:27:11 -08:00
Elliott Hughes
a7603ff87a am 2fee0340: Merge "Everyone has CLZ."
# Via Elliott Hughes (1) and Gerrit Code Review (1)
* commit '2fee0340a93637507de6a860914dc3e14d44ee94':
  Everyone has CLZ.
2013-02-13 15:27:10 -08:00
Elliott Hughes
8ca1da6e71 resolved conflicts for merge of 62727429 to master
Change-Id: I8a3d167f3ef279a7c46cb8fb90c9477beff84d8e
2013-02-13 13:51:54 -08:00
Elliott Hughes
6aca0ce367 am f659b3c9: Merge "Add a test that getaddrinfo works when hints are NULL."
# Via Elliott Hughes (1) and Gerrit Code Review (1)
* commit 'f659b3c90d8b55a44945af807364a5df0475bd0e':
  Add a test that getaddrinfo works when hints are NULL.
2013-02-13 09:18:45 -08:00
Elliott Hughes
2db16ea38e am 3002d64b: Merge "Everyone has a TLS register."
# Via Elliott Hughes (1) and Gerrit Code Review (1)
* commit '3002d64bcd4644456803dd0547d20b39e14be02c':
  Everyone has a TLS register.
2013-02-13 08:11:24 -08:00
Elliott Hughes
32a2340067 am 9cbe1e63: Merge "Fix __pthread_clone and __bionic_clone error handling on x86."
# Via Elliott Hughes (1) and Gerrit Code Review (1)
* commit '9cbe1e63ddf8b61b8ded3d357a30c3d6ed67906f':
  Fix __pthread_clone and __bionic_clone error handling on x86.
2013-02-13 08:11:23 -08:00
The Android Automerger
d41c26e2d8 merge in jb-mr2-release history after reset to master 2013-02-13 05:55:21 -08:00
Elliott Hughes
a244e4eb61 am baf2c09f: Merge "Put the right number of Ls after 64-bit constants."
# Via Elliott Hughes (1) and Gerrit Code Review (1)
* commit 'baf2c09f3f47a35b195eb83cc7acffeaf4b6d4e9':
  Put the right number of Ls after 64-bit constants.
2013-02-12 20:38:05 -08:00
Elliott Hughes
761b344bff am 59aeff94: Merge "Use ENTRY/END in custom x86 assembler too."
# Via Elliott Hughes (1) and Gerrit Code Review (1)
* commit '59aeff94178e03c908791695f6dd4c9bd8c7115b':
  Use ENTRY/END in custom x86 assembler too.
2013-02-12 20:17:26 -08:00
Elliott Hughes
bc35693e6b am 07f7e62a: Merge "Clean up pthread_create."
# Via Elliott Hughes (1) and Gerrit Code Review (1)
* commit '07f7e62a259d13208d6186670d3748e339690127':
  Clean up pthread_create.
2013-02-12 18:20:10 -08:00
Elliott Hughes
d8ceaf5afa am 899d6528: Merge "Give up trying to build the pthread_setname_np tests for glibc."
# Via Elliott Hughes (1) and Gerrit Code Review (1)
* commit '899d65283db0c78537ed27aa3a6c019000ec05da':
  Give up trying to build the pthread_setname_np tests for glibc.
2013-02-12 18:20:09 -08:00
Elliott Hughes
dde1d876b1 am 991ee7d8: Merge "Simplify pthread_create, using more public API."
# Via Elliott Hughes (1) and Gerrit Code Review (1)
* commit '991ee7d89574e8d04c8863a2850613073a2f96b3':
  Simplify pthread_create, using more public API.
2013-02-12 16:52:26 -08:00
Elliott Hughes
f4e258c22e am 4912782c: Merge "Really set errno if __pthread_clone fails."
# Via Elliott Hughes (1) and Gerrit Code Review (1)
* commit '4912782c6af7169686acc9553fb0bb33251b0d0d':
  Really set errno if __pthread_clone fails.
2013-02-12 16:23:25 -08:00
Elliott Hughes
78715fca0b am 558a8b1d: Merge "Revert "Revert "More pthreads cleanup."""
# Via Elliott Hughes (1) and Gerrit Code Review (1)
* commit '558a8b1d3b31300941af78232f2f7f4cb4e933b9':
  Revert "Revert "More pthreads cleanup.""
2013-02-12 16:23:24 -08:00
Dima Zavin
ac480b422a am 3fa67465: Merge "add factory property file definition"
# By Andrew Boie
# Via Andrew Boie (1) and Gerrit Code Review (1)
* commit '3fa67465365baf87f751bea09847e32f01005788':
  add factory property file definition
2013-02-12 11:12:49 -08:00
The Android Automerger
1bb43b02ad merge in jb-mr2-release history after reset to master 2013-02-12 07:10:11 -08:00
Elliott Hughes
191f880bdf am bfa199ab: am fcaf4e9f: Merge "Revert "More pthreads cleanup.""
# Via Gerrit Code Review (2) and Android Git Automerger (1)
* commit 'bfa199ab4019a7de9b95cd3db86c4d7176438803':
  Revert "More pthreads cleanup."
2013-02-11 22:20:39 -08:00
Elliott Hughes
23731e841a am a2a9817f: am 85f491f9: Merge "More pthreads cleanup."
# Via Android Git Automerger (1) and others
* commit 'a2a9817f4c08d1f56d90f02ed13f531e8093f8e8':
  More pthreads cleanup.
2013-02-11 18:39:32 -08:00
Elliott Hughes
13478d856a am 605cc293: am 83bf28e6: Merge "Fix MIPS build."
# Via Android Git Automerger (1) and others
* commit '605cc29358c9a6d575d097fd4b78a483c9dbf89e':
  Fix MIPS build.
2013-02-11 18:23:17 -08:00
Elliott Hughes
0f6882f43d am 8e2b28cb: am c56be54a: Merge "Use ENTRY/END in ARM __get_sp."
# Via Android Git Automerger (1) and others
* commit '8e2b28cb6c16d8a5671ccb333965bb56b2990d7a':
  Use ENTRY/END in ARM __get_sp.
2013-02-11 18:15:13 -08:00
Elliott Hughes
a2b8b833d2 am c440d244: am cae7b2cf: Merge "Fix __pthread_clone on ARM to set errno on failure."
# Via Android Git Automerger (1) and others
* commit 'c440d2442361b78196d2935469ecf78d5c3470e5':
  Fix __pthread_clone on ARM to set errno on failure.
2013-02-11 18:15:07 -08:00
Elliott Hughes
b940711587 am 03798dd2: am 1fea0f25: Merge "Clean up ARM assembler files to use ENTRY/END."
# Via Android Git Automerger (1) and others
* commit '03798dd23cd3d1dc1ee4c4b0472c75369aa1e10f':
  Clean up ARM assembler files to use ENTRY/END.
2013-02-11 18:15:04 -08:00
Elliott Hughes
5bb4f54b4d am 6b73d13f: am 2d3e7233: Merge "Revert "Revert "Pull the pthread_key_t functions out of pthread.c."""
# Via Android Git Automerger (1) and others
* commit '6b73d13fa414afeecba6718bf724e8ac922bac39':
  Revert "Revert "Pull the pthread_key_t functions out of pthread.c.""
2013-02-11 17:34:32 -08:00
Elliott Hughes
1b21249d5a am e4b08318: am 8397cdba: Merge "Revert "Pull the pthread_key_t functions out of pthread.c.""
# Via Gerrit Code Review (2) and Android Git Automerger (1)
* commit 'e4b08318c13fac774b233a5459427563d2983f79':
  Revert "Pull the pthread_key_t functions out of pthread.c."
2013-02-11 17:34:30 -08:00
Elliott Hughes
376bce0097 am 024246ec: am 09e89c3c: Merge "Pull the pthread_key_t functions out of pthread.c."
# Via Android Git Automerger (1) and others
* commit '024246ec274e30bb4a24468d8319620534e13b34':
  Pull the pthread_key_t functions out of pthread.c.
2013-02-11 17:34:29 -08:00
The Android Automerger
c087b7a80f merge in jb-mr2-release history after reset to master 2013-02-11 07:10:25 -08:00
Elliott Hughes
63358ae068 am 8f509e8b: am 9a9bb243: Merge "Switch to using AT_RANDOM for the stack guards."
# Via Android Git Automerger (1) and others
* commit '8f509e8be11876023d4bcb3e827ca096f22fc0c5':
  Switch to using AT_RANDOM for the stack guards.
2013-02-08 11:43:09 -08:00
Elliott Hughes
01cf1678e7 am 636d21f3: am 03579da2: Merge "Add a few more missing libm long double stubs."
# Via Android Git Automerger (1) and others
* commit '636d21f32b8aa9cd3ef7c91c729179e53daddc3a':
  Add a few more missing libm long double stubs.
2013-02-07 20:29:44 -08:00
Nick Kralevich
5eef90699d am f156b901: am fa75fce5: Merge "update xattr.h"
# Via Android Git Automerger (1) and others
* commit 'f156b901b1e51971192c573444b5b7f63e6bc22a':
  update xattr.h
2013-02-07 20:29:43 -08:00
Elliott Hughes
7d2bc92717 am 86e4e234: am 964886af: Merge "Remove dead code from gensyscalls.py."
# Via Android Git Automerger (1) and others
* commit '86e4e23408c157176d20b4baca00eb4d2f7566dc':
  Remove dead code from gensyscalls.py.
2013-02-07 20:29:42 -08:00
Elliott Hughes
8c372fc77e am 5bb67760: am f6afd3b6: Merge "Fix x86 build, remove void* arithmetic."
# Via Android Git Automerger (1) and others
* commit '5bb67760f0baddd815334bf87be79f0e7fd9fafe':
  Fix x86 build, remove void* arithmetic.
2013-02-07 14:45:28 -08:00
Elliott Hughes
dd698ec89a am 8ddef40d: am 59e9a496: Merge "__progname should be const char*, not char*."
# Via Android Git Automerger (1) and others
* commit '8ddef40dad42372ac5596d48f327f162745d7bb8':
  __progname should be const char*, not char*.
2013-02-07 14:45:27 -08:00
Elliott Hughes
389ebfa16f am 6f67cd22: am 2f41531f: Merge "Clean up the argc/argv/envp/auxv handling."
# Via Android Git Automerger (1) and others
* commit '6f67cd224e6ffdfa2619849eb4b9b2ff6c1e2c59':
  Clean up the argc/argv/envp/auxv handling.
2013-02-07 14:45:24 -08:00
Robert Greenwalt
a7d9b655e5 Merge "dns cache per interface iteration 2" 2013-02-07 19:02:16 +00:00
Mattias Falk
c63e59039d dns cache per interface iteration 2
name server addresses are read from the dns
cache associated wih the interface on which
the request shall be done.

processes which has requested to issue dns request
using specific interface are now proxied to netd.

added methods to attach/detach a process to a specific
dns cache/interface.

added getaddrinfoforinface method which takes an
interface as an argument.

bug:4815099
bug:5465296
Change-Id: I7a8fe1980cdf99d4d296ddc5c6411f0c72162263
2013-02-07 09:40:16 -08:00
Elliott Hughes
ffc807fdb6 am 4e9d9e4d: am d4187efd: Merge "Switch x86 syscall stubs over to the ENTER/END style of the ARM stubs."
# Via Android Git Automerger (1) and others
* commit '4e9d9e4df8309493e65c5ca15513644361fda314':
  Switch x86 syscall stubs over to the ENTER/END style of the ARM stubs.
2013-02-07 09:17:14 -08:00
The Android Automerger
a3e0f95fba merge in jb-mr2-release history after reset to master 2013-02-07 07:10:16 -08:00
Elliott Hughes
001437e861 am 09559dd0: am d32fdbaf: Merge "Add a missing logbl stub."
# Via Android Git Automerger (1) and others
* commit '09559dd04604dae062a2a50ce8dc78fd7d0e4a2f':
  Add a missing logbl stub.
2013-02-06 19:45:01 -08:00
Elliott Hughes
5dc29e97a6 am d2a6d8d7: am c9ab32e4: Merge "Improve benchmarking tool, add a few math benchmarks."
# Via Android Git Automerger (1) and others
* commit 'd2a6d8d77d1052b2cef7c0296d1396da5d3f7736':
  Improve benchmarking tool, add a few math benchmarks.
2013-02-06 19:44:53 -08:00
Elliott Hughes
4b9ed9e153 am 5fe28661: am d10a5a02: Merge "Remove the currently-unused i387 assembler to make way for the new."
# Via Android Git Automerger (1) and others
* commit '5fe286618ffea7cb8872a74501bf36d5036ca2a9':
  Remove the currently-unused i387 assembler to make way for the new.
2013-02-06 12:27:59 -08:00
Elliott Hughes
1c3039301b am 0e51a861: am 4fc2a74b: Merge "Remove partial implementation of MIPS non-PIC support."
# Via Android Git Automerger (1) and others
* commit '0e51a861241ea49455c519890b34e80eccfd4709':
  Remove partial implementation of MIPS non-PIC support.
2013-02-06 11:55:06 -08:00
The Android Automerger
a9ebf6c951 merge in jb-mr2-release history after reset to master 2013-02-06 07:10:08 -08:00
Elliott Hughes
6dd470d4d0 am df8c72e5: am d7ff139f: Merge "Remove bogus extra alignment from sbrk."
# Via Android Git Automerger (1) and others
* commit 'df8c72e510ae9d0a9970a31555ea51ea0c8f19ca':
  Remove bogus extra alignment from sbrk.
2013-02-05 17:14:50 -08:00
The Android Automerger
d418c2bd0a merge in jb-mr2-release history after reset to master 2013-02-05 07:10:12 -08:00
Elliott Hughes
303339e8d1 am 3cbcb87b: am a4f88fdc: Merge "Document the mallinfo struct, add missing attributes."
# Via Android Git Automerger (1) and others
* commit '3cbcb87bd1e86bd2bdb218fd324648e5bc7e8260':
  Document the mallinfo struct, add missing attributes.
2013-02-04 17:19:44 -08:00
Elliott Hughes
d1f2fafb72 am 384bdb37: am a3120aaf: Merge "Add basic tests for posix_memalign."
# Via Android Git Automerger (1) and others
* commit '384bdb3776bedaf22e8f1a3dfe7c6118b4bcefa4':
  Add basic tests for posix_memalign.
2013-02-04 17:19:34 -08:00
Elliott Hughes
b72952171b am ada6de67: (-s ours) am a1821f01: Merge "Regenerate msm_ion.h."
# Via Android Git Automerger (1) and others
* commit 'ada6de673be2a66bcfa822e0bb895219391c22a8':
  Regenerate msm_ion.h.
2013-02-04 17:00:26 -08:00
Elliott Hughes
54a2587446 am 16444e0f: am 3dc6b57c: Merge "Don\'t claim there were no leaks if we weren\'t even checking."
# Via Android Git Automerger (1) and others
* commit '16444e0f85585508e74d6166b8bbb4acb19738a0':
  Don't claim there were no leaks if we weren't even checking.
2013-02-04 11:29:33 -08:00
Elliott Hughes
46b3f0bb97 am 33e4365d: am 1bf83555: Merge "Make sincosl call sinl and cosl."
# Via Android Git Automerger (1) and others
* commit '33e4365d87364d8d9c8c4427255050b5e9b8cffe':
  Make sincosl call sinl and cosl.
2013-02-04 11:29:26 -08:00
Elliott Hughes
9cdd76954d am 422c400d: am ae70b946: Merge "Update the libm/NOTICE file after the upgrade."
# Via Android Git Automerger (1) and others
* commit '422c400dd3f6f2fdf096dc33da5b7033b6a58a10':
  Update the libm/NOTICE file after the upgrade.
2013-02-04 11:29:25 -08:00
Elliott Hughes
96a5819afb am 704d9c5b: am a9dd3670: Merge "Restore bionic\'s <linux/elf-em.h>."
# Via Android Git Automerger (1) and others
* commit '704d9c5b45515cc2421bfe3b37c93117da0a1334':
  Restore bionic's <linux/elf-em.h>.
2013-02-04 11:29:24 -08:00
Elliott Hughes
fb7a4850b8 am ff26e25b: am 44badc70: Merge "Upgrade libm."
# Via Android Git Automerger (1) and others
* commit 'ff26e25b51eb672a4c8244946e0f2b4328786f55':
  Upgrade libm.
2013-02-04 11:29:22 -08:00
The Android Automerger
37247ae63c merge in jb-mr2-release history after reset to master 2013-02-04 07:10:06 -08:00
Brian Muramatsu
322c7edba3 Remove MSM headers
Bug 7115545

These headers will be moved to hardware/qcom/msm8960 project.

Change-Id: Idb970c196be239e186e0a406d19135aa27225aca
2013-02-01 16:28:40 -08:00
The Android Automerger
3c72524611 merge in jb-mr2-release history after reset to master 2013-01-31 07:10:09 -08:00
Elliott Hughes
8db7a4cb20 am 9743d7fb: am fb55511e: am e1a124e5: Merge "Say explicitly if there were no leaks."
# Via Android Git Automerger (2) and others
* commit '9743d7fb60836229fde0fbdbd9fb87c78eaa00b7':
  Say explicitly if there were no leaks.
2013-01-30 12:27:12 -08:00
Elliott Hughes
0243962d20 am 9d43c079: am 4e882503: am a990cf5b: Merge "Clean up trailing whitespace in the kernel headers."
# Via Android Git Automerger (2) and others
* commit '9d43c079875ebd2540daccb180e9d6d0fa06061d':
  Clean up trailing whitespace in the kernel headers.
2013-01-30 10:33:52 -08:00
The Android Automerger
4c59597089 merge in jb-mr2-release history after reset to master 2013-01-30 07:10:15 -08:00
Elliott Hughes
8dfe0daf6f am 5821e11d: am 7bc49fcf: am 323287ea: Merge "Fix valgrind build."
# Via Android Git Automerger (2) and others
* commit '5821e11d0b577fda45b81f0c9ea13c1c1c5de1a8':
  Fix valgrind build.
2013-01-29 18:11:34 -08:00
Elliott Hughes
278c059663 am 9d995d67: am 1cc09402: am f6721978: Merge "Fix x86 build to use <elf.h>."
# Via Android Git Automerger (2) and others
* commit '9d995d67217e44e022c9e5d0767634fa81f87b78':
  Fix x86 build to use <elf.h>.
2013-01-29 17:09:13 -08:00
Elliott Hughes
d9397a7c5e am 0a383883: am be11de2b: am 5fb409b7: Merge "Bring the NOTICE files back up to date."
# Via Android Git Automerger (2) and others
* commit '0a383883fa3d358ff4af6b653a0918f4cd01ef7e':
  Bring the NOTICE files back up to date.
2013-01-29 17:09:12 -08:00
Elliott Hughes
a1b8c145cb am a7f44b5a: am 172e038f: am f09f6db5: Merge "Use the NetBSD <sys/exec_elf.h>."
# Via Android Git Automerger (2) and others
* commit 'a7f44b5afe64199eeee715e613c7d42d2724232c':
  Use the NetBSD <sys/exec_elf.h>.
2013-01-29 17:09:11 -08:00
Elliott Hughes
3638641014 am f5d6238c: am 3f20ecc2: am 3db2fc5a: Merge "Don\'t collect useless stack frames; do demangle C++ symbols."
# Via Android Git Automerger (2) and others
* commit 'f5d6238c4b6433f193c6d06c1dd89110b497e449':
  Don't collect useless stack frames; do demangle C++ symbols.
2013-01-29 12:09:31 -08:00
The Android Automerger
2a523d1a06 merge in jb-mr2-release history after reset to master 2013-01-29 07:10:09 -08:00
Elliott Hughes
62228694a0 am 2218b89c: am d383ac15: am a0151cbf: Merge "Unit tests for formatting code, fix %%."
# Via Android Git Automerger (2) and others
* commit '2218b89ca7017e3f1cdb0641528787cd9985501a':
  Unit tests for formatting code, fix %%.
2013-01-28 14:14:44 -08:00
The Android Automerger
8482fbb691 merge in jb-mr2-release history after reset to master 2013-01-28 07:10:05 -08:00
Elliott Hughes
609ca692a9 am d265d367: am f07db754: am 0a91b11d: Merge "More debug malloc fixes."
# Via Android Git Automerger (2) and others
* commit 'd265d3674937651d23a0252e6aad0ee09b02492a':
  More debug malloc fixes.
2013-01-25 18:11:55 -08:00
Iliyan Malchev
ac10757e2a Merge "bionic: update processed msm_vidc_enc.h" 2013-01-26 01:41:55 +00:00
Elliott Hughes
98ce9888b1 am 88af7232: am 7ae99845: am 6a94cb74: Merge "arm syscall : for eabi call_default don\'t use stack"
# By Matthieu Castet
# Via Android Git Automerger (2) and others
* commit '88af723267e86c7b2a685f97c6e442d3766ad9a9':
  arm syscall : for eabi call_default don't use stack
2013-01-25 17:11:52 -08:00
Nick Kralevich
85e76a3652 am 2ebcd19c: am 27818d2a: am b871e5d6: Merge "system_properties: do more checking of file"
# Via Android Git Automerger (2) and others
* commit '2ebcd19cbc42c5edce189df630a48feb9ffec16d':
  system_properties: do more checking of file
2013-01-25 17:11:51 -08:00
Iliyan Malchev
3eaa03df03 bionic: update processed msm_vidc_enc.h
Change-Id: If9aeec6f43b8b2951d1372042c884cd0e01f0a5a
Signed-off-by: Iliyan Malchev <malchev@google.com>
2013-01-25 11:26:53 -08:00
The Android Automerger
0f01df7fc9 merge in jb-mr2-release history after reset to master 2013-01-25 07:10:05 -08:00
Nick Kralevich
ddbb728eff am 151e91e6: am da2d2c61: am 82ef8296: Merge "prctl.h: include sys/cdefs.h"
# Via Android Git Automerger (2) and others
* commit '151e91e66c95a7e415903b87b8157a9bc422df45':
  prctl.h: include sys/cdefs.h
2013-01-24 16:15:39 -08:00
Nick Kralevich
472fdc95a6 am b8726037: am e7d937b5: am b3351f12: Merge "libc: use more secure system properties if available"
* commit 'b8726037ee1100e2704e90d0a54ea2313bf96b00':
  libc: use more secure system properties if available
2013-01-23 16:16:06 -08:00
Nick Kralevich
f5b111df06 am b8726037: am e7d937b5: am b3351f12: Merge "libc: use more secure system properties if available"
* commit 'b8726037ee1100e2704e90d0a54ea2313bf96b00':
  libc: use more secure system properties if available
2013-01-23 11:12:07 -08:00
The Android Automerger
d72183aa16 merge in jb-mr2-release history after reset to master 2013-01-23 07:10:07 -08:00
Elliott Hughes
828aaaac5e am c08ab018: am 40107623: am 778a68e1: Merge "Don\'t free anything when reporting leaks."
* commit 'c08ab018ad133a4e177013d79be547fd55968eac':
  Don't free anything when reporting leaks.
2013-01-22 22:16:11 -08:00
Elliott Hughes
9d28f5bf4a am ce8732b1: am 552e02fa: am 5c8f75ef: Merge "Disable leak checking for mksh; it\'s way too leaky."
* commit 'ce8732b188d96f4c313d20e6be17362a508f572d':
  Disable leak checking for mksh; it's way too leaky.
2013-01-22 22:16:10 -08:00
Elliott Hughes
28fa8e109e am a8e0f2b9: am b16ec162: am 28f82b26: Merge "Add const for first argument of sigismember for fit POSIX spec"
* commit 'a8e0f2b956b5a31311d778b478e63093bc2cac7a':
  Add const for first argument of sigismember for fit POSIX spec
2013-01-22 17:31:20 -08:00
Elliott Hughes
7f0976ef0e am 5f79f75b: am 57edf36c: am 8d6302cd: Merge "Our strcoll(3) is no different from NetBSD\'s, so take exactly theirs."
* commit '5f79f75ba6241ca9cab42e69a68d66d1ca28e031':
  Our strcoll(3) is no different from NetBSD's, so take exactly theirs.
2013-01-22 15:36:26 -08:00
Elliott Hughes
774cef56ee am ad551eaa: am 5f7b6b83: am 547eba0a: Merge "Avoid overflow in memccpy."
* commit 'ad551eaa0429bf5085f2901c5d367e8a54b7ed16':
  Avoid overflow in memccpy.
2013-01-22 15:23:53 -08:00
Elliott Hughes
bdd209561e am 1029364e: am e8e1f34a: am 85597e2b: Merge "Clean up debuggerd-related logging."
* commit '1029364ec5710755164ec9a7f0fe625cc184bb60':
  Clean up debuggerd-related logging.
2013-01-22 15:23:49 -08:00
Elliott Hughes
0b9b068b3f am 0dfb2eca: am 0609c0fe: am 7af7895e: Merge "Use the new non-allocating logging for dlmalloc failures."
* commit '0dfb2ecaab681e27fa81462daec9882ebcf36edc':
  Use the new non-allocating logging for dlmalloc failures.
2013-01-22 15:23:48 -08:00
Nick Kralevich
f27874740f Revert "libc: make system properties more secure."
This reverts commit f10c5a2215.

Bug: 8045561
2013-01-22 15:21:01 -08:00
Nick Kralevich
0acf4069e9 am 98ae1a85: am e652ed30: am 244bee5b: Merge "bionic_auxv.h: fix #define conflict"
* commit '98ae1a85b057f6534bee7e52897a80694ba8b2e1':
  bionic_auxv.h: fix #define conflict
2013-01-22 13:46:31 -08:00
Nick Kralevich
25e3f4a90d Merge "Revert "libc: make system properties more secure."" 2013-01-22 21:26:18 +00:00
Nick Kralevich
8897a9565a Revert "libc: make system properties more secure."
This reverts commit f10c5a2215.

Bug: 8045561
2013-01-22 12:44:11 -08:00
Elliott Hughes
f669fdf11e am 04afcd25: am 8ef83bc4: am 02f96b9d: Merge "Add missing extern "C"."
* commit '04afcd25a3758090009d3261f4c573b8ed73e03a':
  Add missing extern "C".
2013-01-22 11:35:50 -08:00
Elliott Hughes
16f7b78fd1 am 4cd5703b: am 75b64a1b: am ca483765: Merge "Fix the duplication in the debugging code."
* commit '4cd5703b9eef30a32271819503808576666e1601':
  Fix the duplication in the debugging code.
2013-01-22 10:05:19 -08:00
The Android Automerger
5f0de35c3e merge in jb-mr2-release history after reset to master 2013-01-21 07:10:08 -08:00
Robert Greenwalt
1136b7d821 Merge "Revert "dns cache per interface iteration 2"" 2013-01-19 00:40:38 +00:00
Robert Greenwalt
b002a2ff77 Revert "dns cache per interface iteration 2"
This reverts commit f1464ff956

Change-Id: I3496b9a8cb54614fe3eea016d1391c8a89f3db38
2013-01-19 00:40:24 +00:00
Geremy Condra
b1d1a7682f Merge "libc: make system properties more secure." 2013-01-19 00:26:23 +00:00
Nick Kralevich
f10c5a2215 libc: make system properties more secure.
Currently, system properties are passed via the environment
variable ANDROID_PROPERTY_WORKSPACE and a file descriptor passed
from parent to child. This is insecure for setuid executables,
as the environment variable can be changed by the caller.

Modify system property handling so that we get the properties
from a root owned properties file, rather than using an
environment variable.

Related to bug: 8029617

Change-Id: I5717e51f20f9e4339ed0a1fdf2fc797e52670fbb
2013-01-18 14:30:07 -08:00
Nick Kralevich
c82bc4f472 am 9468ee53: am f246ae98: am 5496bbf6: Merge "Revert "Filter ANDROID_PROPERTY_WORKSPACE""
* commit '9468ee53ac01a86255bd00976d8aa5a1a4141020':
  Revert "Filter ANDROID_PROPERTY_WORKSPACE"
2013-01-18 14:01:54 -08:00
The Android Automerger
f73a885f53 merge in jb-mr2-release history after reset to master 2013-01-18 07:10:09 -08:00
Guang Zhu
bf1d225593 Revert "Filter ANDROID_PROPERTY_WORKSPACE"
Temporarily revert the change since DNS resolution seems
broken right now in ping util.

Bug: 8029617

This reverts commit a0f64756a4.
2013-01-17 23:25:24 -08:00
Nick Kralevich
c5c99adeed am 8e833972: am 0a0c2321: am 4bfaf1e5: Merge "FORTIFY_SOURCE: optimize"
* commit '8e833972c2506267024136a0f609bdbb26dcc498':
  FORTIFY_SOURCE: optimize
2013-01-17 17:08:21 -08:00
Elliott Hughes
e230306135 am a4723742: am 261e9d08: am e4ca88d9: Merge "Add functionlity to the scripts to replace tokens in kernel headers based on architecture."
* commit 'a4723742c1ee0daa2ec17a148334c548b5edf3a8':
  Add functionlity to the scripts to replace tokens in kernel headers based on architecture.
2013-01-17 16:53:57 -08:00
Nick Kralevich
dbcf3ed458 am 36c4eb18: am 3a72fe58: am f3fe1945: Merge "linker: add -Wl,--exclude-libs,ALL to LDFLAGS"
* commit '36c4eb188c6594db877bd7b9f46c55264180dc3f':
  linker: add -Wl,--exclude-libs,ALL to LDFLAGS
2013-01-17 11:34:20 -08:00
Robert Greenwalt
89f9b30e4d Merge "dns cache per interface iteration 2" 2013-01-17 16:14:52 +00:00
The Android Automerger
ff1c00a29e merge in jb-mr2-release history after reset to master 2013-01-17 07:10:10 -08:00
Nick Kralevich
927d904d52 am 91bc5865: am 8d01c055: am 1271cdc1: Merge "Revert "stack protector: use AT_RANDOM""
* commit '91bc5865a333212e7cac934b0a2ac7c522911d58':
  Revert "stack protector: use AT_RANDOM"
2013-01-16 13:58:04 -08:00
Nick Kralevich
bcd18c0485 am 27ff1ae4: am de666485: am ba117e41: Merge "stack protector: use AT_RANDOM"
* commit '27ff1ae414915789b27d0a485ff6d856ae742aad':
  stack protector: use AT_RANDOM
2013-01-16 13:34:46 -08:00
Nick Kralevich
dde6b88a9f am 079e4356: am 30894bdf: am 1b34228b: Merge "Filter ANDROID_PROPERTY_WORKSPACE"
* commit '079e4356550030e8bacec86b8aa058ade2b7142c':
  Filter ANDROID_PROPERTY_WORKSPACE
2013-01-16 13:34:45 -08:00
Elliott Hughes
31ecd0c342 am b989c9ce: (-s ours) Revert "DO NOT MERGE Revert "Add the libcutils localtime_tz and mktime_t extensions to bionic.""
* commit 'b989c9ceda71f6f75112645b5c45af341275cbab':
  Revert "DO NOT MERGE Revert "Add the libcutils localtime_tz and mktime_t extensions to bionic.""
2013-01-16 13:31:35 -08:00
The Android Automerger
b3aff045b2 merge in jb-mr2-release history after reset to master 2013-01-16 10:08:57 -08:00
Elliott Hughes
1a18895ebc am e05709b1: am e611fad0: am 14e1975e: Merge "Fix signalfd for MIPS."
* commit 'e05709b1df7dba98c37e83f84dcbd2ad8429bcfc':
  Fix signalfd for MIPS.
2013-01-16 09:50:42 -08:00
Elliott Hughes
7cfe0d2602 am 04aa0fdd: (-s ours) am 42c5847d: (-s ours) am 791e26d9: (-s ours) Merge "Revert "DO NOT MERGE Revert "Add the libcutils localtime_tz and mktime_t extensions to bionic."""
* commit '04aa0fdda60b6a492e572c2a79f21c732e8c33c8':
  Revert "DO NOT MERGE Revert "Add the libcutils localtime_tz and mktime_t extensions to bionic.""
2013-01-15 13:40:39 -08:00
Nick Kralevich
0112ee2190 am d29c9fc1: am b59e358b: Merge "fix strerror_r test"
* commit 'd29c9fc18860a41f59d390b4aab937b61dd63ea1':
  fix strerror_r test
2013-01-15 11:20:23 -08:00
Ben Cheng
6405103a32 am 4130af46: am b09d7d86: Merge "Add __aeabi_idiv to the dummy reference list."
* commit '4130af46bf120ac82ed61453215c7a692d84c1dd':
  Add __aeabi_idiv to the dummy reference list.
2013-01-14 18:01:35 -08:00
Nick Kralevich
9e22af2363 am 1519690c: am 29fe857e: Merge "headers: update auxvec.h from Linux kernel"
* commit '1519690cfb27af79627a8d39bf158a1feca953e3':
  headers: update auxvec.h from Linux kernel
2013-01-14 14:38:36 -08:00
Ben Cheng
86050b9e92 Merge "Add __aeabi_idiv to the dummy reference list." 2013-01-14 13:36:33 -08:00
Ben Cheng
a4e964d200 Add __aeabi_idiv to the dummy reference list.
If the platform code is compiled with -mcpu=cortex-a15, then without this
change prebuilt libraries built against -march=armv7 cannot resolve the
dependency on __aeabi_idiv (provided by libgcc.a).

Bug: 7961327

Change-Id: I0a05ce9c44e44d39b8ce1f0e319e2d37a010f3c7
2013-01-14 11:27:29 -08:00
Ian Rogers
7f7f232f4a am 763d4bb3: am 68fa57f0: Merge "Name anonymous mmap mallocs."
* commit '763d4bb345b2e8882dd39d0656ee9f23ca1d0512':
  Name anonymous mmap mallocs.
2013-01-14 11:22:56 -08:00
Nick Kralevich
1165da8390 am 13bd3716: am bb897fa9: Merge "libc_init_static: apply relro earlier."
* commit '13bd37160ee340ddcf7e1fb57251b124e0ec69c1':
  libc_init_static: apply relro earlier.
2013-01-14 10:34:45 -08:00
Elliott Hughes
32cefdbc7a am 375db86a: am 09d13c39: Merge "Fix my git mistake."
* commit '375db86aeaedfe716b69a62f81a2484ee446d5e5':
  Fix my git mistake.
2013-01-14 10:34:44 -08:00
Elliott Hughes
14ab1a63d6 am bc3c7183: am 48c632a3: Merge "[MIPS] Set DT_DEBUG dyntab entry if it is writable"
* commit 'bc3c718346d81c04451c35c2d8fb00c68b0a815d':
  [MIPS] Set DT_DEBUG dyntab entry if it is writable
2013-01-14 09:50:50 -08:00
The Android Automerger
76c8c61517 merge in master-release history after reset to master 2013-01-14 07:49:05 -08:00
Nick Kralevich
8ffe08c86b am fdd6dfa8: am 2c5153b0: libc: add getauxval()
* commit 'fdd6dfa863ea73251b5d59990e239854c31ecee3':
  libc: add getauxval()
2013-01-11 17:04:04 -08:00
Mattias Falk
f1464ff956 dns cache per interface iteration 2
name server addresses are read from the dns
cache associated wih the interface on which
the request shall be done.

processes which has requested to issue dns request
using specific interface are now proxied to netd.

added methods to attach/detach a process to a specific
dns cache/interface.

added getaddrinfoforinface method which takes an
interface as an argument.

Change-Id: I851ec8ab8ce3112626ad2a729078b91d013f32fd
bug:4815099
bug:5465296
2013-01-11 15:47:27 -08:00
Nick Kralevich
0529a52c60 am d0f81466: am 69c89942: Merge "Add stack canaries / strcpy tests."
* commit 'd0f81466e4e8e4179054a484cf6145efedfd7cb5':
  Add stack canaries / strcpy tests.
2013-01-11 11:31:07 -08:00
Wink Saville
8deebb34d3 am 801aeefe: am a12c5445: Fix unused warnings in pthread.c
* commit '801aeefe2d77a957172c3994f1c20cd0ac8d9bd8':
  Fix unused warnings in pthread.c
2013-01-11 10:54:50 -08:00
Elliott Hughes
376889ad71 am 0f9be1ea: am bfde0b6f: Merge "glibc 2.15 treats errno as signed in strerror(3)."
* commit '0f9be1eaee5a9367fb2f8c6ed86ed2fc1faa70b9':
  glibc 2.15 treats errno as signed in strerror(3).
2013-01-11 10:54:43 -08:00
Elliott Hughes
73dd37d8fe am 34c7a3c2: am 0d3700d9: Merge "Only have one copy of the kernel_sigset_t hack, and add more tests."
* commit '34c7a3c2b0ec50a749e25bd786e670025a6f1c5b':
  Only have one copy of the kernel_sigset_t hack, and add more tests.
2013-01-11 10:54:25 -08:00
Elliott Hughes
7e29f81163 am 4ff6fa97: am 2bbb8fac: Merge "Add signalfd call to bionic"
* commit '4ff6fa97e7cf247e17600cf0d64911c1579df841':
  Add signalfd call to bionic
2013-01-11 10:54:02 -08:00
The Android Automerger
ef06105819 merge in master-release history after reset to master 2013-01-11 07:49:08 -08:00
Robert Greenwalt
d09bdc7148 Merge "Cache negative DNS results." 2013-01-10 14:30:37 -08:00
Elliott Hughes
19dd1567a0 Revert "Add signalfd call to bionic"
This reverts commit 0c11611c11

Change-Id: I1a2beae7ed66ec995fdf6c96c53c35598ac6cde0
2013-01-10 10:47:58 -08:00
Rom Lemarchand
0c11611c11 Add signalfd call to bionic
Add signalfd() call to bionic.

Adding the signalfd call was done in 3 steps:
- add signalfd4 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.
- create the signalfd wrapper in signalfd.cpp and add
  the function prototype to sys/signalfd.h

Change-Id: I7ee1d3e60d5d3e1c73d9820e07d23b9ce6e1a5ab
2013-01-10 10:25:42 -08:00
Robert Greenwalt
78851f10d1 Cache negative DNS results.
Find the TTL for the negative results using the minimum of
the SOA records TTL or the MINIMUM-TTL field (RFC-2308).

bug:5926539
Change-Id: I6d39c9fb558afcb7a4a5bc014d97dab4a85c0d4f
2013-01-09 16:36:33 -08:00
The Android Automerger
8868be3a9f merge in master-release history after reset to master 2013-01-09 07:49:04 -08:00
Elliott Hughes
5043c376c9 am 5c5fe07e: am 364d9ee6: Merge "Don\'t test GNU-style ELF hashes on MIPS."
* commit '5c5fe07e43a20cd28c20bbf7a4a0443062ef144f':
  Don't test GNU-style ELF hashes on MIPS.
2013-01-08 10:27:20 -08:00
Elliott Hughes
76187899a6 am 79cecbd4: am 7e22db03: Merge "Fix an off-by-one error in the sigset_t function error handling."
* commit '79cecbd42187c13cfdb5462c93de42168e56f49b':
  Fix an off-by-one error in the sigset_t function error handling.
2013-01-08 10:27:15 -08:00
Elliott Hughes
375e10f739 am 2458d06f: am 26c5b2d4: Merge "[MIPS] Rewrite fenv.h for Android"
* commit '2458d06fc17ade76a8e2ae980a1e38f36350c6ee':
  [MIPS] Rewrite fenv.h for Android
2013-01-08 10:27:14 -08:00
The Android Automerger
326cb73c58 merge in master-release history after reset to master 2013-01-04 07:49:06 -08:00
Elliott Hughes
00ab4eb0db am ec137019: am 63dc5927: Merge "Add AF_CAN and PF_CAN (and other missing families)."
* commit 'ec1370191e3f0a8aedb8d77d1cec9a8aa58ebdd3':
  Add AF_CAN and PF_CAN (and other missing families).
2013-01-03 17:05:12 -08:00
Elliott Hughes
8dd63f31ba am 81508de3: am f0036944: Merge "Fix debug malloc."
* commit '81508de3d277db2ef3c8aa55b57ce3ce0a142e48':
  Fix debug malloc.
2013-01-03 16:47:22 -08:00
Elliott Hughes
27a7a5c138 am c654f4fd: am b1b53177: Merge "sysconf.c was renamed to sysconf.cpp (and modified)..."
* commit 'c654f4fda8f1b38109669cf0f5cb8a7d43860974':
  sysconf.c was renamed to sysconf.cpp (and modified)...
2013-01-03 12:10:17 -08:00
The Android Automerger
5c532dc8ee merge in master-release history after reset to master 2013-01-03 07:49:09 -08:00
Elliott Hughes
e9d6575e10 am 1287d106: am fb62558b: Merge "Define _POSIX_MONOTONIC_CLOCK and implement sysconf(_SC_MONOTONIC_CLOCK)."
* commit '1287d106ed235e7366912bc7ab09df532848dd7a':
  Define _POSIX_MONOTONIC_CLOCK and implement sysconf(_SC_MONOTONIC_CLOCK).
2013-01-02 16:35:08 -08:00
The Android Automerger
803bd660b6 merge in master-release history after reset to master 2012-12-31 07:49:13 -08:00
Elliott Hughes
36a9f354c0 am c0c05ff8: am 918d776f: Merge "Support System.loadLibrary for libraries with transitive dependencies."
* commit 'c0c05ff8ecfe5f27aedcd6315e191245aa7b4824':
  Support System.loadLibrary for libraries with transitive dependencies.
2012-12-28 09:48:19 -08:00
Elliott Hughes
0ce87c8984 am df5c77c9: am f6524f8b: Merge "Fix format_number."
* commit 'df5c77c91a276a79d05f58241df3695b56422d54':
  Fix format_number.
2012-12-28 09:46:53 -08:00
The Android Automerger
2937d9ab54 merge in master-release history after reset to master 2012-12-20 07:49:12 -08:00
Elliott Hughes
d020802e37 am 5fd31f68: am 4b582142: Merge "Fix x86 dynamic linker build."
* commit '5fd31f6891a6e0b5db84c4c7992d0a4b08f3dddd':
  Fix x86 dynamic linker build.
2012-12-19 09:51:36 -08:00
The Android Automerger
efe3ca7b48 merge in master-release history after reset to master 2012-12-19 07:49:06 -08:00
Elliott Hughes
05ab167cf7 am a0edecf3: am a4ebdcf5: Merge "Check for unknown flags passed to dlopen(3)."
* commit 'a0edecf3438d036ee2353076d171ee68939c2a5e':
  Check for unknown flags passed to dlopen(3).
2012-12-18 19:44:10 -08:00
The Android Automerger
b9cb7ee082 merge in master-release history after reset to master 2012-12-12 07:49:10 -08:00
Elliott Hughes
78b90c744d am 607bd477: am 4c4b08a3: Merge "Fix <endian.h> and <sys/endian.h>."
* commit '607bd47707680db36f377c5e8fc330953fd407e7':
  Fix <endian.h> and <sys/endian.h>.
2012-12-11 17:29:17 -08:00
The Android Automerger
f096529317 merge in master-release history after reset to master 2012-12-11 07:49:16 -08:00
Elliott Hughes
42d7a26d23 am f822e7f6: am 0521ff82: Merge "Use pthread_kill() in raise()"
* commit 'f822e7f68eec30bb175ccb46cd379f4a060b6c74':
  Use pthread_kill() in raise()
2012-12-10 11:42:06 -08:00
The Android Automerger
d08e76cd35 merge in master-release history after reset to master 2012-12-10 07:49:11 -08:00
Geremy Condra
edb53b3e9d am 28996f80: am 6fcf1770: Merge "Added audit.h from the kernel."
* commit '28996f80064579566d5a2ec5c69a00ef159a7e32':
  Added audit.h from the kernel.
2012-12-07 14:34:12 -08:00
Nick Kralevich
a710682db3 am 080210c1: am c8354f50: Merge "FORTIFY_SOURCE: remove memcpy overlap checks"
* commit '080210c16a3c233dacf26dda168932a475fdd40b':
  FORTIFY_SOURCE: remove memcpy overlap checks
2012-12-07 12:24:08 -08:00
Nick Kralevich
5e6213af54 am 79e1a01e: am 5dfdb701: Merge "FORTIFY_SOURCE: fix up previous commit"
* commit '79e1a01e9e994d88e17f6d11819dcfd35cfa5e19':
  FORTIFY_SOURCE: fix up previous commit
2012-12-07 12:24:07 -08:00
The Android Automerger
439bc8d540 merge in master-release history after reset to master 2012-12-06 07:49:14 -08:00
Nick Kralevich
1c88362021 am 8717c3db: am 7a34ed2b: Merge "clean up FORTIFY_SOURCE handling."
* commit '8717c3db2f864226bb68c7e26ad73fcff1212b31':
  clean up FORTIFY_SOURCE handling.
2012-12-05 08:25:37 -08:00
The Android Automerger
c3d031ee91 merge in master-release history after reset to master 2012-12-05 07:49:06 -08:00
Nick Kralevich
babe7e16a1 am ded6e3bf: am db79e827: Merge "FORTIFY_SOURCE: fortify strrchr"
* commit 'ded6e3bfca3010350d58d93f5f0f5cea256a4f73':
  FORTIFY_SOURCE: fortify strrchr
2012-12-04 11:45:28 -08:00
The Android Automerger
49dd0409e0 merge in master-release history after reset to master 2012-12-04 07:49:13 -08:00
Elliott Hughes
a03b2b075f am 3960fb60: am 60fb6833: Merge "mmap: Remove madvise() workaround"
* commit '3960fb602ce0346aecae7eede0f5d2bc1f7463ed':
  mmap: Remove madvise() workaround
2012-12-03 09:38:44 -08:00
Elliott Hughes
db11fdef1a am 43701d68: am 46d64ed2: Merge "Add argument checking to sigemptyset(3) and friends."
* commit '43701d68a90b161c64aa354a7d3e4ad9234a3174':
  Add argument checking to sigemptyset(3) and friends.
2012-12-03 07:55:38 -08:00
The Android Automerger
ae7af291e6 merge in master-release history after reset to master 2012-12-03 07:49:12 -08:00
Nick Kralevich
59b8677562 am 4140d90c: am 3acc908c: Merge "FORTIFY_SOURCE: fortify strchr"
* commit '4140d90c60e0a9b5b2f1b8ad3d17e169f7288ae9':
  FORTIFY_SOURCE: fortify strchr
2012-11-30 18:47:06 -08:00
Elliott Hughes
dcb8209409 am 7beaa502: am 16c61f08: Merge "Reduce the exposure of the __set_errno implementation detail."
* commit '7beaa5024f083431ca74ee73b01f5ad1e5b4198f':
  Reduce the exposure of the __set_errno implementation detail.
2012-11-30 14:46:50 -08:00
Elliott Hughes
2e51dc444f am 4835e6ef: am 97b70b2b: Merge "Replace .S version of x86 crtfiles with .c version"
* commit '4835e6ef519fc941651bbc13909cff971a6ec81b':
  Replace .S version of x86 crtfiles with .c version
2012-11-30 10:16:06 -08:00
The Android Automerger
3fa99562ea merge in master-release history after reset to master 2012-11-30 07:49:20 -08:00
Elliott Hughes
4ef6bc2e62 am 55210f74: am 07c0b73a: Merge "Remove (near-)duplicate definitions of size_t and ssize_t."
* commit '55210f74c71899b16f068bf30d7c9c5e647c490d':
  Remove (near-)duplicate definitions of size_t and ssize_t.
2012-11-29 19:45:27 -08:00
Elliott Hughes
4ad0910774 am c5861c09: am 50e62e40: Merge "Bug: __WINT_TYPE__ and wint_t reference to different types"
* commit 'c5861c09d5be632c2d42a8dcbd3eba97bdf80e0d':
  Bug: __WINT_TYPE__ and wint_t reference to different types
2012-11-29 15:59:48 -08:00
The Android Open Source Project
e12a238d41 am d6d5cbb0: (-s ours) Reconcile with jb-mr1.1-release - do not merge
* commit 'd6d5cbb02a263bb8b5ae9e3721b3ee80575c110a':
  msm_mdp: Update header for 4 layer support
2012-11-29 15:42:37 -08:00
Elliott Hughes
e8be11969f am 9ea86011: am 99ea84b1: Merge "[MIPS] Fix the MIPS getsid system call"
* commit '9ea86011a2c379b58df8c5b92efddf6764a57084':
  [MIPS] Fix the MIPS getsid system call
2012-11-29 15:15:33 -08:00
Elliott Hughes
7492875448 am 852935b6: am 5d4b8421: Merge "Verify architecture neutral syscall numbers"
* commit '852935b68f8b516f9f3f9cdff410b6a4b0cefc28':
  Verify architecture neutral syscall numbers
2012-11-29 15:15:33 -08:00
Elliott Hughes
3b48de92c7 am 56eb0bfe: am 78114220: Merge "Define DEFFILEMODE and friends"
* commit '56eb0bfedb5747407f1db5145f571695450c178d':
  Define DEFFILEMODE and friends
2012-11-29 15:15:27 -08:00
Naseer Ahmed
80a161db5c am ef7eea55: am 940e4c9d: am f61e5020: msm_mdp: Update header for 4 layer support
* commit 'ef7eea5538308d4a6d40cf964a6676409e890c24':
  msm_mdp: Update header for 4 layer support
2012-11-29 15:12:33 -08:00
The Android Automerger
d8366eae3b merge in master-release history after reset to master 2012-11-28 07:49:16 -08:00
Elliott Hughes
321b545ad9 am dea13da3: Merge "Clean up _BYTE_ORDER definitions for better x86 portability."
* commit 'dea13da3407873e4f3fec9ba1a04b4fdacea07f4':
  Clean up _BYTE_ORDER definitions for better x86 portability.
2012-11-27 18:44:17 -08:00
The Android Automerger
947f74dc95 merge in master-release history after reset to master 2012-11-27 07:49:30 -08:00
Elliott Hughes
4867b00666 am f2de6b0f: Merge "Do not include \'\0\' when writing error messages to stderr"
* commit 'f2de6b0f6e873f9cb28682b8fc6764b0ab41c6ee':
  Do not include '\0' when writing error messages to stderr
2012-11-26 16:04:19 -08:00
Elliott Hughes
03ff63cee0 am 429b05a1: Merge "Upgrade to tzdata2012j."
* commit '429b05a1dfa71c6085590d60e0bdfa09beb50844':
  Upgrade to tzdata2012j.
2012-11-26 15:12:30 -08:00
The Android Automerger
72f43a929f merge in master-release history after reset to master 2012-11-20 07:49:04 -08:00
Nick Kralevich
c16ea16134 am 8784709a: Merge "We should use load_bias. This patch fixes MIPS NDK device exception test failures."
* commit '8784709a2cfe6d32b5fff2c6b826b8d9cbf73d7b':
  We should use load_bias.  This patch fixes MIPS NDK device exception test failures.
2012-11-19 11:08:49 -08:00
The Android Automerger
8dd20fcd88 merge in master-release history after reset to master 2012-11-19 07:49:16 -08:00
Robert Greenwalt
3269d63772 Merge "Add search domain to dns interface data." 2012-11-16 12:21:33 -08:00
Nick Kralevich
3a681c8db1 am fe07ca04: Merge "Support GNU_RELRO for static executables."
* commit 'fe07ca04e4af6c43d068df0e23dc83431053fc22':
  Support GNU_RELRO for static executables.
2012-11-16 11:27:30 -08:00
Nick Kralevich
aec9a254a2 am 170168cd: Merge "Temporarily address gcc 4.7 breakage."
* commit '170168cdf37111b45b15817fab9e3df54cbc27b7':
  Temporarily address gcc 4.7 breakage.
2012-11-16 10:42:55 -08:00
Robert Greenwalt
6f3222ea42 Add search domain to dns interface data.
This doesn't currently use this info - it's still using the system
property based data-passing.  That change is comming.

bug:6799630
Change-Id: I725463209855447cd04bf1457281f3084fffd692
2012-11-13 11:50:57 -08:00
The Android Automerger
5b3aa025f3 merge in master-release history after reset to master 2012-11-12 07:49:10 -08:00
Elliott Hughes
da273a17e7 am c079dfe4: am 6542ac03: Merge "Add a memmove(3) benchmark."
* commit 'c079dfe4153941e6da881be9a143b41a1112c2ac':
  Add a memmove(3) benchmark.
2012-11-09 22:44:35 -08:00
Elliott Hughes
02a6ca7ef5 am d86d713b: am b62e2770: Merge "Add optimized version of memset for Cortex A9"
* commit 'd86d713b6345ac9c030aeb0eedee11fc17d2fba1':
  Add optimized version of memset for Cortex A9
2012-11-09 22:44:17 -08:00
The Android Automerger
6aa473274c merge in master-release history after reset to master 2012-11-09 07:49:12 -08:00
Elliott Hughes
b3dc5c60aa am 0b25791a: am 49677dec: Merge "Add optimized version of memcpy for Cortex A9"
* commit '0b25791a2819e01b28f777901facd5db03ba6961':
  Add optimized version of memcpy for Cortex A9
2012-11-08 18:18:35 -08:00
Elliott Hughes
aad391b8a6 am 6181aead: am c2132915: Merge "Add optimized version of memcmp for Cortex A9"
* commit '6181aead7b052503518d3c4ee836b7e9ddeca157':
  Add optimized version of memcmp for Cortex A9
2012-11-08 18:11:55 -08:00
Elliott Hughes
1233104f5e am 66eada96: am 7aca3103: Merge "Simple google3-compatible benchmarking."
* commit '66eada963290104e56a3c1785ff8a08ee5d800b5':
  Simple google3-compatible benchmarking.
2012-11-08 18:11:54 -08:00
Elliott Hughes
dfaf06ac03 am 70827cc8: am d460f3f1: Merge "Tests for string routines."
* commit '70827cc85ad8f7085131ff9c8d1e69bc80f9a9f3':
  Tests for string routines.
2012-11-08 09:33:57 -08:00
The Android Automerger
930a507786 merge in master-release history after reset to master 2012-11-08 07:49:11 -08:00
Elliott Hughes
2c9590664f am e4180f85: am 5408ac3c: Merge "Fix dlopen_library_with_only_gnu_hash_Test."
* commit 'e4180f85b717a4aec8024babda394221ba177c26':
  Fix dlopen_library_with_only_gnu_hash_Test.
2012-11-07 18:36:34 -08:00
The Android Automerger
bace2c47d3 merge in master-release history after reset to master 2012-11-07 07:49:17 -08:00
The Android Open Source Project
d15c8737ce am 92b7fbf8: (-s ours) am 414aadc7: am 3bf2fcf9: Reconcile with jb-mr1-factory-release jb-mr1-release - do not merge
* commit '92b7fbf8725fed5bfa3cae7c26d09e813b3ae920':
2012-11-06 11:18:49 -08:00
Elliott Hughes
d052eb6b47 am 8baaf6ff: am 604a163e: Merge "Rewrite <fenv.h> for ARM."
* commit '8baaf6ff9617ea5d0e49ca4a954c1b01cc306cbc':
  Rewrite <fenv.h> for ARM.
2012-11-05 16:57:23 -08:00
Elliott Hughes
dc20297f8d am 06224085: am bb91e9fb: Merge "Upgrade to tzdata2012i."
* commit '062240853d75a795db956965cacd4ab09a959ce7':
  Upgrade to tzdata2012i.
2012-11-05 11:34:20 -08:00
Elliott Hughes
da71c7d9a3 am ce876beb: am a41e6426: Merge "Tone down some of the overly-verbose linker logging."
* commit 'ce876bebf250d386a06ebc1145c6959e30bf413c':
  Tone down some of the overly-verbose linker logging.
2012-11-05 09:21:57 -08:00
The Android Automerger
5793235ec4 merge in master-release history after reset to master 2012-11-05 07:49:21 -08:00
Elliott Hughes
f1566fd692 am bc35807f: am 9df2e000: Merge "Cleaning the linker environment as we initialize it requires less API."
* commit 'bc35807fc6c5f11b6d057b20250d41ebc419da62':
  Cleaning the linker environment as we initialize it requires less API.
2012-11-02 13:58:48 -07:00
Elliott Hughes
d752fc0286 am cfb47daf: am 01271b18: Merge "Make dynamic linker debugging always available."
* commit 'cfb47daf4eb4741ac462c7350c73ad1cf96cf83f':
  Make dynamic linker debugging always available.
2012-11-02 13:58:47 -07:00
Elliott Hughes
1d0129b1b2 am cdc5a17c: am ed537239: Merge "Adjust symbol lookup for DT_SYMBOLIC case"
* commit 'cdc5a17cef00c49086e1bfe4c3715d2ebd61addb':
  Adjust symbol lookup for DT_SYMBOLIC case
2012-11-02 11:39:02 -07:00
The Android Automerger
80bcf54766 merge in master-release history after reset to master 2012-11-02 07:49:13 -07:00
Elliott Hughes
eb15e1d485 am e109930e: am dc77a228: Merge "Allow dlopen("egl/blah.so")."
* commit 'e109930e9fd0922280e6f74b3df270093ee95fa6':
  Allow dlopen("egl/blah.so").
2012-11-01 23:10:56 -07:00
Elliott Hughes
ceda36fa12 am 7f7ac8cd: am e3c7b519: Merge "Don\'t corrupt the thread list if the main thread exits."
* commit '7f7ac8cd19f1a7fc61aa640505747dee9036fa61':
  Don't corrupt the thread list if the main thread exits.
2012-11-01 17:39:12 -07:00
Elliott Hughes
d781dfdb09 am 6db8f5bb: am d30116cf: Merge "Keep the dynamic linker\'s soinfo pools mostly read-only."
* commit '6db8f5bb75bb79e0b4873e6d293aa25e2c9f090b':
  Keep the dynamic linker's soinfo pools mostly read-only.
2012-11-01 17:02:23 -07:00
Elliott Hughes
02c3513e5f am 65ba5b62: am 064f862d: Merge "Stop defining our own PAGE_SIZE and PAGE_MASK, and test dlclose(3) too."
* commit '65ba5b62c5a59181317b86f772d9ebb756d4741f':
  Stop defining our own PAGE_SIZE and PAGE_MASK, and test dlclose(3) too.
2012-11-01 14:15:11 -07:00
Elliott Hughes
00fe4a20d7 am 3bb62578: am 0be1819b: Merge "Dynamically allocate soinfo-structs in linker"
* commit '3bb62578beb36a35d3b1d2fbe18bd34a9d4ecca4':
  Dynamically allocate soinfo-structs in linker
2012-11-01 11:47:31 -07:00
The Android Automerger
7a6ae1d667 merge in master-release history after reset to master 2012-11-01 07:49:21 -07:00
Elliott Hughes
e892414bd3 am 1de3af51: am c0ac7eba: Merge "Reject .so files with no sysv hash table."
* commit '1de3af51d459c2ced602f10e4f7e7fe704400cdc':
  Reject .so files with no sysv hash table.
2012-10-31 15:15:45 -07:00
Elliott Hughes
a4242290a1 am f510fc78: am b46530bd: Merge "Start cleaning up libm."
* commit 'f510fc789a67344080543b9ae06d0ff3322561d5':
  Start cleaning up libm.
2012-10-31 13:54:18 -07:00
The Android Open Source Project
b5b52e73e9 am 089111a8: (-s ours) Reconcile with jb-mr1-release - do not merge
* commit '089111a80a6a167de827bf32ae2d2a935ff5874f':
2012-10-31 09:19:14 -07:00
The Android Automerger
a9b0cd68de merge in master-release history after reset to master 2012-10-31 07:49:21 -07:00
Elliott Hughes
8478dbc85f am 3cd7a165: am 084be591: Merge "linker: handle R_ARM_COPY relocations in a proper way"
* commit '3cd7a1653aa579213cb68a666bd9949e2b8fff95':
  linker: handle R_ARM_COPY relocations in a proper way
2012-10-30 17:20:01 -07:00
Elliott Hughes
864d48917a am 914112ea: am 155e8d1d: Merge "More dynamic linker cleanup."
* commit '914112ea21a62c7658dc4b094a369358009be6a9':
  More dynamic linker cleanup.
2012-10-30 16:59:17 -07:00
Elliott Hughes
08c4e30e23 am b0ac82e9: Merge commit \'bd8ee3d3\' into mm
* commit 'b0ac82e9baf969236be1174b49784500b33e6f48':
  Upgrade to tzdata2012h.
2012-10-30 15:24:37 -07:00
Elliott Hughes
4d2ea14288 am 4569ab97: am 06b59610: Merge "Fix bug in pthread_join, pthread_exit, pthread_detach"
* commit '4569ab9773efb1c984bde146002975e7a3753f11':
  Fix bug in pthread_join, pthread_exit, pthread_detach
2012-10-30 13:06:47 -07:00
Elliott Hughes
c7358ee57c am 743a273e: am 1f21ece4: Merge "Clean up the <libgen.h> implementation a little, bring in tests."
* commit '743a273e40e49c199d79462338fc606ae12c999f':
  Clean up the <libgen.h> implementation a little, bring in tests.
2012-10-30 10:11:44 -07:00
Elliott Hughes
7d617d0db9 am 5f787190: am 4d36b0bd: Merge "Fix the pthread_join on self error case."
* commit '5f787190a9e7a749d95f566f920b78eafcd05050':
  Fix the pthread_join on self error case.
2012-10-30 10:11:43 -07:00
Elliott Hughes
5e805afa79 am 0b8fa1d4: am 9297af94: Merge "Fix a potential NULL pointer dereference in _init_thread()."
* commit '0b8fa1d456f6cf831be41a6dc6b0a67e89f01bd5':
  Fix a potential NULL pointer dereference in _init_thread().
2012-10-30 10:11:42 -07:00
Elliott Hughes
d4834a217e am 40e467ec: am 33c4a3ad: Merge "libc: Fix alphasort() signature (and implementation)."
* commit '40e467ec668b59be25491bd44bf348a884d6a68d':
  libc: Fix alphasort() signature (and implementation).
2012-10-30 10:11:41 -07:00
Elliott Hughes
5ce5edd6cf am 85765609: am 8f9a1eb1: Merge "Upgrade to tzdata2012h."
* commit '8576560979e3d126ef8204959b87336d980b390b':
  Upgrade to tzdata2012h.
2012-10-30 10:11:40 -07:00
Elliott Hughes
96b52e104a am a67cedb5: am 9e783963: Merge "Clean up the implementation of the <dirent.h> functions."
* commit 'a67cedb52cb57f116a545482bddb979d995fd634':
  Clean up the implementation of the <dirent.h> functions.
2012-10-30 10:11:39 -07:00
The Android Automerger
5b006f3d08 merge in master-release history after reset to master 2012-10-26 07:49:10 -07:00
Elliott Hughes
4e0b489a0c am 8cacc639: am 7193731a: Merge "Workaround g++ 4.7 compfail"
* commit '8cacc639b6ae660c494aca07c537cb443c6c6cd9':
  Workaround g++ 4.7 compfail
2012-10-25 15:23:29 -07:00
Elliott Hughes
a7bb83475b am 85819efe: am f2b3ac95: Merge "Fix recovery: don\'t assert if there\'s no tzdata."
* commit '85819efe8f771759d12ab86f0bd47ede621dbb7d':
  Fix recovery: don't assert if there's no tzdata.
2012-10-25 15:16:44 -07:00
Elliott Hughes
0f96dd8dcb am df7f24f3: am 7b68e3f7: Merge "Per-thread -fstack-protector guards for x86."
* commit 'df7f24f310ee3ceb1dc9413d59d5a8816eb584ef':
  Per-thread -fstack-protector guards for x86.
2012-10-25 12:23:56 -07:00
The Android Automerger
2654447c0e merge in master-release history after reset to master 2012-10-25 07:52:10 -07:00
Elliott Hughes
4cdc426207 am 60c7ac26: am d0f2b7e7: Merge "More upstream NetBSD upgrades."
* commit '60c7ac262241588f7942ca068f33d706c8fe5cc4':
  More upstream NetBSD upgrades.
2012-10-23 17:29:47 -07:00
Elliott Hughes
217e616772 am 45f07555: am e3dbe1e3: Merge "Upgrade more functions to the current upstream NetBSD copy."
* commit '45f075556b26cfe91b1b7e1299b54f0328a06acb':
  Upgrade more functions to the current upstream NetBSD copy.
2012-10-23 13:58:25 -07:00
Elliott Hughes
1d212fa6eb am 4280143d: am fb93e6a5: Merge "Move setlocale(3) and the wchar stubs over to .cpp."
* commit '4280143d371eae2123a5d8c4d8779db159ecd1e2':
  Move setlocale(3) and the wchar stubs over to .cpp.
2012-10-22 18:08:54 -07:00
Elliott Hughes
1d8b87d2b4 am 69ec117b: am 5a9911e9: Merge "Add missing BEGIN_DECLS/END_DECLS for FORTIFY_SOURCE stdio prototypes."
* commit '69ec117b22e3e842bff15f54f3e777cdf3206d21':
  Add missing BEGIN_DECLS/END_DECLS for FORTIFY_SOURCE stdio prototypes.
2012-10-22 16:31:29 -07:00
Elliott Hughes
c866dc20bf am 9d5a96c0: am 574773b1: Merge "Clean up warnings in stubs.cpp."
* commit '9d5a96c0d9583fe9a02190ba54a855a2dcc87eb9':
  Clean up warnings in stubs.cpp.
2012-10-22 16:31:28 -07:00
Elliott Hughes
8b8cc88d39 am 75f33adc: am 4e457759: Merge "Move the FORTIFY_SOURCE helpers over to .cpp."
* commit '75f33adcb1f845ae121eb5508b120aaaa9f7a217':
  Move the FORTIFY_SOURCE helpers over to .cpp.
2012-10-22 16:00:03 -07:00
Elliott Hughes
3135c87ca8 am 008744ce: am df92635a: Merge "Support zone.tab in bionic, and remove the file format version."
* commit '008744cedaa7e3be533bbedb51dd986c6dfea987':
  Support zone.tab in bionic, and remove the file format version.
2012-10-22 15:11:07 -07:00
Elliott Hughes
9407c5c126 am 417834b1: am eb370aa3: Merge "Make bionic look in /data/misc for tzdata updates."
* commit '417834b17ee00a6b1cd4e816f632c3596f3f51c3':
  Make bionic look in /data/misc for tzdata updates.
2012-10-22 11:55:42 -07:00
Elliott Hughes
1b62d4e72e am 629a28cd: am dc595d83: Merge "Change ZoneCompator to generate the single "tzdata" file."
* commit '629a28cdf384d83a4d433de8e1299b01e42cc75e':
  Change ZoneCompator to generate the single "tzdata" file.
2012-10-19 17:24:22 -07:00
Elliott Hughes
421083359e am 58d08711: am 7a85c42b: Merge "Update generate-NOTICE.py to know about tzdata."
* commit '58d08711af5e8237d6196652d59cc4e8b8caafcf':
  Update generate-NOTICE.py to know about tzdata.
2012-10-19 17:24:21 -07:00
Elliott Hughes
933746ad7d am af72df5b: am e75c273a: Merge "Track the tzdata2012g update in the new file format."
* commit 'af72df5b98944cfb89cecb7abc05bceec0612981':
  Track the tzdata2012g update in the new file format.
2012-10-19 14:42:05 -07:00
Elliott Hughes
bde97cf154 am 98533cfa: am 88cd1a21: Merge "Upgrade to tzdata2012g."
* commit '98533cfa4b69d053e111e46bc74d8e9b2035a96e':
  Upgrade to tzdata2012g.
2012-10-19 13:53:21 -07:00
Elliott Hughes
18ee86f892 am f0af78c2: am 551ca77e: Merge "Do all the zoneinfo.* file generation in Java."
* commit 'f0af78c27bede71304a894c23fb3100d027fc74b':
  Do all the zoneinfo.* file generation in Java.
2012-10-19 13:53:20 -07:00
Elliott Hughes
174b6d0e19 am 356c0af6: am 2266e495: Merge "Switch bionic over to using libcore\'s copy of libcore.util.ZoneInfo."
* commit '356c0af60b83988bdb55970c8f29886a2fa5a672':
  Switch bionic over to using libcore's copy of libcore.util.ZoneInfo.
2012-10-19 13:22:50 -07:00
Elliott Hughes
a7bc708e0c am fb8ecd6e: am bc77942a: am f0e402db: Upgrade to tzdata2012g.
* commit 'fb8ecd6e2f20dba3b6eaf0bd6b834c2c072322c5':
  Upgrade to tzdata2012g.
2012-10-19 10:02:11 -07:00
Elliott Hughes
0f7814264c am 4d71adbc: am 10225071: Merge "Fixes x86 build."
* commit '4d71adbc0d12e5153f537f84cce8d9686762e5b9':
  Fixes x86 build.
2012-10-18 13:58:18 -07:00
Elliott Hughes
c0e8400361 am 79c6a8d2: am ca7466d2: Merge "Make bionic\'s dependency on the tzdata explicit."
* commit '79c6a8d2b163e40eb6f19bbf8f59eb85fb7996e6':
  Make bionic's dependency on the tzdata explicit.
2012-10-18 13:40:19 -07:00
Elliott Hughes
c63dda22dd am 1b315363: am 5ae762a3: Merge "Pull bionic\'s time zone data from the new single \'tzdata\' file."
* commit '1b315363c22fdf53d77fc83ec0bbada32e73ccc7':
  Pull bionic's time zone data from the new single 'tzdata' file.
2012-10-18 11:02:01 -07:00
Elliott Hughes
9648b588b4 am e5c8ced4: am 9ffaabcc: Merge "Remove obsolete CHANGES.TXT and ISSUES.TXT."
* commit 'e5c8ced4f95e97b2fadc0c64fbdbeeb023677035':
  Remove obsolete CHANGES.TXT and ISSUES.TXT.
2012-10-18 10:28:52 -07:00
Elliott Hughes
f190a16e5e am c2e4c310: am 32ea9fe5: Merge "Put all the tzdata in one file."
* commit 'c2e4c310ff9ace06be0376d649a09abb51813981':
  Put all the tzdata in one file.
2012-10-17 16:12:19 -07:00
Elliott Hughes
9eaa953642 am 06abe13c: am a2f596b6: Merge "Make dlerror(3) thread-safe."
* commit '06abe13c5f7a318eef316268d0d25d92ff128c19':
  Make dlerror(3) thread-safe.
2012-10-17 11:05:19 -07:00
David 'Digit' Turner
826215bec2 am c7dc8425: am 42ac0e50: Merge "Revert "libc: Provide ucontext_t/mcontext_t/<sys/ucontext.h>""
* commit 'c7dc842529ea6f8801164eb8b4f7d036acc53955':
  Revert "libc: Provide ucontext_t/mcontext_t/<sys/ucontext.h>"
2012-10-17 10:32:36 -07:00
David 'Digit' Turner
87f487f6ce am 423a0740: am 4136c3a2: Merge "libc: Provide ucontext_t/mcontext_t/<sys/ucontext.h>"
* commit '423a0740b536f688b0c1866437dfe59e06413435':
  libc: Provide ucontext_t/mcontext_t/<sys/ucontext.h>
2012-10-17 07:34:57 -07:00
Elliott Hughes
2734345095 am ee7a28c5: am a9944cfe: Merge "LONG_LONG_MIN/MAX: Move declarations to <limits.h>"
* commit 'ee7a28c529dad9f51aa86271350a4e2d7cddc9d4':
  LONG_LONG_MIN/MAX: Move declarations to <limits.h>
2012-10-15 20:25:32 -07:00
Elliott Hughes
b2d2b30a13 am 1452324f: am fcf901d5: Merge "Fix realloc(3) when chk_malloc debugging is on."
* commit '1452324ff551f3aa7f9d61186d3b9cb04f7e9d39':
  Fix realloc(3) when chk_malloc debugging is on.
2012-10-12 17:15:39 -07:00
Elliott Hughes
4089dea451 am c2483ea9: am 9434e8fe: Merge "Make the dlfcn mutex static."
* commit 'c2483ea9b63de373e7521e39162395a8c667239a':
  Make the dlfcn mutex static.
2012-10-12 11:24:25 -07:00
Elliott Hughes
66d71c8f13 am ab4e2ed1: am db4fdf1a: Merge "Fix dlerror(3)."
* commit 'ab4e2ed182011998751ff5d6c321ff5bae20c6cd':
  Fix dlerror(3).
2012-10-12 10:49:08 -07:00
The Android Open Source Project
aff37491a1 am cf3fa7f4: (-s ours) Reconcile with jb-mr1-factory-release - do not merge
* commit 'cf3fa7f45742c870f1478b1bf7717d3042d599d7':
2012-10-12 07:32:05 -07:00
Elliott Hughes
f0f052f28d am 2facd5b5: am 417fd233: Merge "Fix perf_event_open syscall for x86 and mips"
* commit '2facd5b5ef3e52b11590b4de01e17f6923a85aee':
  Fix perf_event_open syscall for x86 and mips
2012-10-11 10:43:49 -07:00
The Android Open Source Project
3622c73cfc am d1844d4b: (-s ours) Reconcile with jb-mr1-release - do not merge
* commit 'd1844d4b30a0f75ed0c30c923bea7c718ba53034':
2012-10-11 05:59:18 -07:00
Ying Wang
9ab8851756 am 06201227: am ecbded40: am 2c287e95: Set up the private variables.
* commit '0620122763502e4ec6f9939c009faaf5a890ad08':
  Set up the private variables.
2012-10-10 13:54:48 -07:00
Elliott Hughes
c41e2216f4 am 4c3d7a86: am 1ceb9824: Merge "Fix a getcwd(3) bug and make our tests run correctly under valgrind."
* commit '4c3d7a86bb568e0b3fa5c9e24d32fa1ee9404b2e':
  Fix a getcwd(3) bug and make our tests run correctly under valgrind.
2012-10-09 18:29:25 -07:00
Elliott Hughes
5a16e92eb5 am c7f654df: am b83cad79: Merge "Fix two comment typos."
* commit 'c7f654dffea47a80ba566cd05f9212c8c7359a67':
  Fix two comment typos.
2012-10-09 17:39:51 -07:00
Ying Wang
ed0570bf0c am a55f0a10: am b04598a6: Set up the private variables.
* commit 'a55f0a1007423837ff8dc26336a1976469439def':
  Set up the private variables.
2012-10-08 16:21:46 -07:00
Elliott Hughes
1cae8da8e7 am 7e785323: am 9a7366e8: am fa7e2586: Merge "Test flags before using "info""
* commit '7e7853230fcf141477d7332634858c08d8eec5b9':
  Test flags before using "info"
2012-10-03 17:44:53 -07:00
The Android Open Source Project
c34bdc957c am ae8000f3: (-s ours) Reconcile with jb-mr1-release - do not merge
* commit 'ae8000f368926478b7a1e0a56a3d3ee53c2c4a01':
2012-10-03 07:36:22 -07:00
Naseer Ahmed
2d5d80985e am 9c389255: am 6b1ba118: am 3ef4fecd: bionic: update processed msm_mdp.h
* commit '9c3892558f68ec8791283844e2d7d7326bcd3574':
  bionic: update processed msm_mdp.h
2012-10-03 01:05:02 -07:00
Andy McFadden
399f54c133 am 51c7167d: am 7c67e4e4: am 98957db5: Merge "Test flags before using "info"" into jb-mr1-dev
* commit '51c7167d2245286e3458ffb06b0b5068d8f04e1b':
  Test flags before using "info"
2012-10-02 15:28:17 -07:00
Andreas Huber
ae554abd41 am 3a0aa5e0: am cafbc940: am 2e0452cb: bionic: update processed msm_vidc_enc.h
* commit '3a0aa5e0a01c26278438513a73bc0150d5fc215c':
  bionic: update processed msm_vidc_enc.h
2012-10-02 14:44:32 -07:00
Elliott Hughes
f0a9cd7847 am 92e6de6f: am b95ad82f: am 95a2a7f3: Merge "Fix MIPS build."
* commit '92e6de6f940fee6362dd306ad77c6d7bfa56e4cb':
  Fix MIPS build.
2012-10-02 11:34:14 -07:00
Elliott Hughes
6cdf8dd025 am 80a29832: am 90172541: am b98204a9: Merge "Move non-upstream code into the libc/bionic directory."
* commit '80a298327299aa28b564941f90818911023ae544':
  Move non-upstream code into the libc/bionic directory.
2012-10-02 09:28:31 -07:00
The Android Open Source Project
4fbb1569f5 am 4cf143f1: (-s ours) Reconcile with jb-mr1-release - do not merge
* commit '4cf143f1c8e7147e696225cc852e532f50115624':
2012-10-02 09:17:27 -07:00
Elliott Hughes
95114ff5c5 am 15edd80a: am 39d7c607: am 75f43525: Merge "Always take GCC\'s definition of NULL."
* commit '15edd80a696c1b5243874f7db9ef2d753016ade8':
  Always take GCC's definition of NULL.
2012-10-01 18:23:31 -07:00
Elliott Hughes
be02504f5f am baa7ee03: am bb7dfcd3: am d3bf954e: Merge "Remove useless #defines and incorrect claims from header files."
* commit 'baa7ee0370fcb88625a666141431a4187c0f91b2':
  Remove useless #defines and incorrect claims from header files.
2012-10-01 15:54:48 -07:00
Elliott Hughes
b5d5173139 am a54d08a7: am a428bc12: am fe712e6c: Merge "Upgrade seed48 too."
* commit 'a54d08a7c15e15f24d94ca6fb97329134d4441a2':
  Upgrade seed48 too.
2012-10-01 14:48:57 -07:00
Elliott Hughes
b28c547aa4 am 6ed5bc12: am b650111a: am cd195eba: Merge "Upgrade to the current NetBSD rand implementation."
* commit '6ed5bc12dac544004f8e79b6393b2a8e260a7cc1':
  Upgrade to the current NetBSD rand implementation.
2012-10-01 14:16:53 -07:00
Elliott Hughes
7f1464c03c am 068f3398: am 0fa6279f: am 5b6346f6: Merge "bionic: linker: Need update the map->l_addr for execution."
* commit '068f33981ddaee7e397eee73ea5ea97827aabeb7':
  bionic: linker: Need update the map->l_addr for execution.
2012-10-01 09:25:18 -07:00
Jean-Baptiste Queru
eab85a379d am adc32bc3: Merge from jb-mr1-aah-dev
* commit 'adc32bc3b18576a554143631ab72dc14c1b905c3':
2012-09-28 17:08:41 -07:00
Saurabh Shah
04373fe6fe am c556da9e: am 204b26b4: bionic: Update msm_mdp.h with new MSMFB_OVERLAY_COMMIT ioctl
* commit 'c556da9ed7b0142523d349e7af8ba6492b98a683':
  bionic: Update msm_mdp.h with new MSMFB_OVERLAY_COMMIT ioctl
2012-09-28 15:52:50 -07:00
Jean-Baptiste Queru
4dc7206c94 am de1efebd: Merge from jb-mr1-aah-dev
* commit 'de1efebdcac1bfa0e30fa7fbe0b4c7860a72a6a0':
2012-09-28 15:52:31 -07:00
Elliott Hughes
326e4037e9 am 8e1a87b5: am bb892a1b: am d03bfe68: Merge "Define ssize_t if necessary."
* commit '8e1a87b5470d0708b0503c3a33580e1782e2bda2':
  Define ssize_t if necessary.
2012-09-28 10:31:09 -07:00
Elliott Hughes
2e223d208f am fb1e192e: am 72b08af3: am f9163dd1: Merge "Add getdelim(3) and getline(3) to bionic"
* commit 'fb1e192e12fb4047bf5f01ccf0fd4e5644743adb':
  Add getdelim(3) and getline(3) to bionic
2012-09-28 09:57:11 -07:00
Elliott Hughes
4137d67cde am 209d67d4: am fd6ca57f: am e4030e0b: Merge "Fix several compiler warnings."
* commit '209d67d448a64d147521b3d2efb3efa392dd3ccd':
  Fix several compiler warnings.
2012-09-26 16:09:26 -07:00
Elliott Hughes
6a3d9af46e am bdc51470: am 2c29bcf7: am 827a2604: Merge "Replace __unused in kernel headers with __linux_unused to avoid conflicts with __unused macro in sys/cdefs.h"
* commit 'bdc514700d9f766f5a44a95bb80dab15846bd1c4':
  Replace __unused in kernel headers with __linux_unused to avoid conflicts with __unused macro in sys/cdefs.h
2012-09-26 15:20:38 -07:00
Elliott Hughes
100e313c75 am 0792223a: am dd9fbc86: am 8e630dac: Merge "Simple tests for dladdr(3)."
* commit '0792223a8ab0f9ecb5fc8fe471dbb7890bb6c2cc':
  Simple tests for dladdr(3).
2012-09-26 12:21:03 -07:00
Elliott Hughes
0a2d31838f am 66569e3d: am a48d5e5f: am 855dde44: Merge "Fix tmpfile(3)."
* commit '66569e3d53643fe4682091c4e11c25449e9b7fdc':
  Fix tmpfile(3).
2012-09-26 12:21:02 -07:00
Ying Wang
1be6e685a5 Merge "Set up the private variables." 2012-09-26 11:27:48 -07:00
Nick Kralevich
0147bd2f78 am 06abf4ed: am 5989ed5c: am 25937d36: Merge "FORTIFY_SOURCE: add umask check"
* commit '06abf4edbf4b6d10ee82369ed48b8145a94ba1aa':
  FORTIFY_SOURCE: add umask check
2012-09-26 11:15:38 -07:00
Ying Wang
f680b0f404 Set up the private variables.
Now we use private variables in transform-o-to-executable to support
build executables against the NDK.

Bug: 7170098
Change-Id: I6e505b33001b76f4b11fcbbb1d35392c4ddf4c70
2012-09-26 10:54:45 -07:00
Elliott Hughes
2fb6457efb am c3233178: am 00f33977: am 3307bff0: Merge "Revert dl_fbase initialization to the address where the shared object is loaded."
* commit 'c32331781097b51a46c03b002cd813752677236a':
  Revert dl_fbase initialization to the address where the shared object is loaded.
2012-09-26 10:46:39 -07:00
The Android Open Source Project
23042bab43 am db2b9d05: (-s ours) Reconcile with jb-mr1-release - do not merge
* commit 'db2b9d052b3ebab73695af9335d649340cb8d193':
2012-09-26 10:08:03 -07:00
Elliott Hughes
a638642f44 am 354867d7: am 0eb4f255: am 6e0e03c3: Merge "Add the cleaned kernel headers"
* commit '354867d7020d4c7fb001c659245b60bff82a1a32':
  Add the cleaned kernel headers
2012-09-24 13:52:05 -07:00
Elliott Hughes
51d1a14c80 am a06e11cc: am c746bed8: am 7b0377ed: Merge "[MIPS] Removed the unused header"
* commit 'a06e11cc34612ef814a0f73bccdd43059111a735':
  [MIPS] Removed the unused header
2012-09-24 13:43:59 -07:00
Elliott Hughes
0647355bef am 28bd96cc: am d5c654c0: am 3b6914bf: Merge "Fix dlsym and dladdr to use load_bias instead of base"
* commit '28bd96cc0b9a5eed785df09a4c1bffc43b95fe6b':
  Fix dlsym and dladdr to use load_bias instead of base
2012-09-24 13:43:58 -07:00
Elliott Hughes
25b3416960 am f153ed38: (-s ours) am f4b34b6c: DO NOT MERGE Revert "Add the libcutils localtime_tz and mktime_t extensions to bionic."
* commit 'f153ed380d94123d873d7ff04bc9b5b65f989c1d':
  DO NOT MERGE Revert "Add the libcutils localtime_tz and mktime_t extensions to bionic."
2012-09-24 10:18:48 -07:00
The Android Open Source Project
7c7609f95e am 51d270af: (-s ours) Reconcile with jb-mr1-release - do not merge
* commit '51d270af6d9e648fdec43f716833b6f69688048e':
2012-09-24 10:14:49 -07:00
Elliott Hughes
c08088376a am 82ec6850: am 6c0e373d: am ec432608: am 0c24effd: Merge "Add the libcutils localtime_tz and mktime_t extensions to bionic."
* commit '82ec685054bd14e596fcb0661c7f5c398743b4b3':
  Add the libcutils localtime_tz and mktime_t extensions to bionic.
2012-09-24 09:48:35 -07:00
Elliott Hughes
9f3c0d32a4 am 6da07f02: am ecf67e15: am 2d51dddf: am 85049ead: Merge "Use hidden visibility for several internal-use-only functions."
* commit '6da07f02bd064cfae852df2b8ac82203432aef35':
  Use hidden visibility for several internal-use-only functions.
2012-09-24 09:48:34 -07:00
Elliott Hughes
2b83e0e67e am 0349e3d3: am d2eea0e6: 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 '0349e3d3ffa411ffd47f005af7f9c5585e469165':
  [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 09:48:33 -07:00
Naseer Ahmed
f9355bc5cd am 21e0a7ee: am f7070074: bionic: Update MDP header for sync
* commit '21e0a7ee8bd9862452a429cef554f31e3c379903':
  bionic: Update MDP header for sync
2012-09-24 09:36:43 -07:00
Rebecca Schultz Zavin
e06f77dce0 am 27cfd6af: am a9dca773: Update ion header to add FLAG_CACHED_NEEDS_SYNC
* commit '27cfd6afd4039a72e3669a2ff32685e81dd455aa':
  Update ion header to add FLAG_CACHED_NEEDS_SYNC
2012-09-20 15:46:02 -07:00
The Android Open Source Project
284de14ebb am 0a6cbb97: (-s ours) Reconcile with jb-mr1-release - do not merge
* commit '0a6cbb97a82ac6cfc3ce3d1eaf2785f911600584':
2012-09-20 12:52:38 -07:00
Iliyan Malchev
dcc80e127c am e5521822: am 4430aa6a: Merge "Update headers for Adreno graphics driver" into jb-mr1-dev
* commit 'e55218223b070d5745dc73c5593c436277c5b9c0':
  Update headers for Adreno graphics driver
2012-09-19 15:18:52 -07:00
Elliott Hughes
73b5a72134 am ae0bccf7: am 0ef00090: am 30289f0d: am 47dc4d43: Merge "Make pthread_create more forgiving of invalid sched_policy. Bug: 7005326"
* commit 'ae0bccf7d3252900d2ef31df2c6e4515908b89ec':
  Make pthread_create more forgiving of invalid sched_policy. Bug: 7005326
2012-09-18 17:31:35 -07:00
Dave Burke
5c5b720d81 am baa09d1e: am e5830324: Make pthread_create more forgiving of invalid sched_policy. Bug: 7005326
* commit 'baa09d1e0a408d410fc5a834fe9c283ae589ff13':
  Make pthread_create more forgiving of invalid sched_policy. Bug: 7005326
2012-09-18 00:10:52 -07:00
Elliott Hughes
41bb2eb806 am 1f1e7b70: am 2aceb4bc: am e2a17ef4: am 77ac158e: Merge "Don\'t copy strerror(3) or strsignal(3) strings if we can share."
* commit '1f1e7b70b7e37039ce53aed8b1b651c8692347e7':
  Don't copy strerror(3) or strsignal(3) strings if we can share.
2012-09-17 16:00:07 -07:00
Elliott Hughes
7379f525be am 469bd669: am 4b3ff1f0: am f8902bf7: am 047a285d: Merge "Fix <sys/klog.h> to correspond to the kernel operations."
* commit '469bd6692b984cfbecc96522960bb83baf7c9131':
  Fix <sys/klog.h> to correspond to the kernel operations.
2012-09-17 12:45:38 -07:00
Elliott Hughes
0e4065e8c7 am e409645c: am b67d4ec5: am 950a3c01: am 51519521: Merge "Add tty defaults to bionic"
* commit 'e409645c9953bb11bbad116834cecaebff444009':
  Add tty defaults to bionic
2012-09-17 12:45:34 -07:00
Elliott Hughes
62466a55bf am 7e9d6d8a: am b2af8b68: am 66a97ea9: am 4e9d953a: Merge "libc: add ftw / nftw functions"
* commit '7e9d6d8abba781992b1f55f36e02b2baae368d07':
  libc: add ftw / nftw functions
2012-09-14 10:28:47 -07:00
Elliott Hughes
cd1fb029eb am c9134074: am 1eaa3e6f: am 77fd7075: am e895e6de: Merge "Update libc/NOTICE and record the incantation."
* commit 'c91340749015c4d7e35bd377f9103a340ef65c6a':
  Update libc/NOTICE and record the incantation.
2012-09-14 10:28:46 -07:00
Kenny Root
07ab5cbbed am c01915fd: am 2b270a0c: am a4ea1a3d: am f7e403d6: Merge changes I06ee0b67,I914d2205
* commit 'c01915fd04dc352c77d4e2a0fbc906b515d2533c':
  Print out shared app gids correctly
  Add tests for Android-specific stubs
2012-09-14 10:28:05 -07:00
Elliott Hughes
6a163a1bf1 am c9829a2b: am 155a70b9: am de9db8f7: am fa36875d: Merge "Make strerror(3) and strsignal(3) thread-safe, and add psignal(3) and psiginfo(3)."
* commit 'c9829a2b6fb70f2eb0fc6a21f48546c66d9724c7':
  Make strerror(3) and strsignal(3) thread-safe, and add psignal(3) and psiginfo(3).
2012-09-14 10:28:04 -07:00
Elliott Hughes
8631744c49 am 953dbbda: am c7fda6a9: am d4623e56: am b338ea30: Merge "Upgrade to tzdata2012f."
* commit '953dbbda49c9a46e5b1b8d78a643c44eb1426d0e':
  Upgrade to tzdata2012f.
2012-09-14 10:28:03 -07:00
Elliott Hughes
4aebbf63c3 am 3d019017: am bec648ee: am 8db4b91b: am d2236e2c: Merge "Fix Mac build."
* commit '3d0190177469a8a25895117fc41625cd22e2fb28':
  Fix Mac build.
2012-09-13 14:12:31 -07:00
Elliott Hughes
ce061964f7 am c005a55c: am 478f8ff3: am b2550dd4: am 4a9b7c69: Merge "Add libdl into libc_malloc_debug_leak build"
* commit 'c005a55c74105c4eed8e2b0ba68ce0bfd67ccffe':
  Add libdl into libc_malloc_debug_leak build
2012-09-13 14:12:02 -07:00
Elliott Hughes
9f7d6840da am 00f927f1: am 29861b5d: am 58d15966: am af4d630e: Merge "Added new test for dlopen which is failing for MIPS."
* commit '00f927f137b553caa19fdc62497c012a1cb95f88':
  Added new test for dlopen which is failing for MIPS.
2012-09-13 14:12:01 -07:00
Elliott Hughes
9a78257905 am cf57515f: am f801cf55: resolved conflicts for merge of 47bda0c2 to jb-mr1-dev
* commit 'cf57515f7070539d560640247df6941a360fcff9':
  Update the kernel headers to match external/kernel-headers.
2012-09-13 03:21:42 -07:00
Elliott Hughes
218c7f5dbe am 7f598671: am ccd7ee62: am 90ae787b: am 666d06fe: Merge "Backwards and forwards compatibility for an upcoming <sys/socket.h> change."
* commit '7f59867170653a62fb1fbce91bca5f4673be065d':
  Backwards and forwards compatibility for an upcoming <sys/socket.h> change.
2012-09-12 17:02:36 -07:00
The Android Open Source Project
b8ceb988ea am 76a3777a: (-s ours) Reconcile with jb-mr1-release - do not merge
* commit '76a3777a4d6c3233ba2935828371abd3fbbac843':
2012-09-12 16:58:49 -07:00
Elliott Hughes
e290cd1606 am 68221a76: am cc0f2253: am 7f798147: am cc8668f2: Merge "[MIPS] Check error status from pipe system call"
* commit '68221a76b7ecfe5ed5d43d76eb3b7a505bf83c0d':
  [MIPS] Check error status from pipe system call
2012-09-12 15:35:00 -07:00
Elliott Hughes
20599f5c9e am eeabbaee: am f50b99f4: am e8b4d67a: am 59726bed: Merge "Rename crtstart variables as crtbegin, to match reality."
* commit 'eeabbaee88202a459ec381edc45c0995bdcfa3c8':
  Rename crtstart variables as crtbegin, to match reality.
2012-09-10 17:15:10 -07:00
Ying Wang
62fd0b699a am 33d552a4: am e3738414: am f9920563: am 67546bf2: Merge "Generate header dependency makefiles for the crt*.o"
* commit '33d552a4d1c766aeb99c71060aa091e7aafaaac9':
  Generate header dependency makefiles for the crt*.o
2012-09-10 17:14:10 -07:00
Elliott Hughes
d203fba8f0 am 934e18e7: am af4371b4: am 56ba6336: am f1d57e16: Merge "Add more pthreads tests."
* commit '934e18e715b0f6627f258d6fc8dc9406f39705f6':
  Add more pthreads tests.
2012-09-10 17:09:54 -07:00
Elliott Hughes
b3cbcb3547 am 5804b88a: am b0102454: am 7c7a7f8e: am d10309c3: Merge "Rename __dso_handle_so.c to __dso_handle_so.h"
* commit '5804b88a44c153fa1b39dd3095be9e905d77cee0':
  Rename __dso_handle_so.c to __dso_handle_so.h
2012-09-10 17:05:15 -07:00
Elliott Hughes
b35a90d682 am ffcb92e7: am b18d4f63: am 72fcdbe9: am 691ef3c8: Merge "Add mlockall and munlockall for Google TV."
* commit 'ffcb92e779b347b3725e560aa3aabd122a4dbd62':
  Add mlockall and munlockall for Google TV.
2012-09-10 17:05:14 -07:00
Ian Rogers
593315c327 am e9859df7: am 973bf681: am 77039d34: am e8f81547: Merge "Fix build warning of initialization but no use."
* commit 'e9859df7cc57f761a4b9457b4d55ecff33bfdc8b':
  Fix build warning of initialization but no use.
2012-09-06 11:54:48 -07:00
Elliott Hughes
f28d8d7042 am 684669df: am de0dc251: am 41ff8b98: am 6e3b0f2d: Merge "Don\'t corrupt the thread list in static executables."
* commit '684669dfd7fdefa1e0f45e91667af628d3742429':
  Don't corrupt the thread list in static executables.
2012-09-06 10:48:52 -07:00
The Android Open Source Project
c99828169b am c0ee1171: (-s ours) Reconcile with jb-mr1-release - do not merge
* commit 'c0ee117170e9a8976ffd2afc99bce8f1242cefd1':
  Revert "Update ion header"
  :Revert "Update ion header"
2012-09-06 09:12:34 -07:00
Ajay Dudani
58deb845c5 am d58928e8: am 183d0a57: Update msm_ion.h ioctls so they dont conflict with ion.h
* commit 'd58928e83109aeac42e2226de3ec99a91e59a695':
  Update msm_ion.h ioctls so they dont conflict with ion.h
2012-09-05 21:52:04 -07:00
Ajay Dudani
1c24c54840 am bf3da78e: am 85811fc7: Revert "msm_ion: switch to using legacy_ion.h"
* commit 'bf3da78e690524414a8874313638f7cf33b44424':
  Revert "msm_ion: switch to using legacy_ion.h"
2012-09-05 21:47:56 -07:00
Ajay Dudani
457e60a2f8 am 7649d622: am dc81b447: Revert "add legacy_ion.h"
* commit '7649d62255f056d1520cd746ddcd6352d091f76f':
  Revert "add legacy_ion.h"
2012-09-05 21:46:33 -07:00
Elliott Hughes
bc30d0a798 am 8140487f: am 2da90705: am 008f4df5: am ff4608ae: Merge "Add missing dependencies."
* commit '8140487f6014f83c14cecb6ecb9535bd4966a13e':
  Add missing dependencies.
2012-09-05 15:22:28 -07:00
Elliott Hughes
db18cbdd85 am d5b14e35: am faf361a6: am 2fc3e1ef: am b2c5bd54: Merge "ARM: warn about atexit() calls from legacy shared libraries"
* commit 'd5b14e35521ee6a038714c42ec523dcfe183b65b':
  ARM: warn about atexit() calls from legacy shared libraries
2012-09-05 10:36:09 -07:00
Elliott Hughes
ec0d2a86b7 am 340ff83f: am ac3e35cd: am a76f2eca: am 26f2e4a1: Merge "ARM: make CRT_LEGACY_WORKAROUND work as intended"
* commit '340ff83f9878a478cfa4b5aaaf4260f96304c416':
  ARM: make CRT_LEGACY_WORKAROUND work as intended
2012-09-05 10:06:25 -07:00
Ian Rogers
48468f258a am 64f4e714: am f71d757f: am 7310a1c4: am 82978cae: Merge "Avoid malloc lock while calling pthread_atfork."
* commit '64f4e714186ff69016abcb241fd912ed8ef8472a':
  Avoid malloc lock while calling pthread_atfork.
2012-09-05 07:56:21 -07:00
Elliott Hughes
3ee5775a0f am 9deb460a: am ab558163: am b9f0a6eb: am be19a367: Merge "termios: add tcdrain"
* commit '9deb460a26b8d5f6c74b5935e35b6f419775a1e5':
  termios: add tcdrain
2012-09-04 18:18:01 -07:00
Elliott Hughes
6b08ed7937 am fe7ac11a: am f34c6d77: am bc374078: am 5ff23471: Merge "Add getsid system call to bionic"
* commit 'fe7ac11afa1c3a64c12e7e632e12b5c853ca3d89':
  Add getsid system call to bionic
2012-09-04 16:52:05 -07:00
Elliott Hughes
5f517ce256 am ad639c1d: am 877ad30f: am 507bcabb: am e03ab936: Merge "Add missing MALLOC_FAILURE_ACTION calls to dlmalloc."
* commit 'ad639c1d2bf0c12a77c24a3247cedf86cc719d6e':
  Add missing MALLOC_FAILURE_ACTION calls to dlmalloc.
2012-09-04 16:05:33 -07:00
Elliott Hughes
839ae785d8 am 1d07eda8: am c0e3b9dd: am b438c54d: am 1db615b4: Merge "bionic: Fix TINY_ANDROID build"
* commit '1d07eda8db4a8a8986b0e2681eef0d839c9901df':
  bionic: Fix TINY_ANDROID build
2012-09-04 13:53:51 -07:00
Ian Rogers
a4e3391db2 am 5b0e2de6: am b9ad1a1e: am 6abab301: am 6fe901ef: Merge "Upgrade to dlmalloc 2.8.6."
* commit '5b0e2de6aef96e10c26034d9b447208a56df82d9':
  Upgrade to dlmalloc 2.8.6.
2012-08-31 09:03:23 -07:00
Elliott Hughes
6709aba126 am 418ecb7e: am 8c368b5d: am dde94f4c: am 8b4e8a93: Merge "Improve the dynamic linker diagnostics."
* commit '418ecb7ec800d8caa97b01a84d7403272fab4e28':
  Improve the dynamic linker diagnostics.
2012-08-29 14:11:52 -07:00
Nick Kralevich
35c3408b0d am 29e52652: am fe7d7d46: am 92133ca4: am 17d9be8a: Merge "disable _FORTIFY_SOURCE under clang"
* commit '29e526527c10f92d0a563d1cdec5f4eab0b33875':
  disable _FORTIFY_SOURCE under clang
2012-08-29 14:11:52 -07:00
Elliott Hughes
5fe555ecac am b3732862: am 8900e2de: am e5b85f45: am 0d7177c0: Merge "Clean up warnings in the malloc_debug_* files."
* commit 'b37328627be403b9c2a2896765a7bc7a357cb073':
  Clean up warnings in the malloc_debug_* files.
2012-08-29 13:23:34 -07:00
Ian Rogers
72758a138e am 71258e0d: am 15afed42: Merge "Revert "Revert "Restore posix_memalign""" into jb-mr1-dev
* commit '71258e0d207b9b51f1295808837df95e4dd2711a':
  Revert "Revert "Restore posix_memalign""
2012-08-29 08:57:50 -07:00
Ian Rogers
31abfc3a98 am 1df8fe33: am f71fa083: Merge "Revert "Revert "Upgrade to dlmalloc 2.8.5.""" into jb-mr1-dev
* commit '1df8fe33d59df1be3b1d33db033e379a32416a68':
  Revert "Revert "Upgrade to dlmalloc 2.8.5.""
2012-08-29 08:57:49 -07:00
Iliyan Malchev
230752b861 am 7e585192: am 66edcd9d: msm_ion: switch to using legacy_ion.h
* commit '7e5851922ce5430ea55e3c9325386846fbedf16c':
  msm_ion: switch to using legacy_ion.h
2012-08-29 01:39:28 -07:00
Iliyan Malchev
e59f4c31cb am ba13ae76: am 5f1d206d: add legacy_ion.h
* commit 'ba13ae767207d50dd2214cd5e8a941ab4da74d56':
  add legacy_ion.h
2012-08-29 01:39:28 -07:00
Nick Kralevich
9416782be5 am 2868bbab: am 4f90a093: am d3d09f7d: am 069c64cd: Merge "ARM: make sure __on_dlclose() actually gets called"
* commit '2868bbabf3a3146e682f314794b8803bfd60963b':
  ARM: make sure __on_dlclose() actually gets called
2012-08-28 13:46:31 -07:00
Nick Kralevich
97b9643c5b am 036fa6e6: am 54662dd4: am 1389db8b: am e026b1d8: Merge "ARM: remove dummy entries from .so init_array/fini_array"
* commit '036fa6e66958a05fbde9fddefc5fc8e31741fe80':
  ARM: remove dummy entries from .so init_array/fini_array
2012-08-28 13:09:40 -07:00
Nick Kralevich
c64bb00cdf am 773a7832: am d7440f37: am 7cab2188: am ad180738: Merge "linker: Fix ARM_R_COPY relocations"
* commit '773a783295e758bdef1a7e205761bcc1f832af95':
  linker: Fix ARM_R_COPY relocations
2012-08-28 13:09:39 -07:00
Nick Kralevich
953de64819 am 88160880: am 3ffdef19: am c7d9c400: am c410a961: Merge "libc: remove ctors/dtors sections"
* commit '88160880953e01f4fa7523938b6448f194f598a0':
  libc: remove ctors/dtors sections
2012-08-28 13:02:10 -07:00
Nick Kralevich
47cac977f5 am 5443561d: am 48c88804: am 775dabd4: am 9dfaa63a: Merge "Allow linker to compile with -DLINKER_DEBUG=1"
* commit '5443561d5d9fd8ababac989116a036b3ab7b15b0':
  Allow linker to compile with -DLINKER_DEBUG=1
2012-08-27 16:12:39 -07:00
Elliott Hughes
80921057d4 am ea108d8a: am 8c7f4777: am d2d8031d: am bc366292: Merge "Added missing cache failed notification"
* commit 'ea108d8a665aa708e878432ab1cdab959809ef9b':
  Added missing cache failed notification
2012-08-27 15:27:46 -07:00
Iliyan Malchev
5006660be8 am c9008991: am 3ad36e52: bionic: update sanitized MSM, V4L2 kernel headers
* commit 'c9008991f33b95831f94e0cc970c94a6ea6f4199':
  bionic: update sanitized MSM, V4L2 kernel headers
2012-08-27 15:17:31 -07:00
The Android Open Source Project
99696a9373 am 75f3d25c: (-s ours) Reconcile with jb-mr1-release - do not merge
* commit '75f3d25cef30dfa4578b1bb7562222ad51a75de5':
2012-08-25 07:16:49 -07:00
Ian Rogers
995f8c925f am 1f84a4e4: am a190cbb8: am 05fddb41: am a37ce7fa: Merge "Add missing va_end() to prevent stack corruptions"
* commit '1f84a4e426aca34ad17b6d626bd725e86a7c97b8':
  Add missing va_end() to prevent stack corruptions
2012-08-24 15:27:30 -07:00
Rebecca Schultz Zavin
bbe3d3916f am fa5942cc: am cbd76d15: Merge "Update ion header" into jb-mr1-dev
* commit 'fa5942cc081f3aef1ceb8cf6f0d8c0984d18bf82':
  Update ion header
2012-08-23 16:34:33 -07:00
Nick Kralevich
b46a1d8890 am dd5d865d: am 81af404b: am e8198b97: am 26facba2: Merge "hardening: remove pointless ARM __get_pc() function"
* commit 'dd5d865d92c21105d28dd931d56c2f5e2f4df275':
  hardening: remove pointless ARM __get_pc() function
2012-08-23 12:37:19 -07:00
The Android Open Source Project
e2862bb984 am b1d43872: (-s ours) Reconcile with jb-mr1-release - do not merge
* commit 'b1d43872224837a85f593d9f946686c7272c7d0e':
  Revert "Upgrade to dlmalloc 2.8.5."
  Revert "Restore posix_memalign"
2012-08-22 15:35:50 -07:00
Brian Carlstrom
2bdfdfbf09 am 4a56211b: am f72ee269: Revert "Upgrade to dlmalloc 2.8.5."
* commit '4a56211b0b30757c8a5d64a59976a3a97d300a18':
  Revert "Upgrade to dlmalloc 2.8.5."
2012-08-22 13:56:16 -07:00
Brian Carlstrom
3985fbb348 am 71633454: am 78a3069f: Revert "Restore posix_memalign"
* commit '716334543788fe564b7d91055d6122657d409efd':
  Revert "Restore posix_memalign"
2012-08-22 13:56:16 -07:00
Jean-Baptiste Queru
3487c9b4a8 am 2400c7a6: am e49df020: am 170ad354: am c7de0225: Merge "Use unambiguous mnemonics"
* commit '2400c7a60edb18ab62fedcad86ce0d709895e26d':
  Use unambiguous mnemonics
2012-08-22 07:35:31 -07:00
Erik Gilling
98b62860cf am fed12112: am 974e16cd: update linux/sync.h
* commit 'fed121126afa91eb04a073ecc1e42535b1b52d27':
  update linux/sync.h
2012-08-21 19:14:12 -07:00
The Android Open Source Project
92042e8b91 am a5b7d6dd: (-s ours) Reconcile with jb-mr1-release - do not merge
* commit 'a5b7d6dd00914651f77c4ff6604a2c16df6d73b9':
2012-08-21 16:07:05 -07:00
Andrew Hsieh
0b8770ccbd am 5e2aa357: am f861705f: am 5cd1efb2: am 1bd035cf: Merge "Enclosed functions in fenv.h with __BEGIN_DECLS/__END_DECLS"
* commit '5e2aa357d2f76a01c403a208524137c6fccf7304':
  Enclosed functions in fenv.h with __BEGIN_DECLS/__END_DECLS
2012-08-21 03:34:44 -07:00
Ian Rogers
6acc9d10e2 am 7c6cc4df: am 4ac3b0a1: am 8af726b2: am 7b0d9b79: Merge "Restore posix_memalign"
* commit '7c6cc4dffdcfad48733ac3c3001f5d9b137182b1':
  Restore posix_memalign
2012-08-20 19:47:21 -07:00
Brian Carlstrom
4beae98ae0 am 638b0fd9: am cc1f4acb: Restore posix_memalign
* commit '638b0fd95346c8930aabcdec933e8caa6d6b4c7c':
  Restore posix_memalign
2012-08-20 18:38:50 -07:00
Brian Carlstrom
d03266b2b7 am 94c82633: am 76f60e2e: am fe87596a: am c37dcd3d: Merge "Upgrade to dlmalloc 2.8.5."
* commit '94c82633c72acae0eb7a3390167b35eb3008b4ff':
  Upgrade to dlmalloc 2.8.5.
2012-08-20 16:36:05 -07:00
Elliott Hughes
758b1c46fb am 98f26893: am dd0e991c: am 2651d6c6: am 9417a80e: Merge "Always define the 64-bit int types."
* commit '98f26893a6a8811df1fe7e012f6cf8885e6c560e':
  Always define the 64-bit int types.
2012-08-17 17:01:23 -07:00
Elliott Hughes
230df050ed am ea5dea8e: am db2903fa: am cbeccc84: am 200de748: Merge "Fix race condition in pthread_create()"
* commit 'ea5dea8edb4217da7798ef29759c2b5d27f7dcfb':
  Fix race condition in pthread_create()
2012-08-17 16:30:02 -07:00
Elliott Hughes
1f6639a1bf am d060b824: am efd39834: am e5242bfd: am 1771a33d: Merge "Add link.h for all platforms with dl_phdr_info"
* commit 'd060b824dd293bf1ecd7814cd2e75a77186cefcb':
  Add link.h for all platforms with dl_phdr_info
2012-08-17 14:04:52 -07:00
Joe Onorato
342e174b24 am 947f2e61: am 28ae6f5d: am cefb93b6: am 6c98cdb1: Merge "Don\'t over-generalize makefiles. Host modules always build. This isn\'t needed on eng builds."
* commit '947f2e610a89931b20a4ddd678e89df12c76e058':
  Don't over-generalize makefiles.  Host modules always build. This isn't needed on eng builds.
2012-08-17 00:18:26 -07:00
The Android Open Source Project
cd6fd2f14d am 89a4090e: (-s ours) Reconcile with jb-mr1-release - do not merge
* commit '89a4090ecae61053e3ac6c9b96a8ee469495cf01':
2012-08-16 19:11:21 -07:00
Elliott Hughes
4b027b381f am 12911624: am a7d8f3d5: am c80ca54f: am 60ef95e1: Merge "Enhance getcwd(3) to handle NULL like glibc."
* commit '129116241022d51ca915ef1d6b94d131a3f5569f':
  Enhance getcwd(3) to handle NULL like glibc.
2012-08-16 17:09:35 -07:00
Elliott Hughes
0a14d9f5c8 am ca82e1f3: am 820ad428: am 74438bb2: am 449d4634: Merge "bionic: add macro protection for MALLOC_ALIGNMENT"
* commit 'ca82e1f3d17b57b1d5bbf0527cae58be1861e9ae':
  bionic: add macro protection for MALLOC_ALIGNMENT
2012-08-16 14:28:52 -07:00
Scott Anderson
4628d2f6bb am cc8165ae: am 09d9dd3a: Merge "Add clean kernel header for uhid." into jb-mr1-dev
* commit 'cc8165aea50294c6a86ad456967a7a741ac85a65':
  Add clean kernel header for uhid.
2012-08-16 12:07:53 -07:00
Elliott Hughes
26145cfc18 am 949d6faa: am a626bbdb: am 4af9141c: am ae728099: Merge "enable clone system call for x86"
* commit '949d6faa96e25170293d2a9ebe6f76cc91b77a6e':
  enable clone system call for x86
2012-08-15 17:26:44 -07:00
Elliott Hughes
1d16b89289 am 31041a01: am 29af938c: am ab8850f7: am 07cd1125: Merge "Fix comment typos."
* commit '31041a0138d62879257d6980abd1e006c299752b':
  Fix comment typos.
2012-08-15 17:11:48 -07:00
Elliott Hughes
b8d2695c82 am cdbd3406: am 4d63f33c: am 76aad1d2: am e1cd69a7: Merge "Regenerate all NOTICE files with the latest version of the script."
* commit 'cdbd3406f51d7f21326fe99df21e48a9191dddc1':
  Regenerate all NOTICE files with the latest version of the script.
2012-08-15 17:11:47 -07:00
Elliott Hughes
0681b2e477 am f53c75e5: am 2e3756b4: am 9b3bbcda: am fe43c768: Merge "Switch to the current NetBSD regex implementation."
* commit 'f53c75e513cb088d712badc32b89a8792a329d63':
  Switch to the current NetBSD regex implementation.
2012-08-15 16:03:03 -07:00
The Android Open Source Project
c05ca5f058 am e24cde44: (-s ours) Reconcile with jb-mr1-release - do not merge
* commit 'e24cde4406792ee57f5dbfaa1efc35131f289063':
2012-08-15 08:29:17 -07:00
Elliott Hughes
cc9f4d56c0 am ff45d5cd: am 82259117: am 008a0a5d: am 53493a9b: Merge "Sort NOTICE entries."
* commit 'ff45d5cdbfc4117d69fc688f12ec251297eb8751':
  Sort NOTICE entries.
2012-08-14 15:47:31 -07:00
Iliyan Malchev
422bb8b5c4 am 912dd712: am df88d88f: Merge changes I2e8af44e,Ie9250a0e into jb-mr1-dev
* commit '912dd71259959a259478465296438e83d0ad8e64':
  update msm_mdp.h header to support vsync
  update processed msm_camera.h and msm_isp.h
2012-08-14 15:43:18 -07:00
Elliott Hughes
ea4900b89a am 0a3f66e9: am fdbecf3b: am 63696738: am b6a97196: Merge "More cleanup."
* commit '0a3f66e9a0ef47dc2f751292a69434405221ef90':
  More cleanup.
2012-08-14 15:14:56 -07:00
Elliott Hughes
8af9d9a7d0 am 7bb37492: am 89a35435: am 16a0cbaa: am b7c6991c: Merge "Update MS_ mount flags, define unshare() syscall."
* commit '7bb37492cc371e9bbca68406af1b94ae1348fe3c':
  Update MS_ mount flags, define unshare() syscall.
2012-08-14 12:33:05 -07:00
Elliott Hughes
6bdc30e923 am 028ed539: am dc320d99: am 82b69fcb: am b9c6854c: Merge "linker: avoid clobbering the .dynamic section of shared libs"
* commit '028ed539ddbe577687ac9778382c98aab3bf279f':
  linker: avoid clobbering the .dynamic section of shared libs
2012-08-14 12:21:21 -07:00
Elliott Hughes
a10b277de2 am bfcd5525: am b6d6ec53: am 370a7094: am c50e0197: Merge "Switch to upstream NetBSD tdelete/tfind/tsearch."
* commit 'bfcd55250058e927e0c6d0b94337c89fc2d86fa2':
  Switch to upstream NetBSD tdelete/tfind/tsearch.
2012-08-14 12:21:20 -07:00
Jeff Sharkey
0febe091a5 am 21f7ef9e: am d8450043: Merge "Update MS_ mount flags, define unshare() syscall." into jb-mr1-dev
* commit '21f7ef9eb269f75d7c291b4c574eabc865bf4362':
  Update MS_ mount flags, define unshare() syscall.
2012-08-14 12:11:01 -07:00
Elliott Hughes
d52075bd97 am 2bc1cade: am 93a9d534: am d544bdfa: am 54655eaf: Merge "Fix nice..."
* commit '2bc1cadeff4b7d41c889b8f1b965028ec575bed6':
  Fix nice...
2012-08-13 17:16:55 -07:00
Elliott Hughes
50b4523380 am aa29740c: am 69fc1522: am aa6c8994: am b66bc514: Merge "Clean up warnings in stubs.cpp."
* commit 'aa29740ce252113071f96872b7b99c8528bd1637':
  Clean up warnings in stubs.cpp.
2012-08-13 16:28:44 -07:00
Elliott Hughes
71c9a05614 am c37b31d8: am eab7bddd: am ca09412a: am 222eec2e: Merge "Handle naming for system uids running as secondary users"
* commit 'c37b31d848050b6bc534984556641f738fa0324b':
  Handle naming for system uids running as secondary users
2012-08-13 16:10:32 -07:00
Elliott Hughes
66c033868f am c64c1b49: am ad8ff472: am c1eb7619: am 440e417d: Merge "Add dependencies on all the makefiles."
* commit 'c64c1b49fd5c51b1b6e87d88b233d23fa172d372':
  Add dependencies on all the makefiles.
2012-08-13 16:10:31 -07:00
Elliott Hughes
4a5ab7a191 am 141a3b10: am cfd0345f: am 35dcf19b: am 66fba009: Merge "Update arch-mips/asm/unistd.h for the newer syscalls"
* commit '141a3b109c32acb0d7279ea85706db781bfc0594':
  Update arch-mips/asm/unistd.h for the newer syscalls
2012-08-13 16:10:30 -07:00
Amith Yamasani
79f3698f39 am c6c26a08: am ca7ee8a9: Merge "Handle naming for system uids running as secondary users" into jb-mr1-dev
* commit 'c6c26a08c8ffd431824e13c40328c35394fb4148':
  Handle naming for system uids running as secondary users
2012-08-13 13:53:55 -07:00
Elliott Hughes
5dcf871abb am 94d7f701: am 71c0366f: am e135d7f3: am a61ac525: Merge "Fix module constructor order."
* commit '94d7f701d1b5cda0621eb46160e11ccbeb85cdd3':
  Fix module constructor order.
2012-08-13 11:15:25 -07:00
Nick Kralevich
f574ce603a am 34e52129: am 19b10419: am 89fd9ecc: am 20b94c0c: Merge "linker: don\'t perform unnecessary mprotects"
* commit '34e5212961cb64cf690289bc94c59b3b6245694c':
  linker: don't perform unnecessary mprotects
2012-08-13 09:51:48 -07:00
Elliott Hughes
259f4a1503 am 7261264c: am 2a22a69e: am 877dc946: am 072a7e6c: Merge "MIPS support to the libc Makefile"
* commit '7261264c3a336bfb6e52241c2ba80679cbba68c8':
  MIPS support to the libc Makefile
2012-08-11 15:19:34 -07:00
Ben Cheng
dd8cd5d6bc am daedcfc5: am 9eeaa4bd: am 7e3918eb: am 0bf5cf87: Merge "Set the dynamic field in the link map for the linker itself."
* commit 'daedcfc595f51b1fe22b53d272cee1a142305a11':
  Set the dynamic field in the link map for the linker itself.
2012-08-11 15:19:33 -07:00
Ying Wang
c97c5fc788 Split out LOCAL_ASFLAGS.
Bug: 6967574
Change-Id: I5be50d582c1cb8075039b06292cf0745a996c3c4
2012-08-11 14:23:19 -07:00
Elliott Hughes
6a80cc9e08 am 516b26f2: am 0837c69a: am edf09bf9: am 316ee626: Merge "MIPS support to sigsuspend and sigwait routines"
* commit '516b26f2bf755879feb51d06dcd9511903d0a9bd':
  MIPS support to sigsuspend and sigwait routines
2012-08-10 15:20:58 -07:00
Nick Kralevich
d7a941f210 am 17f65bf4: am 73d99958: am fabeb736: am 38a02b4b: Merge "crtend*: Add GNU_STACK note"
* commit '17f65bf468074083624aa7546da024193d70c50a':
  crtend*: Add GNU_STACK note
2012-08-10 14:50:02 -07:00
Elliott Hughes
4a20a7f77c am 623ed02e: am d71ada63: am 535477ca: am 3ede900b: Merge "Revert "Revert "Switch to NetBSD\'s strxfrm(3)."""
* commit '623ed02e35fb8c5b8c868b11f53c005e39707f74':
  Revert "Revert "Switch to NetBSD's strxfrm(3).""
2012-08-10 14:16:50 -07:00
Elliott Hughes
63c16f85c5 am be01adce: am 5adc7fdc: am b54e5f2a: am a1822dce: Merge "Add unshare() syscall."
* commit 'be01adce3653912644b33e34a3c7894cf42c71e9':
  Add unshare() syscall.
2012-08-10 13:10:22 -07:00
Elliott Hughes
c383a32926 am 4fc5f6c3: am 5140b785: am f6922be2: am f91e2f72: Merge "Fix typo in SIGTTOU description."
* commit '4fc5f6c366dac9c3c264b94b413b1f162a60a53d':
  Fix typo in SIGTTOU description.
2012-08-10 12:54:39 -07:00
Elliott Hughes
1bb1aea178 am 7186a132: am 55206504: am a618ea30: am 4ec9e343: Merge "Revert "Switch to NetBSD\'s strxfrm(3).""
* commit '7186a13284bd70840b396aaec2090804e461869c':
  Revert "Switch to NetBSD's strxfrm(3)."
2012-08-10 12:54:38 -07:00
Elliott Hughes
c2817899e4 am 731ecf0a: am 29b8fb3d: am 3e83da43: am 9ad1d6f5: Merge "Switch to NetBSD\'s strxfrm(3)."
* commit '731ecf0a317b46e12a71542fdaa289d31898f3c0':
  Switch to NetBSD's strxfrm(3).
2012-08-10 12:54:37 -07:00
Elliott Hughes
75501a17f2 am d18b181a: am b6c1e34d: am dc6d5327: am 0836a7ff: Merge "Auto-generate a complete NOTICE file."
* commit 'd18b181a25b2fa21c20ecd4faaf5c8e6e50fb35b':
  Auto-generate a complete NOTICE file.
2012-08-10 12:40:35 -07:00
Jeff Sharkey
b17cd156b5 am 9a477de2: am 6ccc2c8f: Merge "Add unshare() syscall." into jb-mr1-dev
* commit '9a477de2f54922ba28dbc4789b12b83e64bd1474':
  Add unshare() syscall.
2012-08-10 11:33:26 -07:00
The Android Open Source Project
cb221a5cbe am 1551f18a: (-s ours) Reconcile with jb-mr1-release - do not merge
* commit '1551f18af0c75c2b2c3ca61168fe4284b54f1a2e':
2012-08-10 08:53:33 -07:00
Elliott Hughes
444a2bf314 am 8e1e66da: am 31ab6ac0: am 8cc8f7e0: am 709bb0f7: Merge "Remove ThirdPartyProject.prop."
* commit '8e1e66da21398b9ccd4ce68d855909e5eb53f6f0':
  Remove ThirdPartyProject.prop.
2012-08-09 14:51:21 -07:00
Elliott Hughes
f1e95d935f am 9550a7c5: am 3fc21198: am 531d348d: am a17b85d9: Merge "Remove the last .jam file."
* commit '9550a7c57c7f2ed98a5266843e1929cfd92c4a16':
  Remove the last .jam file.
2012-08-09 12:15:02 -07:00
Elliott Hughes
1ab6f486de am 0ac6d235: am b13ad93f: am 3820229b: am d504eee9: Merge "MIPS support to sys/ headers"
* commit '0ac6d23515cbeb8462b62be713119edb8718cd70':
  MIPS support to sys/ headers
2012-08-08 17:49:39 -07:00
Elliott Hughes
a8e76ddf9e am 1afca3f6: am 73ac7d94: am d2040cb2: am f655ce7e: Merge "Fix x86 build."
* commit '1afca3f69887d9c761d448ddc0c4031176351fe1':
  Fix x86 build.
2012-08-08 17:49:38 -07:00
Elliott Hughes
40805076f9 am b02f100f: am 366c0199: am f3ffb8fa: am 78129204: Merge "Clean up the linker a bit, remove prelinking support."
* commit 'b02f100fa41d1905013b571fa4092857b873d78d':
  Clean up the linker a bit, remove prelinking support.
2012-08-08 15:34:04 -07:00
Elliott Hughes
baa35efba8 am 96fd6601: am 10e2d222: am d463f6e9: am 34959e0b: Merge "Clean up libc/Android.mk a bit after the crtbrand changes."
* commit '96fd66018cff2e3a217abdc95aafbcaea94e4a4e':
  Clean up libc/Android.mk a bit after the crtbrand changes.
2012-08-08 15:11:55 -07:00
Jean-Baptiste Queru
6dd6634bf6 am d0a7bc2f: am affd1b42: am 9f3a8aaf: am 7e248be7: Merge "Add a .note.android.ident section to Android ELF binaries."
* commit 'd0a7bc2fd61c052801226a7b92f544ebed6eb59a':
  Add a .note.android.ident section to Android ELF binaries.
2012-08-08 15:11:30 -07:00
The Android Open Source Project
60ca41ebb7 am d9c2de10: (-s ours) Reconcile with jb-mr1-release - do not merge
* commit 'd9c2de10d94b1c46e0e3dee41bd6d8de673d2267':
2012-08-07 11:04:10 -07:00
The Android Open Source Project
fa844eff32 am 45193df5: (-s ours) Reconcile with jb-mr1-release - do not merge
* commit '45193df53aebb0764853aa21541e6f6ab73b9b9f':
  When compiling with clang, don't "fortify_source" the strlcpy and strlcat.
  When compiling with clang, don't "fortify_source" the strlen.
  Revert "Fix the clang build: this compiler doesn't support the gnu_inline function attribute"
2012-08-06 13:35:38 -07:00
The Android Open Source Project
31096ceb79 am 1466b1aa: (-s ours) Reconcile with jb-mr1-release - do not merge
* commit '1466b1aad294138fc1e189c6fdce5eb7a2d06a42':
  Update msm_camera.h to version that supports instance handle based lookup
2012-08-06 13:19:43 -07:00
Shih-wei Liao
6f2e8f9878 am 25ef2bbf: am 3b4c9db2: am df523880: am e2731d98: Merge "When compiling with clang, don\'t "fortify_source" the strlcpy and strlcat."
* commit '25ef2bbf01bf6f8e934a07bd1304cba35ae5a38e':
  When compiling with clang, don't "fortify_source" the strlcpy and strlcat.
2012-08-06 11:12:30 -07:00
Shih-wei Liao
dec42d9112 am 42bfbd1e: am 6ff66601: am ce4a5cd5: am 8173d767: Merge "Revert "Fix the clang build: this compiler doesn\'t support the gnu_inline function attribute""
* commit '42bfbd1e617b7430fd5c62cb9162ab5c79655e3d':
  Revert "Fix the clang build: this compiler doesn't support the gnu_inline function attribute"
2012-08-06 10:23:24 -07:00
Shih-wei Liao
839c4f1eb6 am ed33635d: am cddedade: am 924fd920: am 601a49d3: Merge "When compiling with clang, don\'t "fortify_source" the strlen."
* commit 'ed33635da7d8cfc6f5c61c5d7ab9bc42ab5b3916':
  When compiling with clang, don't "fortify_source" the strlen.
2012-08-06 10:23:23 -07:00
Elliott Hughes
b11eaaed35 am a870ded2: am eaac1e5a: am 94ce1356: am 7c92b6ca: Merge "Remove an awkward #include that is no longer upstream."
* commit 'a870ded21ac2e8b792ddc1fe1c5d71c421f0d8a1':
  Remove an awkward #include that is no longer upstream.
2012-08-06 08:09:25 -07:00
Elliott Hughes
15b3aef581 am 8ccbc90a: am 4bac8f68: am 7e81ee04: am 1c861728: Merge "Remove yet more SH4 cruft."
* commit '8ccbc90a3b6071dff015bff284b0a11d95a00349':
  Remove yet more SH4 cruft.
2012-08-03 15:17:14 -07:00
Elliott Hughes
031226a9fd am 9f8c7daf: am c9dbebe3: am f5385754: am aea5f00d: Merge "bionic: modify syscall to use 6 registers to pass parameter."
* commit '9f8c7daf402738beda56868692e62a90e095481d':
  bionic: modify syscall to use 6 registers to pass parameter.
2012-08-03 14:34:57 -07:00
Elliott Hughes
7478b0bfa6 am 58234e78: am 48955d24: am c6f15ecf: am 1510795f: Merge "Upgrade to tzdata2012e."
* commit '58234e788be30a16e6ba745adc21cbfd6d9828ec':
  Upgrade to tzdata2012e.
2012-08-03 13:41:39 -07:00
David Turner
65f12237b8 am c7813c08: am d7552a31: am 2f2b7212: am 16d40217: Merge "Fix the clang build: this compiler doesn\'t support the gnu_inline function attribute"
* commit 'c7813c08570a5e6ef3e410973d7f4b4befebee77':
  Fix the clang build: this compiler doesn't support the gnu_inline function attribute
2012-08-03 05:04:06 -07:00
Elliott Hughes
889a706637 am df7aa950: am 9b6a4538: am 0ce92b96: am 1e304a3b: Merge "[MIPS] Support for TLS register"
* commit 'df7aa95031f5f99ba3fc95956c38bf7ffd037ab4':
  [MIPS] Support for TLS register
2012-08-02 18:51:38 -07:00
Elliott Hughes
855a3779be am e5bd6efa: am f94effda: am fd4685be: am 52f3ee96: Merge "MIPS support for libc."
* commit 'e5bd6efa0805a743ed6c2022c65c5a8ff79d7310':
  MIPS support for libc.
2012-08-02 16:39:18 -07:00
Elliott Hughes
36c27b547e am 79d834b5: am 82dcfee5: am 19e30fc4: am a1c0f08d: Merge "Fix a ENOTUP/ENOTSUP typo."
* commit '79d834b5aba80407046ece1377033c8d48fbd427':
  Fix a ENOTUP/ENOTSUP typo.
2012-08-02 16:13:40 -07:00
Elliott Hughes
967c9f7fcb am 422067eb: am c0719660: am 670766c5: am 994935f6: Merge "Error numbers are target specific."
* commit '422067eb3ceba3c39903df5562cb8997b40d61c4':
  Error numbers are target specific.
2012-08-02 16:13:38 -07:00
Elliott Hughes
fccadc38bd am 0b8dda0e: am 673c092e: am 54830578: am f34ecbff: Merge "MIPS support to the linker"
* commit '0b8dda0e422e9669af06d9e6d264fb14652b23b5':
  MIPS support to the linker
2012-08-02 15:45:45 -07:00
Brian Muramatsu
963a8fc036 am fa22fd9f: am 402ec708: Merge "Update msm_camera.h to version that supports instance handle based lookup" into jb-mr1-dev
* commit 'fa22fd9f817e0fe49e0f7524f5589710f1140d8f':
  Update msm_camera.h to version that supports instance handle based lookup
2012-08-02 15:24:34 -07:00
The Android Open Source Project
3a6e56534d am d7b3cc0c: (-s ours) Reconcile with jb-mr1-release - do not merge
* commit 'd7b3cc0c69b02cad4090a0068349f1ab83e3112f':
2012-08-02 15:09:18 -07:00
The Android Open Source Project
2a258c9f2d am 8f2f2466: (-s ours) Reconcile with jb-mr1-release - do not merge
* commit '8f2f24661870c349a19bff71d85ed5eb897c7c9f':
2012-08-01 14:50:42 -07:00
Shih-wei Liao
543960121c am cfc8b93c: am 4f13bdd4: am 7565d5b1: am 0ca9d074: Merge "Had include/arm/fenv.h, but missed include/mips/fenv.h."
* commit 'cfc8b93c4e223f72a2e419f4571f55f7eb819df3':
  Had include/arm/fenv.h, but missed include/mips/fenv.h.
2012-07-31 21:07:50 -07:00
Elliott Hughes
96ca71a7a6 am 029cf34c: am 81f1617a: am 8d2c5b24: am b910b6f8: Merge "Updated the cleaned header file mman.h for MIPS."
* commit '029cf34cfd3fc50fe373527c82855924a1db41ad':
  Updated the cleaned header file mman.h for MIPS.
2012-07-31 15:35:53 -07:00
The Android Open Source Project
338d3fbc8b am 6ac55791: (-s ours) Reconcile with jb-mr1-release - do not merge
* commit '6ac557918a1a5703f0376f659e5cb1a9af6a2901':
2012-07-31 15:05:49 -07:00
Elliott Hughes
0f004be596 am 494e534b: am f1997971: am 7645355e: am a513f70b: Merge "bionic: Stack pointer/signal race condition."
* commit '494e534b003a45c32e06d225cd89ad84777d28f7':
  bionic: Stack pointer/signal race condition.
2012-07-31 10:43:46 -07:00
Elliott Hughes
120e7fbeb9 am ad2e065d: am b78aa539: am bf397b60: am 21372896: Merge "fix __cxa_finalize() implementation to be thread safe."
* commit 'ad2e065de11748e1c33562cd2005ce14843d64f0':
  fix __cxa_finalize() implementation to be thread safe.
2012-07-31 10:43:45 -07:00
The Android Open Source Project
d8b46b7bc4 am 0531d199: Reconcile with jb-mr1-release
* commit '0531d199dca9d70ccfd4642f845de02736ecf87f':
2012-07-30 15:10:37 -07:00
Shih-wei Liao
a68c57ee5f am 0c2d3188: am 18421669: am 1ee6e3b7: Merge "Install crt(begin|end)_so.o to target library path."
* commit '0c2d3188373d7386b5946d1cf70155188cd616cd':
  Install crt(begin|end)_so.o to target library path.
2012-07-30 13:17:01 -07:00
The Android Automerger
f40c69c259 merge in master-release history after reset to master 2012-07-25 07:49:07 -07:00
The Android Automerger
1e52e79b70 merge in master-release history after reset to master 2012-07-24 07:49:06 -07:00
The Android Automerger
aaba380787 merge in master-release history after reset to master 2012-07-20 07:59:22 -07:00
The Android Automerger
43ef6784df merge in master-release history after reset to master 2012-07-19 07:49:05 -07:00
The Android Automerger
d18f341398 merge in master-release history after reset to master 2012-07-17 09:10:34 -07:00
Nick Kralevich
761ba27d62 Merge "FORTIFY_SOURCE: revert memcpy changes." 2012-07-16 15:18:43 -07:00
305 changed files with 5415 additions and 28397 deletions

View File

@@ -6,33 +6,67 @@ include $(LOCAL_PATH)/arch-$(TARGET_ARCH)/syscalls.mk
# ========================================================= # =========================================================
libc_common_src_files := \ libc_common_src_files := \
$(syscall_src) \ $(syscall_src) \
unistd/abort.c \
unistd/alarm.c \ unistd/alarm.c \
unistd/exec.c \ unistd/exec.c \
unistd/fnmatch.c \ unistd/fnmatch.c \
unistd/getopt_long.c \
unistd/syslog.c \ unistd/syslog.c \
unistd/system.c \ unistd/system.c \
unistd/time.c \ unistd/time.c \
stdio/asprintf.c \ stdio/asprintf.c \
stdio/clrerr.c \
stdio/fclose.c \
stdio/fdopen.c \
stdio/feof.c \
stdio/ferror.c \
stdio/fflush.c \ stdio/fflush.c \
stdio/fgetc.c \ stdio/fgetc.c \
stdio/fgetln.c \
stdio/fgetpos.c \
stdio/fgets.c \
stdio/fileno.c \
stdio/findfp.c \ stdio/findfp.c \
stdio/flags.c \
stdio/fopen.c \
stdio/fprintf.c \ stdio/fprintf.c \
stdio/fpurge.c \
stdio/fputc.c \ stdio/fputc.c \
stdio/fputs.c \
stdio/fread.c \ stdio/fread.c \
stdio/freopen.c \ stdio/freopen.c \
stdio/fscanf.c \ stdio/fscanf.c \
stdio/fseek.c \ stdio/fseek.c \
stdio/fsetpos.c \
stdio/ftell.c \ stdio/ftell.c \
stdio/funopen.c \
stdio/fvwrite.c \ stdio/fvwrite.c \
stdio/fwalk.c \
stdio/fwrite.c \
stdio/getc.c \
stdio/getchar.c \
stdio/gets.c \ stdio/gets.c \
stdio/makebuf.c \
stdio/mktemp.c \
stdio/printf.c \ stdio/printf.c \
stdio/putc.c \
stdio/putchar.c \
stdio/puts.c \
stdio/putw.c \
stdio/refill.c \ stdio/refill.c \
stdio/remove.c \
stdio/rewind.c \ stdio/rewind.c \
stdio/rget.c \
stdio/scanf.c \ stdio/scanf.c \
stdio/setbuf.c \
stdio/setbuffer.c \
stdio/setvbuf.c \
stdio/snprintf.c\ stdio/snprintf.c\
stdio/sprintf.c \ stdio/sprintf.c \
stdio/sscanf.c \ stdio/sscanf.c \
stdio/stdio.c \ stdio/stdio.c \
stdio/tempnam.c \
stdio/tmpnam.c \
stdio/ungetc.c \ stdio/ungetc.c \
stdio/vasprintf.c \ stdio/vasprintf.c \
stdio/vfprintf.c \ stdio/vfprintf.c \
@@ -43,11 +77,13 @@ libc_common_src_files := \
stdio/vscanf.c \ stdio/vscanf.c \
stdio/vsscanf.c \ stdio/vsscanf.c \
stdio/wbuf.c \ stdio/wbuf.c \
stdio/wsetup.c \
stdlib/atexit.c \ stdlib/atexit.c \
stdlib/ctype_.c \ stdlib/ctype_.c \
stdlib/exit.c \ stdlib/exit.c \
stdlib/getenv.c \ stdlib/getenv.c \
stdlib/putenv.c \ stdlib/putenv.c \
stdlib/qsort.c \
stdlib/setenv.c \ stdlib/setenv.c \
stdlib/strtod.c \ stdlib/strtod.c \
stdlib/strtoimax.c \ stdlib/strtoimax.c \
@@ -58,17 +94,29 @@ libc_common_src_files := \
stdlib/strtoumax.c \ stdlib/strtoumax.c \
stdlib/tolower_.c \ stdlib/tolower_.c \
stdlib/toupper_.c \ stdlib/toupper_.c \
string/index.c \
string/strcasecmp.c \ string/strcasecmp.c \
string/strcat.c \
string/strchr.c \
string/strcspn.c \ string/strcspn.c \
string/strdup.c \ string/strdup.c \
string/strlcat.c \
string/strlcpy.c \
string/strncat.c \
string/strncpy.c \
string/strpbrk.c \ string/strpbrk.c \
string/__strrchr_chk.c \ string/strrchr.c \
string/strsep.c \ string/strsep.c \
string/strspn.c \ string/strspn.c \
string/strstr.c \ string/strstr.c \
string/strtok.c \ string/strtok.c \
wchar/wcswidth.c \ wchar/wcswidth.c \
wchar/wcsxfrm.c \ wchar/wcsxfrm.c \
tzcode/asctime.c \
tzcode/difftime.c \
tzcode/localtime.c \
tzcode/strftime.c \
tzcode/strptime.c \
bionic/arc4random.c \ bionic/arc4random.c \
bionic/atoi.c \ bionic/atoi.c \
bionic/atol.c \ bionic/atol.c \
@@ -103,8 +151,11 @@ libc_common_src_files := \
bionic/ldexp.c \ bionic/ldexp.c \
bionic/lseek64.c \ bionic/lseek64.c \
bionic/md5.c \ bionic/md5.c \
bionic/memchr.c \
bionic/memmem.c \ bionic/memmem.c \
bionic/memrchr.c \
bionic/memswap.c \ bionic/memswap.c \
bionic/mmap.c \
bionic/openat.c \ bionic/openat.c \
bionic/open.c \ bionic/open.c \
bionic/pathconf.c \ bionic/pathconf.c \
@@ -119,6 +170,7 @@ libc_common_src_files := \
bionic/recv.c \ bionic/recv.c \
bionic/sched_cpualloc.c \ bionic/sched_cpualloc.c \
bionic/sched_cpucount.c \ bionic/sched_cpucount.c \
bionic/sched_getaffinity.c \
bionic/sched_getcpu.c \ bionic/sched_getcpu.c \
bionic/semaphore.c \ bionic/semaphore.c \
bionic/send.c \ bionic/send.c \
@@ -138,11 +190,11 @@ libc_common_src_files := \
bionic/sleep.c \ bionic/sleep.c \
bionic/statfs.c \ bionic/statfs.c \
bionic/strndup.c \ bionic/strndup.c \
bionic/strnlen.c \
bionic/strntoimax.c \ bionic/strntoimax.c \
bionic/strntoumax.c \ bionic/strntoumax.c \
bionic/strtotimeval.c \ bionic/strtotimeval.c \
bionic/system_properties.c \ bionic/system_properties.c \
bionic/system_properties_compat.c \
bionic/tcgetpgrp.c \ bionic/tcgetpgrp.c \
bionic/tcsetpgrp.c \ bionic/tcsetpgrp.c \
bionic/thread_atexit.c \ bionic/thread_atexit.c \
@@ -182,7 +234,6 @@ libc_common_src_files := \
netbsd/nameser/ns_samedomain.c \ netbsd/nameser/ns_samedomain.c \
libc_bionic_src_files := \ libc_bionic_src_files := \
bionic/abort.cpp \
bionic/assert.cpp \ bionic/assert.cpp \
bionic/brk.cpp \ bionic/brk.cpp \
bionic/dirent.cpp \ bionic/dirent.cpp \
@@ -198,7 +249,6 @@ libc_bionic_src_files := \
bionic/__memcpy_chk.cpp \ bionic/__memcpy_chk.cpp \
bionic/__memmove_chk.cpp \ bionic/__memmove_chk.cpp \
bionic/__memset_chk.cpp \ bionic/__memset_chk.cpp \
bionic/mmap.cpp \
bionic/pthread_attr.cpp \ bionic/pthread_attr.cpp \
bionic/pthread_detach.cpp \ bionic/pthread_detach.cpp \
bionic/pthread_equal.cpp \ bionic/pthread_equal.cpp \
@@ -214,14 +264,11 @@ libc_bionic_src_files := \
bionic/raise.cpp \ bionic/raise.cpp \
bionic/sbrk.cpp \ bionic/sbrk.cpp \
bionic/scandir.cpp \ bionic/scandir.cpp \
bionic/sched_getaffinity.cpp \
bionic/__set_errno.cpp \ bionic/__set_errno.cpp \
bionic/setlocale.cpp \ bionic/setlocale.cpp \
bionic/signalfd.cpp \ bionic/signalfd.cpp \
bionic/sigwait.cpp \ bionic/sigwait.cpp \
bionic/statvfs.cpp \
bionic/__strcat_chk.cpp \ bionic/__strcat_chk.cpp \
bionic/__strchr_chk.cpp \
bionic/__strcpy_chk.cpp \ bionic/__strcpy_chk.cpp \
bionic/strerror.cpp \ bionic/strerror.cpp \
bionic/strerror_r.cpp \ bionic/strerror_r.cpp \
@@ -241,67 +288,32 @@ libc_bionic_src_files := \
bionic/wait.cpp \ bionic/wait.cpp \
bionic/wchar.cpp \ bionic/wchar.cpp \
libc_tzcode_src_files := \
tzcode/asctime.c \
tzcode/difftime.c \
tzcode/localtime.c \
tzcode/strftime.c \
tzcode/strptime.c \
libc_upstream_freebsd_src_files := \ libc_upstream_freebsd_src_files := \
upstream-freebsd/lib/libc/stdio/clrerr.c \
upstream-freebsd/lib/libc/stdio/fclose.c \
upstream-freebsd/lib/libc/stdio/fdopen.c \
upstream-freebsd/lib/libc/stdio/feof.c \
upstream-freebsd/lib/libc/stdio/ferror.c \
upstream-freebsd/lib/libc/stdio/fgetln.c \
upstream-freebsd/lib/libc/stdio/fgetpos.c \
upstream-freebsd/lib/libc/stdio/fgets.c \
upstream-freebsd/lib/libc/stdio/fileno.c \
upstream-freebsd/lib/libc/stdio/flags.c \
upstream-freebsd/lib/libc/stdio/fopen.c \
upstream-freebsd/lib/libc/stdio/fpurge.c \
upstream-freebsd/lib/libc/stdio/fputs.c \
upstream-freebsd/lib/libc/stdio/fsetpos.c \
upstream-freebsd/lib/libc/stdio/funopen.c \
upstream-freebsd/lib/libc/stdio/fwalk.c \
upstream-freebsd/lib/libc/stdio/fwrite.c \
upstream-freebsd/lib/libc/stdio/getc.c \
upstream-freebsd/lib/libc/stdio/getchar.c \
upstream-freebsd/lib/libc/stdio/makebuf.c \
upstream-freebsd/lib/libc/stdio/mktemp.c \
upstream-freebsd/lib/libc/stdio/putc.c \
upstream-freebsd/lib/libc/stdio/putchar.c \
upstream-freebsd/lib/libc/stdio/puts.c \
upstream-freebsd/lib/libc/stdio/putw.c \
upstream-freebsd/lib/libc/stdio/remove.c \
upstream-freebsd/lib/libc/stdio/rget.c \
upstream-freebsd/lib/libc/stdio/setbuf.c \
upstream-freebsd/lib/libc/stdio/setbuffer.c \
upstream-freebsd/lib/libc/stdio/setvbuf.c \
upstream-freebsd/lib/libc/stdio/tempnam.c \
upstream-freebsd/lib/libc/stdio/tmpnam.c \
upstream-freebsd/lib/libc/stdio/wsetup.c \
upstream-freebsd/lib/libc/stdlib/getopt_long.c \
upstream-freebsd/lib/libc/stdlib/qsort.c \
upstream-freebsd/lib/libc/stdlib/realpath.c \ upstream-freebsd/lib/libc/stdlib/realpath.c \
upstream-freebsd/lib/libc/string/wcpcpy.c \ upstream-freebsd/lib/libc/string/wcpcpy.c \
upstream-freebsd/lib/libc/string/wcpncpy.c \ upstream-freebsd/lib/libc/string/wcpncpy.c \
upstream-freebsd/lib/libc/string/wcscasecmp.c \ upstream-freebsd/lib/libc/string/wcscasecmp.c \
upstream-freebsd/lib/libc/string/wcscat.c \
upstream-freebsd/lib/libc/string/wcschr.c \
upstream-freebsd/lib/libc/string/wcscmp.c \
upstream-freebsd/lib/libc/string/wcscpy.c \
upstream-freebsd/lib/libc/string/wcscspn.c \ upstream-freebsd/lib/libc/string/wcscspn.c \
upstream-freebsd/lib/libc/string/wcsdup.c \ upstream-freebsd/lib/libc/string/wcsdup.c \
upstream-freebsd/lib/libc/string/wcslcat.c \ upstream-freebsd/lib/libc/string/wcslcat.c \
upstream-freebsd/lib/libc/string/wcslcpy.c \ upstream-freebsd/lib/libc/string/wcslcpy.c \
upstream-freebsd/lib/libc/string/wcslen.c \
upstream-freebsd/lib/libc/string/wcsncasecmp.c \ upstream-freebsd/lib/libc/string/wcsncasecmp.c \
upstream-freebsd/lib/libc/string/wcsncat.c \ upstream-freebsd/lib/libc/string/wcsncat.c \
upstream-freebsd/lib/libc/string/wcsncmp.c \ upstream-freebsd/lib/libc/string/wcsncmp.c \
upstream-freebsd/lib/libc/string/wcsncpy.c \ upstream-freebsd/lib/libc/string/wcsncpy.c \
upstream-freebsd/lib/libc/string/wcsnlen.c \ upstream-freebsd/lib/libc/string/wcsnlen.c \
upstream-freebsd/lib/libc/string/wcspbrk.c \ upstream-freebsd/lib/libc/string/wcspbrk.c \
upstream-freebsd/lib/libc/string/wcsrchr.c \
upstream-freebsd/lib/libc/string/wcsspn.c \ upstream-freebsd/lib/libc/string/wcsspn.c \
upstream-freebsd/lib/libc/string/wcsstr.c \ upstream-freebsd/lib/libc/string/wcsstr.c \
upstream-freebsd/lib/libc/string/wcstok.c \ upstream-freebsd/lib/libc/string/wcstok.c \
upstream-freebsd/lib/libc/string/wmemchr.c \ upstream-freebsd/lib/libc/string/wmemchr.c \
upstream-freebsd/lib/libc/string/wmemcmp.c \
upstream-freebsd/lib/libc/string/wmemcpy.c \ upstream-freebsd/lib/libc/string/wmemcpy.c \
upstream-freebsd/lib/libc/string/wmemmove.c \ upstream-freebsd/lib/libc/string/wmemmove.c \
upstream-freebsd/lib/libc/string/wmemset.c \ upstream-freebsd/lib/libc/string/wmemset.c \
@@ -357,24 +369,6 @@ libc_common_src_files += \
bionic/memmove.c.arm \ bionic/memmove.c.arm \
string/bcopy.c \ string/bcopy.c \
string/strncmp.c \ string/strncmp.c \
string/strcat.c \
string/strncat.c \
string/strncpy.c \
bionic/strchr.cpp \
string/strrchr.c \
bionic/memchr.c \
bionic/memrchr.c \
string/index.c \
bionic/strnlen.c \
string/strlcat.c \
string/strlcpy.c \
upstream-freebsd/lib/libc/string/wcschr.c \
upstream-freebsd/lib/libc/string/wcsrchr.c \
upstream-freebsd/lib/libc/string/wcscmp.c \
upstream-freebsd/lib/libc/string/wcscpy.c \
upstream-freebsd/lib/libc/string/wmemcmp.c \
upstream-freebsd/lib/libc/string/wcslen.c \
upstream-freebsd/lib/libc/string/wcscat.c
# These files need to be arm so that gdbserver # These files need to be arm so that gdbserver
# can set breakpoints in them without messing # can set breakpoints in them without messing
@@ -398,6 +392,7 @@ libc_common_src_files += \
bionic/pthread-rwlocks.c \ bionic/pthread-rwlocks.c \
bionic/pthread-timers.c \ bionic/pthread-timers.c \
bionic/ptrace.c \ bionic/ptrace.c \
string/strcpy.c \
libc_static_common_src_files += \ libc_static_common_src_files += \
bionic/pthread.c \ bionic/pthread.c \
@@ -412,25 +407,7 @@ libc_common_src_files += \
string/bcopy.c \ string/bcopy.c \
string/strcmp.c \ string/strcmp.c \
string/strcpy.c \ string/strcpy.c \
string/strncmp.c \ string/strncmp.c
string/strcat.c \
string/strncat.c \
string/strncpy.c \
bionic/strchr.cpp \
string/strrchr.c \
bionic/memchr.c \
bionic/memrchr.c \
string/index.c \
bionic/strnlen.c \
string/strlcat.c \
string/strlcpy.c \
upstream-freebsd/lib/libc/string/wcschr.c \
upstream-freebsd/lib/libc/string/wcsrchr.c \
upstream-freebsd/lib/libc/string/wcscmp.c \
upstream-freebsd/lib/libc/string/wcscpy.c \
upstream-freebsd/lib/libc/string/wmemcmp.c \
upstream-freebsd/lib/libc/string/wcslen.c \
upstream-freebsd/lib/libc/string/wcscat.c
libc_common_src_files += \ libc_common_src_files += \
bionic/pthread-atfork.c \ bionic/pthread-atfork.c \
@@ -492,6 +469,14 @@ libc_common_cflags := \
-DLOG_ON_HEAP_ERROR \ -DLOG_ON_HEAP_ERROR \
-Wall -Wextra -Wall -Wextra
# these macro definitions are required to implement the
# 'timezone' and 'daylight' global variables, as well as
# properly update the 'tm_gmtoff' field in 'struct tm'.
#
libc_common_cflags += \
-DTM_GMTOFF=tm_gmtoff \
-DUSG_COMPAT=1
ifeq ($(strip $(DEBUG_BIONIC_LIBC)),true) ifeq ($(strip $(DEBUG_BIONIC_LIBC)),true)
libc_common_cflags += -DDEBUG libc_common_cflags += -DDEBUG
endif endif
@@ -569,17 +554,23 @@ libc_crt_target_cflags += \
# static C++ destructors are properly called on dlclose(). # static C++ destructors are properly called on dlclose().
# #
ifeq ($(TARGET_ARCH),arm) ifeq ($(TARGET_ARCH),arm)
libc_crtbegin_extension := c
libc_crt_target_so_cflags := libc_crt_target_so_cflags :=
endif endif
ifeq ($(TARGET_ARCH),mips) ifeq ($(TARGET_ARCH),mips)
libc_crtbegin_extension := S
libc_crt_target_so_cflags := -fPIC libc_crt_target_so_cflags := -fPIC
endif endif
ifeq ($(TARGET_ARCH),x86) ifeq ($(TARGET_ARCH),x86)
libc_crtbegin_extension := c
libc_crt_target_so_cflags := -fPIC libc_crt_target_so_cflags := -fPIC
endif endif
ifeq ($(libc_crtbegin_extension),)
$(error $(TARGET_ARCH) not supported)
endif
libc_crt_target_so_cflags += $(libc_crt_target_cflags) libc_crt_target_so_cflags += $(libc_crt_target_cflags)
libc_crt_target_crtbegin_file := $(LOCAL_PATH)/arch-$(TARGET_ARCH)/bionic/crtbegin.c 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.c 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 # See the comment in crtbrand.c for the reason why we need to generate
# crtbrand.s before generating crtbrand.o. # crtbrand.s before generating crtbrand.o.
@@ -695,28 +686,6 @@ LOCAL_SYSTEM_SHARED_LIBRARIES :=
include $(BUILD_STATIC_LIBRARY) include $(BUILD_STATIC_LIBRARY)
# ========================================================
# libc_tzcode.a - upstream 'tzcode' code
# ========================================================
include $(CLEAR_VARS)
LOCAL_SRC_FILES := $(libc_tzcode_src_files)
LOCAL_CFLAGS := \
$(libc_common_cflags) \
-std=gnu99 \
-DSTD_INSPIRED=1 \
-DTZDIR=\"/system/usr/share/zoneinfo\" \
-DTM_GMTOFF=tm_gmtoff \
-DUSG_COMPAT=1
LOCAL_C_INCLUDES := $(libc_common_c_includes)
LOCAL_MODULE := libc_tzcode
LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk
LOCAL_SYSTEM_SHARED_LIBRARIES :=
include $(BUILD_STATIC_LIBRARY)
# ======================================================== # ========================================================
# libc_freebsd.a - upstream FreeBSD C library code # libc_freebsd.a - upstream FreeBSD C library code
# ======================================================== # ========================================================
@@ -792,14 +761,12 @@ LOCAL_CFLAGS := $(libc_common_cflags) \
LOCAL_C_INCLUDES := $(libc_common_c_includes) LOCAL_C_INCLUDES := $(libc_common_c_includes)
LOCAL_MODULE := libc_common LOCAL_MODULE := libc_common
LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk
LOCAL_WHOLE_STATIC_LIBRARIES := \ LOCAL_WHOLE_STATIC_LIBRARIES := libbionic_ssp libc_bionic libc_freebsd libc_netbsd
libbionic_ssp \
libc_bionic \
libc_freebsd \
libc_netbsd \
libc_tzcode
LOCAL_SYSTEM_SHARED_LIBRARIES := LOCAL_SYSTEM_SHARED_LIBRARIES :=
# TODO: split out the asflags.
LOCAL_ASFLAGS := $(LOCAL_CFLAGS)
include $(BUILD_STATIC_LIBRARY) include $(BUILD_STATIC_LIBRARY)

View File

@@ -1673,6 +1673,38 @@ SUCH DAMAGE.
------------------------------------------------------------------- -------------------------------------------------------------------
Copyright (c) 1990, 1993
The Regents of the University of California. All rights reserved.
This code is derived from software contributed to Berkeley by
Chris Torek.
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.
4. 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.
-------------------------------------------------------------------
Copyright (c) 1990, 1993 Copyright (c) 1990, 1993
The Regents of the University of California. All rights reserved. The Regents of the University of California. All rights reserved.
@@ -2820,7 +2852,7 @@ are met:
2. Redistributions in binary form must reproduce the above copyright 2. Redistributions in binary form must reproduce the above copyright
notices, this list of conditions and the following disclaimer in the notices, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution. documentation and/or other materials provided with the distribution.
3. Neither the name of the University nor the names of its contributors 4. Neither the name of the University nor the names of its contributors
may be used to endorse or promote products derived from this software may be used to endorse or promote products derived from this software
without specific prior written permission. without specific prior written permission.
@@ -3060,6 +3092,13 @@ are met:
2. Redistributions in binary form must reproduce the above copyright 2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution. documentation and/or other materials provided with the distribution.
3. All advertising materials mentioning features or use of this software
must display the following acknowledgement:
This product includes software developed by the NetBSD
Foundation, Inc. and its contributors.
4. Neither the name of The NetBSD Foundation 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 NETBSD FOUNDATION, INC. AND CONTRIBUTORS THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
@@ -3877,36 +3916,6 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
------------------------------------------------------------------- -------------------------------------------------------------------
Copyright (c) 2010, 2011 Intel Corporation
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 Intel Corporation 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.
-------------------------------------------------------------------
Copyright (c) 2010, Intel Corporation Copyright (c) 2010, Intel Corporation
All rights reserved. All rights reserved.
@@ -3937,36 +3946,6 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
------------------------------------------------------------------- -------------------------------------------------------------------
Copyright (c) 2011 Intel Corporation
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 Intel Corporation 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.
-------------------------------------------------------------------
Copyright (c) 2011 The Android Open Source Project Copyright (c) 2011 The Android Open Source Project
Copyright (c) 2008 ARM Ltd Copyright (c) 2008 ARM Ltd
All rights reserved. All rights reserved.
@@ -3996,36 +3975,6 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
------------------------------------------------------------------- -------------------------------------------------------------------
Copyright (c) 2011, Intel Corporation
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 Intel Corporation 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.
-------------------------------------------------------------------
Copyright (c) 2011, VMware, Inc. Copyright (c) 2011, VMware, Inc.
All rights reserved. All rights reserved.
@@ -4109,38 +4058,6 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
------------------------------------------------------------------- -------------------------------------------------------------------
Copyright (c) 2013, Linaro Limited
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 Linaro Limited 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
HOLDER 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.
-------------------------------------------------------------------
Copyright (c)1999 Citrus Project, Copyright (c)1999 Citrus Project,
All rights reserved. All rights reserved.

View File

@@ -201,8 +201,6 @@ int removexattr(const char *, const char *) 1
int lremovexattr(const char *, const char *) 1 int lremovexattr(const char *, const char *) 1
int __statfs64:statfs64(const char *, size_t, struct statfs *) 1 int __statfs64:statfs64(const char *, size_t, struct statfs *) 1
long unshare(unsigned long) 1 long unshare(unsigned long) 1
int swapon(const char *, int) 1
int swapoff(const char *) 1
# time # time
int pause () 1 int pause () 1
@@ -223,9 +221,6 @@ int __timer_getoverrun:timer_getoverrun(timer_t)
int __timer_delete:timer_delete(timer_t) 1 int __timer_delete:timer_delete(timer_t) 1
int utimes(const char*, const struct timeval tvp[2]) 1 int utimes(const char*, const struct timeval tvp[2]) 1
int utimensat(int, const char *, const struct timespec times[2], int) 1 int utimensat(int, const char *, const struct timespec times[2], int) 1
int timerfd_create(clockid_t, int) 1
int timerfd_settime(int, int, const struct itimerspec *, struct itimerspec *) 1
int timerfd_gettime(int, struct itimerspec *) 1
# signals # signals
int sigaction(int, const struct sigaction *, struct sigaction *) 1 int sigaction(int, const struct sigaction *, struct sigaction *) 1

View File

@@ -15,6 +15,7 @@ _LIBC_ARCH_COMMON_SRC_FILES := \
arch-arm/bionic/setjmp.S \ arch-arm/bionic/setjmp.S \
arch-arm/bionic/sigsetjmp.S \ arch-arm/bionic/sigsetjmp.S \
arch-arm/bionic/strcpy.S \ arch-arm/bionic/strcpy.S \
arch-arm/bionic/strlen.c.arm \
arch-arm/bionic/syscall.S \ arch-arm/bionic/syscall.S \
arch-arm/bionic/tgkill.S \ arch-arm/bionic/tgkill.S \
arch-arm/bionic/tkill.S \ arch-arm/bionic/tkill.S \
@@ -28,7 +29,7 @@ _LIBC_ARCH_DYNAMIC_SRC_FILES := \
arch-arm/bionic/exidx_dynamic.c arch-arm/bionic/exidx_dynamic.c
ifeq ($(strip $(wildcard bionic/libc/arch-arm/$(TARGET_CPU_VARIANT)/$(TARGET_CPU_VARIANT).mk)),) ifeq ($(strip $(wildcard bionic/libc/arch-arm/$(TARGET_CPU_VARIANT)/$(TARGET_CPU_VARIANT).mk)),)
$(error "TARGET_CPU_VARIANT not set or set to an unknown value. Possible values are cortex-a7, cortex-a8, cortex-a9, cortex-a15, krait. Use generic for devices that do not have a CPU similar to any of the supported cpu variants.") $(error "TARGET_CPU_VARIANT not set or set to an unknown value. Possible values are cortex-a9, cortex-a15, krait. Use generic for devices that do not have a CPU similar to any of the supported cpu variants.")
endif endif
include bionic/libc/arch-arm/$(TARGET_CPU_VARIANT)/$(TARGET_CPU_VARIANT).mk include bionic/libc/arch-arm/$(TARGET_CPU_VARIANT)/$(TARGET_CPU_VARIANT).mk

View File

@@ -38,5 +38,5 @@
ENTRY(abort) ENTRY(abort)
.save {r3, r14} .save {r3, r14}
stmfd sp!, {r3, r14} stmfd sp!, {r3, r14}
bl PIC_SYM(_C_LABEL(__libc_android_abort), PLT) blx PIC_SYM(_C_LABEL(__libc_android_abort), PLT)
END(abort) END(abort)

View File

@@ -32,33 +32,33 @@
// int __pthread_clone(void* (*fn)(void*), void* child_stack, int flags, void* arg); // int __pthread_clone(void* (*fn)(void*), void* child_stack, int flags, void* arg);
ENTRY(__pthread_clone) ENTRY(__pthread_clone)
# Push 'fn' and 'arg' onto 'child_stack'. # Copy the args onto the new stack.
stmdb r1!, {r0, r3} stmdb r1!, {r0, r3}
# The sys_clone system call only takes two arguments: 'flags' and 'child_stack'. # The sys_clone system call only takes two arguments: 'flags' and 'child_stack'.
# 'child_stack' is already in r1, but we need to move 'flags' into position. # 'child_stack' is already in r1, but we need to move 'flags' into position.
mov r0, r2 mov r0, r2
stmfd sp!, {r4, r7}
# System call. # System call.
mov ip, r7
ldr r7, =__NR_clone ldr r7, =__NR_clone
swi #0 swi #0
# Child?
movs r0, r0 movs r0, r0
beq 1f beq 1f
# Parent. # In parent, reload saved registers then either return or set errno.
mov r7, ip ldmfd sp!, {r4, r7}
cmn r0, #(MAX_ERRNO + 1) cmn r0, #(MAX_ERRNO + 1)
bxls lr bxls lr
neg r0, r0 neg r0, r0
b __set_errno b __set_errno
1: # Child. 1: # The child.
# Pop 'fn' and 'arg' back off the stack and call __thread_entry. # pick the function arg and call address off the stack and jump
# to the C __thread_entry function which does some setup and then
# calls the thread's start function
pop {r0, r1} pop {r0, r1}
# __thread_entry also needs our stack pointer. # __thread_entry needs the TLS pointer
mov r2, sp mov r2, sp
b __thread_entry b __thread_entry
END(__pthread_clone) END(__pthread_clone)

View File

@@ -34,10 +34,11 @@
// __futex_syscall3(*ftx, op, val) // __futex_syscall3(*ftx, op, val)
ENTRY(__futex_syscall3) ENTRY(__futex_syscall3)
mov ip, r7 stmdb sp!, {r4, r7}
.save {r4, r7}
ldr r7, =__NR_futex ldr r7, =__NR_futex
swi #0 swi #0
mov r7, ip ldmia sp!, {r4, r7}
bx lr bx lr
END(__futex_syscall3) END(__futex_syscall3)
@@ -48,23 +49,25 @@ END(__futex_syscall4)
// __futex_wait(*ftx, val, *timespec) // __futex_wait(*ftx, val, *timespec)
ENTRY(__futex_wait) ENTRY(__futex_wait)
mov ip, r7 stmdb sp!, {r4, r7}
.save {r4, r7}
mov r3, r2 mov r3, r2
mov r2, r1 mov r2, r1
mov r1, #FUTEX_WAIT mov r1, #FUTEX_WAIT
ldr r7, =__NR_futex ldr r7, =__NR_futex
swi #0 swi #0
mov r7, ip ldmia sp!, {r4, r7}
bx lr bx lr
END(__futex_wait) END(__futex_wait)
// __futex_wake(*ftx, counter) // __futex_wake(*ftx, counter)
ENTRY(__futex_wake) ENTRY(__futex_wake)
mov ip, r7 .save {r4, r7}
stmdb sp!, {r4, r7}
mov r2, r1 mov r2, r1
mov r1, #FUTEX_WAKE mov r1, #FUTEX_WAKE
ldr r7, =__NR_futex ldr r7, =__NR_futex
swi #0 swi #0
mov r7, ip ldmia sp!, {r4, r7}
bx lr bx lr
END(__futex_wake) END(__futex_wake)

View File

@@ -1,614 +0,0 @@
/* Copyright (c) 2013, Linaro Limited
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 Linaro Limited 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
HOLDER 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.
*/
/*
This memcpy routine is optimised for Cortex-A15 cores and takes advantage
of VFP or NEON when built with the appropriate flags.
Assumptions:
ARMv6 (ARMv7-a if using Neon)
ARM state
Unaligned accesses
LDRD/STRD support unaligned word accesses
*/
#include <machine/cpu-features.h>
#include <machine/asm.h>
.syntax unified
/* This implementation requires ARM state. */
.arm
#ifdef __ARM_NEON__
.fpu neon
.arch armv7-a
# define FRAME_SIZE 4
# define USE_VFP
# define USE_NEON
#elif !defined (__SOFTFP__)
.arch armv6
.fpu vfpv2
# define FRAME_SIZE 32
# define USE_VFP
#else
.arch armv6
# define FRAME_SIZE 32
#endif
/* Old versions of GAS incorrectly implement the NEON align semantics. */
#ifdef BROKEN_ASM_NEON_ALIGN
#define ALIGN(addr, align) addr,:align
#else
#define ALIGN(addr, align) addr:align
#endif
#define PC_OFFSET 8 /* PC pipeline compensation. */
#define INSN_SIZE 4
/* Call parameters. */
#define dstin r0
#define src r1
#define count r2
/* Locals. */
#define tmp1 r3
#define dst ip
#define tmp2 r10
#ifndef USE_NEON
/* For bulk copies using GP registers. */
#define A_l r2 /* Call-clobbered. */
#define A_h r3 /* Call-clobbered. */
#define B_l r4
#define B_h r5
#define C_l r6
#define C_h r7
#define D_l r8
#define D_h r9
#endif
/* Number of lines ahead to pre-fetch data. If you change this the code
below will need adjustment to compensate. */
#define prefetch_lines 5
#ifdef USE_VFP
.macro cpy_line_vfp vreg, base
vstr \vreg, [dst, #\base]
vldr \vreg, [src, #\base]
vstr d0, [dst, #\base + 8]
vldr d0, [src, #\base + 8]
vstr d1, [dst, #\base + 16]
vldr d1, [src, #\base + 16]
vstr d2, [dst, #\base + 24]
vldr d2, [src, #\base + 24]
vstr \vreg, [dst, #\base + 32]
vldr \vreg, [src, #\base + prefetch_lines * 64 - 32]
vstr d0, [dst, #\base + 40]
vldr d0, [src, #\base + 40]
vstr d1, [dst, #\base + 48]
vldr d1, [src, #\base + 48]
vstr d2, [dst, #\base + 56]
vldr d2, [src, #\base + 56]
.endm
.macro cpy_tail_vfp vreg, base
vstr \vreg, [dst, #\base]
vldr \vreg, [src, #\base]
vstr d0, [dst, #\base + 8]
vldr d0, [src, #\base + 8]
vstr d1, [dst, #\base + 16]
vldr d1, [src, #\base + 16]
vstr d2, [dst, #\base + 24]
vldr d2, [src, #\base + 24]
vstr \vreg, [dst, #\base + 32]
vstr d0, [dst, #\base + 40]
vldr d0, [src, #\base + 40]
vstr d1, [dst, #\base + 48]
vldr d1, [src, #\base + 48]
vstr d2, [dst, #\base + 56]
vldr d2, [src, #\base + 56]
.endm
#endif
.p2align 6
ENTRY(memcpy)
mov dst, dstin /* Preserve dstin, we need to return it. */
cmp count, #64
bge .Lcpy_not_short
/* Deal with small copies quickly by dropping straight into the
exit block. */
.Ltail63unaligned:
#ifdef USE_NEON
and tmp1, count, #0x38
rsb tmp1, tmp1, #(56 - PC_OFFSET + INSN_SIZE)
add pc, pc, tmp1
vld1.8 {d0}, [src]! /* 14 words to go. */
vst1.8 {d0}, [dst]!
vld1.8 {d0}, [src]! /* 12 words to go. */
vst1.8 {d0}, [dst]!
vld1.8 {d0}, [src]! /* 10 words to go. */
vst1.8 {d0}, [dst]!
vld1.8 {d0}, [src]! /* 8 words to go. */
vst1.8 {d0}, [dst]!
vld1.8 {d0}, [src]! /* 6 words to go. */
vst1.8 {d0}, [dst]!
vld1.8 {d0}, [src]! /* 4 words to go. */
vst1.8 {d0}, [dst]!
vld1.8 {d0}, [src]! /* 2 words to go. */
vst1.8 {d0}, [dst]!
tst count, #4
ldrne tmp1, [src], #4
strne tmp1, [dst], #4
#else
/* Copy up to 15 full words of data. May not be aligned. */
/* Cannot use VFP for unaligned data. */
and tmp1, count, #0x3c
add dst, dst, tmp1
add src, src, tmp1
rsb tmp1, tmp1, #(60 - PC_OFFSET/2 + INSN_SIZE/2)
/* Jump directly into the sequence below at the correct offset. */
add pc, pc, tmp1, lsl #1
ldr tmp1, [src, #-60] /* 15 words to go. */
str tmp1, [dst, #-60]
ldr tmp1, [src, #-56] /* 14 words to go. */
str tmp1, [dst, #-56]
ldr tmp1, [src, #-52]
str tmp1, [dst, #-52]
ldr tmp1, [src, #-48] /* 12 words to go. */
str tmp1, [dst, #-48]
ldr tmp1, [src, #-44]
str tmp1, [dst, #-44]
ldr tmp1, [src, #-40] /* 10 words to go. */
str tmp1, [dst, #-40]
ldr tmp1, [src, #-36]
str tmp1, [dst, #-36]
ldr tmp1, [src, #-32] /* 8 words to go. */
str tmp1, [dst, #-32]
ldr tmp1, [src, #-28]
str tmp1, [dst, #-28]
ldr tmp1, [src, #-24] /* 6 words to go. */
str tmp1, [dst, #-24]
ldr tmp1, [src, #-20]
str tmp1, [dst, #-20]
ldr tmp1, [src, #-16] /* 4 words to go. */
str tmp1, [dst, #-16]
ldr tmp1, [src, #-12]
str tmp1, [dst, #-12]
ldr tmp1, [src, #-8] /* 2 words to go. */
str tmp1, [dst, #-8]
ldr tmp1, [src, #-4]
str tmp1, [dst, #-4]
#endif
lsls count, count, #31
ldrhcs tmp1, [src], #2
ldrbne src, [src] /* Src is dead, use as a scratch. */
strhcs tmp1, [dst], #2
strbne src, [dst]
bx lr
.Lcpy_not_short:
/* At least 64 bytes to copy, but don't know the alignment yet. */
str tmp2, [sp, #-FRAME_SIZE]!
and tmp2, src, #7
and tmp1, dst, #7
cmp tmp1, tmp2
bne .Lcpy_notaligned
#ifdef USE_VFP
/* Magic dust alert! Force VFP on Cortex-A9. Experiments show
that the FP pipeline is much better at streaming loads and
stores. This is outside the critical loop. */
vmov.f32 s0, s0
#endif
/* SRC and DST have the same mutual 32-bit alignment, but we may
still need to pre-copy some bytes to get to natural alignment.
We bring DST into full 64-bit alignment. */
lsls tmp2, dst, #29
beq 1f
rsbs tmp2, tmp2, #0
sub count, count, tmp2, lsr #29
ldrmi tmp1, [src], #4
strmi tmp1, [dst], #4
lsls tmp2, tmp2, #2
ldrhcs tmp1, [src], #2
ldrbne tmp2, [src], #1
strhcs tmp1, [dst], #2
strbne tmp2, [dst], #1
1:
subs tmp2, count, #64 /* Use tmp2 for count. */
blt .Ltail63aligned
cmp tmp2, #512
bge .Lcpy_body_long
.Lcpy_body_medium: /* Count in tmp2. */
#ifdef USE_VFP
1:
vldr d0, [src, #0]
subs tmp2, tmp2, #64
vldr d1, [src, #8]
vstr d0, [dst, #0]
vldr d0, [src, #16]
vstr d1, [dst, #8]
vldr d1, [src, #24]
vstr d0, [dst, #16]
vldr d0, [src, #32]
vstr d1, [dst, #24]
vldr d1, [src, #40]
vstr d0, [dst, #32]
vldr d0, [src, #48]
vstr d1, [dst, #40]
vldr d1, [src, #56]
vstr d0, [dst, #48]
add src, src, #64
vstr d1, [dst, #56]
add dst, dst, #64
bge 1b
tst tmp2, #0x3f
beq .Ldone
.Ltail63aligned: /* Count in tmp2. */
and tmp1, tmp2, #0x38
add dst, dst, tmp1
add src, src, tmp1
rsb tmp1, tmp1, #(56 - PC_OFFSET + INSN_SIZE)
add pc, pc, tmp1
vldr d0, [src, #-56] /* 14 words to go. */
vstr d0, [dst, #-56]
vldr d0, [src, #-48] /* 12 words to go. */
vstr d0, [dst, #-48]
vldr d0, [src, #-40] /* 10 words to go. */
vstr d0, [dst, #-40]
vldr d0, [src, #-32] /* 8 words to go. */
vstr d0, [dst, #-32]
vldr d0, [src, #-24] /* 6 words to go. */
vstr d0, [dst, #-24]
vldr d0, [src, #-16] /* 4 words to go. */
vstr d0, [dst, #-16]
vldr d0, [src, #-8] /* 2 words to go. */
vstr d0, [dst, #-8]
#else
sub src, src, #8
sub dst, dst, #8
1:
ldrd A_l, A_h, [src, #8]
strd A_l, A_h, [dst, #8]
ldrd A_l, A_h, [src, #16]
strd A_l, A_h, [dst, #16]
ldrd A_l, A_h, [src, #24]
strd A_l, A_h, [dst, #24]
ldrd A_l, A_h, [src, #32]
strd A_l, A_h, [dst, #32]
ldrd A_l, A_h, [src, #40]
strd A_l, A_h, [dst, #40]
ldrd A_l, A_h, [src, #48]
strd A_l, A_h, [dst, #48]
ldrd A_l, A_h, [src, #56]
strd A_l, A_h, [dst, #56]
ldrd A_l, A_h, [src, #64]!
strd A_l, A_h, [dst, #64]!
subs tmp2, tmp2, #64
bge 1b
tst tmp2, #0x3f
bne 1f
ldr tmp2,[sp], #FRAME_SIZE
bx lr
1:
add src, src, #8
add dst, dst, #8
.Ltail63aligned: /* Count in tmp2. */
/* Copy up to 7 d-words of data. Similar to Ltail63unaligned, but
we know that the src and dest are 32-bit aligned so we can use
LDRD/STRD to improve efficiency. */
/* TMP2 is now negative, but we don't care about that. The bottom
six bits still tell us how many bytes are left to copy. */
and tmp1, tmp2, #0x38
add dst, dst, tmp1
add src, src, tmp1
rsb tmp1, tmp1, #(56 - PC_OFFSET + INSN_SIZE)
add pc, pc, tmp1
ldrd A_l, A_h, [src, #-56] /* 14 words to go. */
strd A_l, A_h, [dst, #-56]
ldrd A_l, A_h, [src, #-48] /* 12 words to go. */
strd A_l, A_h, [dst, #-48]
ldrd A_l, A_h, [src, #-40] /* 10 words to go. */
strd A_l, A_h, [dst, #-40]
ldrd A_l, A_h, [src, #-32] /* 8 words to go. */
strd A_l, A_h, [dst, #-32]
ldrd A_l, A_h, [src, #-24] /* 6 words to go. */
strd A_l, A_h, [dst, #-24]
ldrd A_l, A_h, [src, #-16] /* 4 words to go. */
strd A_l, A_h, [dst, #-16]
ldrd A_l, A_h, [src, #-8] /* 2 words to go. */
strd A_l, A_h, [dst, #-8]
#endif
tst tmp2, #4
ldrne tmp1, [src], #4
strne tmp1, [dst], #4
lsls tmp2, tmp2, #31 /* Count (tmp2) now dead. */
ldrhcs tmp1, [src], #2
ldrbne tmp2, [src]
strhcs tmp1, [dst], #2
strbne tmp2, [dst]
.Ldone:
ldr tmp2, [sp], #FRAME_SIZE
bx lr
.Lcpy_body_long: /* Count in tmp2. */
/* Long copy. We know that there's at least (prefetch_lines * 64)
bytes to go. */
#ifdef USE_VFP
/* Don't use PLD. Instead, read some data in advance of the current
copy position into a register. This should act like a PLD
operation but we won't have to repeat the transfer. */
vldr d3, [src, #0]
vldr d4, [src, #64]
vldr d5, [src, #128]
vldr d6, [src, #192]
vldr d7, [src, #256]
vldr d0, [src, #8]
vldr d1, [src, #16]
vldr d2, [src, #24]
add src, src, #32
subs tmp2, tmp2, #prefetch_lines * 64 * 2
blt 2f
1:
cpy_line_vfp d3, 0
cpy_line_vfp d4, 64
cpy_line_vfp d5, 128
add dst, dst, #3 * 64
add src, src, #3 * 64
cpy_line_vfp d6, 0
cpy_line_vfp d7, 64
add dst, dst, #2 * 64
add src, src, #2 * 64
subs tmp2, tmp2, #prefetch_lines * 64
bge 1b
2:
cpy_tail_vfp d3, 0
cpy_tail_vfp d4, 64
cpy_tail_vfp d5, 128
add src, src, #3 * 64
add dst, dst, #3 * 64
cpy_tail_vfp d6, 0
vstr d7, [dst, #64]
vldr d7, [src, #64]
vstr d0, [dst, #64 + 8]
vldr d0, [src, #64 + 8]
vstr d1, [dst, #64 + 16]
vldr d1, [src, #64 + 16]
vstr d2, [dst, #64 + 24]
vldr d2, [src, #64 + 24]
vstr d7, [dst, #64 + 32]
add src, src, #96
vstr d0, [dst, #64 + 40]
vstr d1, [dst, #64 + 48]
vstr d2, [dst, #64 + 56]
add dst, dst, #128
add tmp2, tmp2, #prefetch_lines * 64
b .Lcpy_body_medium
#else
/* Long copy. Use an SMS style loop to maximize the I/O
bandwidth of the core. We don't have enough spare registers
to synthesise prefetching, so use PLD operations. */
/* Pre-bias src and dst. */
sub src, src, #8
sub dst, dst, #8
pld [src, #8]
pld [src, #72]
subs tmp2, tmp2, #64
pld [src, #136]
ldrd A_l, A_h, [src, #8]
strd B_l, B_h, [sp, #8]
ldrd B_l, B_h, [src, #16]
strd C_l, C_h, [sp, #16]
ldrd C_l, C_h, [src, #24]
strd D_l, D_h, [sp, #24]
pld [src, #200]
ldrd D_l, D_h, [src, #32]!
b 1f
.p2align 6
2:
pld [src, #232]
strd A_l, A_h, [dst, #40]
ldrd A_l, A_h, [src, #40]
strd B_l, B_h, [dst, #48]
ldrd B_l, B_h, [src, #48]
strd C_l, C_h, [dst, #56]
ldrd C_l, C_h, [src, #56]
strd D_l, D_h, [dst, #64]!
ldrd D_l, D_h, [src, #64]!
subs tmp2, tmp2, #64
1:
strd A_l, A_h, [dst, #8]
ldrd A_l, A_h, [src, #8]
strd B_l, B_h, [dst, #16]
ldrd B_l, B_h, [src, #16]
strd C_l, C_h, [dst, #24]
ldrd C_l, C_h, [src, #24]
strd D_l, D_h, [dst, #32]
ldrd D_l, D_h, [src, #32]
bcs 2b
/* Save the remaining bytes and restore the callee-saved regs. */
strd A_l, A_h, [dst, #40]
add src, src, #40
strd B_l, B_h, [dst, #48]
ldrd B_l, B_h, [sp, #8]
strd C_l, C_h, [dst, #56]
ldrd C_l, C_h, [sp, #16]
strd D_l, D_h, [dst, #64]
ldrd D_l, D_h, [sp, #24]
add dst, dst, #72
tst tmp2, #0x3f
bne .Ltail63aligned
ldr tmp2, [sp], #FRAME_SIZE
bx lr
#endif
.Lcpy_notaligned:
pld [src]
pld [src, #64]
/* There's at least 64 bytes to copy, but there is no mutual
alignment. */
/* Bring DST to 64-bit alignment. */
lsls tmp2, dst, #29
pld [src, #(2 * 64)]
beq 1f
rsbs tmp2, tmp2, #0
sub count, count, tmp2, lsr #29
ldrmi tmp1, [src], #4
strmi tmp1, [dst], #4
lsls tmp2, tmp2, #2
ldrbne tmp1, [src], #1
ldrhcs tmp2, [src], #2
strbne tmp1, [dst], #1
strhcs tmp2, [dst], #2
1:
pld [src, #(3 * 64)]
subs count, count, #64
ldrmi tmp2, [sp], #FRAME_SIZE
bmi .Ltail63unaligned
pld [src, #(4 * 64)]
#ifdef USE_NEON
vld1.8 {d0-d3}, [src]!
vld1.8 {d4-d7}, [src]!
subs count, count, #64
bmi 2f
1:
pld [src, #(4 * 64)]
vst1.8 {d0-d3}, [ALIGN (dst, 64)]!
vld1.8 {d0-d3}, [src]!
vst1.8 {d4-d7}, [ALIGN (dst, 64)]!
vld1.8 {d4-d7}, [src]!
subs count, count, #64
bpl 1b
2:
vst1.8 {d0-d3}, [ALIGN (dst, 64)]!
vst1.8 {d4-d7}, [ALIGN (dst, 64)]!
ands count, count, #0x3f
#else
/* Use an SMS style loop to maximize the I/O bandwidth. */
sub src, src, #4
sub dst, dst, #8
subs tmp2, count, #64 /* Use tmp2 for count. */
ldr A_l, [src, #4]
ldr A_h, [src, #8]
strd B_l, B_h, [sp, #8]
ldr B_l, [src, #12]
ldr B_h, [src, #16]
strd C_l, C_h, [sp, #16]
ldr C_l, [src, #20]
ldr C_h, [src, #24]
strd D_l, D_h, [sp, #24]
ldr D_l, [src, #28]
ldr D_h, [src, #32]!
b 1f
.p2align 6
2:
pld [src, #(5 * 64) - (32 - 4)]
strd A_l, A_h, [dst, #40]
ldr A_l, [src, #36]
ldr A_h, [src, #40]
strd B_l, B_h, [dst, #48]
ldr B_l, [src, #44]
ldr B_h, [src, #48]
strd C_l, C_h, [dst, #56]
ldr C_l, [src, #52]
ldr C_h, [src, #56]
strd D_l, D_h, [dst, #64]!
ldr D_l, [src, #60]
ldr D_h, [src, #64]!
subs tmp2, tmp2, #64
1:
strd A_l, A_h, [dst, #8]
ldr A_l, [src, #4]
ldr A_h, [src, #8]
strd B_l, B_h, [dst, #16]
ldr B_l, [src, #12]
ldr B_h, [src, #16]
strd C_l, C_h, [dst, #24]
ldr C_l, [src, #20]
ldr C_h, [src, #24]
strd D_l, D_h, [dst, #32]
ldr D_l, [src, #28]
ldr D_h, [src, #32]
bcs 2b
/* Save the remaining bytes and restore the callee-saved regs. */
strd A_l, A_h, [dst, #40]
add src, src, #36
strd B_l, B_h, [dst, #48]
ldrd B_l, B_h, [sp, #8]
strd C_l, C_h, [dst, #56]
ldrd C_l, C_h, [sp, #16]
strd D_l, D_h, [dst, #64]
ldrd D_l, D_h, [sp, #24]
add dst, dst, #72
ands count, tmp2, #0x3f
#endif
ldr tmp2, [sp], #FRAME_SIZE
bne .Ltail63unaligned
bx lr
END(memcpy)

View File

@@ -33,16 +33,16 @@ size_t strlen(const char *s)
{ {
__builtin_prefetch(s); __builtin_prefetch(s);
__builtin_prefetch(s+32); __builtin_prefetch(s+32);
union { union {
const char *b; const char *b;
const uint32_t *w; const uint32_t *w;
uintptr_t i; uintptr_t i;
} u; } u;
// these are some scratch variables for the asm code below // these are some scratch variables for the asm code below
uint32_t v, t; uint32_t v, t;
// initialize the string length to zero // initialize the string length to zero
size_t l = 0; size_t l = 0;
@@ -60,60 +60,52 @@ size_t strlen(const char *s)
// We need to process 32 bytes per loop to schedule PLD properly // We need to process 32 bytes per loop to schedule PLD properly
// and achieve the maximum bus speed. // and achieve the maximum bus speed.
asm( asm(
"ldr %[v], [%[s]], #4 \n" "ldr %[v], [ %[s] ], #4 \n"
"sub %[l], %[l], %[s] \n" "sub %[l], %[l], %[s] \n"
"0: \n" "0: \n"
#if __ARM_HAVE_PLD #if __ARM_HAVE_PLD
"pld [%[s], #64] \n" "pld [ %[s], #64 ] \n"
#endif #endif
"sub %[t], %[v], %[mask], lsr #7\n" "sub %[t], %[v], %[mask], lsr #7\n"
"and %[t], %[t], %[mask] \n" "and %[t], %[t], %[mask] \n"
"bics %[t], %[t], %[v] \n" "bics %[t], %[t], %[v] \n"
"it eq \n" "ldreq %[v], [ %[s] ], #4 \n"
"ldreq %[v], [%[s]], #4 \n"
#if !defined(__OPTIMIZE_SIZE__) #if !defined(__OPTIMIZE_SIZE__)
"bne 1f \n" "bne 1f \n"
"sub %[t], %[v], %[mask], lsr #7\n" "sub %[t], %[v], %[mask], lsr #7\n"
"and %[t], %[t], %[mask] \n" "and %[t], %[t], %[mask] \n"
"bics %[t], %[t], %[v] \n" "bics %[t], %[t], %[v] \n"
"it eq \n" "ldreq %[v], [ %[s] ], #4 \n"
"ldreq %[v], [%[s]], #4 \n"
"bne 1f \n" "bne 1f \n"
"sub %[t], %[v], %[mask], lsr #7\n" "sub %[t], %[v], %[mask], lsr #7\n"
"and %[t], %[t], %[mask] \n" "and %[t], %[t], %[mask] \n"
"bics %[t], %[t], %[v] \n" "bics %[t], %[t], %[v] \n"
"it eq \n" "ldreq %[v], [ %[s] ], #4 \n"
"ldreq %[v], [%[s]], #4 \n"
"bne 1f \n" "bne 1f \n"
"sub %[t], %[v], %[mask], lsr #7\n" "sub %[t], %[v], %[mask], lsr #7\n"
"and %[t], %[t], %[mask] \n" "and %[t], %[t], %[mask] \n"
"bics %[t], %[t], %[v] \n" "bics %[t], %[t], %[v] \n"
"it eq \n" "ldreq %[v], [ %[s] ], #4 \n"
"ldreq %[v], [%[s]], #4 \n"
"bne 1f \n" "bne 1f \n"
"sub %[t], %[v], %[mask], lsr #7\n" "sub %[t], %[v], %[mask], lsr #7\n"
"and %[t], %[t], %[mask] \n" "and %[t], %[t], %[mask] \n"
"bics %[t], %[t], %[v] \n" "bics %[t], %[t], %[v] \n"
"it eq \n" "ldreq %[v], [ %[s] ], #4 \n"
"ldreq %[v], [%[s]], #4 \n"
"bne 1f \n" "bne 1f \n"
"sub %[t], %[v], %[mask], lsr #7\n" "sub %[t], %[v], %[mask], lsr #7\n"
"and %[t], %[t], %[mask] \n" "and %[t], %[t], %[mask] \n"
"bics %[t], %[t], %[v] \n" "bics %[t], %[t], %[v] \n"
"it eq \n" "ldreq %[v], [ %[s] ], #4 \n"
"ldreq %[v], [%[s]], #4 \n"
"bne 1f \n" "bne 1f \n"
"sub %[t], %[v], %[mask], lsr #7\n" "sub %[t], %[v], %[mask], lsr #7\n"
"and %[t], %[t], %[mask] \n" "and %[t], %[t], %[mask] \n"
"bics %[t], %[t], %[v] \n" "bics %[t], %[t], %[v] \n"
"it eq \n" "ldreq %[v], [ %[s] ], #4 \n"
"ldreq %[v], [%[s]], #4 \n"
"bne 1f \n" "bne 1f \n"
"sub %[t], %[v], %[mask], lsr #7\n" "sub %[t], %[v], %[mask], lsr #7\n"
"and %[t], %[t], %[mask] \n" "and %[t], %[t], %[mask] \n"
"bics %[t], %[t], %[v] \n" "bics %[t], %[t], %[v] \n"
"it eq \n" "ldreq %[v], [ %[s] ], #4 \n"
"ldreq %[v], [%[s]], #4 \n"
#endif #endif
"beq 0b \n" "beq 0b \n"
"1: \n" "1: \n"
@@ -125,14 +117,13 @@ size_t strlen(const char *s)
"beq 2f \n" "beq 2f \n"
"add %[l], %[l], #1 \n" "add %[l], %[l], #1 \n"
"tst %[v], #0xFF0000 \n" "tst %[v], #0xFF0000 \n"
"it ne \n"
"addne %[l], %[l], #1 \n" "addne %[l], %[l], #1 \n"
"2: \n" "2: \n"
: [l]"=&r"(l), [v]"=&r"(v), [t]"=&r"(t), [s]"=&r"(u.b) : [l]"=&r"(l), [v]"=&r"(v), [t]"=&r"(t), [s]"=&r"(u.b)
: "%[l]"(l), "%[s]"(u.b), [mask]"r"(0x80808080UL) : "%[l]"(l), "%[s]"(u.b), [mask]"r"(0x80808080UL)
: "cc" : "cc"
); );
done: done:
return l; return l;
} }

View File

@@ -39,7 +39,6 @@
*/ */
ENTRY(tgkill) ENTRY(tgkill)
.save {r4-r7, ip, lr}
stmfd sp!, {r4-r7, ip, lr} stmfd sp!, {r4-r7, ip, lr}
ldr r7, =__NR_tgkill ldr r7, =__NR_tgkill
swi #0 swi #0

View File

@@ -24,110 +24,81 @@
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE. * SUCH DAMAGE.
*/
/*
* Copyright (c) 2013 ARM Ltd
* 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 may not be used to endorse or promote
* products derived from this software without specific prior written
* permission.
*
* THIS SOFTWARE IS PROVIDED BY ARM LTD ``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 ARM LTD 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.
*/ */
/* Prototype: void *memcpy (void *dst, const void *src, size_t count). */ /* Assumes neon instructions and a cache line size of 64 bytes. */
// This version is tuned for the Cortex-A15 processor.
#include <machine/cpu-features.h> #include <machine/cpu-features.h>
#include <machine/asm.h> #include <machine/asm.h>
/*
* This code assumes it is running on a processor that supports all arm v7
* instructions, that supports neon instructions, and that has a 64 byte
* cache line.
*/
.text .text
.syntax unified
.fpu neon .fpu neon
#define CACHE_LINE_SIZE 64 #define CACHE_LINE_SIZE 64
ENTRY(memcpy) ENTRY(memcpy)
// Assumes that n >= 0, and dst, src are valid pointers. .save {r0, lr}
// For any sizes less than 832 use the neon code that doesn't /* start preloading as early as possible */
// care about the src alignment. This avoids any checks pld [r1, #(CACHE_LINE_SIZE*0)]
// for src alignment, and offers the best improvement since stmfd sp!, {r0, lr}
// smaller sized copies are dominated by the overhead of pld [r1, #(CACHE_LINE_SIZE*1)]
// the pre and post main loop.
// For larger copies, if src and dst cannot both be aligned to
// word boundaries, use the neon code.
// For all other copies, align dst to a double word boundary
// and copy using LDRD/STRD instructions.
// Save registers (r0 holds the return value): /* do we have at least 16-bytes to copy (needed for alignment below) */
// optimized push {r0, lr}. cmp r2, #16
.save {r0, lr} blo 5f
pld [r1, #(CACHE_LINE_SIZE*16)]
push {r0, lr}
cmp r2, #16 /* align destination to cache-line for the write-buffer */
blo copy_less_than_16_unknown_align
cmp r2, #832
bge check_alignment
copy_unknown_alignment:
// Unknown alignment of src and dst.
// Assumes that the first few bytes have already been prefetched.
// Align destination to 128 bits. The mainloop store instructions
// require this alignment or they will throw an exception.
rsb r3, r0, #0 rsb r3, r0, #0
ands r3, r3, #0xF ands r3, r3, #0xF
beq 2f beq 0f
// Copy up to 15 bytes (count in r3). /* copy up to 15-bytes (count in r3) */
sub r2, r2, r3 sub r2, r2, r3
movs ip, r3, lsl #31 movs ip, r3, lsl #31
ldrmib lr, [r1], #1
itt mi strmib lr, [r0], #1
ldrbmi lr, [r1], #1 ldrcsb ip, [r1], #1
strbmi lr, [r0], #1 ldrcsb lr, [r1], #1
itttt cs strcsb ip, [r0], #1
ldrbcs ip, [r1], #1 strcsb lr, [r0], #1
ldrbcs lr, [r1], #1
strbcs ip, [r0], #1
strbcs lr, [r0], #1
movs ip, r3, lsl #29 movs ip, r3, lsl #29
bge 1f bge 1f
// Copies 4 bytes, dst 32 bits aligned before, at least 64 bits after. // copies 4 bytes, destination 32-bits aligned
vld4.8 {d0[0], d1[0], d2[0], d3[0]}, [r1]! vld4.8 {d0[0], d1[0], d2[0], d3[0]}, [r1]!
vst4.8 {d0[0], d1[0], d2[0], d3[0]}, [r0, :32]! vst4.8 {d0[0], d1[0], d2[0], d3[0]}, [r0, :32]!
1: bcc 2f 1: bcc 2f
// Copies 8 bytes, dst 64 bits aligned before, at least 128 bits after. // copies 8 bytes, destination 64-bits aligned
vld1.8 {d0}, [r1]! vld1.8 {d0}, [r1]!
vst1.8 {d0}, [r0, :64]! vst1.8 {d0}, [r0, :64]!
2:
2: // Make sure we have at least 64 bytes to copy. 0: /* preload immediately the next cache line, which we may need */
pld [r1, #(CACHE_LINE_SIZE*0)]
pld [r1, #(CACHE_LINE_SIZE*1)]
/* make sure we have at least 64 bytes to copy */
subs r2, r2, #64 subs r2, r2, #64
blo 2f blo 2f
1: // The main loop copies 64 bytes at a time. /* Preload all the cache lines we need.
* NOTE: The number of pld below depends on CACHE_LINE_SIZE,
* ideally we 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.
* NOTE: The value CACHE_LINE_SIZE * 4 was chosen through
* experimentation.
*/
pld [r1, #(CACHE_LINE_SIZE*2)]
pld [r1, #(CACHE_LINE_SIZE*3)]
pld [r1, #(CACHE_LINE_SIZE*4)]
1: /* The main loop copies 64 bytes at a time */
vld1.8 {d0 - d3}, [r1]! vld1.8 {d0 - d3}, [r1]!
vld1.8 {d4 - d7}, [r1]! vld1.8 {d4 - d7}, [r1]!
pld [r1, #(CACHE_LINE_SIZE*4)] pld [r1, #(CACHE_LINE_SIZE*4)]
@@ -136,24 +107,25 @@ copy_unknown_alignment:
vst1.8 {d4 - d7}, [r0, :128]! vst1.8 {d4 - d7}, [r0, :128]!
bhs 1b bhs 1b
2: // Fix-up the remaining count and make sure we have >= 32 bytes left. 2: /* fix-up the remaining count and make sure we have >= 32 bytes left */
adds r2, r2, #32 add r2, r2, #64
blo 3f subs r2, r2, #32
blo 4f
// 32 bytes. These cache lines were already preloaded. 3: /* 32 bytes at a time. These cache lines were already preloaded */
vld1.8 {d0 - d3}, [r1]! vld1.8 {d0 - d3}, [r1]!
sub r2, r2, #32 subs r2, r2, #32
vst1.8 {d0 - d3}, [r0, :128]! vst1.8 {d0 - d3}, [r0, :128]!
3: // Less than 32 left. bhs 3b
4: /* less than 32 left */
add r2, r2, #32 add r2, r2, #32
tst r2, #0x10 tst r2, #0x10
beq copy_less_than_16_unknown_align beq 5f
// Copies 16 bytes, destination 128 bits aligned. // copies 16 bytes, 128-bits aligned
vld1.8 {d0, d1}, [r1]! vld1.8 {d0, d1}, [r1]!
vst1.8 {d0, d1}, [r0, :128]! vst1.8 {d0, d1}, [r0, :128]!
copy_less_than_16_unknown_align: 5: /* copy up to 15-bytes (count in r2) */
// Copy up to 15 bytes (count in r2).
movs ip, r2, lsl #29 movs ip, r2, lsl #29
bcc 1f bcc 1f
vld1.8 {d0}, [r1]! vld1.8 {d0}, [r1]!
@@ -161,164 +133,14 @@ copy_less_than_16_unknown_align:
1: bge 2f 1: bge 2f
vld4.8 {d0[0], d1[0], d2[0], d3[0]}, [r1]! vld4.8 {d0[0], d1[0], d2[0], d3[0]}, [r1]!
vst4.8 {d0[0], d1[0], d2[0], d3[0]}, [r0]! vst4.8 {d0[0], d1[0], d2[0], d3[0]}, [r0]!
2: movs ip, r2, lsl #31
ldrmib r3, [r1], #1
ldrcsb ip, [r1], #1
ldrcsb lr, [r1], #1
strmib r3, [r0], #1
strcsb ip, [r0], #1
strcsb lr, [r0], #1
2: // Copy 0 to 4 bytes. ldmfd sp!, {r0, lr}
lsls r2, r2, #31 bx lr
itt ne
ldrbne lr, [r1], #1
strbne lr, [r0], #1
itttt cs
ldrbcs ip, [r1], #1
ldrbcs lr, [r1]
strbcs ip, [r0], #1
strbcs lr, [r0]
pop {r0, pc}
check_alignment:
// If src and dst cannot both be aligned to a word boundary,
// use the unaligned copy version.
eor r3, r0, r1
ands r3, r3, #0x3
bne copy_unknown_alignment
// To try and improve performance, stack layout changed,
// i.e., not keeping the stack looking like users expect
// (highest numbered register at highest address).
// TODO: Add debug frame directives.
// We don't need exception unwind directives, because the code below
// does not throw any exceptions and does not call any other functions.
// Generally, newlib functions like this lack debug information for
// assembler source.
.save {r4, r5}
strd r4, r5, [sp, #-8]!
.save {r6, r7}
strd r6, r7, [sp, #-8]!
.save {r8, r9}
strd r8, r9, [sp, #-8]!
// Optimized for already aligned dst code.
ands ip, r0, #3
bne dst_not_word_aligned
word_aligned:
// Align the destination buffer to 8 bytes, to make sure double
// loads and stores don't cross a cache line boundary,
// as they are then more expensive even if the data is in the cache
// (require two load/store issue cycles instead of one).
// If only one of the buffers is not 8 bytes aligned,
// then it's more important to align dst than src,
// because there is more penalty for stores
// than loads that cross a cacheline boundary.
// This check and realignment are only done if there is >= 832
// bytes to copy.
// Dst is word aligned, but check if it is already double word aligned.
ands r3, r0, #4
beq 1f
ldr r3, [r1], #4
str r3, [r0], #4
sub r2, #4
1: // Can only get here if > 64 bytes to copy, so don't do check r2.
sub r2, #64
2: // Every loop iteration copies 64 bytes.
.irp offset, #0, #8, #16, #24, #32
ldrd r4, r5, [r1, \offset]
strd r4, r5, [r0, \offset]
.endr
ldrd r4, r5, [r1, #40]
ldrd r6, r7, [r1, #48]
ldrd r8, r9, [r1, #56]
// Keep the pld as far from the next load as possible.
// The amount to prefetch was determined experimentally using
// large sizes, and verifying the prefetch size does not affect
// the smaller copies too much.
// WARNING: If the ldrd and strd instructions get too far away
// from each other, performance suffers. Three loads
// in a row is the best tradeoff.
pld [r1, #(CACHE_LINE_SIZE*16)]
strd r4, r5, [r0, #40]
strd r6, r7, [r0, #48]
strd r8, r9, [r0, #56]
add r0, r0, #64
add r1, r1, #64
subs r2, r2, #64
bge 2b
// Fix-up the remaining count and make sure we have >= 32 bytes left.
adds r2, r2, #32
blo 4f
// Copy 32 bytes. These cache lines were already preloaded.
.irp offset, #0, #8, #16, #24
ldrd r4, r5, [r1, \offset]
strd r4, r5, [r0, \offset]
.endr
add r1, r1, #32
add r0, r0, #32
sub r2, r2, #32
4: // Less than 32 left.
add r2, r2, #32
tst r2, #0x10
beq 5f
// Copy 16 bytes.
.irp offset, #0, #8
ldrd r4, r5, [r1, \offset]
strd r4, r5, [r0, \offset]
.endr
add r1, r1, #16
add r0, r0, #16
5: // Copy up to 15 bytes (count in r2).
movs ip, r2, lsl #29
bcc 1f
// Copy 8 bytes.
ldrd r4, r5, [r1], #8
strd r4, r5, [r0], #8
1: bge 2f
// Copy 4 bytes.
ldr r4, [r1], #4
str r4, [r0], #4
2: // Copy 0 to 4 bytes.
lsls r2, r2, #31
itt ne
ldrbne lr, [r1], #1
strbne lr, [r0], #1
itttt cs
ldrbcs ip, [r1], #1
ldrbcs lr, [r1]
strbcs ip, [r0], #1
strbcs lr, [r0]
// Restore registers: optimized pop {r0, pc}
ldrd r8, r9, [sp], #8
ldrd r6, r7, [sp], #8
ldrd r4, r5, [sp], #8
pop {r0, pc}
dst_not_word_aligned:
// Align dst to word.
rsb ip, ip, #4
cmp ip, #2
itt gt
ldrbgt lr, [r1], #1
strbgt lr, [r0], #1
itt ge
ldrbge lr, [r1], #1
strbge lr, [r0], #1
ldrb lr, [r1], #1
strb lr, [r0], #1
sub r2, r2, ip
// Src is guaranteed to be at least word aligned by this point.
b word_aligned
END(memcpy) END(memcpy)

View File

@@ -1,5 +1,5 @@
/* /*
* Copyright (C) 2013 The Android Open Source Project * Copyright (C) 2008 The Android Open Source Project
* All rights reserved. * All rights reserved.
* *
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
@@ -35,12 +35,11 @@
* memset() returns its first argument. * memset() returns its first argument.
*/ */
.fpu neon .fpu neon
.syntax unified
ENTRY(bzero) ENTRY(bzero)
mov r2, r1 mov r2, r1
mov r1, #0 mov r1, #0
// Fall through to memset... // Fall through to memset...
END(bzero) END(bzero)
@@ -48,117 +47,60 @@ ENTRY(memset)
.save {r0} .save {r0}
stmfd sp!, {r0} stmfd sp!, {r0}
// The new algorithm is slower for copies < 16 so use the old vdup.8 q0, r1
// neon code in that case.
/* do we have at least 16-bytes to write (needed for alignment below) */
cmp r2, #16 cmp r2, #16
blo set_less_than_16_unknown_align blo 3f
// Use strd which requires an even and odd register so move the /* align destination to 16 bytes for the write-buffer */
// values so that: rsb r3, r0, #0
// r0 and r1 contain the memset value ands r3, r3, #0xF
// r2 is the number of bytes to set beq 2f
// r3 is the destination pointer
mov r3, r0
// Copy the byte value in every byte of r1. /* write up to 15-bytes (count in r3) */
mov r1, r1, lsl #24 sub r2, r2, r3
orr r1, r1, r1, lsr #8 movs ip, r3, lsl #31
orr r1, r1, r1, lsr #16 strmib r1, [r0], #1
strcsb r1, [r0], #1
strcsb r1, [r0], #1
movs ip, r3, lsl #29
bge 1f
check_alignment: // writes 4 bytes, 32-bits aligned
// Align destination to a double word to avoid the strd crossing vst1.32 {d0[0]}, [r0, :32]!
// a cache line boundary. 1: bcc 2f
ands ip, r3, #7
bne do_double_word_align
double_word_aligned: // writes 8 bytes, 64-bits aligned
mov r0, r1 vst1.8 {d0}, [r0, :64]!
2:
/* make sure we have at least 32 bytes to write */
subs r2, r2, #32
blo 2f
vmov q1, q0
subs r2, #64 1: /* The main loop writes 32 bytes at a time */
blo set_less_than_64 subs r2, r2, #32
vst1.8 {d0 - d3}, [r0, :128]!
bhs 1b
1: // Main loop sets 64 bytes at a time. 2: /* less than 32 left */
.irp offset, #0, #8, #16, #24, #32, #40, #48, #56 add r2, r2, #32
strd r0, r1, [r3, \offset] tst r2, #0x10
.endr beq 3f
add r3, #64 // writes 16 bytes, 128-bits aligned
subs r2, #64 vst1.8 {d0, d1}, [r0, :128]!
bge 1b 3: /* write up to 15-bytes (count in r2) */
set_less_than_64:
// Restore r2 to the count of bytes left to set.
add r2, #64
lsls ip, r2, #27
bcc set_less_than_32
// Set 32 bytes.
.irp offset, #0, #8, #16, #24
strd r0, r1, [r3, \offset]
.endr
add r3, #32
set_less_than_32:
bpl set_less_than_16
// Set 16 bytes.
.irp offset, #0, #8
strd r0, r1, [r3, \offset]
.endr
add r3, #16
set_less_than_16:
// Less than 16 bytes to set.
lsls ip, r2, #29
bcc set_less_than_8
// Set 8 bytes.
strd r0, r1, [r3], #8
set_less_than_8:
bpl set_less_than_4
// Set 4 bytes
str r1, [r3], #4
set_less_than_4:
lsls ip, r2, #31
it ne
strbne r1, [r3], #1
itt cs
strbcs r1, [r3], #1
strbcs r1, [r3]
ldmfd sp!, {r0}
bx lr
do_double_word_align:
rsb ip, ip, #8
sub r2, r2, ip
movs r0, ip, lsl #31
it mi
strbmi r1, [r3], #1
itt cs
strbcs r1, [r3], #1
strbcs r1, [r3], #1
// Dst is at least word aligned by this point.
cmp ip, #4
blo double_word_aligned
str r1, [r3], #4
b double_word_aligned
set_less_than_16_unknown_align:
// Set up to 15 bytes.
vdup.8 d0, r1
movs ip, r2, lsl #29 movs ip, r2, lsl #29
bcc 1f bcc 1f
vst1.8 {d0}, [r0]! vst1.8 {d0}, [r0]!
1: bge 2f 1: bge 2f
vst1.32 {d0[0]}, [r0]! vst1.32 {d0[0]}, [r0]!
2: movs ip, r2, lsl #31 2: movs ip, r2, lsl #31
it mi strmib r1, [r0], #1
strbmi r1, [r0], #1 strcsb r1, [r0], #1
itt cs strcsb r1, [r0], #1
strbcs r1, [r0], #1
strbcs r1, [r0], #1
ldmfd sp!, {r0} ldmfd sp!, {r0}
bx lr bx lr
END(memset) END(memset)

View File

@@ -1,151 +0,0 @@
/*
* Copyright (C) 2013 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.
*/
/*
* Copyright (c) 2013 ARM Ltd
* 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 may not be used to endorse or promote
* products derived from this software without specific prior written
* permission.
*
* THIS SOFTWARE IS PROVIDED BY ARM LTD ``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 ARM LTD 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>
.syntax unified
.thumb
.thumb_func
ENTRY(strlen)
pld [r1, #128]
mov r1, r0
rsb r3, r0, #0
ands r3, r3, #7
beq mainloop
// Align to a double word (64 bits).
ands ip, r3, #1
beq align_to_32
ldrb r2, [r1], #1
cmp r2, #0
beq update_count_and_return
align_to_32:
ands ip, r3, #2
beq align_to_64
ldrb r2, [r1], #1
cmp r2, #0
beq update_count_and_return
ldrb r2, [r1], #1
cmp r2, #0
beq update_count_and_return
align_to_64:
ands ip, r3, #4
beq mainloop
ldr r3, [r1], #4
sub ip, r3, #0x01010101
bic ip, ip, r3
ands ip, ip, #0x80808080
bne zero_in_second_register
mainloop:
ldrd r2, r3, [r1], #8
pld [r1, #64]
sub ip, r2, #0x01010101
bic ip, ip, r2
ands ip, ip, #0x80808080
bne zero_in_first_register
sub ip, r3, #0x01010101
bic ip, ip, r3
ands ip, ip, #0x80808080
bne zero_in_second_register
b mainloop
zero_in_first_register:
sub r1, r1, #4
zero_in_second_register:
sub r0, r1, r0
// Check for zero in byte 0.
ands r1, ip, #0x80
beq check_byte1
sub r0, r0, #4
bx lr
check_byte1:
// Check for zero in byte 1.
ands r1, ip, #0x8000
beq check_byte2
sub r0, r0, #3
bx lr
check_byte2:
// Check for zero in byte 2.
ands r1, ip, #0x800000
beq return
sub r0, r0, #2
bx lr
update_count_and_return:
sub r0, r1, r0
return:
sub r0, r0, #1
bx lr
END(strlen)

View File

@@ -1,6 +1,5 @@
$(call libc-add-cpu-variant-src,MEMCPY,arch-arm/cortex-a15/bionic/memcpy.S) $(call libc-add-cpu-variant-src,MEMCPY,arch-arm/cortex-a15/bionic/memcpy.S)
$(call libc-add-cpu-variant-src,MEMSET,arch-arm/cortex-a15/bionic/memset.S) $(call libc-add-cpu-variant-src,MEMSET,arch-arm/cortex-a15/bionic/memset.S)
$(call libc-add-cpu-variant-src,STRCMP,arch-arm/cortex-a15/bionic/strcmp.S) $(call libc-add-cpu-variant-src,STRCMP,arch-arm/cortex-a15/bionic/strcmp.S)
$(call libc-add-cpu-variant-src,STRLEN,arch-arm/cortex-a15/bionic/strlen.S)
include bionic/libc/arch-arm/generic/generic.mk include bionic/libc/arch-arm/generic/generic.mk

View File

@@ -1,7 +1,5 @@
$(call libc-add-cpu-variant-src,MEMCPY,arch-arm/cortex-a9/bionic/memcpy.S) $(call libc-add-cpu-variant-src,MEMCPY,arch-arm/cortex-a9/bionic/memcpy.S)
$(call libc-add-cpu-variant-src,MEMSET,arch-arm/cortex-a9/bionic/memset.S) $(call libc-add-cpu-variant-src,MEMSET,arch-arm/cortex-a9/bionic/memset.S)
$(call libc-add-cpu-variant-src,STRCMP,arch-arm/cortex-a9/bionic/strcmp.S) $(call libc-add-cpu-variant-src,STRCMP,arch-arm/cortex-a9/bionic/strcmp.S)
# Use cortex-a15 version of strlen.
$(call libc-add-cpu-variant-src,STRLEN,arch-arm/cortex-a15/bionic/strlen.S)
include bionic/libc/arch-arm/generic/generic.mk include bionic/libc/arch-arm/generic/generic.mk

View File

@@ -1,4 +1,3 @@
$(call libc-add-cpu-variant-src,MEMCPY,arch-arm/generic/bionic/memcpy.S) $(call libc-add-cpu-variant-src,MEMCPY,arch-arm/generic/bionic/memcpy.S)
$(call libc-add-cpu-variant-src,MEMSET,arch-arm/generic/bionic/memset.S) $(call libc-add-cpu-variant-src,MEMSET,arch-arm/generic/bionic/memset.S)
$(call libc-add-cpu-variant-src,STRCMP,arch-arm/generic/bionic/strcmp.S) $(call libc-add-cpu-variant-src,STRCMP,arch-arm/generic/bionic/strcmp.S)
$(call libc-add-cpu-variant-src,STRLEN,arch-arm/generic/bionic/strlen.c)

View File

@@ -1,7 +1,5 @@
$(call libc-add-cpu-variant-src,MEMCPY,arch-arm/krait/bionic/memcpy.S) $(call libc-add-cpu-variant-src,MEMCPY,arch-arm/krait/bionic/memcpy.S)
$(call libc-add-cpu-variant-src,MEMSET,arch-arm/krait/bionic/memset.S) $(call libc-add-cpu-variant-src,MEMSET,arch-arm/krait/bionic/memset.S)
$(call libc-add-cpu-variant-src,STRCMP,arch-arm/krait/bionic/strcmp.S) $(call libc-add-cpu-variant-src,STRCMP,arch-arm/krait/bionic/strcmp.S)
# Use cortex-a15 version of strlen.
$(call libc-add-cpu-variant-src,STRLEN,arch-arm/cortex-a15/bionic/strlen.S)
include bionic/libc/arch-arm/generic/generic.mk include bionic/libc/arch-arm/generic/generic.mk

View File

@@ -126,8 +126,6 @@ syscall_src += arch-arm/syscalls/removexattr.S
syscall_src += arch-arm/syscalls/lremovexattr.S syscall_src += arch-arm/syscalls/lremovexattr.S
syscall_src += arch-arm/syscalls/__statfs64.S syscall_src += arch-arm/syscalls/__statfs64.S
syscall_src += arch-arm/syscalls/unshare.S syscall_src += arch-arm/syscalls/unshare.S
syscall_src += arch-arm/syscalls/swapon.S
syscall_src += arch-arm/syscalls/swapoff.S
syscall_src += arch-arm/syscalls/pause.S syscall_src += arch-arm/syscalls/pause.S
syscall_src += arch-arm/syscalls/gettimeofday.S syscall_src += arch-arm/syscalls/gettimeofday.S
syscall_src += arch-arm/syscalls/settimeofday.S syscall_src += arch-arm/syscalls/settimeofday.S
@@ -146,9 +144,6 @@ syscall_src += arch-arm/syscalls/__timer_getoverrun.S
syscall_src += arch-arm/syscalls/__timer_delete.S syscall_src += arch-arm/syscalls/__timer_delete.S
syscall_src += arch-arm/syscalls/utimes.S syscall_src += arch-arm/syscalls/utimes.S
syscall_src += arch-arm/syscalls/utimensat.S syscall_src += arch-arm/syscalls/utimensat.S
syscall_src += arch-arm/syscalls/timerfd_create.S
syscall_src += arch-arm/syscalls/timerfd_settime.S
syscall_src += arch-arm/syscalls/timerfd_gettime.S
syscall_src += arch-arm/syscalls/sigaction.S syscall_src += arch-arm/syscalls/sigaction.S
syscall_src += arch-arm/syscalls/sigprocmask.S syscall_src += arch-arm/syscalls/sigprocmask.S
syscall_src += arch-arm/syscalls/__sigsuspend.S syscall_src += arch-arm/syscalls/__sigsuspend.S

View File

@@ -1,15 +0,0 @@
/* autogenerated by gensyscalls.py */
#include <asm/unistd.h>
#include <linux/err.h>
#include <machine/asm.h>
ENTRY(swapoff)
mov ip, r7
ldr r7, =__NR_swapoff
swi #0
mov r7, ip
cmn r0, #(MAX_ERRNO + 1)
bxls lr
neg r0, r0
b __set_errno
END(swapoff)

View File

@@ -1,15 +0,0 @@
/* autogenerated by gensyscalls.py */
#include <asm/unistd.h>
#include <linux/err.h>
#include <machine/asm.h>
ENTRY(swapon)
mov ip, r7
ldr r7, =__NR_swapon
swi #0
mov r7, ip
cmn r0, #(MAX_ERRNO + 1)
bxls lr
neg r0, r0
b __set_errno
END(swapon)

View File

@@ -1,15 +0,0 @@
/* autogenerated by gensyscalls.py */
#include <asm/unistd.h>
#include <linux/err.h>
#include <machine/asm.h>
ENTRY(timerfd_create)
mov ip, r7
ldr r7, =__NR_timerfd_create
swi #0
mov r7, ip
cmn r0, #(MAX_ERRNO + 1)
bxls lr
neg r0, r0
b __set_errno
END(timerfd_create)

View File

@@ -1,15 +0,0 @@
/* autogenerated by gensyscalls.py */
#include <asm/unistd.h>
#include <linux/err.h>
#include <machine/asm.h>
ENTRY(timerfd_gettime)
mov ip, r7
ldr r7, =__NR_timerfd_gettime
swi #0
mov r7, ip
cmn r0, #(MAX_ERRNO + 1)
bxls lr
neg r0, r0
b __set_errno
END(timerfd_gettime)

View File

@@ -1,15 +0,0 @@
/* autogenerated by gensyscalls.py */
#include <asm/unistd.h>
#include <linux/err.h>
#include <machine/asm.h>
ENTRY(timerfd_settime)
mov ip, r7
ldr r7, =__NR_timerfd_settime
swi #0
mov r7, ip
cmn r0, #(MAX_ERRNO + 1)
bxls lr
neg r0, r0
b __set_errno
END(timerfd_settime)

View File

@@ -1,5 +1,5 @@
/* /*
* Copyright (C) 2013 The Android Open Source Project * Copyright (C) 2010 The Android Open Source Project
* All rights reserved. * All rights reserved.
* *
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
@@ -26,16 +26,17 @@
* SUCH DAMAGE. * SUCH DAMAGE.
*/ */
#ifndef _SYS_SWAP_H_ # The __dso_handle global variable is used by static
#define _SYS_SWAP_H_ # C++ constructors and destructors in the binary.
# See http://www.codesourcery.com/public/cxx-abi/abi.html#dso-dtor
#
.section .bss
.align 4
#include <sys/cdefs.h> #ifndef CRT_LEGACY_WORKAROUND
.hidden __dso_handle
#endif
__BEGIN_DECLS .globl __dso_handle
__dso_handle:
extern int swapon(const char*, int) __nonnull((1)); .long 0
extern int swapoff(const char*) __nonnull((1));
__END_DECLS
#endif /* _SYS_SWAP_H_ */

View File

@@ -1,5 +1,5 @@
/* /*
* Copyright (C) 2013 The Android Open Source Project * Copyright (C) 2010 The Android Open Source Project
* All rights reserved. * All rights reserved.
* *
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
@@ -26,11 +26,13 @@
* SUCH DAMAGE. * SUCH DAMAGE.
*/ */
extern void *__dso_handle; # The __dso_handle global variable is used by static
extern int __cxa_atexit(void (*func)(void *), void *arg, void *dso); # C++ constructors and destructors in the binary.
# See http://www.codesourcery.com/public/cxx-abi/abi.html#dso-dtor
__attribute__ ((visibility ("hidden"))) #
int atexit(void (*func)(void)) .data
{ .align 4
return (__cxa_atexit((void (*)(void *))func, (void *)0, &__dso_handle)); .hidden __dso_handle
} .globl __dso_handle
__dso_handle:
.long __dso_handle

View File

@@ -1,5 +1,5 @@
/* /*
* Copyright (C) 2013 The Android Open Source Project * Copyright (C) 2008 The Android Open Source Project
* All rights reserved. * All rights reserved.
* *
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
@@ -25,14 +25,19 @@
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE. * SUCH DAMAGE.
*/ */
.text
extern void __cxa_finalize(void *); .globl atexit
extern void *__dso_handle; .hidden atexit
.type atexit, @function
__attribute__((visibility("hidden"),destructor)) .align 4
void __on_dlclose() { .ent atexit
__cxa_finalize(&__dso_handle); atexit:
} .set noreorder
.cpload $t9
#include "__dso_handle_so.h" .set reorder
#include "atexit.h" la $t9, __cxa_atexit
move $a1, $0
la $a2, __dso_handle
j $t9
.size atexit, .-atexit
.end atexit

View File

@@ -0,0 +1,146 @@
/*
* 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
.align 4
.type __start,@function
.globl __start
.globl _start
# this is the small startup code that is first run when
# any executable that is statically-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.
#
# - address of the constructor list
#
.ent __start
__start:
_start:
bal 1f
1:
.set noreorder
.cpload $ra
.set reorder
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
.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

@@ -1,94 +0,0 @@
/*
* Copyright (C) 2013 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 "../../bionic/libc_init_common.h"
#include <stddef.h>
#include <stdint.h>
__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;
__LIBC_HIDDEN__ void do_mips_start(void *raw_args) {
structors_array_t array;
array.preinit_array = &__PREINIT_ARRAY__;
array.init_array = &__INIT_ARRAY__;
array.fini_array = &__FINI_ARRAY__;
__libc_init(raw_args, NULL, &main, &array);
}
/*
* This function prepares the return address with a branch-and-link
* instruction (bal) and then uses a .cpload to compute the Global
* Offset Table (GOT) pointer ($gp). The $gp is then used to load
* the address of _do_start() into $t9 just before calling it.
* Terminating the stack with a NULL return address.
*/
__asm__ (
" .set push \n"
" \n"
" .text \n"
" .align 4 \n"
" .type __start,@function \n"
" .globl __start \n"
" .globl _start \n"
" \n"
" .ent __start \n"
"__start: \n"
" _start: \n"
" .frame $sp,32,$ra \n"
" .mask 0x80000000,-4 \n"
" \n"
" .set noreorder \n"
" bal 1f \n"
" nop \n"
"1: \n"
" .cpload $ra \n"
" .set reorder \n"
" \n"
" move $a0, $sp \n"
" addiu $sp, $sp, (-32) \n"
" sw $0, 28($sp) \n"
" la $t9, do_mips_start \n"
" jalr $t9 \n"
" \n"
"2: b 2b \n"
" .end __start \n"
" \n"
" .set pop \n"
);
#include "__dso_handle.h"
#include "atexit.h"

View File

@@ -25,30 +25,70 @@
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE. * SUCH DAMAGE.
*/ */
.section .init_array, "aw"
.type __INIT_ARRAY__, @object
.globl __INIT_ARRAY__
__INIT_ARRAY__:
.long -1
#include <errno.h> .section .fini_array, "aw"
#include <sys/mman.h> .type __FINI_ARRAY__, @object
#include <unistd.h> .globl __FINI_ARRAY__
__FINI_ARRAY__:
.long -1
.long __do_global_dtors_aux
#include "private/ErrnoRestorer.h" .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
// mmap2(2) is like mmap(2), but the offset is in 4096-byte blocks, not bytes. $L4:
extern "C" void* __mmap2(void*, size_t, int, int, int, size_t); lw $2,%got(__cxa_finalize)($28)
beq $2,$0,$L6
nop
#define MMAP2_SHIFT 12 // 2**12 == 4096 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
void* mmap(void* addr, size_t size, int prot, int flags, int fd, long offset) { lw $28,16($sp)
if (offset & ((1UL << MMAP2_SHIFT)-1)) { $L6:
errno = EINVAL; lw $2,%got(completed.1269)($28)
return MAP_FAILED; li $3,1 # 0x1
} sb $3,%lo(completed.1269)($2)
$L8:
lw $31,28($sp)
addiu $sp,$sp,32
j $31
nop
void* result = __mmap2(addr, size, prot, flags, fd, offset >> MMAP2_SHIFT); .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
if (result != MAP_FAILED && (flags & (MAP_PRIVATE | MAP_ANONYMOUS)) != 0) { #include "__dso_handle_so.S"
ErrnoRestorer errno_restorer; #include "atexit.S"
madvise(result, size, MADV_MERGEABLE);
}
return result;
}

View File

@@ -129,8 +129,6 @@ syscall_src += arch-mips/syscalls/removexattr.S
syscall_src += arch-mips/syscalls/lremovexattr.S syscall_src += arch-mips/syscalls/lremovexattr.S
syscall_src += arch-mips/syscalls/__statfs64.S syscall_src += arch-mips/syscalls/__statfs64.S
syscall_src += arch-mips/syscalls/unshare.S syscall_src += arch-mips/syscalls/unshare.S
syscall_src += arch-mips/syscalls/swapon.S
syscall_src += arch-mips/syscalls/swapoff.S
syscall_src += arch-mips/syscalls/pause.S syscall_src += arch-mips/syscalls/pause.S
syscall_src += arch-mips/syscalls/gettimeofday.S syscall_src += arch-mips/syscalls/gettimeofday.S
syscall_src += arch-mips/syscalls/settimeofday.S syscall_src += arch-mips/syscalls/settimeofday.S
@@ -149,9 +147,6 @@ syscall_src += arch-mips/syscalls/__timer_getoverrun.S
syscall_src += arch-mips/syscalls/__timer_delete.S syscall_src += arch-mips/syscalls/__timer_delete.S
syscall_src += arch-mips/syscalls/utimes.S syscall_src += arch-mips/syscalls/utimes.S
syscall_src += arch-mips/syscalls/utimensat.S syscall_src += arch-mips/syscalls/utimensat.S
syscall_src += arch-mips/syscalls/timerfd_create.S
syscall_src += arch-mips/syscalls/timerfd_settime.S
syscall_src += arch-mips/syscalls/timerfd_gettime.S
syscall_src += arch-mips/syscalls/sigaction.S syscall_src += arch-mips/syscalls/sigaction.S
syscall_src += arch-mips/syscalls/sigprocmask.S syscall_src += arch-mips/syscalls/sigprocmask.S
syscall_src += arch-mips/syscalls/__sigsuspend.S syscall_src += arch-mips/syscalls/__sigsuspend.S

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@@ -1,4 +1,4 @@
/* $OpenBSD: endian.h,v 1.17 2011/03/12 04:03:04 guenther Exp $ */ /* $OpenBSD: endian.h,v 1.14 2005/12/13 00:35:23 millert Exp $ */
/*- /*-
* Copyright (c) 1997 Niklas Hallqvist. All rights reserved. * Copyright (c) 1997 Niklas Hallqvist. All rights reserved.
@@ -24,28 +24,38 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/ */
#ifndef _MACHINE_ENDIAN_H_ #ifndef _I386_ENDIAN_H_
#define _MACHINE_ENDIAN_H_ #define _I386_ENDIAN_H_
#ifdef __GNUC__ #ifdef __GNUC__
#define __swap32md(x) __statement({ \ #if defined(_KERNEL) && !defined(I386_CPU)
#define __swap32md(x) ({ \
uint32_t __swap32md_x = (x); \ uint32_t __swap32md_x = (x); \
\ \
__asm ("bswap %0" : "+r" (__swap32md_x)); \ __asm ("bswap %1" : "+r" (__swap32md_x)); \
__swap32md_x; \ __swap32md_x; \
}) })
#else
#define __swap32md(x) ({ \
uint32_t __swap32md_x = (x); \
\
__asm ("rorw $8, %w1; rorl $16, %1; rorw $8, %w1" : \
"+r" (__swap32md_x)); \
__swap32md_x; \
})
#endif /* _KERNEL && !I386_CPU */
#define __swap64md(x) __statement({ \ #define __swap64md(x) ({ \
uint64_t __swap64md_x = (x); \ uint64_t __swap64md_x = (x); \
\ \
(uint64_t)__swap32md(__swap64md_x >> 32) | \ (uint64_t)__swap32md(__swap64md_x >> 32) | \
(uint64_t)__swap32md(__swap64md_x & 0xffffffff) << 32; \ (uint64_t)__swap32md(__swap64md_x & 0xffffffff) << 32; \
}) })
#define __swap16md(x) __statement({ \ #define __swap16md(x) ({ \
uint16_t __swap16md_x = (x); \ uint16_t __swap16md_x = (x); \
\ \
__asm ("rorw $8, %w0" : "+r" (__swap16md_x)); \ __asm ("rorw $8, %w1" : "+r" (__swap16md_x)); \
__swap16md_x; \ __swap16md_x; \
}) })
@@ -58,4 +68,4 @@
#include <sys/types.h> #include <sys/types.h>
#include <sys/endian.h> #include <sys/endian.h>
#endif /* _MACHINE_ENDIAN_H_ */ #endif /* _I386_ENDIAN_H_ */

View File

@@ -0,0 +1,45 @@
/*
Copyright (c) 2010, Intel Corporation
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 Intel Corporation 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.
*/
#if defined(USE_SSSE3)
# include "cache_wrapper.S"
# undef __i686
# define MEMCPY bcopy
# define USE_AS_MEMMOVE
# define USE_AS_BCOPY
# include "ssse3-memcpy5.S"
#else
# include "bcopy.S"
#endif

View File

@@ -0,0 +1,43 @@
/*
Copyright (c) 2010, Intel Corporation
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 Intel Corporation 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.
*/
#if defined(USE_SSE2)
# include "cache_wrapper.S"
# undef __i686
# define USE_AS_BZERO
# define sse2_memset5_atom bzero
# include "sse2-memset5-atom.S"
#else
# include "bzero.S"
#endif

View File

@@ -0,0 +1,26 @@
/* $OpenBSD: index.S,v 1.4 2005/08/07 11:30:38 espie Exp $ */
/*
* Written by J.T. Conklin <jtc@netbsd.org>.
* Public domain.
*/
#include <machine/asm.h>
#ifdef STRCHR
ENTRY(strchr)
#else
ENTRY(index)
#endif
movl 4(%esp),%eax
movb 8(%esp),%cl
.align 2,0x90
L1:
movb (%eax),%dl
cmpb %dl,%cl /* found char??? */
je L2
incl %eax
testb %dl,%dl /* null terminator??? */
jnz L1
xorl %eax,%eax
L2:
ret

View File

@@ -0,0 +1,27 @@
/* $OpenBSD: memchr.S,v 1.3 2005/08/07 11:30:38 espie Exp $ */
/*
* Written by J.T. Conklin <jtc@netbsd.org>.
* Public domain.
*/
#include <machine/asm.h>
ENTRY(memchr)
pushl %edi
movl 8(%esp),%edi /* string address */
movl 12(%esp),%eax /* set character to search for */
movl 16(%esp),%ecx /* set length of search */
testl %ecx,%ecx /* test for len == 0 */
jz L1
cld /* set search forward */
repne /* search! */
scasb
jne L1 /* scan failed, return null */
leal -1(%edi),%eax /* adjust result of scan */
popl %edi
ret
.align 2,0x90
L1: xorl %eax,%eax
popl %edi
ret
END(memchr)

View File

@@ -28,8 +28,13 @@ ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/ */
#if defined(USE_SSSE3)
#define USE_AS_STRNCMP # define MEMCMP memcmp
#define STRCMP strncmp # include "ssse3-memcmp3-new.S"
#include "ssse3-strcmp-atom.S"
#else
# include "memcmp.S"
#endif

View File

@@ -0,0 +1,43 @@
/*
Copyright (c) 2010, Intel Corporation
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 Intel Corporation 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.
*/
#if defined(USE_SSSE3)
# include "cache_wrapper.S"
# undef __i686
# define MEMCPY memcpy
# define USE_AS_MEMMOVE
# include "ssse3-memcpy5.S"
#else
# include "memcpy.S"
#endif

View File

@@ -0,0 +1,43 @@
/*
Copyright (c) 2010, Intel Corporation
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 Intel Corporation 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.
*/
#if defined(USE_SSSE3)
# include "cache_wrapper.S"
# undef __i686
# define MEMCPY memmove
# define USE_AS_MEMMOVE
# include "ssse3-memcpy5.S"
#else
# include "memmove.S"
#endif

View File

@@ -0,0 +1,42 @@
/*
Copyright (c) 2010, Intel Corporation
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 Intel Corporation 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.
*/
#if defined(USE_SSE2)
# include "cache_wrapper.S"
# undef __i686
# define sse2_memset5_atom memset
# include "sse2-memset5-atom.S"
#else
# include "memset.S"
#endif

View File

@@ -1,32 +0,0 @@
/*
Copyright (c) 2011, Intel Corporation
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 Intel Corporation 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.
*/
#define strchr index
#include "sse2-strchr-atom.S"

View File

@@ -1,556 +0,0 @@
/*
Copyright (c) 2011, Intel Corporation
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 Intel Corporation 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 L
# define L(label) .L##label
#endif
#ifndef cfi_startproc
# define cfi_startproc .cfi_startproc
#endif
#ifndef cfi_endproc
# define cfi_endproc .cfi_endproc
#endif
#ifndef cfi_rel_offset
# define cfi_rel_offset(reg, off) .cfi_rel_offset reg, off
#endif
#ifndef cfi_restore
# define cfi_restore(reg) .cfi_restore reg
#endif
#ifndef cfi_adjust_cfa_offset
# define cfi_adjust_cfa_offset(off) .cfi_adjust_cfa_offset off
#endif
#ifndef ENTRY
# define ENTRY(name) \
.type name, @function; \
.globl name; \
.p2align 4; \
name: \
cfi_startproc
#endif
#ifndef END
# define END(name) \
cfi_endproc; \
.size name, .-name
#endif
#define CFI_PUSH(REG) \
cfi_adjust_cfa_offset (4); \
cfi_rel_offset (REG, 0)
#define CFI_POP(REG) \
cfi_adjust_cfa_offset (-4); \
cfi_restore (REG)
#define PUSH(REG) pushl REG; CFI_PUSH (REG)
#define POP(REG) popl REG; CFI_POP (REG)
#define ENTRANCE PUSH (%edi);
#define PARMS 8
#define RETURN POP (%edi); ret; CFI_PUSH (%edi);
#define STR1 PARMS
#define STR2 STR1+4
#define LEN STR2+4
.text
ENTRY (memchr)
ENTRANCE
mov STR1(%esp), %ecx
movd STR2(%esp), %xmm1
mov LEN(%esp), %edx
test %edx, %edx
jz L(return_null)
punpcklbw %xmm1, %xmm1
mov %ecx, %edi
punpcklbw %xmm1, %xmm1
and $63, %ecx
pshufd $0, %xmm1, %xmm1
cmp $48, %ecx
ja L(crosscache)
movdqu (%edi), %xmm0
pcmpeqb %xmm1, %xmm0
pmovmskb %xmm0, %eax
test %eax, %eax
jnz L(match_case2_prolog)
sub $16, %edx
jbe L(return_null)
lea 16(%edi), %edi
and $15, %ecx
and $-16, %edi
add %ecx, %edx
sub $64, %edx
jbe L(exit_loop)
jmp L(loop_prolog)
.p2align 4
L(crosscache):
and $15, %ecx
and $-16, %edi
movdqa (%edi), %xmm0
pcmpeqb %xmm1, %xmm0
pmovmskb %xmm0, %eax
sar %cl, %eax
test %eax, %eax
jnz L(match_case2_prolog1)
lea -16(%edx), %edx
add %ecx, %edx
jle L(return_null)
lea 16(%edi), %edi
sub $64, %edx
jbe L(exit_loop)
.p2align 4
L(loop_prolog):
movdqa (%edi), %xmm0
pcmpeqb %xmm1, %xmm0
xor %ecx, %ecx
pmovmskb %xmm0, %eax
test %eax, %eax
jnz L(match_case1)
movdqa 16(%edi), %xmm2
pcmpeqb %xmm1, %xmm2
lea 16(%ecx), %ecx
pmovmskb %xmm2, %eax
test %eax, %eax
jnz L(match_case1)
movdqa 32(%edi), %xmm3
pcmpeqb %xmm1, %xmm3
lea 16(%ecx), %ecx
pmovmskb %xmm3, %eax
test %eax, %eax
jnz L(match_case1)
movdqa 48(%edi), %xmm4
pcmpeqb %xmm1, %xmm4
lea 16(%ecx), %ecx
pmovmskb %xmm4, %eax
test %eax, %eax
jnz L(match_case1)
lea 64(%edi), %edi
sub $64, %edx
jbe L(exit_loop)
movdqa (%edi), %xmm0
pcmpeqb %xmm1, %xmm0
xor %ecx, %ecx
pmovmskb %xmm0, %eax
test %eax, %eax
jnz L(match_case1)
movdqa 16(%edi), %xmm2
pcmpeqb %xmm1, %xmm2
lea 16(%ecx), %ecx
pmovmskb %xmm2, %eax
test %eax, %eax
jnz L(match_case1)
movdqa 32(%edi), %xmm3
pcmpeqb %xmm1, %xmm3
lea 16(%ecx), %ecx
pmovmskb %xmm3, %eax
test %eax, %eax
jnz L(match_case1)
movdqa 48(%edi), %xmm4
pcmpeqb %xmm1, %xmm4
lea 16(%ecx), %ecx
pmovmskb %xmm4, %eax
test %eax, %eax
jnz L(match_case1)
lea 64(%edi), %edi
mov %edi, %ecx
and $-64, %edi
and $63, %ecx
add %ecx, %edx
.p2align 4
L(align64_loop):
sub $64, %edx
jbe L(exit_loop)
movdqa (%edi), %xmm0
movdqa 16(%edi), %xmm2
movdqa 32(%edi), %xmm3
movdqa 48(%edi), %xmm4
pcmpeqb %xmm1, %xmm0
pcmpeqb %xmm1, %xmm2
pcmpeqb %xmm1, %xmm3
pcmpeqb %xmm1, %xmm4
pmaxub %xmm0, %xmm3
pmaxub %xmm2, %xmm4
pmaxub %xmm3, %xmm4
add $64, %edi
pmovmskb %xmm4, %eax
test %eax, %eax
jz L(align64_loop)
sub $64, %edi
pmovmskb %xmm0, %eax
xor %ecx, %ecx
test %eax, %eax
jnz L(match_case1)
pmovmskb %xmm2, %eax
lea 16(%ecx), %ecx
test %eax, %eax
jnz L(match_case1)
movdqa 32(%edi), %xmm3
pcmpeqb %xmm1, %xmm3
pmovmskb %xmm3, %eax
lea 16(%ecx), %ecx
test %eax, %eax
jnz L(match_case1)
pcmpeqb 48(%edi), %xmm1
pmovmskb %xmm1, %eax
lea 16(%ecx), %ecx
.p2align 4
L(match_case1):
add %ecx, %edi
test %al, %al
jz L(match_case1_high)
mov %al, %cl
and $15, %cl
jz L(match_case1_8)
test $0x01, %al
jnz L(exit_case1_1)
test $0x02, %al
jnz L(exit_case1_2)
test $0x04, %al
jnz L(exit_case1_3)
lea 3(%edi), %eax
RETURN
.p2align 4
L(match_case1_8):
test $0x10, %al
jnz L(exit_case1_5)
test $0x20, %al
jnz L(exit_case1_6)
test $0x40, %al
jnz L(exit_case1_7)
lea 7(%edi), %eax
RETURN
.p2align 4
L(match_case1_high):
mov %ah, %ch
and $15, %ch
jz L(match_case1_high_8)
test $0x01, %ah
jnz L(exit_case1_9)
test $0x02, %ah
jnz L(exit_case1_10)
test $0x04, %ah
jnz L(exit_case1_11)
lea 11(%edi), %eax
RETURN
.p2align 4
L(match_case1_high_8):
test $0x10, %ah
jnz L(exit_case1_13)
test $0x20, %ah
jnz L(exit_case1_14)
test $0x40, %ah
jnz L(exit_case1_15)
lea 15(%edi), %eax
RETURN
.p2align 4
L(exit_loop):
add $64, %edx
movdqa (%edi), %xmm0
pcmpeqb %xmm1, %xmm0
xor %ecx, %ecx
pmovmskb %xmm0, %eax
test %eax, %eax
jnz L(match_case2)
cmp $16, %edx
jbe L(return_null)
movdqa 16(%edi), %xmm2
pcmpeqb %xmm1, %xmm2
lea 16(%ecx), %ecx
pmovmskb %xmm2, %eax
test %eax, %eax
jnz L(match_case2)
cmp $32, %edx
jbe L(return_null)
movdqa 32(%edi), %xmm3
pcmpeqb %xmm1, %xmm3
lea 16(%ecx), %ecx
pmovmskb %xmm3, %eax
test %eax, %eax
jnz L(match_case2)
cmp $48, %edx
jbe L(return_null)
pcmpeqb 48(%edi), %xmm1
lea 16(%ecx), %ecx
pmovmskb %xmm1, %eax
test %eax, %eax
jnz L(match_case2)
xor %eax, %eax
RETURN
.p2align 4
L(exit_case1_1):
mov %edi, %eax
RETURN
.p2align 4
L(exit_case1_2):
lea 1(%edi), %eax
RETURN
.p2align 4
L(exit_case1_3):
lea 2(%edi), %eax
RETURN
.p2align 4
L(exit_case1_5):
lea 4(%edi), %eax
RETURN
.p2align 4
L(exit_case1_6):
lea 5(%edi), %eax
RETURN
.p2align 4
L(exit_case1_7):
lea 6(%edi), %eax
RETURN
.p2align 4
L(exit_case1_9):
lea 8(%edi), %eax
RETURN
.p2align 4
L(exit_case1_10):
lea 9(%edi), %eax
RETURN
.p2align 4
L(exit_case1_11):
lea 10(%edi), %eax
RETURN
.p2align 4
L(exit_case1_13):
lea 12(%edi), %eax
RETURN
.p2align 4
L(exit_case1_14):
lea 13(%edi), %eax
RETURN
.p2align 4
L(exit_case1_15):
lea 14(%edi), %eax
RETURN
.p2align 4
L(match_case2):
sub %ecx, %edx
L(match_case2_prolog1):
add %ecx, %edi
L(match_case2_prolog):
test %al, %al
jz L(match_case2_high)
mov %al, %cl
and $15, %cl
jz L(match_case2_8)
test $0x01, %al
jnz L(exit_case2_1)
test $0x02, %al
jnz L(exit_case2_2)
test $0x04, %al
jnz L(exit_case2_3)
sub $4, %edx
jb L(return_null)
lea 3(%edi), %eax
RETURN
.p2align 4
L(match_case2_8):
test $0x10, %al
jnz L(exit_case2_5)
test $0x20, %al
jnz L(exit_case2_6)
test $0x40, %al
jnz L(exit_case2_7)
sub $8, %edx
jb L(return_null)
lea 7(%edi), %eax
RETURN
.p2align 4
L(match_case2_high):
mov %ah, %ch
and $15, %ch
jz L(match_case2_high_8)
test $0x01, %ah
jnz L(exit_case2_9)
test $0x02, %ah
jnz L(exit_case2_10)
test $0x04, %ah
jnz L(exit_case2_11)
sub $12, %edx
jb L(return_null)
lea 11(%edi), %eax
RETURN
.p2align 4
L(match_case2_high_8):
test $0x10, %ah
jnz L(exit_case2_13)
test $0x20, %ah
jnz L(exit_case2_14)
test $0x40, %ah
jnz L(exit_case2_15)
sub $16, %edx
jb L(return_null)
lea 15(%edi), %eax
RETURN
.p2align 4
L(exit_case2_1):
mov %edi, %eax
RETURN
.p2align 4
L(exit_case2_2):
sub $2, %edx
jb L(return_null)
lea 1(%edi), %eax
RETURN
.p2align 4
L(exit_case2_3):
sub $3, %edx
jb L(return_null)
lea 2(%edi), %eax
RETURN
.p2align 4
L(exit_case2_5):
sub $5, %edx
jb L(return_null)
lea 4(%edi), %eax
RETURN
.p2align 4
L(exit_case2_6):
sub $6, %edx
jb L(return_null)
lea 5(%edi), %eax
RETURN
.p2align 4
L(exit_case2_7):
sub $7, %edx
jb L(return_null)
lea 6(%edi), %eax
RETURN
.p2align 4
L(exit_case2_9):
sub $9, %edx
jb L(return_null)
lea 8(%edi), %eax
RETURN
.p2align 4
L(exit_case2_10):
sub $10, %edx
jb L(return_null)
lea 9(%edi), %eax
RETURN
.p2align 4
L(exit_case2_11):
sub $11, %edx
jb L(return_null)
lea 10(%edi), %eax
RETURN
.p2align 4
L(exit_case2_13):
sub $13, %edx
jb L(return_null)
lea 12(%edi), %eax
RETURN
.p2align 4
L(exit_case2_14):
sub $14, %edx
jb L(return_null)
lea 13(%edi), %eax
RETURN
.p2align 4
L(exit_case2_15):
sub $15, %edx
jb L(return_null)
lea 14(%edi), %eax
RETURN
.p2align 4
L(return_null):
xor %eax, %eax
RETURN
END (memchr)

View File

@@ -1,778 +0,0 @@
/*
Copyright (c) 2011, Intel Corporation
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 Intel Corporation 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 L
# define L(label) .L##label
#endif
#ifndef cfi_startproc
# define cfi_startproc .cfi_startproc
#endif
#ifndef cfi_endproc
# define cfi_endproc .cfi_endproc
#endif
#ifndef cfi_rel_offset
# define cfi_rel_offset(reg, off) .cfi_rel_offset reg, off
#endif
#ifndef cfi_restore
# define cfi_restore(reg) .cfi_restore reg
#endif
#ifndef cfi_adjust_cfa_offset
# define cfi_adjust_cfa_offset(off) .cfi_adjust_cfa_offset off
#endif
#ifndef ENTRY
# define ENTRY(name) \
.type name, @function; \
.globl name; \
.p2align 4; \
name: \
cfi_startproc
#endif
#ifndef END
# define END(name) \
cfi_endproc; \
.size name, .-name
#endif
#define CFI_PUSH(REG) \
cfi_adjust_cfa_offset (4); \
cfi_rel_offset (REG, 0)
#define CFI_POP(REG) \
cfi_adjust_cfa_offset (-4); \
cfi_restore (REG)
#define PUSH(REG) pushl REG; CFI_PUSH (REG)
#define POP(REG) popl REG; CFI_POP (REG)
#define PARMS 4
#define STR1 PARMS
#define STR2 STR1+4
#define LEN STR2+4
.text
ENTRY (memrchr)
mov STR1(%esp), %ecx
movd STR2(%esp), %xmm1
mov LEN(%esp), %edx
test %edx, %edx
jz L(return_null)
sub $16, %edx
jbe L(length_less16)
punpcklbw %xmm1, %xmm1
add %edx, %ecx
punpcklbw %xmm1, %xmm1
movdqu (%ecx), %xmm0
pshufd $0, %xmm1, %xmm1
pcmpeqb %xmm1, %xmm0
pmovmskb %xmm0, %eax
test %eax, %eax
jnz L(exit_dispatch)
sub $64, %ecx
mov %ecx, %eax
and $15, %eax
jz L(loop_prolog)
add $16, %ecx
add $16, %edx
and $-16, %ecx
sub %eax, %edx
.p2align 4
/* Loop start on aligned string. */
L(loop_prolog):
sub $64, %edx
jbe L(exit_loop)
movdqa 48(%ecx), %xmm0
pcmpeqb %xmm1, %xmm0
pmovmskb %xmm0, %eax
test %eax, %eax
jnz L(matches48)
movdqa 32(%ecx), %xmm2
pcmpeqb %xmm1, %xmm2
pmovmskb %xmm2, %eax
test %eax, %eax
jnz L(matches32)
movdqa 16(%ecx), %xmm3
pcmpeqb %xmm1, %xmm3
pmovmskb %xmm3, %eax
test %eax, %eax
jnz L(matches16)
movdqa (%ecx), %xmm4
pcmpeqb %xmm1, %xmm4
pmovmskb %xmm4, %eax
test %eax, %eax
jnz L(exit_dispatch)
sub $64, %ecx
sub $64, %edx
jbe L(exit_loop)
movdqa 48(%ecx), %xmm0
pcmpeqb %xmm1, %xmm0
pmovmskb %xmm0, %eax
test %eax, %eax
jnz L(matches48)
movdqa 32(%ecx), %xmm2
pcmpeqb %xmm1, %xmm2
pmovmskb %xmm2, %eax
test %eax, %eax
jnz L(matches32)
movdqa 16(%ecx), %xmm3
pcmpeqb %xmm1, %xmm3
pmovmskb %xmm3, %eax
test %eax, %eax
jnz L(matches16)
movdqa (%ecx), %xmm3
pcmpeqb %xmm1, %xmm3
pmovmskb %xmm3, %eax
test %eax, %eax
jnz L(exit_dispatch)
mov %ecx, %eax
and $63, %eax
test %eax, %eax
jz L(align64_loop)
add $64, %ecx
add $64, %edx
and $-64, %ecx
sub %eax, %edx
.p2align 4
L(align64_loop):
sub $64, %ecx
sub $64, %edx
jbe L(exit_loop)
movdqa (%ecx), %xmm0
movdqa 16(%ecx), %xmm2
movdqa 32(%ecx), %xmm3
movdqa 48(%ecx), %xmm4
pcmpeqb %xmm1, %xmm0
pcmpeqb %xmm1, %xmm2
pcmpeqb %xmm1, %xmm3
pcmpeqb %xmm1, %xmm4
pmaxub %xmm3, %xmm0
pmaxub %xmm4, %xmm2
pmaxub %xmm0, %xmm2
pmovmskb %xmm2, %eax
test %eax, %eax
jz L(align64_loop)
pmovmskb %xmm4, %eax
test %eax, %eax
jnz L(matches48)
pmovmskb %xmm3, %eax
test %eax, %eax
jnz L(matches32)
movdqa 16(%ecx), %xmm2
pcmpeqb %xmm1, %xmm2
pcmpeqb (%ecx), %xmm1
pmovmskb %xmm2, %eax
test %eax, %eax
jnz L(matches16)
pmovmskb %xmm1, %eax
test %ah, %ah
jnz L(exit_dispatch_high)
mov %al, %dl
and $15 << 4, %dl
jnz L(exit_dispatch_8)
test $0x08, %al
jnz L(exit_4)
test $0x04, %al
jnz L(exit_3)
test $0x02, %al
jnz L(exit_2)
mov %ecx, %eax
ret
.p2align 4
L(exit_loop):
add $64, %edx
cmp $32, %edx
jbe L(exit_loop_32)
movdqa 48(%ecx), %xmm0
pcmpeqb %xmm1, %xmm0
pmovmskb %xmm0, %eax
test %eax, %eax
jnz L(matches48)
movdqa 32(%ecx), %xmm2
pcmpeqb %xmm1, %xmm2
pmovmskb %xmm2, %eax
test %eax, %eax
jnz L(matches32)
movdqa 16(%ecx), %xmm3
pcmpeqb %xmm1, %xmm3
pmovmskb %xmm3, %eax
test %eax, %eax
jnz L(matches16_1)
cmp $48, %edx
jbe L(return_null)
pcmpeqb (%ecx), %xmm1
pmovmskb %xmm1, %eax
test %eax, %eax
jnz L(matches0_1)
xor %eax, %eax
ret
.p2align 4
L(exit_loop_32):
movdqa 48(%ecx), %xmm0
pcmpeqb %xmm1, %xmm0
pmovmskb %xmm0, %eax
test %eax, %eax
jnz L(matches48_1)
cmp $16, %edx
jbe L(return_null)
pcmpeqb 32(%ecx), %xmm1
pmovmskb %xmm1, %eax
test %eax, %eax
jnz L(matches32_1)
xor %eax, %eax
ret
.p2align 4
L(matches16):
lea 16(%ecx), %ecx
test %ah, %ah
jnz L(exit_dispatch_high)
mov %al, %dl
and $15 << 4, %dl
jnz L(exit_dispatch_8)
test $0x08, %al
jnz L(exit_4)
test $0x04, %al
jnz L(exit_3)
test $0x02, %al
jnz L(exit_2)
mov %ecx, %eax
ret
.p2align 4
L(matches32):
lea 32(%ecx), %ecx
test %ah, %ah
jnz L(exit_dispatch_high)
mov %al, %dl
and $15 << 4, %dl
jnz L(exit_dispatch_8)
test $0x08, %al
jnz L(exit_4)
test $0x04, %al
jnz L(exit_3)
test $0x02, %al
jnz L(exit_2)
mov %ecx, %eax
ret
.p2align 4
L(matches48):
lea 48(%ecx), %ecx
.p2align 4
L(exit_dispatch):
test %ah, %ah
jnz L(exit_dispatch_high)
mov %al, %dl
and $15 << 4, %dl
jnz L(exit_dispatch_8)
test $0x08, %al
jnz L(exit_4)
test $0x04, %al
jnz L(exit_3)
test $0x02, %al
jnz L(exit_2)
mov %ecx, %eax
ret
.p2align 4
L(exit_dispatch_8):
test $0x80, %al
jnz L(exit_8)
test $0x40, %al
jnz L(exit_7)
test $0x20, %al
jnz L(exit_6)
lea 4(%ecx), %eax
ret
.p2align 4
L(exit_dispatch_high):
mov %ah, %dh
and $15 << 4, %dh
jnz L(exit_dispatch_high_8)
test $0x08, %ah
jnz L(exit_12)
test $0x04, %ah
jnz L(exit_11)
test $0x02, %ah
jnz L(exit_10)
lea 8(%ecx), %eax
ret
.p2align 4
L(exit_dispatch_high_8):
test $0x80, %ah
jnz L(exit_16)
test $0x40, %ah
jnz L(exit_15)
test $0x20, %ah
jnz L(exit_14)
lea 12(%ecx), %eax
ret
.p2align 4
L(exit_2):
lea 1(%ecx), %eax
ret
.p2align 4
L(exit_3):
lea 2(%ecx), %eax
ret
.p2align 4
L(exit_4):
lea 3(%ecx), %eax
ret
.p2align 4
L(exit_6):
lea 5(%ecx), %eax
ret
.p2align 4
L(exit_7):
lea 6(%ecx), %eax
ret
.p2align 4
L(exit_8):
lea 7(%ecx), %eax
ret
.p2align 4
L(exit_10):
lea 9(%ecx), %eax
ret
.p2align 4
L(exit_11):
lea 10(%ecx), %eax
ret
.p2align 4
L(exit_12):
lea 11(%ecx), %eax
ret
.p2align 4
L(exit_14):
lea 13(%ecx), %eax
ret
.p2align 4
L(exit_15):
lea 14(%ecx), %eax
ret
.p2align 4
L(exit_16):
lea 15(%ecx), %eax
ret
.p2align 4
L(matches0_1):
lea -64(%edx), %edx
test %ah, %ah
jnz L(exit_dispatch_1_high)
mov %al, %ah
and $15 << 4, %ah
jnz L(exit_dispatch_1_8)
test $0x08, %al
jnz L(exit_1_4)
test $0x04, %al
jnz L(exit_1_3)
test $0x02, %al
jnz L(exit_1_2)
add $0, %edx
jl L(return_null)
mov %ecx, %eax
ret
.p2align 4
L(matches16_1):
lea -48(%edx), %edx
lea 16(%ecx), %ecx
test %ah, %ah
jnz L(exit_dispatch_1_high)
mov %al, %ah
and $15 << 4, %ah
jnz L(exit_dispatch_1_8)
test $0x08, %al
jnz L(exit_1_4)
test $0x04, %al
jnz L(exit_1_3)
test $0x02, %al
jnz L(exit_1_2)
add $0, %edx
jl L(return_null)
mov %ecx, %eax
ret
.p2align 4
L(matches32_1):
lea -32(%edx), %edx
lea 32(%ecx), %ecx
test %ah, %ah
jnz L(exit_dispatch_1_high)
mov %al, %ah
and $15 << 4, %ah
jnz L(exit_dispatch_1_8)
test $0x08, %al
jnz L(exit_1_4)
test $0x04, %al
jnz L(exit_1_3)
test $0x02, %al
jnz L(exit_1_2)
add $0, %edx
jl L(return_null)
mov %ecx, %eax
ret
.p2align 4
L(matches48_1):
lea -16(%edx), %edx
lea 48(%ecx), %ecx
.p2align 4
L(exit_dispatch_1):
test %ah, %ah
jnz L(exit_dispatch_1_high)
mov %al, %ah
and $15 << 4, %ah
jnz L(exit_dispatch_1_8)
test $0x08, %al
jnz L(exit_1_4)
test $0x04, %al
jnz L(exit_1_3)
test $0x02, %al
jnz L(exit_1_2)
add $0, %edx
jl L(return_null)
mov %ecx, %eax
ret
.p2align 4
L(exit_dispatch_1_8):
test $0x80, %al
jnz L(exit_1_8)
test $0x40, %al
jnz L(exit_1_7)
test $0x20, %al
jnz L(exit_1_6)
add $4, %edx
jl L(return_null)
lea 4(%ecx), %eax
ret
.p2align 4
L(exit_dispatch_1_high):
mov %ah, %al
and $15 << 4, %al
jnz L(exit_dispatch_1_high_8)
test $0x08, %ah
jnz L(exit_1_12)
test $0x04, %ah
jnz L(exit_1_11)
test $0x02, %ah
jnz L(exit_1_10)
add $8, %edx
jl L(return_null)
lea 8(%ecx), %eax
ret
.p2align 4
L(exit_dispatch_1_high_8):
test $0x80, %ah
jnz L(exit_1_16)
test $0x40, %ah
jnz L(exit_1_15)
test $0x20, %ah
jnz L(exit_1_14)
add $12, %edx
jl L(return_null)
lea 12(%ecx), %eax
ret
.p2align 4
L(exit_1_2):
add $1, %edx
jl L(return_null)
lea 1(%ecx), %eax
ret
.p2align 4
L(exit_1_3):
add $2, %edx
jl L(return_null)
lea 2(%ecx), %eax
ret
.p2align 4
L(exit_1_4):
add $3, %edx
jl L(return_null)
lea 3(%ecx), %eax
ret
.p2align 4
L(exit_1_6):
add $5, %edx
jl L(return_null)
lea 5(%ecx), %eax
ret
.p2align 4
L(exit_1_7):
add $6, %edx
jl L(return_null)
lea 6(%ecx), %eax
ret
.p2align 4
L(exit_1_8):
add $7, %edx
jl L(return_null)
lea 7(%ecx), %eax
ret
.p2align 4
L(exit_1_10):
add $9, %edx
jl L(return_null)
lea 9(%ecx), %eax
ret
.p2align 4
L(exit_1_11):
add $10, %edx
jl L(return_null)
lea 10(%ecx), %eax
ret
.p2align 4
L(exit_1_12):
add $11, %edx
jl L(return_null)
lea 11(%ecx), %eax
ret
.p2align 4
L(exit_1_14):
add $13, %edx
jl L(return_null)
lea 13(%ecx), %eax
ret
.p2align 4
L(exit_1_15):
add $14, %edx
jl L(return_null)
lea 14(%ecx), %eax
ret
.p2align 4
L(exit_1_16):
add $15, %edx
jl L(return_null)
lea 15(%ecx), %eax
ret
.p2align 4
L(return_null):
xor %eax, %eax
ret
.p2align 4
L(length_less16_offset0):
mov %dl, %cl
pcmpeqb (%eax), %xmm1
mov $1, %edx
sal %cl, %edx
sub $1, %edx
mov %eax, %ecx
pmovmskb %xmm1, %eax
and %edx, %eax
test %eax, %eax
jnz L(exit_dispatch)
xor %eax, %eax
ret
.p2align 4
L(length_less16):
punpcklbw %xmm1, %xmm1
add $16, %edx
punpcklbw %xmm1, %xmm1
mov %ecx, %eax
pshufd $0, %xmm1, %xmm1
and $15, %ecx
jz L(length_less16_offset0)
PUSH (%edi)
mov %cl, %dh
add %dl, %dh
and $-16, %eax
sub $16, %dh
ja L(length_less16_part2)
pcmpeqb (%eax), %xmm1
pmovmskb %xmm1, %edi
sar %cl, %edi
add %ecx, %eax
mov %dl, %cl
mov $1, %edx
sal %cl, %edx
sub $1, %edx
and %edx, %edi
test %edi, %edi
jz L(ret_null)
bsr %edi, %edi
add %edi, %eax
POP (%edi)
ret
CFI_PUSH (%edi)
.p2align 4
L(length_less16_part2):
movdqa 16(%eax), %xmm2
pcmpeqb %xmm1, %xmm2
pmovmskb %xmm2, %edi
mov %cl, %ch
mov %dh, %cl
mov $1, %edx
sal %cl, %edx
sub $1, %edx
and %edx, %edi
test %edi, %edi
jnz L(length_less16_part2_return)
pcmpeqb (%eax), %xmm1
pmovmskb %xmm1, %edi
mov %ch, %cl
sar %cl, %edi
test %edi, %edi
jz L(ret_null)
bsr %edi, %edi
add %edi, %eax
xor %ch, %ch
add %ecx, %eax
POP (%edi)
ret
CFI_PUSH (%edi)
.p2align 4
L(length_less16_part2_return):
bsr %edi, %edi
lea 16(%eax, %edi), %eax
POP (%edi)
ret
CFI_PUSH (%edi)
.p2align 4
L(ret_null):
xor %eax, %eax
POP (%edi)
ret
END (memrchr)

View File

@@ -28,9 +28,6 @@ ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/ */
#include "cache.h"
#undef __i686
#ifndef L #ifndef L
# define L(label) .L##label # define L(label) .L##label
#endif #endif
@@ -139,13 +136,9 @@ __i686.get_pc_thunk.bx:
jmp *TABLE(,%ecx,4) jmp *TABLE(,%ecx,4)
#endif #endif
#ifndef MEMSET
# define MEMSET memset
#endif
.section .text.sse2,"ax",@progbits .section .text.sse2,"ax",@progbits
ALIGN (4) ALIGN (4)
ENTRY (MEMSET) ENTRY (sse2_memset5_atom)
ENTRANCE ENTRANCE
movl LEN(%esp), %ecx movl LEN(%esp), %ecx
@@ -918,4 +911,4 @@ L(aligned_16_15bytes):
SETRTNVAL SETRTNVAL
RETURN_END RETURN_END
END (MEMSET) END (sse2_memset5_atom)

View File

@@ -1,391 +0,0 @@
/*
Copyright (c) 2011, Intel Corporation
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 Intel Corporation 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 L
# define L(label) .L##label
#endif
#ifndef cfi_startproc
# define cfi_startproc .cfi_startproc
#endif
#ifndef cfi_endproc
# define cfi_endproc .cfi_endproc
#endif
#ifndef cfi_rel_offset
# define cfi_rel_offset(reg, off) .cfi_rel_offset reg, off
#endif
#ifndef cfi_restore
# define cfi_restore(reg) .cfi_restore reg
#endif
#ifndef cfi_adjust_cfa_offset
# define cfi_adjust_cfa_offset(off) .cfi_adjust_cfa_offset off
#endif
#ifndef ENTRY
# define ENTRY(name) \
.type name, @function; \
.globl name; \
.p2align 4; \
name: \
cfi_startproc
#endif
#ifndef END
# define END(name) \
cfi_endproc; \
.size name, .-name
#endif
#define CFI_PUSH(REG) \
cfi_adjust_cfa_offset (4); \
cfi_rel_offset (REG, 0)
#define CFI_POP(REG) \
cfi_adjust_cfa_offset (-4); \
cfi_restore (REG)
#define PUSH(REG) pushl REG; CFI_PUSH (REG)
#define POP(REG) popl REG; CFI_POP (REG)
#define PARMS 8
#define ENTRANCE PUSH(%edi)
#define RETURN POP (%edi); ret; CFI_PUSH (%edi);
#define STR1 PARMS
#define STR2 STR1+4
.text
ENTRY (strchr)
ENTRANCE
mov STR1(%esp), %ecx
movd STR2(%esp), %xmm1
pxor %xmm2, %xmm2
mov %ecx, %edi
punpcklbw %xmm1, %xmm1
punpcklbw %xmm1, %xmm1
/* ECX has OFFSET. */
and $15, %ecx
pshufd $0, %xmm1, %xmm1
je L(loop)
/* Handle unaligned string. */
and $-16, %edi
movdqa (%edi), %xmm0
pcmpeqb %xmm0, %xmm2
pcmpeqb %xmm1, %xmm0
/* Find where NULL is. */
pmovmskb %xmm2, %edx
/* Check if there is a match. */
pmovmskb %xmm0, %eax
/* Remove the leading bytes. */
sarl %cl, %edx
sarl %cl, %eax
test %eax, %eax
jz L(unaligned_no_match)
add %ecx, %edi
test %edx, %edx
jz L(match_case1)
jmp L(match_case2)
.p2align 4
L(unaligned_no_match):
test %edx, %edx
jne L(return_null)
pxor %xmm2, %xmm2
add $16, %edi
.p2align 4
/* Loop start on aligned string. */
L(loop):
movdqa (%edi), %xmm0
pcmpeqb %xmm0, %xmm2
pcmpeqb %xmm1, %xmm0
pmovmskb %xmm2, %edx
pmovmskb %xmm0, %eax
test %eax, %eax
jnz L(matches)
test %edx, %edx
jnz L(return_null)
add $16, %edi
movdqa (%edi), %xmm0
pcmpeqb %xmm0, %xmm2
pcmpeqb %xmm1, %xmm0
pmovmskb %xmm2, %edx
pmovmskb %xmm0, %eax
test %eax, %eax
jnz L(matches)
test %edx, %edx
jnz L(return_null)
add $16, %edi
movdqa (%edi), %xmm0
pcmpeqb %xmm0, %xmm2
pcmpeqb %xmm1, %xmm0
pmovmskb %xmm2, %edx
pmovmskb %xmm0, %eax
test %eax, %eax
jnz L(matches)
test %edx, %edx
jnz L(return_null)
add $16, %edi
movdqa (%edi), %xmm0
pcmpeqb %xmm0, %xmm2
pcmpeqb %xmm1, %xmm0
pmovmskb %xmm2, %edx
pmovmskb %xmm0, %eax
test %eax, %eax
jnz L(matches)
test %edx, %edx
jnz L(return_null)
add $16, %edi
jmp L(loop)
L(matches):
/* There is a match. First find where NULL is. */
test %edx, %edx
jz L(match_case1)
.p2align 4
L(match_case2):
test %al, %al
jz L(match_higth_case2)
mov %al, %cl
and $15, %cl
jnz L(match_case2_4)
mov %dl, %ch
and $15, %ch
jnz L(return_null)
test $0x10, %al
jnz L(Exit5)
test $0x10, %dl
jnz L(return_null)
test $0x20, %al
jnz L(Exit6)
test $0x20, %dl
jnz L(return_null)
test $0x40, %al
jnz L(Exit7)
test $0x40, %dl
jnz L(return_null)
lea 7(%edi), %eax
RETURN
.p2align 4
L(match_case2_4):
test $0x01, %al
jnz L(Exit1)
test $0x01, %dl
jnz L(return_null)
test $0x02, %al
jnz L(Exit2)
test $0x02, %dl
jnz L(return_null)
test $0x04, %al
jnz L(Exit3)
test $0x04, %dl
jnz L(return_null)
lea 3(%edi), %eax
RETURN
.p2align 4
L(match_higth_case2):
test %dl, %dl
jnz L(return_null)
mov %ah, %cl
and $15, %cl
jnz L(match_case2_12)
mov %dh, %ch
and $15, %ch
jnz L(return_null)
test $0x10, %ah
jnz L(Exit13)
test $0x10, %dh
jnz L(return_null)
test $0x20, %ah
jnz L(Exit14)
test $0x20, %dh
jnz L(return_null)
test $0x40, %ah
jnz L(Exit15)
test $0x40, %dh
jnz L(return_null)
lea 15(%edi), %eax
RETURN
.p2align 4
L(match_case2_12):
test $0x01, %ah
jnz L(Exit9)
test $0x01, %dh
jnz L(return_null)
test $0x02, %ah
jnz L(Exit10)
test $0x02, %dh
jnz L(return_null)
test $0x04, %ah
jnz L(Exit11)
test $0x04, %dh
jnz L(return_null)
lea 11(%edi), %eax
RETURN
.p2align 4
L(match_case1):
test %al, %al
jz L(match_higth_case1)
test $0x01, %al
jnz L(Exit1)
test $0x02, %al
jnz L(Exit2)
test $0x04, %al
jnz L(Exit3)
test $0x08, %al
jnz L(Exit4)
test $0x10, %al
jnz L(Exit5)
test $0x20, %al
jnz L(Exit6)
test $0x40, %al
jnz L(Exit7)
lea 7(%edi), %eax
RETURN
.p2align 4
L(match_higth_case1):
test $0x01, %ah
jnz L(Exit9)
test $0x02, %ah
jnz L(Exit10)
test $0x04, %ah
jnz L(Exit11)
test $0x08, %ah
jnz L(Exit12)
test $0x10, %ah
jnz L(Exit13)
test $0x20, %ah
jnz L(Exit14)
test $0x40, %ah
jnz L(Exit15)
lea 15(%edi), %eax
RETURN
.p2align 4
L(Exit1):
lea (%edi), %eax
RETURN
.p2align 4
L(Exit2):
lea 1(%edi), %eax
RETURN
.p2align 4
L(Exit3):
lea 2(%edi), %eax
RETURN
.p2align 4
L(Exit4):
lea 3(%edi), %eax
RETURN
.p2align 4
L(Exit5):
lea 4(%edi), %eax
RETURN
.p2align 4
L(Exit6):
lea 5(%edi), %eax
RETURN
.p2align 4
L(Exit7):
lea 6(%edi), %eax
RETURN
.p2align 4
L(Exit9):
lea 8(%edi), %eax
RETURN
.p2align 4
L(Exit10):
lea 9(%edi), %eax
RETURN
.p2align 4
L(Exit11):
lea 10(%edi), %eax
RETURN
.p2align 4
L(Exit12):
lea 11(%edi), %eax
RETURN
.p2align 4
L(Exit13):
lea 12(%edi), %eax
RETURN
.p2align 4
L(Exit14):
lea 13(%edi), %eax
RETURN
.p2align 4
L(Exit15):
lea 14(%edi), %eax
RETURN
.p2align 4
L(return_null):
xor %eax, %eax
RETURN
END (strchr)

View File

@@ -1,112 +1,71 @@
/* #define STRLEN sse2_strlen_atom
Copyright (c) 2011, Intel Corporation
All rights reserved.
Redistribution and use in source and binary forms, with or without #ifndef L
modification, are permitted provided that the following conditions are met: # define L(label) .L##label
#endif
* Redistributions of source code must retain the above copyright notice, #ifndef cfi_startproc
* this list of conditions and the following disclaimer. # define cfi_startproc .cfi_startproc
#endif
* Redistributions in binary form must reproduce the above copyright notice, #ifndef cfi_endproc
* this list of conditions and the following disclaimer in the documentation # define cfi_endproc .cfi_endproc
* and/or other materials provided with the distribution. #endif
* Neither the name of Intel Corporation nor the names of its contributors #ifndef cfi_rel_offset
* may be used to endorse or promote products derived from this software # define cfi_rel_offset(reg, off) .cfi_rel_offset reg, off
* without specific prior written permission. #endif
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND #ifndef cfi_restore
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED # define cfi_restore(reg) .cfi_restore reg
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE #endif
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 USE_AS_STRCAT #ifndef cfi_adjust_cfa_offset
# define cfi_adjust_cfa_offset(off) .cfi_adjust_cfa_offset off
#endif
# ifndef STRLEN #ifndef cfi_remember_state
# define STRLEN strlen # define cfi_remember_state .cfi_remember_state
# endif #endif
# ifndef L #ifndef cfi_restore_state
# define L(label) .L##label # define cfi_restore_state .cfi_restore_state
# endif #endif
# ifndef cfi_startproc #ifndef ENTRY
# define cfi_startproc .cfi_startproc # define ENTRY(name) \
# endif .type name, @function; \
.globl name; \
# ifndef cfi_endproc .p2align 4; \
# define cfi_endproc .cfi_endproc name: \
# endif
/* calee safe register only for strnlen is required */
# ifdef USE_AS_STRNLEN
# ifndef cfi_rel_offset
# define cfi_rel_offset(reg, off) .cfi_rel_offset reg, off
# endif
# ifndef cfi_restore
# define cfi_restore(reg) .cfi_restore reg
# endif
# ifndef cfi_adjust_cfa_offset
# define cfi_adjust_cfa_offset(off) .cfi_adjust_cfa_offset off
# endif
# endif
# ifndef ENTRY
# define ENTRY(name) \
.type name, @function; \
.globl name; \
.p2align 4; \
name: \
cfi_startproc cfi_startproc
# endif #endif
# ifndef END #ifndef END
# define END(name) \ # define END(name) \
cfi_endproc; \ cfi_endproc; \
.size name, .-name .size name, .-name
# endif #endif
# define PARMS 4 #define CFI_PUSH(REG) \
# define STR PARMS cfi_adjust_cfa_offset (4); \
# define RETURN ret cfi_rel_offset (REG, 0)
# ifdef USE_AS_STRNLEN #define CFI_POP(REG) \
# define LEN PARMS + 8 cfi_adjust_cfa_offset (-4); \
# define CFI_PUSH(REG) \ cfi_restore (REG)
cfi_adjust_cfa_offset (4); \
cfi_rel_offset (REG, 0)
# define CFI_POP(REG) \ #define PUSH(REG) pushl REG; CFI_PUSH (REG)
cfi_adjust_cfa_offset (-4); \ #define POP(REG) popl REG; CFI_POP (REG)
cfi_restore (REG) #define PARMS 4
#define STR PARMS
# define PUSH(REG) pushl REG; CFI_PUSH (REG) #define ENTRANCE
# define POP(REG) popl REG; CFI_POP (REG) #define RETURN ret
# undef RETURN
# define RETURN POP (%edi); ret; CFI_PUSH(%edi);
# endif
.text .text
ENTRY (STRLEN) ENTRY (STRLEN)
ENTRANCE
mov STR(%esp), %edx mov STR(%esp), %edx
# ifdef USE_AS_STRNLEN
PUSH (%edi)
movl LEN(%esp), %edi
sub $4, %edi
jbe L(len_less4_prolog)
# endif
#endif
xor %eax, %eax xor %eax, %eax
cmpb $0, (%edx) cmpb $0, (%edx)
jz L(exit_tail0) jz L(exit_tail0)
@@ -116,12 +75,6 @@ ENTRY (STRLEN)
jz L(exit_tail2) jz L(exit_tail2)
cmpb $0, 3(%edx) cmpb $0, 3(%edx)
jz L(exit_tail3) jz L(exit_tail3)
#ifdef USE_AS_STRNLEN
sub $4, %edi
jbe L(len_less8_prolog)
#endif
cmpb $0, 4(%edx) cmpb $0, 4(%edx)
jz L(exit_tail4) jz L(exit_tail4)
cmpb $0, 5(%edx) cmpb $0, 5(%edx)
@@ -130,12 +83,6 @@ ENTRY (STRLEN)
jz L(exit_tail6) jz L(exit_tail6)
cmpb $0, 7(%edx) cmpb $0, 7(%edx)
jz L(exit_tail7) jz L(exit_tail7)
#ifdef USE_AS_STRNLEN
sub $4, %edi
jbe L(len_less12_prolog)
#endif
cmpb $0, 8(%edx) cmpb $0, 8(%edx)
jz L(exit_tail8) jz L(exit_tail8)
cmpb $0, 9(%edx) cmpb $0, 9(%edx)
@@ -144,12 +91,6 @@ ENTRY (STRLEN)
jz L(exit_tail10) jz L(exit_tail10)
cmpb $0, 11(%edx) cmpb $0, 11(%edx)
jz L(exit_tail11) jz L(exit_tail11)
#ifdef USE_AS_STRNLEN
sub $4, %edi
jbe L(len_less16_prolog)
#endif
cmpb $0, 12(%edx) cmpb $0, 12(%edx)
jz L(exit_tail12) jz L(exit_tail12)
cmpb $0, 13(%edx) cmpb $0, 13(%edx)
@@ -158,532 +99,212 @@ ENTRY (STRLEN)
jz L(exit_tail14) jz L(exit_tail14)
cmpb $0, 15(%edx) cmpb $0, 15(%edx)
jz L(exit_tail15) jz L(exit_tail15)
pxor %xmm0, %xmm0 pxor %xmm0, %xmm0
lea 16(%edx), %eax mov %edx, %eax
mov %eax, %ecx mov %edx, %ecx
and $-16, %eax and $-16, %eax
add $16, %ecx
#ifdef USE_AS_STRNLEN add $16, %eax
and $15, %edx
add %edx, %edi
sub $64, %edi
jbe L(len_less64)
#endif
pcmpeqb (%eax), %xmm0 pcmpeqb (%eax), %xmm0
pmovmskb %xmm0, %edx pmovmskb %xmm0, %edx
pxor %xmm1, %xmm1 pxor %xmm1, %xmm1
lea 16(%eax), %eax
test %edx, %edx test %edx, %edx
lea 16(%eax), %eax
jnz L(exit) jnz L(exit)
pcmpeqb (%eax), %xmm1 pcmpeqb (%eax), %xmm1
pmovmskb %xmm1, %edx pmovmskb %xmm1, %edx
pxor %xmm2, %xmm2 pxor %xmm2, %xmm2
lea 16(%eax), %eax
test %edx, %edx test %edx, %edx
lea 16(%eax), %eax
jnz L(exit) jnz L(exit)
pcmpeqb (%eax), %xmm2 pcmpeqb (%eax), %xmm2
pmovmskb %xmm2, %edx pmovmskb %xmm2, %edx
pxor %xmm3, %xmm3 pxor %xmm3, %xmm3
lea 16(%eax), %eax
test %edx, %edx test %edx, %edx
lea 16(%eax), %eax
jnz L(exit) jnz L(exit)
pcmpeqb (%eax), %xmm3 pcmpeqb (%eax), %xmm3
pmovmskb %xmm3, %edx pmovmskb %xmm3, %edx
lea 16(%eax), %eax
test %edx, %edx test %edx, %edx
lea 16(%eax), %eax
jnz L(exit) jnz L(exit)
#ifdef USE_AS_STRNLEN
sub $64, %edi
jbe L(len_less64)
#endif
pcmpeqb (%eax), %xmm0 pcmpeqb (%eax), %xmm0
pmovmskb %xmm0, %edx pmovmskb %xmm0, %edx
lea 16(%eax), %eax
test %edx, %edx test %edx, %edx
lea 16(%eax), %eax
jnz L(exit) jnz L(exit)
pcmpeqb (%eax), %xmm1 pcmpeqb (%eax), %xmm1
pmovmskb %xmm1, %edx pmovmskb %xmm1, %edx
lea 16(%eax), %eax
test %edx, %edx test %edx, %edx
lea 16(%eax), %eax
jnz L(exit) jnz L(exit)
pcmpeqb (%eax), %xmm2 pcmpeqb (%eax), %xmm2
pmovmskb %xmm2, %edx pmovmskb %xmm2, %edx
lea 16(%eax), %eax
test %edx, %edx test %edx, %edx
lea 16(%eax), %eax
jnz L(exit) jnz L(exit)
pcmpeqb (%eax), %xmm3 pcmpeqb (%eax), %xmm3
pmovmskb %xmm3, %edx pmovmskb %xmm3, %edx
lea 16(%eax), %eax
test %edx, %edx test %edx, %edx
lea 16(%eax), %eax
jnz L(exit) jnz L(exit)
#ifdef USE_AS_STRNLEN
sub $64, %edi
jbe L(len_less64)
#endif
pcmpeqb (%eax), %xmm0 pcmpeqb (%eax), %xmm0
pmovmskb %xmm0, %edx pmovmskb %xmm0, %edx
lea 16(%eax), %eax
test %edx, %edx test %edx, %edx
lea 16(%eax), %eax
jnz L(exit) jnz L(exit)
pcmpeqb (%eax), %xmm1 pcmpeqb (%eax), %xmm1
pmovmskb %xmm1, %edx pmovmskb %xmm1, %edx
lea 16(%eax), %eax
test %edx, %edx test %edx, %edx
lea 16(%eax), %eax
jnz L(exit) jnz L(exit)
pcmpeqb (%eax), %xmm2 pcmpeqb (%eax), %xmm2
pmovmskb %xmm2, %edx pmovmskb %xmm2, %edx
lea 16(%eax), %eax
test %edx, %edx test %edx, %edx
lea 16(%eax), %eax
jnz L(exit) jnz L(exit)
pcmpeqb (%eax), %xmm3 pcmpeqb (%eax), %xmm3
pmovmskb %xmm3, %edx pmovmskb %xmm3, %edx
lea 16(%eax), %eax
test %edx, %edx test %edx, %edx
lea 16(%eax), %eax
jnz L(exit) jnz L(exit)
#ifdef USE_AS_STRNLEN
sub $64, %edi
jbe L(len_less64)
#endif
pcmpeqb (%eax), %xmm0 pcmpeqb (%eax), %xmm0
pmovmskb %xmm0, %edx pmovmskb %xmm0, %edx
lea 16(%eax), %eax
test %edx, %edx test %edx, %edx
lea 16(%eax), %eax
jnz L(exit) jnz L(exit)
pcmpeqb (%eax), %xmm1 pcmpeqb (%eax), %xmm1
pmovmskb %xmm1, %edx pmovmskb %xmm1, %edx
lea 16(%eax), %eax
test %edx, %edx test %edx, %edx
lea 16(%eax), %eax
jnz L(exit) jnz L(exit)
pcmpeqb (%eax), %xmm2 pcmpeqb (%eax), %xmm2
pmovmskb %xmm2, %edx pmovmskb %xmm2, %edx
lea 16(%eax), %eax
test %edx, %edx test %edx, %edx
lea 16(%eax), %eax
jnz L(exit) jnz L(exit)
pcmpeqb (%eax), %xmm3 pcmpeqb (%eax), %xmm3
pmovmskb %xmm3, %edx pmovmskb %xmm3, %edx
lea 16(%eax), %eax
test %edx, %edx test %edx, %edx
lea 16(%eax), %eax
jnz L(exit) jnz L(exit)
#ifdef USE_AS_STRNLEN
mov %eax, %edx
and $63, %edx
add %edx, %edi
#endif
and $-0x40, %eax and $-0x40, %eax
PUSH (%esi)
.p2align 4 PUSH (%edi)
L(aligned_64_loop): PUSH (%ebx)
#ifdef USE_AS_STRNLEN PUSH (%ebp)
sub $64, %edi xor %ebp, %ebp
jbe L(len_less64) L(aligned_64):
#endif pcmpeqb (%eax), %xmm0
movaps (%eax), %xmm0 pcmpeqb 16(%eax), %xmm1
movaps 16(%eax), %xmm1 pcmpeqb 32(%eax), %xmm2
movaps 32(%eax), %xmm2 pcmpeqb 48(%eax), %xmm3
movaps 48(%eax), %xmm6 pmovmskb %xmm0, %edx
pminub %xmm1, %xmm0 pmovmskb %xmm1, %esi
pminub %xmm6, %xmm2 pmovmskb %xmm2, %edi
pminub %xmm0, %xmm2 pmovmskb %xmm3, %ebx
pcmpeqb %xmm3, %xmm2 or %edx, %ebp
pmovmskb %xmm2, %edx or %esi, %ebp
or %edi, %ebp
or %ebx, %ebp
lea 64(%eax), %eax lea 64(%eax), %eax
jz L(aligned_64)
L(48leave):
test %edx, %edx test %edx, %edx
jz L(aligned_64_loop) jnz L(aligned_64_exit_16)
test %esi, %esi
pcmpeqb -64(%eax), %xmm3 jnz L(aligned_64_exit_32)
pmovmskb %xmm3, %edx test %edi, %edi
lea 48(%ecx), %ecx jnz L(aligned_64_exit_48)
test %edx, %edx mov %ebx, %edx
jnz L(exit) lea (%eax), %eax
jmp L(aligned_64_exit)
pcmpeqb %xmm1, %xmm3 L(aligned_64_exit_48):
pmovmskb %xmm3, %edx lea -16(%eax), %eax
lea -16(%ecx), %ecx mov %edi, %edx
test %edx, %edx jmp L(aligned_64_exit)
jnz L(exit) L(aligned_64_exit_32):
lea -32(%eax), %eax
pcmpeqb -32(%eax), %xmm3 mov %esi, %edx
pmovmskb %xmm3, %edx jmp L(aligned_64_exit)
lea -16(%ecx), %ecx L(aligned_64_exit_16):
test %edx, %edx lea -48(%eax), %eax
jnz L(exit) L(aligned_64_exit):
POP (%ebp)
pcmpeqb %xmm6, %xmm3 POP (%ebx)
pmovmskb %xmm3, %edx POP (%edi)
lea -16(%ecx), %ecx POP (%esi)
L(exit): L(exit):
sub %ecx, %eax sub %ecx, %eax
test %dl, %dl test %dl, %dl
jz L(exit_high) jz L(exit_high)
mov %dl, %cl
and $15, %cl
jz L(exit_8)
test $0x01, %dl test $0x01, %dl
jnz L(exit_tail0) jnz L(exit_tail0)
test $0x02, %dl test $0x02, %dl
jnz L(exit_tail1) jnz L(exit_tail1)
test $0x04, %dl test $0x04, %dl
jnz L(exit_tail2) jnz L(exit_tail2)
add $3, %eax
RETURN
.p2align 4 test $0x08, %dl
L(exit_8): jnz L(exit_tail3)
test $0x10, %dl test $0x10, %dl
jnz L(exit_tail4) jnz L(exit_tail4)
test $0x20, %dl test $0x20, %dl
jnz L(exit_tail5) jnz L(exit_tail5)
test $0x40, %dl test $0x40, %dl
jnz L(exit_tail6) jnz L(exit_tail6)
add $7, %eax add $7, %eax
RETURN
.p2align 4
L(exit_high):
mov %dh, %ch
and $15, %ch
jz L(exit_high_8)
test $0x01, %dh
jnz L(exit_tail8)
test $0x02, %dh
jnz L(exit_tail9)
test $0x04, %dh
jnz L(exit_tail10)
add $11, %eax
RETURN
.p2align 4
L(exit_high_8):
test $0x10, %dh
jnz L(exit_tail12)
test $0x20, %dh
jnz L(exit_tail13)
test $0x40, %dh
jnz L(exit_tail14)
add $15, %eax
L(exit_tail0): L(exit_tail0):
RETURN RETURN
#ifdef USE_AS_STRNLEN L(exit_high):
add $8, %eax
.p2align 4
L(len_less64):
pxor %xmm0, %xmm0
add $64, %edi
pcmpeqb (%eax), %xmm0
pmovmskb %xmm0, %edx
pxor %xmm1, %xmm1
lea 16(%eax), %eax
test %edx, %edx
jnz L(strnlen_exit)
sub $16, %edi
jbe L(return_start_len)
pcmpeqb (%eax), %xmm1
pmovmskb %xmm1, %edx
lea 16(%eax), %eax
test %edx, %edx
jnz L(strnlen_exit)
sub $16, %edi
jbe L(return_start_len)
pcmpeqb (%eax), %xmm0
pmovmskb %xmm0, %edx
lea 16(%eax), %eax
test %edx, %edx
jnz L(strnlen_exit)
sub $16, %edi
jbe L(return_start_len)
pcmpeqb (%eax), %xmm1
pmovmskb %xmm1, %edx
lea 16(%eax), %eax
test %edx, %edx
jnz L(strnlen_exit)
#ifndef USE_AS_STRLCAT
movl LEN(%esp), %eax
RETURN
#else
jmp L(return_start_len)
#endif
.p2align 4
L(strnlen_exit):
sub %ecx, %eax
test %dl, %dl
jz L(strnlen_exit_high)
mov %dl, %cl
and $15, %cl
jz L(strnlen_exit_8)
test $0x01, %dl
jnz L(exit_tail0)
test $0x02, %dl
jnz L(strnlen_exit_tail1)
test $0x04, %dl
jnz L(strnlen_exit_tail2)
sub $4, %edi
jb L(return_start_len)
lea 3(%eax), %eax
RETURN
.p2align 4
L(strnlen_exit_8):
test $0x10, %dl
jnz L(strnlen_exit_tail4)
test $0x20, %dl
jnz L(strnlen_exit_tail5)
test $0x40, %dl
jnz L(strnlen_exit_tail6)
sub $8, %edi
jb L(return_start_len)
lea 7(%eax), %eax
RETURN
.p2align 4
L(strnlen_exit_high):
mov %dh, %ch
and $15, %ch
jz L(strnlen_exit_high_8)
test $0x01, %dh test $0x01, %dh
jnz L(strnlen_exit_tail8) jnz L(exit_tail0)
test $0x02, %dh test $0x02, %dh
jnz L(strnlen_exit_tail9) jnz L(exit_tail1)
test $0x04, %dh test $0x04, %dh
jnz L(strnlen_exit_tail10) jnz L(exit_tail2)
sub $12, %edi
jb L(return_start_len) test $0x08, %dh
lea 11(%eax), %eax jnz L(exit_tail3)
RETURN
.p2align 4
L(strnlen_exit_high_8):
test $0x10, %dh test $0x10, %dh
jnz L(strnlen_exit_tail12) jnz L(exit_tail4)
test $0x20, %dh test $0x20, %dh
jnz L(strnlen_exit_tail13) jnz L(exit_tail5)
test $0x40, %dh test $0x40, %dh
jnz L(strnlen_exit_tail14) jnz L(exit_tail6)
sub $16, %edi add $7, %eax
jb L(return_start_len)
lea 15(%eax), %eax
RETURN RETURN
.p2align 4
L(strnlen_exit_tail1):
sub $2, %edi
jb L(return_start_len)
lea 1(%eax), %eax
RETURN
.p2align 4
L(strnlen_exit_tail2):
sub $3, %edi
jb L(return_start_len)
lea 2(%eax), %eax
RETURN
.p2align 4
L(strnlen_exit_tail4):
sub $5, %edi
jb L(return_start_len)
lea 4(%eax), %eax
RETURN
.p2align 4
L(strnlen_exit_tail5):
sub $6, %edi
jb L(return_start_len)
lea 5(%eax), %eax
RETURN
.p2align 4
L(strnlen_exit_tail6):
sub $7, %edi
jb L(return_start_len)
lea 6(%eax), %eax
RETURN
.p2align 4
L(strnlen_exit_tail8):
sub $9, %edi
jb L(return_start_len)
lea 8(%eax), %eax
RETURN
.p2align 4
L(strnlen_exit_tail9):
sub $10, %edi
jb L(return_start_len)
lea 9(%eax), %eax
RETURN
.p2align 4
L(strnlen_exit_tail10):
sub $11, %edi
jb L(return_start_len)
lea 10(%eax), %eax
RETURN
.p2align 4
L(strnlen_exit_tail12):
sub $13, %edi
jb L(return_start_len)
lea 12(%eax), %eax
RETURN
.p2align 4
L(strnlen_exit_tail13):
sub $14, %edi
jb L(return_start_len)
lea 13(%eax), %eax
RETURN
.p2align 4
L(strnlen_exit_tail14):
sub $15, %edi
jb L(return_start_len)
lea 14(%eax), %eax
RETURN
#ifndef USE_AS_STRLCAT
.p2align 4
L(return_start_len):
movl LEN(%esp), %eax
RETURN
#endif
/* for prolog only */
.p2align 4
L(len_less4_prolog):
xor %eax, %eax
add $4, %edi
jz L(exit_tail0)
cmpb $0, (%edx)
jz L(exit_tail0)
cmp $1, %edi
je L(exit_tail1)
cmpb $0, 1(%edx)
jz L(exit_tail1)
cmp $2, %edi
je L(exit_tail2)
cmpb $0, 2(%edx)
jz L(exit_tail2)
cmp $3, %edi
je L(exit_tail3)
cmpb $0, 3(%edx)
jz L(exit_tail3)
mov %edi, %eax
RETURN
.p2align 4
L(len_less8_prolog):
add $4, %edi
cmpb $0, 4(%edx)
jz L(exit_tail4)
cmp $1, %edi
je L(exit_tail5)
cmpb $0, 5(%edx)
jz L(exit_tail5)
cmp $2, %edi
je L(exit_tail6)
cmpb $0, 6(%edx)
jz L(exit_tail6)
cmp $3, %edi
je L(exit_tail7)
cmpb $0, 7(%edx)
jz L(exit_tail7)
mov $8, %eax
RETURN
.p2align 4
L(len_less12_prolog):
add $4, %edi
cmpb $0, 8(%edx)
jz L(exit_tail8)
cmp $1, %edi
je L(exit_tail9)
cmpb $0, 9(%edx)
jz L(exit_tail9)
cmp $2, %edi
je L(exit_tail10)
cmpb $0, 10(%edx)
jz L(exit_tail10)
cmp $3, %edi
je L(exit_tail11)
cmpb $0, 11(%edx)
jz L(exit_tail11)
mov $12, %eax
RETURN
.p2align 4
L(len_less16_prolog):
add $4, %edi
cmpb $0, 12(%edx)
jz L(exit_tail12)
cmp $1, %edi
je L(exit_tail13)
cmpb $0, 13(%edx)
jz L(exit_tail13)
cmp $2, %edi
je L(exit_tail14)
cmpb $0, 14(%edx)
jz L(exit_tail14)
cmp $3, %edi
je L(exit_tail15)
cmpb $0, 15(%edx)
jz L(exit_tail15)
mov $16, %eax
RETURN
#endif
.p2align 4 .p2align 4
L(exit_tail1): L(exit_tail1):
add $1, %eax add $1, %eax
@@ -743,7 +364,6 @@ L(exit_tail14):
L(exit_tail15): L(exit_tail15):
add $15, %eax add $15, %eax
#ifndef USE_AS_STRCAT ret
RETURN
END (STRLEN) END (STRLEN)
#endif

View File

@@ -1,33 +0,0 @@
/*
Copyright (c) 2011, Intel Corporation
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 Intel Corporation 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.
*/
#define USE_AS_STRNLEN 1
#define STRLEN strnlen
#include "sse2-strlen-atom.S"

View File

@@ -1,753 +0,0 @@
/*
Copyright (c) 2011, Intel Corporation
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 Intel Corporation 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 L
# define L(label) .L##label
#endif
#ifndef cfi_startproc
# define cfi_startproc .cfi_startproc
#endif
#ifndef cfi_endproc
# define cfi_endproc .cfi_endproc
#endif
#ifndef cfi_rel_offset
# define cfi_rel_offset(reg, off) .cfi_rel_offset reg, off
#endif
#ifndef cfi_restore
# define cfi_restore(reg) .cfi_restore reg
#endif
#ifndef cfi_adjust_cfa_offset
# define cfi_adjust_cfa_offset(off) .cfi_adjust_cfa_offset off
#endif
#ifndef ENTRY
# define ENTRY(name) \
.type name, @function; \
.globl name; \
.p2align 4; \
name: \
cfi_startproc
#endif
#ifndef END
# define END(name) \
cfi_endproc; \
.size name, .-name
#endif
#define CFI_PUSH(REG) \
cfi_adjust_cfa_offset (4); \
cfi_rel_offset (REG, 0)
#define CFI_POP(REG) \
cfi_adjust_cfa_offset (-4); \
cfi_restore (REG)
#define PUSH(REG) pushl REG; CFI_PUSH (REG)
#define POP(REG) popl REG; CFI_POP (REG)
#define PARMS 8
#define ENTRANCE PUSH(%edi);
#define RETURN POP (%edi); ret; CFI_PUSH (%edi);
#define STR1 PARMS
#define STR2 STR1+4
.text
ENTRY (strrchr)
ENTRANCE
mov STR1(%esp), %ecx
movd STR2(%esp), %xmm1
pxor %xmm2, %xmm2
mov %ecx, %edi
punpcklbw %xmm1, %xmm1
punpcklbw %xmm1, %xmm1
/* ECX has OFFSET. */
and $63, %ecx
pshufd $0, %xmm1, %xmm1
cmp $48, %ecx
ja L(crosscache)
/* unaligned string. */
movdqu (%edi), %xmm0
pcmpeqb %xmm0, %xmm2
pcmpeqb %xmm1, %xmm0
/* Find where NULL is. */
pmovmskb %xmm2, %ecx
/* Check if there is a match. */
pmovmskb %xmm0, %eax
add $16, %edi
test %eax, %eax
jnz L(unaligned_match1)
test %ecx, %ecx
jnz L(return_null)
and $-16, %edi
PUSH (%esi)
PUSH (%ebx)
xor %ebx, %ebx
jmp L(loop)
CFI_POP (%esi)
CFI_POP (%ebx)
.p2align 4
L(unaligned_match1):
test %ecx, %ecx
jnz L(prolog_find_zero_1)
PUSH (%esi)
PUSH (%ebx)
mov %eax, %ebx
mov %edi, %esi
and $-16, %edi
jmp L(loop)
CFI_POP (%esi)
CFI_POP (%ebx)
.p2align 4
L(crosscache):
/* Hancle unaligned string. */
and $15, %ecx
and $-16, %edi
pxor %xmm3, %xmm3
movdqa (%edi), %xmm0
pcmpeqb %xmm0, %xmm3
pcmpeqb %xmm1, %xmm0
/* Find where NULL is. */
pmovmskb %xmm3, %edx
/* Check if there is a match. */
pmovmskb %xmm0, %eax
/* Remove the leading bytes. */
shr %cl, %edx
shr %cl, %eax
add $16, %edi
test %eax, %eax
jnz L(unaligned_match)
test %edx, %edx
jnz L(return_null)
PUSH (%esi)
PUSH (%ebx)
xor %ebx, %ebx
jmp L(loop)
CFI_POP (%esi)
CFI_POP (%ebx)
.p2align 4
L(unaligned_match):
test %edx, %edx
jnz L(prolog_find_zero)
PUSH (%esi)
PUSH (%ebx)
mov %eax, %ebx
lea (%edi, %ecx), %esi
/* Loop start on aligned string. */
.p2align 4
L(loop):
movdqa (%edi), %xmm0
pcmpeqb %xmm0, %xmm2
add $16, %edi
pcmpeqb %xmm1, %xmm0
pmovmskb %xmm2, %ecx
pmovmskb %xmm0, %eax
or %eax, %ecx
jnz L(matches)
movdqa (%edi), %xmm0
pcmpeqb %xmm0, %xmm2
add $16, %edi
pcmpeqb %xmm1, %xmm0
pmovmskb %xmm2, %ecx
pmovmskb %xmm0, %eax
or %eax, %ecx
jnz L(matches)
movdqa (%edi), %xmm0
pcmpeqb %xmm0, %xmm2
add $16, %edi
pcmpeqb %xmm1, %xmm0
pmovmskb %xmm2, %ecx
pmovmskb %xmm0, %eax
or %eax, %ecx
jnz L(matches)
movdqa (%edi), %xmm0
pcmpeqb %xmm0, %xmm2
add $16, %edi
pcmpeqb %xmm1, %xmm0
pmovmskb %xmm2, %ecx
pmovmskb %xmm0, %eax
or %eax, %ecx
jz L(loop)
L(matches):
test %eax, %eax
jnz L(match)
L(return_value):
test %ebx, %ebx
jz L(return_null_1)
mov %ebx, %eax
mov %esi, %edi
POP (%ebx)
POP (%esi)
jmp L(match_case1)
CFI_PUSH (%ebx)
CFI_PUSH (%esi)
.p2align 4
L(return_null_1):
POP (%ebx)
POP (%esi)
xor %eax, %eax
RETURN
CFI_PUSH (%ebx)
CFI_PUSH (%esi)
.p2align 4
L(match):
pmovmskb %xmm2, %ecx
test %ecx, %ecx
jnz L(find_zero)
mov %eax, %ebx
mov %edi, %esi
jmp L(loop)
.p2align 4
L(find_zero):
test %cl, %cl
jz L(find_zero_high)
mov %cl, %dl
and $15, %dl
jz L(find_zero_8)
test $0x01, %cl
jnz L(FindZeroExit1)
test $0x02, %cl
jnz L(FindZeroExit2)
test $0x04, %cl
jnz L(FindZeroExit3)
and $1 << 4 - 1, %eax
jz L(return_value)
POP (%ebx)
POP (%esi)
jmp L(match_case1)
CFI_PUSH (%ebx)
CFI_PUSH (%esi)
.p2align 4
L(find_zero_8):
test $0x10, %cl
jnz L(FindZeroExit5)
test $0x20, %cl
jnz L(FindZeroExit6)
test $0x40, %cl
jnz L(FindZeroExit7)
and $1 << 8 - 1, %eax
jz L(return_value)
POP (%ebx)
POP (%esi)
jmp L(match_case1)
CFI_PUSH (%ebx)
CFI_PUSH (%esi)
.p2align 4
L(find_zero_high):
mov %ch, %dh
and $15, %dh
jz L(find_zero_high_8)
test $0x01, %ch
jnz L(FindZeroExit9)
test $0x02, %ch
jnz L(FindZeroExit10)
test $0x04, %ch
jnz L(FindZeroExit11)
and $1 << 12 - 1, %eax
jz L(return_value)
POP (%ebx)
POP (%esi)
jmp L(match_case1)
CFI_PUSH (%ebx)
CFI_PUSH (%esi)
.p2align 4
L(find_zero_high_8):
test $0x10, %ch
jnz L(FindZeroExit13)
test $0x20, %ch
jnz L(FindZeroExit14)
test $0x40, %ch
jnz L(FindZeroExit15)
and $1 << 16 - 1, %eax
jz L(return_value)
POP (%ebx)
POP (%esi)
jmp L(match_case1)
CFI_PUSH (%ebx)
CFI_PUSH (%esi)
.p2align 4
L(FindZeroExit1):
and $1, %eax
jz L(return_value)
POP (%ebx)
POP (%esi)
jmp L(match_case1)
CFI_PUSH (%ebx)
CFI_PUSH (%esi)
.p2align 4
L(FindZeroExit2):
and $1 << 2 - 1, %eax
jz L(return_value)
POP (%ebx)
POP (%esi)
jmp L(match_case1)
CFI_PUSH (%ebx)
CFI_PUSH (%esi)
.p2align 4
L(FindZeroExit3):
and $1 << 3 - 1, %eax
jz L(return_value)
POP (%ebx)
POP (%esi)
jmp L(match_case1)
CFI_PUSH (%ebx)
CFI_PUSH (%esi)
.p2align 4
L(FindZeroExit5):
and $1 << 5 - 1, %eax
jz L(return_value)
POP (%ebx)
POP (%esi)
jmp L(match_case1)
CFI_PUSH (%ebx)
CFI_PUSH (%esi)
.p2align 4
L(FindZeroExit6):
and $1 << 6 - 1, %eax
jz L(return_value)
POP (%ebx)
POP (%esi)
jmp L(match_case1)
CFI_PUSH (%ebx)
CFI_PUSH (%esi)
.p2align 4
L(FindZeroExit7):
and $1 << 7 - 1, %eax
jz L(return_value)
POP (%ebx)
POP (%esi)
jmp L(match_case1)
CFI_PUSH (%ebx)
CFI_PUSH (%esi)
.p2align 4
L(FindZeroExit9):
and $1 << 9 - 1, %eax
jz L(return_value)
POP (%ebx)
POP (%esi)
jmp L(match_case1)
CFI_PUSH (%ebx)
CFI_PUSH (%esi)
.p2align 4
L(FindZeroExit10):
and $1 << 10 - 1, %eax
jz L(return_value)
POP (%ebx)
POP (%esi)
jmp L(match_case1)
CFI_PUSH (%ebx)
CFI_PUSH (%esi)
.p2align 4
L(FindZeroExit11):
and $1 << 11 - 1, %eax
jz L(return_value)
POP (%ebx)
POP (%esi)
jmp L(match_case1)
CFI_PUSH (%ebx)
CFI_PUSH (%esi)
.p2align 4
L(FindZeroExit13):
and $1 << 13 - 1, %eax
jz L(return_value)
POP (%ebx)
POP (%esi)
jmp L(match_case1)
CFI_PUSH (%ebx)
CFI_PUSH (%esi)
.p2align 4
L(FindZeroExit14):
and $1 << 14 - 1, %eax
jz L(return_value)
POP (%ebx)
POP (%esi)
jmp L(match_case1)
CFI_PUSH (%ebx)
CFI_PUSH (%esi)
.p2align 4
L(FindZeroExit15):
and $1 << 15 - 1, %eax
jz L(return_value)
POP (%ebx)
POP (%esi)
.p2align 4
L(match_case1):
test %ah, %ah
jnz L(match_case1_high)
mov %al, %dl
and $15 << 4, %dl
jnz L(match_case1_8)
test $0x08, %al
jnz L(Exit4)
test $0x04, %al
jnz L(Exit3)
test $0x02, %al
jnz L(Exit2)
lea -16(%edi), %eax
RETURN
.p2align 4
L(match_case1_8):
test $0x80, %al
jnz L(Exit8)
test $0x40, %al
jnz L(Exit7)
test $0x20, %al
jnz L(Exit6)
lea -12(%edi), %eax
RETURN
.p2align 4
L(match_case1_high):
mov %ah, %dh
and $15 << 4, %dh
jnz L(match_case1_high_8)
test $0x08, %ah
jnz L(Exit12)
test $0x04, %ah
jnz L(Exit11)
test $0x02, %ah
jnz L(Exit10)
lea -8(%edi), %eax
RETURN
.p2align 4
L(match_case1_high_8):
test $0x80, %ah
jnz L(Exit16)
test $0x40, %ah
jnz L(Exit15)
test $0x20, %ah
jnz L(Exit14)
lea -4(%edi), %eax
RETURN
.p2align 4
L(Exit2):
lea -15(%edi), %eax
RETURN
.p2align 4
L(Exit3):
lea -14(%edi), %eax
RETURN
.p2align 4
L(Exit4):
lea -13(%edi), %eax
RETURN
.p2align 4
L(Exit6):
lea -11(%edi), %eax
RETURN
.p2align 4
L(Exit7):
lea -10(%edi), %eax
RETURN
.p2align 4
L(Exit8):
lea -9(%edi), %eax
RETURN
.p2align 4
L(Exit10):
lea -7(%edi), %eax
RETURN
.p2align 4
L(Exit11):
lea -6(%edi), %eax
RETURN
.p2align 4
L(Exit12):
lea -5(%edi), %eax
RETURN
.p2align 4
L(Exit14):
lea -3(%edi), %eax
RETURN
.p2align 4
L(Exit15):
lea -2(%edi), %eax
RETURN
.p2align 4
L(Exit16):
lea -1(%edi), %eax
RETURN
/* Return NULL. */
.p2align 4
L(return_null):
xor %eax, %eax
RETURN
.p2align 4
L(prolog_find_zero):
add %ecx, %edi
mov %edx, %ecx
L(prolog_find_zero_1):
test %cl, %cl
jz L(prolog_find_zero_high)
mov %cl, %dl
and $15, %dl
jz L(prolog_find_zero_8)
test $0x01, %cl
jnz L(PrologFindZeroExit1)
test $0x02, %cl
jnz L(PrologFindZeroExit2)
test $0x04, %cl
jnz L(PrologFindZeroExit3)
and $1 << 4 - 1, %eax
jnz L(match_case1)
xor %eax, %eax
RETURN
.p2align 4
L(prolog_find_zero_8):
test $0x10, %cl
jnz L(PrologFindZeroExit5)
test $0x20, %cl
jnz L(PrologFindZeroExit6)
test $0x40, %cl
jnz L(PrologFindZeroExit7)
and $1 << 8 - 1, %eax
jnz L(match_case1)
xor %eax, %eax
RETURN
.p2align 4
L(prolog_find_zero_high):
mov %ch, %dh
and $15, %dh
jz L(prolog_find_zero_high_8)
test $0x01, %ch
jnz L(PrologFindZeroExit9)
test $0x02, %ch
jnz L(PrologFindZeroExit10)
test $0x04, %ch
jnz L(PrologFindZeroExit11)
and $1 << 12 - 1, %eax
jnz L(match_case1)
xor %eax, %eax
RETURN
.p2align 4
L(prolog_find_zero_high_8):
test $0x10, %ch
jnz L(PrologFindZeroExit13)
test $0x20, %ch
jnz L(PrologFindZeroExit14)
test $0x40, %ch
jnz L(PrologFindZeroExit15)
and $1 << 16 - 1, %eax
jnz L(match_case1)
xor %eax, %eax
RETURN
.p2align 4
L(PrologFindZeroExit1):
and $1, %eax
jnz L(match_case1)
xor %eax, %eax
RETURN
.p2align 4
L(PrologFindZeroExit2):
and $1 << 2 - 1, %eax
jnz L(match_case1)
xor %eax, %eax
RETURN
.p2align 4
L(PrologFindZeroExit3):
and $1 << 3 - 1, %eax
jnz L(match_case1)
xor %eax, %eax
RETURN
.p2align 4
L(PrologFindZeroExit5):
and $1 << 5 - 1, %eax
jnz L(match_case1)
xor %eax, %eax
RETURN
.p2align 4
L(PrologFindZeroExit6):
and $1 << 6 - 1, %eax
jnz L(match_case1)
xor %eax, %eax
RETURN
.p2align 4
L(PrologFindZeroExit7):
and $1 << 7 - 1, %eax
jnz L(match_case1)
xor %eax, %eax
RETURN
.p2align 4
L(PrologFindZeroExit9):
and $1 << 9 - 1, %eax
jnz L(match_case1)
xor %eax, %eax
RETURN
.p2align 4
L(PrologFindZeroExit10):
and $1 << 10 - 1, %eax
jnz L(match_case1)
xor %eax, %eax
RETURN
.p2align 4
L(PrologFindZeroExit11):
and $1 << 11 - 1, %eax
jnz L(match_case1)
xor %eax, %eax
RETURN
.p2align 4
L(PrologFindZeroExit13):
and $1 << 13 - 1, %eax
jnz L(match_case1)
xor %eax, %eax
RETURN
.p2align 4
L(PrologFindZeroExit14):
and $1 << 14 - 1, %eax
jnz L(match_case1)
xor %eax, %eax
RETURN
.p2align 4
L(PrologFindZeroExit15):
and $1 << 15 - 1, %eax
jnz L(match_case1)
xor %eax, %eax
RETURN
END (strrchr)

View File

@@ -1,267 +0,0 @@
/*
Copyright (c) 2011 Intel Corporation
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 Intel Corporation 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 L
# define L(label) .L##label
#endif
#ifndef cfi_startproc
# define cfi_startproc .cfi_startproc
#endif
#ifndef cfi_endproc
# define cfi_endproc .cfi_endproc
#endif
#ifndef cfi_rel_offset
# define cfi_rel_offset(reg, off) .cfi_rel_offset reg, off
#endif
#ifndef cfi_restore
# define cfi_restore(reg) .cfi_restore reg
#endif
#ifndef cfi_adjust_cfa_offset
# define cfi_adjust_cfa_offset(off) .cfi_adjust_cfa_offset off
#endif
#ifndef ENTRY
# define ENTRY(name) \
.type name, @function; \
.globl name; \
.p2align 4; \
name: \
cfi_startproc
#endif
#ifndef END
# define END(name) \
cfi_endproc; \
.size name, .-name
#endif
#define CFI_PUSH(REG) \
cfi_adjust_cfa_offset (4); \
cfi_rel_offset (REG, 0)
#define CFI_POP(REG) \
cfi_adjust_cfa_offset (-4); \
cfi_restore (REG)
#define PUSH(REG) pushl REG; CFI_PUSH (REG)
#define POP(REG) popl REG; CFI_POP (REG)
#define PARMS 4
#define STR1 PARMS
#define STR2 STR1+4
.text
ENTRY (wcschr)
mov STR1(%esp), %ecx
movd STR2(%esp), %xmm1
mov %ecx, %eax
punpckldq %xmm1, %xmm1
pxor %xmm2, %xmm2
punpckldq %xmm1, %xmm1
and $63, %eax
cmp $48, %eax
ja L(cross_cache)
movdqu (%ecx), %xmm0
pcmpeqd %xmm0, %xmm2
pcmpeqd %xmm1, %xmm0
pmovmskb %xmm2, %edx
pmovmskb %xmm0, %eax
or %eax, %edx
jnz L(matches)
and $-16, %ecx
jmp L(loop)
.p2align 4
L(cross_cache):
PUSH (%edi)
mov %ecx, %edi
mov %eax, %ecx
and $-16, %edi
and $15, %ecx
movdqa (%edi), %xmm0
pcmpeqd %xmm0, %xmm2
pcmpeqd %xmm1, %xmm0
pmovmskb %xmm2, %edx
pmovmskb %xmm0, %eax
sarl %cl, %edx
sarl %cl, %eax
test %eax, %eax
jz L(unaligned_no_match)
add %edi, %ecx
POP (%edi)
test %edx, %edx
jz L(match_case1)
test %al, %al
jz L(match_higth_case2)
test $15, %al
jnz L(match_case2_4)
test $15, %dl
jnz L(return_null)
lea 4(%ecx), %eax
ret
CFI_PUSH (%edi)
.p2align 4
L(unaligned_no_match):
mov %edi, %ecx
POP (%edi)
test %edx, %edx
jnz L(return_null)
pxor %xmm2, %xmm2
/* Loop start on aligned string. */
.p2align 4
L(loop):
add $16, %ecx
movdqa (%ecx), %xmm0
pcmpeqd %xmm0, %xmm2
pcmpeqd %xmm1, %xmm0
pmovmskb %xmm2, %edx
pmovmskb %xmm0, %eax
or %eax, %edx
jnz L(matches)
add $16, %ecx
movdqa (%ecx), %xmm0
pcmpeqd %xmm0, %xmm2
pcmpeqd %xmm1, %xmm0
pmovmskb %xmm2, %edx
pmovmskb %xmm0, %eax
or %eax, %edx
jnz L(matches)
add $16, %ecx
movdqa (%ecx), %xmm0
pcmpeqd %xmm0, %xmm2
pcmpeqd %xmm1, %xmm0
pmovmskb %xmm2, %edx
pmovmskb %xmm0, %eax
or %eax, %edx
jnz L(matches)
add $16, %ecx
movdqa (%ecx), %xmm0
pcmpeqd %xmm0, %xmm2
pcmpeqd %xmm1, %xmm0
pmovmskb %xmm2, %edx
pmovmskb %xmm0, %eax
or %eax, %edx
jz L(loop)
.p2align 4
L(matches):
pmovmskb %xmm2, %edx
test %eax, %eax
jz L(return_null)
test %edx, %edx
jz L(match_case1)
.p2align 4
L(match_case2):
test %al, %al
jz L(match_higth_case2)
test $15, %al
jnz L(match_case2_4)
test $15, %dl
jnz L(return_null)
lea 4(%ecx), %eax
ret
.p2align 4
L(match_case2_4):
mov %ecx, %eax
ret
.p2align 4
L(match_higth_case2):
test %dl, %dl
jnz L(return_null)
test $15, %ah
jnz L(match_case2_12)
test $15, %dh
jnz L(return_null)
lea 12(%ecx), %eax
ret
.p2align 4
L(match_case2_12):
lea 8(%ecx), %eax
ret
.p2align 4
L(match_case1):
test %al, %al
jz L(match_higth_case1)
test $0x01, %al
jnz L(exit0)
lea 4(%ecx), %eax
ret
.p2align 4
L(match_higth_case1):
test $0x01, %ah
jnz L(exit3)
lea 12(%ecx), %eax
ret
.p2align 4
L(exit0):
mov %ecx, %eax
ret
.p2align 4
L(exit3):
lea 8(%ecx), %eax
ret
.p2align 4
L(return_null):
xor %eax, %eax
ret
END (wcschr)

File diff suppressed because it is too large Load Diff

View File

@@ -1,306 +0,0 @@
/*
Copyright (c) 2011 Intel Corporation
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 Intel Corporation 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 USE_AS_WCSCAT
# ifndef L
# define L(label) .L##label
# endif
# ifndef cfi_startproc
# define cfi_startproc .cfi_startproc
# endif
# ifndef cfi_endproc
# define cfi_endproc .cfi_endproc
# endif
# ifndef ENTRY
# define ENTRY(name) \
.type name, @function; \
.globl name; \
.p2align 4; \
name: \
cfi_startproc
# endif
# ifndef END
# define END(name) \
cfi_endproc; \
.size name, .-name
# endif
# define PARMS 4
# define STR PARMS
# define RETURN ret
.text
ENTRY (wcslen)
mov STR(%esp), %edx
#endif
cmp $0, (%edx)
jz L(exit_tail0)
cmp $0, 4(%edx)
jz L(exit_tail1)
cmp $0, 8(%edx)
jz L(exit_tail2)
cmp $0, 12(%edx)
jz L(exit_tail3)
cmp $0, 16(%edx)
jz L(exit_tail4)
cmp $0, 20(%edx)
jz L(exit_tail5)
cmp $0, 24(%edx)
jz L(exit_tail6)
cmp $0, 28(%edx)
jz L(exit_tail7)
pxor %xmm0, %xmm0
lea 32(%edx), %eax
lea -16(%eax), %ecx
and $-16, %eax
pcmpeqd (%eax), %xmm0
pmovmskb %xmm0, %edx
pxor %xmm1, %xmm1
lea 16(%eax), %eax
test %edx, %edx
jnz L(exit)
pcmpeqd (%eax), %xmm1
pmovmskb %xmm1, %edx
pxor %xmm2, %xmm2
lea 16(%eax), %eax
test %edx, %edx
jnz L(exit)
pcmpeqd (%eax), %xmm2
pmovmskb %xmm2, %edx
pxor %xmm3, %xmm3
lea 16(%eax), %eax
test %edx, %edx
jnz L(exit)
pcmpeqd (%eax), %xmm3
pmovmskb %xmm3, %edx
lea 16(%eax), %eax
test %edx, %edx
jnz L(exit)
pcmpeqd (%eax), %xmm0
pmovmskb %xmm0, %edx
lea 16(%eax), %eax
test %edx, %edx
jnz L(exit)
pcmpeqd (%eax), %xmm1
pmovmskb %xmm1, %edx
lea 16(%eax), %eax
test %edx, %edx
jnz L(exit)
pcmpeqd (%eax), %xmm2
pmovmskb %xmm2, %edx
lea 16(%eax), %eax
test %edx, %edx
jnz L(exit)
pcmpeqd (%eax), %xmm3
pmovmskb %xmm3, %edx
lea 16(%eax), %eax
test %edx, %edx
jnz L(exit)
pcmpeqd (%eax), %xmm0
pmovmskb %xmm0, %edx
lea 16(%eax), %eax
test %edx, %edx
jnz L(exit)
pcmpeqd (%eax), %xmm1
pmovmskb %xmm1, %edx
lea 16(%eax), %eax
test %edx, %edx
jnz L(exit)
pcmpeqd (%eax), %xmm2
pmovmskb %xmm2, %edx
lea 16(%eax), %eax
test %edx, %edx
jnz L(exit)
pcmpeqd (%eax), %xmm3
pmovmskb %xmm3, %edx
lea 16(%eax), %eax
test %edx, %edx
jnz L(exit)
pcmpeqd (%eax), %xmm0
pmovmskb %xmm0, %edx
lea 16(%eax), %eax
test %edx, %edx
jnz L(exit)
pcmpeqd (%eax), %xmm1
pmovmskb %xmm1, %edx
lea 16(%eax), %eax
test %edx, %edx
jnz L(exit)
pcmpeqd (%eax), %xmm2
pmovmskb %xmm2, %edx
lea 16(%eax), %eax
test %edx, %edx
jnz L(exit)
pcmpeqd (%eax), %xmm3
pmovmskb %xmm3, %edx
lea 16(%eax), %eax
test %edx, %edx
jnz L(exit)
and $-0x40, %eax
.p2align 4
L(aligned_64_loop):
movaps (%eax), %xmm0
movaps 16(%eax), %xmm1
movaps 32(%eax), %xmm2
movaps 48(%eax), %xmm6
pminub %xmm1, %xmm0
pminub %xmm6, %xmm2
pminub %xmm0, %xmm2
pcmpeqd %xmm3, %xmm2
pmovmskb %xmm2, %edx
lea 64(%eax), %eax
test %edx, %edx
jz L(aligned_64_loop)
pcmpeqd -64(%eax), %xmm3
pmovmskb %xmm3, %edx
lea 48(%ecx), %ecx
test %edx, %edx
jnz L(exit)
pcmpeqd %xmm1, %xmm3
pmovmskb %xmm3, %edx
lea -16(%ecx), %ecx
test %edx, %edx
jnz L(exit)
pcmpeqd -32(%eax), %xmm3
pmovmskb %xmm3, %edx
lea -16(%ecx), %ecx
test %edx, %edx
jnz L(exit)
pcmpeqd %xmm6, %xmm3
pmovmskb %xmm3, %edx
lea -16(%ecx), %ecx
test %edx, %edx
jnz L(exit)
jmp L(aligned_64_loop)
.p2align 4
L(exit):
sub %ecx, %eax
shr $2, %eax
test %dl, %dl
jz L(exit_high)
mov %dl, %cl
and $15, %cl
jz L(exit_1)
RETURN
.p2align 4
L(exit_high):
mov %dh, %ch
and $15, %ch
jz L(exit_3)
add $2, %eax
RETURN
.p2align 4
L(exit_1):
add $1, %eax
RETURN
.p2align 4
L(exit_3):
add $3, %eax
RETURN
.p2align 4
L(exit_tail0):
xor %eax, %eax
RETURN
.p2align 4
L(exit_tail1):
mov $1, %eax
RETURN
.p2align 4
L(exit_tail2):
mov $2, %eax
RETURN
.p2align 4
L(exit_tail3):
mov $3, %eax
RETURN
.p2align 4
L(exit_tail4):
mov $4, %eax
RETURN
.p2align 4
L(exit_tail5):
mov $5, %eax
RETURN
.p2align 4
L(exit_tail6):
mov $6, %eax
RETURN
.p2align 4
L(exit_tail7):
mov $7, %eax
#ifndef USE_AS_WCSCAT
RETURN
END (wcslen)
#endif

View File

@@ -1,402 +0,0 @@
/*
Copyright (c) 2011 Intel Corporation
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 Intel Corporation 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 L
# define L(label) .L##label
#endif
#ifndef cfi_startproc
# define cfi_startproc .cfi_startproc
#endif
#ifndef cfi_endproc
# define cfi_endproc .cfi_endproc
#endif
#ifndef cfi_rel_offset
# define cfi_rel_offset(reg, off) .cfi_rel_offset reg, off
#endif
#ifndef cfi_restore
# define cfi_restore(reg) .cfi_restore reg
#endif
#ifndef cfi_adjust_cfa_offset
# define cfi_adjust_cfa_offset(off) .cfi_adjust_cfa_offset off
#endif
#ifndef ENTRY
# define ENTRY(name) \
.type name, @function; \
.globl name; \
.p2align 4; \
name: \
cfi_startproc
#endif
#ifndef END
# define END(name) \
cfi_endproc; \
.size name, .-name
#endif
#define CFI_PUSH(REG) \
cfi_adjust_cfa_offset (4); \
cfi_rel_offset (REG, 0)
#define CFI_POP(REG) \
cfi_adjust_cfa_offset (-4); \
cfi_restore (REG)
#define PUSH(REG) pushl REG; CFI_PUSH (REG)
#define POP(REG) popl REG; CFI_POP (REG)
#define PARMS 8
#define ENTRANCE PUSH(%edi);
#define RETURN POP(%edi); ret; CFI_PUSH(%edi);
#define STR1 PARMS
#define STR2 STR1+4
.text
ENTRY (wcsrchr)
ENTRANCE
mov STR1(%esp), %ecx
movd STR2(%esp), %xmm1
mov %ecx, %edi
punpckldq %xmm1, %xmm1
pxor %xmm2, %xmm2
punpckldq %xmm1, %xmm1
/* ECX has OFFSET. */
and $63, %ecx
cmp $48, %ecx
ja L(crosscache)
/* unaligned string. */
movdqu (%edi), %xmm0
pcmpeqd %xmm0, %xmm2
pcmpeqd %xmm1, %xmm0
/* Find where NULL is. */
pmovmskb %xmm2, %ecx
/* Check if there is a match. */
pmovmskb %xmm0, %eax
add $16, %edi
test %eax, %eax
jnz L(unaligned_match1)
test %ecx, %ecx
jnz L(return_null)
and $-16, %edi
PUSH (%esi)
xor %edx, %edx
jmp L(loop)
CFI_POP (%esi)
.p2align 4
L(unaligned_match1):
test %ecx, %ecx
jnz L(prolog_find_zero_1)
PUSH (%esi)
/* Save current match */
mov %eax, %edx
mov %edi, %esi
and $-16, %edi
jmp L(loop)
CFI_POP (%esi)
.p2align 4
L(crosscache):
/* Hancle unaligned string. */
and $15, %ecx
and $-16, %edi
pxor %xmm3, %xmm3
movdqa (%edi), %xmm0
pcmpeqd %xmm0, %xmm3
pcmpeqd %xmm1, %xmm0
/* Find where NULL is. */
pmovmskb %xmm3, %edx
/* Check if there is a match. */
pmovmskb %xmm0, %eax
/* Remove the leading bytes. */
shr %cl, %edx
shr %cl, %eax
add $16, %edi
test %eax, %eax
jnz L(unaligned_match)
test %edx, %edx
jnz L(return_null)
PUSH (%esi)
xor %edx, %edx
jmp L(loop)
CFI_POP (%esi)
.p2align 4
L(unaligned_match):
test %edx, %edx
jnz L(prolog_find_zero)
PUSH (%esi)
mov %eax, %edx
lea (%edi, %ecx), %esi
/* Loop start on aligned string. */
.p2align 4
L(loop):
movdqa (%edi), %xmm0
pcmpeqd %xmm0, %xmm2
add $16, %edi
pcmpeqd %xmm1, %xmm0
pmovmskb %xmm2, %ecx
pmovmskb %xmm0, %eax
or %eax, %ecx
jnz L(matches)
movdqa (%edi), %xmm3
pcmpeqd %xmm3, %xmm2
add $16, %edi
pcmpeqd %xmm1, %xmm3
pmovmskb %xmm2, %ecx
pmovmskb %xmm3, %eax
or %eax, %ecx
jnz L(matches)
movdqa (%edi), %xmm4
pcmpeqd %xmm4, %xmm2
add $16, %edi
pcmpeqd %xmm1, %xmm4
pmovmskb %xmm2, %ecx
pmovmskb %xmm4, %eax
or %eax, %ecx
jnz L(matches)
movdqa (%edi), %xmm5
pcmpeqd %xmm5, %xmm2
add $16, %edi
pcmpeqd %xmm1, %xmm5
pmovmskb %xmm2, %ecx
pmovmskb %xmm5, %eax
or %eax, %ecx
jz L(loop)
.p2align 4
L(matches):
test %eax, %eax
jnz L(match)
L(return_value):
test %edx, %edx
jz L(return_null_1)
mov %edx, %eax
mov %esi, %edi
POP (%esi)
test %ah, %ah
jnz L(match_third_or_fourth_wchar)
test $15 << 4, %al
jnz L(match_second_wchar)
lea -16(%edi), %eax
RETURN
CFI_PUSH (%esi)
.p2align 4
L(return_null_1):
POP (%esi)
xor %eax, %eax
RETURN
CFI_PUSH (%esi)
.p2align 4
L(match):
pmovmskb %xmm2, %ecx
test %ecx, %ecx
jnz L(find_zero)
/* save match info */
mov %eax, %edx
mov %edi, %esi
jmp L(loop)
.p2align 4
L(find_zero):
test %cl, %cl
jz L(find_zero_in_third_or_fourth_wchar)
test $15, %cl
jz L(find_zero_in_second_wchar)
and $1, %eax
jz L(return_value)
POP (%esi)
lea -16(%edi), %eax
RETURN
CFI_PUSH (%esi)
.p2align 4
L(find_zero_in_second_wchar):
and $1 << 5 - 1, %eax
jz L(return_value)
POP (%esi)
test $15 << 4, %al
jnz L(match_second_wchar)
lea -16(%edi), %eax
RETURN
CFI_PUSH (%esi)
.p2align 4
L(find_zero_in_third_or_fourth_wchar):
test $15, %ch
jz L(find_zero_in_fourth_wchar)
and $1 << 9 - 1, %eax
jz L(return_value)
POP (%esi)
test %ah, %ah
jnz L(match_third_wchar)
test $15 << 4, %al
jnz L(match_second_wchar)
lea -16(%edi), %eax
RETURN
CFI_PUSH (%esi)
.p2align 4
L(find_zero_in_fourth_wchar):
POP (%esi)
test %ah, %ah
jnz L(match_third_or_fourth_wchar)
test $15 << 4, %al
jnz L(match_second_wchar)
lea -16(%edi), %eax
RETURN
CFI_PUSH (%esi)
.p2align 4
L(match_second_wchar):
lea -12(%edi), %eax
RETURN
.p2align 4
L(match_third_or_fourth_wchar):
test $15 << 4, %ah
jnz L(match_fourth_wchar)
lea -8(%edi), %eax
RETURN
.p2align 4
L(match_third_wchar):
lea -8(%edi), %eax
RETURN
.p2align 4
L(match_fourth_wchar):
lea -4(%edi), %eax
RETURN
.p2align 4
L(return_null):
xor %eax, %eax
RETURN
.p2align 4
L(prolog_find_zero):
add %ecx, %edi
mov %edx, %ecx
L(prolog_find_zero_1):
test %cl, %cl
jz L(prolog_find_zero_in_third_or_fourth_wchar)
test $15, %cl
jz L(prolog_find_zero_in_second_wchar)
and $1, %eax
jz L(return_null)
lea -16(%edi), %eax
RETURN
.p2align 4
L(prolog_find_zero_in_second_wchar):
and $1 << 5 - 1, %eax
jz L(return_null)
test $15 << 4, %al
jnz L(match_second_wchar)
lea -16(%edi), %eax
RETURN
.p2align 4
L(prolog_find_zero_in_third_or_fourth_wchar):
test $15, %ch
jz L(prolog_find_zero_in_fourth_wchar)
and $1 << 9 - 1, %eax
jz L(return_null)
test %ah, %ah
jnz L(match_third_wchar)
test $15 << 4, %al
jnz L(match_second_wchar)
lea -16(%edi), %eax
RETURN
.p2align 4
L(prolog_find_zero_in_fourth_wchar):
test %ah, %ah
jnz L(match_third_or_fourth_wchar)
test $15 << 4, %al
jnz L(match_second_wchar)
lea -16(%edi), %eax
RETURN
END (wcsrchr)

View File

@@ -28,11 +28,8 @@ ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/ */
#include "cache.h"
#undef __i686
#ifndef MEMCPY #ifndef MEMCPY
# define MEMCPY memcpy # define MEMCPY ssse3_memcpy5
#endif #endif
#ifndef L #ifndef L

View File

@@ -1,620 +0,0 @@
/*
Copyright (c) 2011, Intel Corporation
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 Intel Corporation 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 L
# define L(label) .L##label
#endif
#ifndef cfi_startproc
# define cfi_startproc .cfi_startproc
#endif
#ifndef cfi_endproc
# define cfi_endproc .cfi_endproc
#endif
#ifndef cfi_rel_offset
# define cfi_rel_offset(reg, off) .cfi_rel_offset reg, off
#endif
#ifndef cfi_restore
# define cfi_restore(reg) .cfi_restore reg
#endif
#ifndef cfi_adjust_cfa_offset
# define cfi_adjust_cfa_offset(off) .cfi_adjust_cfa_offset off
#endif
#ifndef cfi_remember_state
# define cfi_remember_state .cfi_remember_state
#endif
#ifndef cfi_restore_state
# define cfi_restore_state .cfi_restore_state
#endif
#ifndef ENTRY
# define ENTRY(name) \
.type name, @function; \
.globl name; \
.p2align 4; \
name: \
cfi_startproc
#endif
#ifndef END
# define END(name) \
cfi_endproc; \
.size name, .-name
#endif
#define CFI_PUSH(REG) \
cfi_adjust_cfa_offset (4); \
cfi_rel_offset (REG, 0)
#define CFI_POP(REG) \
cfi_adjust_cfa_offset (-4); \
cfi_restore (REG)
#define PUSH(REG) pushl REG; CFI_PUSH (REG)
#define POP(REG) popl REG; CFI_POP (REG)
#ifndef STRCAT
# define STRCAT strcat
#endif
#define PARMS 4
#define STR1 PARMS+4
#define STR2 STR1+4
#ifdef USE_AS_STRNCAT
# define LEN STR2+8
#endif
#define USE_AS_STRCAT
.section .text.ssse3,"ax",@progbits
ENTRY (STRCAT)
PUSH (%edi)
mov STR1(%esp), %edi
mov %edi, %edx
#define RETURN jmp L(StrcpyAtom)
#include "sse2-strlen-atom.S"
L(StrcpyAtom):
mov STR2(%esp), %ecx
lea (%edi, %eax), %edx
#ifdef USE_AS_STRNCAT
PUSH (%ebx)
mov LEN(%esp), %ebx
test %ebx, %ebx
jz L(StrncatExit0)
cmp $8, %ebx
jbe L(StrncpyExit8Bytes)
#endif
cmpb $0, (%ecx)
jz L(Exit1)
cmpb $0, 1(%ecx)
jz L(Exit2)
cmpb $0, 2(%ecx)
jz L(Exit3)
cmpb $0, 3(%ecx)
jz L(Exit4)
cmpb $0, 4(%ecx)
jz L(Exit5)
cmpb $0, 5(%ecx)
jz L(Exit6)
cmpb $0, 6(%ecx)
jz L(Exit7)
cmpb $0, 7(%ecx)
jz L(Exit8)
cmpb $0, 8(%ecx)
jz L(Exit9)
#ifdef USE_AS_STRNCAT
cmp $16, %ebx
jb L(StrncpyExit15Bytes)
#endif
cmpb $0, 9(%ecx)
jz L(Exit10)
cmpb $0, 10(%ecx)
jz L(Exit11)
cmpb $0, 11(%ecx)
jz L(Exit12)
cmpb $0, 12(%ecx)
jz L(Exit13)
cmpb $0, 13(%ecx)
jz L(Exit14)
cmpb $0, 14(%ecx)
jz L(Exit15)
cmpb $0, 15(%ecx)
jz L(Exit16)
#ifdef USE_AS_STRNCAT
cmp $16, %ebx
je L(StrncatExit16)
# define RETURN1 POP (%ebx); POP (%edi); ret; \
CFI_PUSH (%ebx); CFI_PUSH (%edi)
# define USE_AS_STRNCPY
#else
# define RETURN1 POP(%edi); ret; CFI_PUSH(%edi)
#endif
#include "ssse3-strcpy-atom.S"
.p2align 4
L(CopyFrom1To16Bytes):
add %esi, %edx
add %esi, %ecx
POP (%esi)
test %al, %al
jz L(ExitHigh)
test $0x01, %al
jnz L(Exit1)
test $0x02, %al
jnz L(Exit2)
test $0x04, %al
jnz L(Exit3)
test $0x08, %al
jnz L(Exit4)
test $0x10, %al
jnz L(Exit5)
test $0x20, %al
jnz L(Exit6)
test $0x40, %al
jnz L(Exit7)
movlpd (%ecx), %xmm0
movlpd %xmm0, (%edx)
movl %edi, %eax
RETURN1
.p2align 4
L(ExitHigh):
test $0x01, %ah
jnz L(Exit9)
test $0x02, %ah
jnz L(Exit10)
test $0x04, %ah
jnz L(Exit11)
test $0x08, %ah
jnz L(Exit12)
test $0x10, %ah
jnz L(Exit13)
test $0x20, %ah
jnz L(Exit14)
test $0x40, %ah
jnz L(Exit15)
movlpd (%ecx), %xmm0
movlpd 8(%ecx), %xmm1
movlpd %xmm0, (%edx)
movlpd %xmm1, 8(%edx)
movl %edi, %eax
RETURN1
.p2align 4
L(StrncatExit1):
movb %bh, 1(%edx)
L(Exit1):
movb (%ecx), %al
movb %al, (%edx)
movl %edi, %eax
RETURN1
.p2align 4
L(StrncatExit2):
movb %bh, 2(%edx)
L(Exit2):
movw (%ecx), %ax
movw %ax, (%edx)
movl %edi, %eax
RETURN1
.p2align 4
L(StrncatExit3):
movb %bh, 3(%edx)
L(Exit3):
movw (%ecx), %ax
movw %ax, (%edx)
movb 2(%ecx), %al
movb %al, 2(%edx)
movl %edi, %eax
RETURN1
.p2align 4
L(StrncatExit4):
movb %bh, 4(%edx)
L(Exit4):
movl (%ecx), %eax
movl %eax, (%edx)
movl %edi, %eax
RETURN1
.p2align 4
L(StrncatExit5):
movb %bh, 5(%edx)
L(Exit5):
movl (%ecx), %eax
movl %eax, (%edx)
movb 4(%ecx), %al
movb %al, 4(%edx)
movl %edi, %eax
RETURN1
.p2align 4
L(StrncatExit6):
movb %bh, 6(%edx)
L(Exit6):
movl (%ecx), %eax
movl %eax, (%edx)
movw 4(%ecx), %ax
movw %ax, 4(%edx)
movl %edi, %eax
RETURN1
.p2align 4
L(StrncatExit7):
movb %bh, 7(%edx)
L(Exit7):
movl (%ecx), %eax
movl %eax, (%edx)
movl 3(%ecx), %eax
movl %eax, 3(%edx)
movl %edi, %eax
RETURN1
.p2align 4
L(StrncatExit8):
movb %bh, 8(%edx)
L(Exit8):
movlpd (%ecx), %xmm0
movlpd %xmm0, (%edx)
movl %edi, %eax
RETURN1
.p2align 4
L(StrncatExit9):
movb %bh, 9(%edx)
L(Exit9):
movlpd (%ecx), %xmm0
movlpd %xmm0, (%edx)
movb 8(%ecx), %al
movb %al, 8(%edx)
movl %edi, %eax
RETURN1
.p2align 4
L(StrncatExit10):
movb %bh, 10(%edx)
L(Exit10):
movlpd (%ecx), %xmm0
movlpd %xmm0, (%edx)
movw 8(%ecx), %ax
movw %ax, 8(%edx)
movl %edi, %eax
RETURN1
.p2align 4
L(StrncatExit11):
movb %bh, 11(%edx)
L(Exit11):
movlpd (%ecx), %xmm0
movlpd %xmm0, (%edx)
movl 7(%ecx), %eax
movl %eax, 7(%edx)
movl %edi, %eax
RETURN1
.p2align 4
L(StrncatExit12):
movb %bh, 12(%edx)
L(Exit12):
movlpd (%ecx), %xmm0
movlpd %xmm0, (%edx)
movl 8(%ecx), %eax
movl %eax, 8(%edx)
movl %edi, %eax
RETURN1
.p2align 4
L(StrncatExit13):
movb %bh, 13(%edx)
L(Exit13):
movlpd (%ecx), %xmm0
movlpd %xmm0, (%edx)
movlpd 5(%ecx), %xmm0
movlpd %xmm0, 5(%edx)
movl %edi, %eax
RETURN1
.p2align 4
L(StrncatExit14):
movb %bh, 14(%edx)
L(Exit14):
movlpd (%ecx), %xmm0
movlpd %xmm0, (%edx)
movlpd 6(%ecx), %xmm0
movlpd %xmm0, 6(%edx)
movl %edi, %eax
RETURN1
.p2align 4
L(StrncatExit15):
movb %bh, 15(%edx)
L(Exit15):
movlpd (%ecx), %xmm0
movlpd %xmm0, (%edx)
movlpd 7(%ecx), %xmm0
movlpd %xmm0, 7(%edx)
movl %edi, %eax
RETURN1
.p2align 4
L(StrncatExit16):
movb %bh, 16(%edx)
L(Exit16):
movlpd (%ecx), %xmm0
movlpd 8(%ecx), %xmm1
movlpd %xmm0, (%edx)
movlpd %xmm1, 8(%edx)
movl %edi, %eax
RETURN1
#ifdef USE_AS_STRNCPY
CFI_PUSH(%esi)
.p2align 4
L(CopyFrom1To16BytesCase2):
add $16, %ebx
add %esi, %ecx
lea (%esi, %edx), %esi
lea -9(%ebx), %edx
and $1<<7, %dh
or %al, %dh
lea (%esi), %edx
POP (%esi)
jz L(ExitHighCase2)
test $0x01, %al
jnz L(Exit1)
cmp $1, %ebx
je L(StrncatExit1)
test $0x02, %al
jnz L(Exit2)
cmp $2, %ebx
je L(StrncatExit2)
test $0x04, %al
jnz L(Exit3)
cmp $3, %ebx
je L(StrncatExit3)
test $0x08, %al
jnz L(Exit4)
cmp $4, %ebx
je L(StrncatExit4)
test $0x10, %al
jnz L(Exit5)
cmp $5, %ebx
je L(StrncatExit5)
test $0x20, %al
jnz L(Exit6)
cmp $6, %ebx
je L(StrncatExit6)
test $0x40, %al
jnz L(Exit7)
cmp $7, %ebx
je L(StrncatExit7)
movlpd (%ecx), %xmm0
movlpd %xmm0, (%edx)
lea 7(%edx), %eax
cmpb $1, (%eax)
sbb $-1, %eax
xor %cl, %cl
movb %cl, (%eax)
movl %edi, %eax
RETURN1
.p2align 4
L(ExitHighCase2):
test $0x01, %ah
jnz L(Exit9)
cmp $9, %ebx
je L(StrncatExit9)
test $0x02, %ah
jnz L(Exit10)
cmp $10, %ebx
je L(StrncatExit10)
test $0x04, %ah
jnz L(Exit11)
cmp $11, %ebx
je L(StrncatExit11)
test $0x8, %ah
jnz L(Exit12)
cmp $12, %ebx
je L(StrncatExit12)
test $0x10, %ah
jnz L(Exit13)
cmp $13, %ebx
je L(StrncatExit13)
test $0x20, %ah
jnz L(Exit14)
cmp $14, %ebx
je L(StrncatExit14)
test $0x40, %ah
jnz L(Exit15)
cmp $15, %ebx
je L(StrncatExit15)
movlpd (%ecx), %xmm0
movlpd %xmm0, (%edx)
movlpd 8(%ecx), %xmm1
movlpd %xmm1, 8(%edx)
movl %edi, %eax
RETURN1
CFI_PUSH(%esi)
L(CopyFrom1To16BytesCase2OrCase3):
test %eax, %eax
jnz L(CopyFrom1To16BytesCase2)
.p2align 4
L(CopyFrom1To16BytesCase3):
add $16, %ebx
add %esi, %edx
add %esi, %ecx
POP (%esi)
cmp $8, %ebx
ja L(ExitHighCase3)
cmp $1, %ebx
je L(StrncatExit1)
cmp $2, %ebx
je L(StrncatExit2)
cmp $3, %ebx
je L(StrncatExit3)
cmp $4, %ebx
je L(StrncatExit4)
cmp $5, %ebx
je L(StrncatExit5)
cmp $6, %ebx
je L(StrncatExit6)
cmp $7, %ebx
je L(StrncatExit7)
movlpd (%ecx), %xmm0
movlpd %xmm0, (%edx)
movb %bh, 8(%edx)
movl %edi, %eax
RETURN1
.p2align 4
L(ExitHighCase3):
cmp $9, %ebx
je L(StrncatExit9)
cmp $10, %ebx
je L(StrncatExit10)
cmp $11, %ebx
je L(StrncatExit11)
cmp $12, %ebx
je L(StrncatExit12)
cmp $13, %ebx
je L(StrncatExit13)
cmp $14, %ebx
je L(StrncatExit14)
cmp $15, %ebx
je L(StrncatExit15)
movlpd (%ecx), %xmm0
movlpd %xmm0, (%edx)
movlpd 8(%ecx), %xmm1
movlpd %xmm1, 8(%edx)
movb %bh, 16(%edx)
movl %edi, %eax
RETURN1
.p2align 4
L(StrncatExit0):
movl %edi, %eax
RETURN1
.p2align 4
L(StrncpyExit15Bytes):
cmp $9, %ebx
je L(StrncatExit9)
cmpb $0, 9(%ecx)
jz L(Exit10)
cmp $10, %ebx
je L(StrncatExit10)
cmpb $0, 10(%ecx)
jz L(Exit11)
cmp $11, %ebx
je L(StrncatExit11)
cmpb $0, 11(%ecx)
jz L(Exit12)
cmp $12, %ebx
je L(StrncatExit12)
cmpb $0, 12(%ecx)
jz L(Exit13)
cmp $13, %ebx
je L(StrncatExit13)
cmpb $0, 13(%ecx)
jz L(Exit14)
cmp $14, %ebx
je L(StrncatExit14)
movlpd (%ecx), %xmm0
movlpd %xmm0, (%edx)
movlpd 7(%ecx), %xmm0
movlpd %xmm0, 7(%edx)
lea 14(%edx), %eax
cmpb $1, (%eax)
sbb $-1, %eax
movb %bh, (%eax)
movl %edi, %eax
RETURN1
.p2align 4
L(StrncpyExit8Bytes):
cmpb $0, (%ecx)
jz L(Exit1)
cmp $1, %ebx
je L(StrncatExit1)
cmpb $0, 1(%ecx)
jz L(Exit2)
cmp $2, %ebx
je L(StrncatExit2)
cmpb $0, 2(%ecx)
jz L(Exit3)
cmp $3, %ebx
je L(StrncatExit3)
cmpb $0, 3(%ecx)
jz L(Exit4)
cmp $4, %ebx
je L(StrncatExit4)
cmpb $0, 4(%ecx)
jz L(Exit5)
cmp $5, %ebx
je L(StrncatExit5)
cmpb $0, 5(%ecx)
jz L(Exit6)
cmp $6, %ebx
je L(StrncatExit6)
cmpb $0, 6(%ecx)
jz L(Exit7)
cmp $7, %ebx
je L(StrncatExit7)
movlpd (%ecx), %xmm0
movlpd %xmm0, (%edx)
lea 7(%edx), %eax
cmpb $1, (%eax)
sbb $-1, %eax
movb %bh, (%eax)
movl %edi, %eax
RETURN1
#endif
END (STRCAT)

View File

@@ -107,12 +107,8 @@ name: \
sub %esi, %ebp sub %esi, %ebp
#endif #endif
#ifndef STRCMP
# define STRCMP strcmp
#endif
.section .text.ssse3,"ax",@progbits .section .text.ssse3,"ax",@progbits
ENTRY (STRCMP) ENTRY (ssse3_strcmp_latest)
#ifdef USE_AS_STRNCMP #ifdef USE_AS_STRNCMP
PUSH (%ebp) PUSH (%ebp)
#endif #endif
@@ -2275,4 +2271,4 @@ L(less16bytes_sncmp):
ret ret
#endif #endif
END (STRCMP) END (ssse3_strcmp_latest)

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -1,34 +0,0 @@
/*
Copyright (c) 2011, Intel Corporation
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 Intel Corporation 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.
*/
#define STRCAT strncat
#define USE_AS_STRNCAT
#include "ssse3-strcat-atom.S"

View File

@@ -1,33 +0,0 @@
/*
Copyright (c) 2011, Intel Corporation
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 Intel Corporation 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.
*/
#define USE_AS_STRNCPY
#define STRCPY strncpy
#include "ssse3-strcpy-atom.S"

View File

@@ -1,114 +0,0 @@
/*
Copyright (c) 2011 Intel Corporation
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 Intel Corporation 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 L
# define L(label) .L##label
#endif
#ifndef cfi_startproc
# define cfi_startproc .cfi_startproc
#endif
#ifndef cfi_endproc
# define cfi_endproc .cfi_endproc
#endif
#ifndef cfi_rel_offset
# define cfi_rel_offset(reg, off) .cfi_rel_offset reg, off
#endif
#ifndef cfi_restore
# define cfi_restore(reg) .cfi_restore reg
#endif
#ifndef cfi_adjust_cfa_offset
# define cfi_adjust_cfa_offset(off) .cfi_adjust_cfa_offset off
#endif
#ifndef ENTRY
# define ENTRY(name) \
.type name, @function; \
.globl name; \
.p2align 4; \
name: \
cfi_startproc
#endif
#ifndef END
# define END(name) \
cfi_endproc; \
.size name, .-name
#endif
#define CFI_PUSH(REG) \
cfi_adjust_cfa_offset (4); \
cfi_rel_offset (REG, 0)
#define CFI_POP(REG) \
cfi_adjust_cfa_offset (-4); \
cfi_restore (REG)
#define PUSH(REG) pushl REG; CFI_PUSH (REG)
#define POP(REG) popl REG; CFI_POP (REG)
#define PARMS 4
#define STR1 PARMS+4
#define STR2 STR1+4
#define USE_AS_WCSCAT
.text
ENTRY (wcscat)
PUSH (%edi)
mov STR1(%esp), %edi
mov %edi, %edx
#define RETURN jmp L(WcscpyAtom)
#include "sse2-wcslen-atom.S"
L(WcscpyAtom):
shl $2, %eax
mov STR2(%esp), %ecx
lea (%edi, %eax), %edx
cmp $0, (%ecx)
jz L(Exit4)
cmp $0, 4(%ecx)
jz L(Exit8)
cmp $0, 8(%ecx)
jz L(Exit12)
cmp $0, 12(%ecx)
jz L(Exit16)
#undef RETURN
#define RETURN POP(%edi); ret; CFI_PUSH(%edi)
#include "ssse3-wcscpy-atom.S"
END (wcscat)

View File

@@ -1,652 +0,0 @@
/*
Copyright (c) 2011, Intel Corporation
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 Intel Corporation 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 USE_AS_WCSCAT
# ifndef L
# define L(label) .L##label
# endif
# ifndef cfi_startproc
# define cfi_startproc .cfi_startproc
# endif
# ifndef cfi_endproc
# define cfi_endproc .cfi_endproc
# endif
# ifndef cfi_rel_offset
# define cfi_rel_offset(reg, off) .cfi_rel_offset reg, off
# endif
# ifndef cfi_restore
# define cfi_restore(reg) .cfi_restore reg
# endif
# ifndef cfi_adjust_cfa_offset
# define cfi_adjust_cfa_offset(off) .cfi_adjust_cfa_offset off
# endif
# ifndef ENTRY
# define ENTRY(name) \
.type name, @function; \
.globl name; \
.p2align 4; \
name: \
cfi_startproc
# endif
# ifndef END
# define END(name) \
cfi_endproc; \
.size name, .-name
# endif
# define CFI_PUSH(REG) \
cfi_adjust_cfa_offset (4); \
cfi_rel_offset (REG, 0)
# define CFI_POP(REG) \
cfi_adjust_cfa_offset (-4); \
cfi_restore (REG)
# define PUSH(REG) pushl REG; CFI_PUSH (REG)
# define POP(REG) popl REG; CFI_POP (REG)
# define PARMS 4
# define RETURN POP (%edi); ret; CFI_PUSH (%edi)
# define STR1 PARMS
# define STR2 STR1+4
# define LEN STR2+4
.text
ENTRY (wcscpy)
mov STR1(%esp), %edx
mov STR2(%esp), %ecx
cmp $0, (%ecx)
jz L(ExitTail4)
cmp $0, 4(%ecx)
jz L(ExitTail8)
cmp $0, 8(%ecx)
jz L(ExitTail12)
cmp $0, 12(%ecx)
jz L(ExitTail16)
PUSH (%edi)
mov %edx, %edi
#endif
PUSH (%esi)
lea 16(%ecx), %esi
and $-16, %esi
pxor %xmm0, %xmm0
pcmpeqd (%esi), %xmm0
movdqu (%ecx), %xmm1
movdqu %xmm1, (%edx)
pmovmskb %xmm0, %eax
sub %ecx, %esi
test %eax, %eax
jnz L(CopyFrom1To16Bytes)
mov %edx, %eax
lea 16(%edx), %edx
and $-16, %edx
sub %edx, %eax
sub %eax, %ecx
mov %ecx, %eax
and $0xf, %eax
mov $0, %esi
jz L(Align16Both)
cmp $4, %eax
je L(Shl4)
cmp $8, %eax
je L(Shl8)
jmp L(Shl12)
L(Align16Both):
movaps (%ecx), %xmm1
movaps 16(%ecx), %xmm2
movaps %xmm1, (%edx)
pcmpeqd %xmm2, %xmm0
pmovmskb %xmm0, %eax
lea 16(%esi), %esi
test %eax, %eax
jnz L(CopyFrom1To16Bytes)
movaps 16(%ecx, %esi), %xmm3
movaps %xmm2, (%edx, %esi)
pcmpeqd %xmm3, %xmm0
pmovmskb %xmm0, %eax
lea 16(%esi), %esi
test %eax, %eax
jnz L(CopyFrom1To16Bytes)
movaps 16(%ecx, %esi), %xmm4
movaps %xmm3, (%edx, %esi)
pcmpeqd %xmm4, %xmm0
pmovmskb %xmm0, %eax
lea 16(%esi), %esi
test %eax, %eax
jnz L(CopyFrom1To16Bytes)
movaps 16(%ecx, %esi), %xmm1
movaps %xmm4, (%edx, %esi)
pcmpeqd %xmm1, %xmm0
pmovmskb %xmm0, %eax
lea 16(%esi), %esi
test %eax, %eax
jnz L(CopyFrom1To16Bytes)
movaps 16(%ecx, %esi), %xmm2
movaps %xmm1, (%edx, %esi)
pcmpeqd %xmm2, %xmm0
pmovmskb %xmm0, %eax
lea 16(%esi), %esi
test %eax, %eax
jnz L(CopyFrom1To16Bytes)
movaps 16(%ecx, %esi), %xmm3
movaps %xmm2, (%edx, %esi)
pcmpeqd %xmm3, %xmm0
pmovmskb %xmm0, %eax
lea 16(%esi), %esi
test %eax, %eax
jnz L(CopyFrom1To16Bytes)
movaps %xmm3, (%edx, %esi)
mov %ecx, %eax
lea 16(%ecx, %esi), %ecx
and $-0x40, %ecx
sub %ecx, %eax
sub %eax, %edx
mov $-0x40, %esi
L(Aligned64Loop):
movaps (%ecx), %xmm2
movaps 32(%ecx), %xmm3
movaps %xmm2, %xmm4
movaps 16(%ecx), %xmm5
movaps %xmm3, %xmm6
movaps 48(%ecx), %xmm7
pminub %xmm5, %xmm2
pminub %xmm7, %xmm3
pminub %xmm2, %xmm3
lea 64(%edx), %edx
pcmpeqd %xmm0, %xmm3
lea 64(%ecx), %ecx
pmovmskb %xmm3, %eax
test %eax, %eax
jnz L(Aligned64Leave)
movaps %xmm4, -64(%edx)
movaps %xmm5, -48(%edx)
movaps %xmm6, -32(%edx)
movaps %xmm7, -16(%edx)
jmp L(Aligned64Loop)
L(Aligned64Leave):
pcmpeqd %xmm4, %xmm0
pmovmskb %xmm0, %eax
test %eax, %eax
jnz L(CopyFrom1To16Bytes)
pcmpeqd %xmm5, %xmm0
pmovmskb %xmm0, %eax
movaps %xmm4, -64(%edx)
lea 16(%esi), %esi
test %eax, %eax
jnz L(CopyFrom1To16Bytes)
pcmpeqd %xmm6, %xmm0
pmovmskb %xmm0, %eax
movaps %xmm5, -48(%edx)
lea 16(%esi), %esi
test %eax, %eax
jnz L(CopyFrom1To16Bytes)
movaps %xmm6, -32(%edx)
pcmpeqd %xmm7, %xmm0
pmovmskb %xmm0, %eax
lea 16(%esi), %esi
test %eax, %eax
jnz L(CopyFrom1To16Bytes)
mov $-0x40, %esi
movaps %xmm7, -16(%edx)
jmp L(Aligned64Loop)
.p2align 4
L(Shl4):
movaps -4(%ecx), %xmm1
movaps 12(%ecx), %xmm2
L(Shl4Start):
pcmpeqd %xmm2, %xmm0
pmovmskb %xmm0, %eax
movaps %xmm2, %xmm3
test %eax, %eax
jnz L(Shl4LoopExit)
palignr $4, %xmm1, %xmm2
movaps %xmm2, (%edx)
movaps 28(%ecx), %xmm2
pcmpeqd %xmm2, %xmm0
lea 16(%edx), %edx
pmovmskb %xmm0, %eax
lea 16(%ecx), %ecx
movaps %xmm2, %xmm1
test %eax, %eax
jnz L(Shl4LoopExit)
palignr $4, %xmm3, %xmm2
movaps %xmm2, (%edx)
movaps 28(%ecx), %xmm2
pcmpeqd %xmm2, %xmm0
lea 16(%edx), %edx
pmovmskb %xmm0, %eax
lea 16(%ecx), %ecx
movaps %xmm2, %xmm3
test %eax, %eax
jnz L(Shl4LoopExit)
palignr $4, %xmm1, %xmm2
movaps %xmm2, (%edx)
movaps 28(%ecx), %xmm2
pcmpeqd %xmm2, %xmm0
lea 16(%edx), %edx
pmovmskb %xmm0, %eax
lea 16(%ecx), %ecx
test %eax, %eax
jnz L(Shl4LoopExit)
palignr $4, %xmm3, %xmm2
movaps %xmm2, (%edx)
lea 28(%ecx), %ecx
lea 16(%edx), %edx
mov %ecx, %eax
and $-0x40, %ecx
sub %ecx, %eax
lea -12(%ecx), %ecx
sub %eax, %edx
movaps -4(%ecx), %xmm1
L(Shl4LoopStart):
movaps 12(%ecx), %xmm2
movaps 28(%ecx), %xmm3
movaps %xmm3, %xmm6
movaps 44(%ecx), %xmm4
movaps %xmm4, %xmm7
movaps 60(%ecx), %xmm5
pminub %xmm2, %xmm6
pminub %xmm5, %xmm7
pminub %xmm6, %xmm7
pcmpeqd %xmm0, %xmm7
pmovmskb %xmm7, %eax
movaps %xmm5, %xmm7
palignr $4, %xmm4, %xmm5
palignr $4, %xmm3, %xmm4
test %eax, %eax
jnz L(Shl4Start)
palignr $4, %xmm2, %xmm3
lea 64(%ecx), %ecx
palignr $4, %xmm1, %xmm2
movaps %xmm7, %xmm1
movaps %xmm5, 48(%edx)
movaps %xmm4, 32(%edx)
movaps %xmm3, 16(%edx)
movaps %xmm2, (%edx)
lea 64(%edx), %edx
jmp L(Shl4LoopStart)
L(Shl4LoopExit):
movlpd (%ecx), %xmm0
movl 8(%ecx), %esi
movlpd %xmm0, (%edx)
movl %esi, 8(%edx)
POP (%esi)
add $12, %edx
add $12, %ecx
test %al, %al
jz L(ExitHigh)
test $0x01, %al
jnz L(Exit4)
movlpd (%ecx), %xmm0
movlpd %xmm0, (%edx)
movl %edi, %eax
RETURN
CFI_PUSH (%esi)
.p2align 4
L(Shl8):
movaps -8(%ecx), %xmm1
movaps 8(%ecx), %xmm2
L(Shl8Start):
pcmpeqd %xmm2, %xmm0
pmovmskb %xmm0, %eax
movaps %xmm2, %xmm3
test %eax, %eax
jnz L(Shl8LoopExit)
palignr $8, %xmm1, %xmm2
movaps %xmm2, (%edx)
movaps 24(%ecx), %xmm2
pcmpeqd %xmm2, %xmm0
lea 16(%edx), %edx
pmovmskb %xmm0, %eax
lea 16(%ecx), %ecx
movaps %xmm2, %xmm1
test %eax, %eax
jnz L(Shl8LoopExit)
palignr $8, %xmm3, %xmm2
movaps %xmm2, (%edx)
movaps 24(%ecx), %xmm2
pcmpeqd %xmm2, %xmm0
lea 16(%edx), %edx
pmovmskb %xmm0, %eax
lea 16(%ecx), %ecx
movaps %xmm2, %xmm3
test %eax, %eax
jnz L(Shl8LoopExit)
palignr $8, %xmm1, %xmm2
movaps %xmm2, (%edx)
movaps 24(%ecx), %xmm2
pcmpeqd %xmm2, %xmm0
lea 16(%edx), %edx
pmovmskb %xmm0, %eax
lea 16(%ecx), %ecx
test %eax, %eax
jnz L(Shl8LoopExit)
palignr $8, %xmm3, %xmm2
movaps %xmm2, (%edx)
lea 24(%ecx), %ecx
lea 16(%edx), %edx
mov %ecx, %eax
and $-0x40, %ecx
sub %ecx, %eax
lea -8(%ecx), %ecx
sub %eax, %edx
movaps -8(%ecx), %xmm1
L(Shl8LoopStart):
movaps 8(%ecx), %xmm2
movaps 24(%ecx), %xmm3
movaps %xmm3, %xmm6
movaps 40(%ecx), %xmm4
movaps %xmm4, %xmm7
movaps 56(%ecx), %xmm5
pminub %xmm2, %xmm6
pminub %xmm5, %xmm7
pminub %xmm6, %xmm7
pcmpeqd %xmm0, %xmm7
pmovmskb %xmm7, %eax
movaps %xmm5, %xmm7
palignr $8, %xmm4, %xmm5
palignr $8, %xmm3, %xmm4
test %eax, %eax
jnz L(Shl8Start)
palignr $8, %xmm2, %xmm3
lea 64(%ecx), %ecx
palignr $8, %xmm1, %xmm2
movaps %xmm7, %xmm1
movaps %xmm5, 48(%edx)
movaps %xmm4, 32(%edx)
movaps %xmm3, 16(%edx)
movaps %xmm2, (%edx)
lea 64(%edx), %edx
jmp L(Shl8LoopStart)
L(Shl8LoopExit):
movlpd (%ecx), %xmm0
movlpd %xmm0, (%edx)
POP (%esi)
add $8, %edx
add $8, %ecx
test %al, %al
jz L(ExitHigh)
test $0x01, %al
jnz L(Exit4)
movlpd (%ecx), %xmm0
movlpd %xmm0, (%edx)
movl %edi, %eax
RETURN
CFI_PUSH (%esi)
.p2align 4
L(Shl12):
movaps -12(%ecx), %xmm1
movaps 4(%ecx), %xmm2
L(Shl12Start):
pcmpeqd %xmm2, %xmm0
pmovmskb %xmm0, %eax
movaps %xmm2, %xmm3
test %eax, %eax
jnz L(Shl12LoopExit)
palignr $12, %xmm1, %xmm2
movaps %xmm2, (%edx)
movaps 20(%ecx), %xmm2
pcmpeqd %xmm2, %xmm0
lea 16(%edx), %edx
pmovmskb %xmm0, %eax
lea 16(%ecx), %ecx
movaps %xmm2, %xmm1
test %eax, %eax
jnz L(Shl12LoopExit)
palignr $12, %xmm3, %xmm2
movaps %xmm2, (%edx)
movaps 20(%ecx), %xmm2
pcmpeqd %xmm2, %xmm0
lea 16(%edx), %edx
pmovmskb %xmm0, %eax
lea 16(%ecx), %ecx
movaps %xmm2, %xmm3
test %eax, %eax
jnz L(Shl12LoopExit)
palignr $12, %xmm1, %xmm2
movaps %xmm2, (%edx)
movaps 20(%ecx), %xmm2
pcmpeqd %xmm2, %xmm0
lea 16(%edx), %edx
pmovmskb %xmm0, %eax
lea 16(%ecx), %ecx
test %eax, %eax
jnz L(Shl12LoopExit)
palignr $12, %xmm3, %xmm2
movaps %xmm2, (%edx)
lea 20(%ecx), %ecx
lea 16(%edx), %edx
mov %ecx, %eax
and $-0x40, %ecx
sub %ecx, %eax
lea -4(%ecx), %ecx
sub %eax, %edx
movaps -12(%ecx), %xmm1
L(Shl12LoopStart):
movaps 4(%ecx), %xmm2
movaps 20(%ecx), %xmm3
movaps %xmm3, %xmm6
movaps 36(%ecx), %xmm4
movaps %xmm4, %xmm7
movaps 52(%ecx), %xmm5
pminub %xmm2, %xmm6
pminub %xmm5, %xmm7
pminub %xmm6, %xmm7
pcmpeqd %xmm0, %xmm7
pmovmskb %xmm7, %eax
movaps %xmm5, %xmm7
palignr $12, %xmm4, %xmm5
palignr $12, %xmm3, %xmm4
test %eax, %eax
jnz L(Shl12Start)
palignr $12, %xmm2, %xmm3
lea 64(%ecx), %ecx
palignr $12, %xmm1, %xmm2
movaps %xmm7, %xmm1
movaps %xmm5, 48(%edx)
movaps %xmm4, 32(%edx)
movaps %xmm3, 16(%edx)
movaps %xmm2, (%edx)
lea 64(%edx), %edx
jmp L(Shl12LoopStart)
L(Shl12LoopExit):
movl (%ecx), %esi
movl %esi, (%edx)
mov $4, %esi
.p2align 4
L(CopyFrom1To16Bytes):
add %esi, %edx
add %esi, %ecx
POP (%esi)
test %al, %al
jz L(ExitHigh)
test $0x01, %al
jnz L(Exit4)
L(Exit8):
movlpd (%ecx), %xmm0
movlpd %xmm0, (%edx)
movl %edi, %eax
RETURN
.p2align 4
L(ExitHigh):
test $0x01, %ah
jnz L(Exit12)
L(Exit16):
movdqu (%ecx), %xmm0
movdqu %xmm0, (%edx)
movl %edi, %eax
RETURN
.p2align 4
L(Exit4):
movl (%ecx), %eax
movl %eax, (%edx)
movl %edi, %eax
RETURN
.p2align 4
L(Exit12):
movlpd (%ecx), %xmm0
movlpd %xmm0, (%edx)
movl 8(%ecx), %eax
movl %eax, 8(%edx)
movl %edi, %eax
RETURN
CFI_POP (%edi)
.p2align 4
L(ExitTail4):
movl (%ecx), %eax
movl %eax, (%edx)
movl %edx, %eax
ret
.p2align 4
L(ExitTail8):
movlpd (%ecx), %xmm0
movlpd %xmm0, (%edx)
movl %edx, %eax
ret
.p2align 4
L(ExitTail12):
movlpd (%ecx), %xmm0
movlpd %xmm0, (%edx)
movl 8(%ecx), %eax
movl %eax, 8(%edx)
movl %edx, %eax
ret
.p2align 4
L(ExitTail16):
movdqu (%ecx), %xmm0
movdqu %xmm0, (%edx)
movl %edx, %eax
ret
#ifndef USE_AS_WCSCAT
END (wcscpy)
#endif

View File

@@ -1,33 +0,0 @@
/*
Copyright (c) 2011, Intel Corporation
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 Intel Corporation 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.
*/
#define MEMCMP wmemcmp
#define USE_AS_WMEMCMP 1
#include "ssse3-memcmp-atom.S"

View File

@@ -0,0 +1,3 @@
/* $OpenBSD: strchr.S,v 1.3 2005/08/07 11:30:38 espie Exp $ */
#define STRCHR
#include "index.S"

View File

@@ -28,8 +28,13 @@ ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/ */
#if defined(USE_SSSE3)
#define MEMCPY bcopy # define ssse3_strcmp_latest strcmp
#define USE_AS_MEMMOVE # include "ssse3-strcmp-latest.S"
#define USE_AS_BCOPY
#include "ssse3-memcpy-atom.S" #else
# include "strcmp.S"
#endif

View File

@@ -0,0 +1,64 @@
/* $OpenBSD: strcpy.S,v 1.8 2005/08/07 11:30:38 espie Exp $ */
/*
* Written by J.T. Conklin <jtc@netbsd.org>.
* Public domain.
*/
#include <machine/asm.h>
#if defined(APIWARN)
#APP
.section .gnu.warning.strcpy
.ascii "warning: strcpy() is almost always misused, please use strlcpy()"
#NO_APP
#endif
/*
* NOTE: I've unrolled the loop eight times: large enough to make a
* significant difference, and small enough not to totally trash the
* cache.
*/
ENTRY(strcpy)
movl 4(%esp),%ecx /* dst address */
movl 8(%esp),%edx /* src address */
pushl %ecx /* push dst address */
.align 2,0x90
L1: movb (%edx),%al /* unroll loop, but not too much */
movb %al,(%ecx)
testb %al,%al
jz L2
movb 1(%edx),%al
movb %al,1(%ecx)
testb %al,%al
jz L2
movb 2(%edx),%al
movb %al,2(%ecx)
testb %al,%al
jz L2
movb 3(%edx),%al
movb %al,3(%ecx)
testb %al,%al
jz L2
movb 4(%edx),%al
movb %al,4(%ecx)
testb %al,%al
jz L2
movb 5(%edx),%al
movb %al,5(%ecx)
testb %al,%al
jz L2
movb 6(%edx),%al
movb %al,6(%ecx)
testb %al,%al
jz L2
movb 7(%edx),%al
movb %al,7(%ecx)
addl $8,%edx
addl $8,%ecx
testb %al,%al
jnz L1
L2: popl %eax /* pop dst address */
ret
END(strcpy)

View File

@@ -28,7 +28,13 @@ ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/ */
#if defined(USE_SSE2)
#define MEMCPY memmove # define sse2_strlen_atom strlen
#define USE_AS_MEMMOVE # include "sse2-strlen-atom.S"
#include "ssse3-memcpy-atom.S"
#else
# include "strlen.S"
#endif

View File

@@ -28,6 +28,15 @@ ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/ */
#define USE_AS_BZERO #if defined(USE_SSSE3)
#define MEMSET bzero
#include "sse2-memset-atom.S" # define USE_AS_STRNCMP
# define ssse3_strcmp_latest strncmp
# include "ssse3-strcmp-latest.S"
#else
# include "strncmp.S"
#endif

View File

@@ -130,8 +130,6 @@ syscall_src += arch-x86/syscalls/removexattr.S
syscall_src += arch-x86/syscalls/lremovexattr.S syscall_src += arch-x86/syscalls/lremovexattr.S
syscall_src += arch-x86/syscalls/__statfs64.S syscall_src += arch-x86/syscalls/__statfs64.S
syscall_src += arch-x86/syscalls/unshare.S syscall_src += arch-x86/syscalls/unshare.S
syscall_src += arch-x86/syscalls/swapon.S
syscall_src += arch-x86/syscalls/swapoff.S
syscall_src += arch-x86/syscalls/pause.S syscall_src += arch-x86/syscalls/pause.S
syscall_src += arch-x86/syscalls/gettimeofday.S syscall_src += arch-x86/syscalls/gettimeofday.S
syscall_src += arch-x86/syscalls/settimeofday.S syscall_src += arch-x86/syscalls/settimeofday.S
@@ -150,9 +148,6 @@ syscall_src += arch-x86/syscalls/__timer_getoverrun.S
syscall_src += arch-x86/syscalls/__timer_delete.S syscall_src += arch-x86/syscalls/__timer_delete.S
syscall_src += arch-x86/syscalls/utimes.S syscall_src += arch-x86/syscalls/utimes.S
syscall_src += arch-x86/syscalls/utimensat.S syscall_src += arch-x86/syscalls/utimensat.S
syscall_src += arch-x86/syscalls/timerfd_create.S
syscall_src += arch-x86/syscalls/timerfd_settime.S
syscall_src += arch-x86/syscalls/timerfd_gettime.S
syscall_src += arch-x86/syscalls/sigaction.S syscall_src += arch-x86/syscalls/sigaction.S
syscall_src += arch-x86/syscalls/sigprocmask.S syscall_src += arch-x86/syscalls/sigprocmask.S
syscall_src += arch-x86/syscalls/__sigsuspend.S syscall_src += arch-x86/syscalls/__sigsuspend.S

View File

@@ -1,21 +0,0 @@
/* autogenerated by gensyscalls.py */
#include <linux/err.h>
#include <machine/asm.h>
#include <asm/unistd.h>
ENTRY(swapoff)
pushl %ebx
mov 8(%esp), %ebx
movl $__NR_swapoff, %eax
int $0x80
cmpl $-MAX_ERRNO, %eax
jb 1f
negl %eax
pushl %eax
call __set_errno
addl $4, %esp
orl $-1, %eax
1:
popl %ebx
ret
END(swapoff)

View File

@@ -1,24 +0,0 @@
/* autogenerated by gensyscalls.py */
#include <linux/err.h>
#include <machine/asm.h>
#include <asm/unistd.h>
ENTRY(swapon)
pushl %ebx
pushl %ecx
mov 12(%esp), %ebx
mov 16(%esp), %ecx
movl $__NR_swapon, %eax
int $0x80
cmpl $-MAX_ERRNO, %eax
jb 1f
negl %eax
pushl %eax
call __set_errno
addl $4, %esp
orl $-1, %eax
1:
popl %ecx
popl %ebx
ret
END(swapon)

View File

@@ -1,24 +0,0 @@
/* autogenerated by gensyscalls.py */
#include <linux/err.h>
#include <machine/asm.h>
#include <asm/unistd.h>
ENTRY(timerfd_create)
pushl %ebx
pushl %ecx
mov 12(%esp), %ebx
mov 16(%esp), %ecx
movl $__NR_timerfd_create, %eax
int $0x80
cmpl $-MAX_ERRNO, %eax
jb 1f
negl %eax
pushl %eax
call __set_errno
addl $4, %esp
orl $-1, %eax
1:
popl %ecx
popl %ebx
ret
END(timerfd_create)

View File

@@ -1,24 +0,0 @@
/* autogenerated by gensyscalls.py */
#include <linux/err.h>
#include <machine/asm.h>
#include <asm/unistd.h>
ENTRY(timerfd_gettime)
pushl %ebx
pushl %ecx
mov 12(%esp), %ebx
mov 16(%esp), %ecx
movl $__NR_timerfd_gettime, %eax
int $0x80
cmpl $-MAX_ERRNO, %eax
jb 1f
negl %eax
pushl %eax
call __set_errno
addl $4, %esp
orl $-1, %eax
1:
popl %ecx
popl %ebx
ret
END(timerfd_gettime)

View File

@@ -1,30 +0,0 @@
/* autogenerated by gensyscalls.py */
#include <linux/err.h>
#include <machine/asm.h>
#include <asm/unistd.h>
ENTRY(timerfd_settime)
pushl %ebx
pushl %ecx
pushl %edx
pushl %esi
mov 20(%esp), %ebx
mov 24(%esp), %ecx
mov 28(%esp), %edx
mov 32(%esp), %esi
movl $__NR_timerfd_settime, %eax
int $0x80
cmpl $-MAX_ERRNO, %eax
jb 1f
negl %eax
pushl %eax
call __set_errno
addl $4, %esp
orl $-1, %eax
1:
popl %esi
popl %edx
popl %ecx
popl %ebx
ret
END(timerfd_settime)

View File

@@ -10,75 +10,16 @@ _LIBC_ARCH_COMMON_SRC_FILES := \
arch-x86/bionic/sigsetjmp.S \ arch-x86/bionic/sigsetjmp.S \
arch-x86/bionic/syscall.S \ arch-x86/bionic/syscall.S \
arch-x86/bionic/vfork.S \ arch-x86/bionic/vfork.S \
arch-x86/string/ffs.S arch-x86/string/bcopy_wrapper.S \
arch-x86/string/bzero_wrapper.S \
ifeq ($(ARCH_X86_HAVE_SSSE3),true) arch-x86/string/ffs.S \
_LIBC_ARCH_COMMON_SRC_FILES += \ arch-x86/string/memcmp_wrapper.S \
arch-x86/string/ssse3-memcpy-atom.S \ arch-x86/string/memcpy_wrapper.S \
arch-x86/string/ssse3-memmove-atom.S \ arch-x86/string/memmove_wrapper.S \
arch-x86/string/ssse3-bcopy-atom.S \ arch-x86/string/memset_wrapper.S \
arch-x86/string/ssse3-strncat-atom.S \ arch-x86/string/strcmp_wrapper.S \
arch-x86/string/ssse3-strncpy-atom.S \ arch-x86/string/strlen_wrapper.S \
arch-x86/string/ssse3-strlcat-atom.S \ arch-x86/string/strncmp_wrapper.S \
arch-x86/string/ssse3-strlcpy-atom.S \
arch-x86/string/ssse3-strcmp-atom.S \
arch-x86/string/ssse3-strncmp-atom.S \
arch-x86/string/ssse3-strcat-atom.S \
arch-x86/string/ssse3-strcpy-atom.S \
arch-x86/string/ssse3-memcmp-atom.S \
arch-x86/string/ssse3-wmemcmp-atom.S \
arch-x86/string/ssse3-wcscat-atom.S \
arch-x86/string/ssse3-wcscpy-atom.S
else
_LIBC_ARCH_COMMON_SRC_FILES += \
arch-x86/string/memcpy.S \
arch-x86/string/memmove.S \
arch-x86/string/bcopy.S \
arch-x86/string/strcmp.S \
arch-x86/string/strncmp.S \
arch-x86/string/strcat.S \
arch-x86/string/memcmp.S \
string/strcpy.c \
string/strncat.c \
string/strncpy.c \
string/strlcat.c \
string/strlcpy.c \
upstream-freebsd/lib/libc/string/wcscpy.c \
upstream-freebsd/lib/libc/string/wcscat.c \
upstream-freebsd/lib/libc/string/wmemcmp.c
endif
ifeq ($(ARCH_X86_HAVE_SSE2),true)
_LIBC_ARCH_COMMON_SRC_FILES += \
arch-x86/string/sse2-memset-atom.S \
arch-x86/string/sse2-bzero-atom.S \
arch-x86/string/sse2-memchr-atom.S \
arch-x86/string/sse2-memrchr-atom.S \
arch-x86/string/sse2-strchr-atom.S \
arch-x86/string/sse2-strrchr-atom.S \
arch-x86/string/sse2-index-atom.S \
arch-x86/string/sse2-strlen-atom.S \
arch-x86/string/sse2-strnlen-atom.S \
arch-x86/string/sse2-wcschr-atom.S \
arch-x86/string/sse2-wcsrchr-atom.S \
arch-x86/string/sse2-wcslen-atom.S \
arch-x86/string/sse2-wcscmp-atom.S
else
_LIBC_ARCH_COMMON_SRC_FILES += \
arch-x86/string/memset.S \
arch-x86/string/strlen.S \
arch-x86/string/bzero.S \
bionic/memrchr.c \
bionic/memchr.c \
string/strchr.cpp \
string/strrchr.c \
string/index.c \
bionic/strnlen.c \
upstream-freebsd/lib/libc/string/wcschr.c \
upstream-freebsd/lib/libc/string/wcsrchr.c \
upstream-freebsd/lib/libc/string/wcslen.c \
upstream-freebsd/lib/libc/string/wcscmp.c
endif
_LIBC_ARCH_STATIC_SRC_FILES := \ _LIBC_ARCH_STATIC_SRC_FILES := \
bionic/dl_iterate_phdr_static.c \ bionic/dl_iterate_phdr_static.c \

View File

@@ -45,7 +45,7 @@
extern "C" void *__memcpy_chk(void *dest, const void *src, extern "C" void *__memcpy_chk(void *dest, const void *src,
size_t copy_amount, size_t dest_len) size_t copy_amount, size_t dest_len)
{ {
if (__predict_false(copy_amount > dest_len)) { if (__builtin_expect(copy_amount > dest_len, 0)) {
__fortify_chk_fail("memcpy buffer overflow", __fortify_chk_fail("memcpy buffer overflow",
BIONIC_EVENT_MEMCPY_BUFFER_OVERFLOW); BIONIC_EVENT_MEMCPY_BUFFER_OVERFLOW);
} }

View File

@@ -44,7 +44,7 @@
extern "C" void *__memmove_chk (void *dest, const void *src, extern "C" void *__memmove_chk (void *dest, const void *src,
size_t len, size_t dest_len) size_t len, size_t dest_len)
{ {
if (__predict_false(len > dest_len)) { if (len > dest_len) {
__fortify_chk_fail("memmove buffer overflow", __fortify_chk_fail("memmove buffer overflow",
BIONIC_EVENT_MEMMOVE_BUFFER_OVERFLOW); BIONIC_EVENT_MEMMOVE_BUFFER_OVERFLOW);
} }

View File

@@ -42,7 +42,7 @@
* greater than 0. * greater than 0.
*/ */
extern "C" void *__memset_chk (void *dest, int c, size_t n, size_t dest_len) { extern "C" void *__memset_chk (void *dest, int c, size_t n, size_t dest_len) {
if (__predict_false(n > dest_len)) { if (n > dest_len) {
__fortify_chk_fail("memset buffer overflow", __fortify_chk_fail("memset buffer overflow",
BIONIC_EVENT_MEMSET_BUFFER_OVERFLOW); BIONIC_EVENT_MEMSET_BUFFER_OVERFLOW);
} }

View File

@@ -29,6 +29,7 @@
#include <string.h> #include <string.h>
#include <stdlib.h> #include <stdlib.h>
#include "libc_logging.h" #include "libc_logging.h"
#include <safe_iop.h>
/* /*
* Runtime implementation of __builtin____strcat_chk. * Runtime implementation of __builtin____strcat_chk.
@@ -41,24 +42,22 @@
* This strcat check is called if _FORTIFY_SOURCE is defined and * This strcat check is called if _FORTIFY_SOURCE is defined and
* greater than 0. * greater than 0.
*/ */
extern "C" char* __strcat_chk( extern "C" char *__strcat_chk (char *dest, const char *src, size_t dest_buf_size) {
char* __restrict dest, // TODO: optimize so we don't scan src/dest twice.
const char* __restrict src, size_t src_len = strlen(src);
size_t dest_buf_size) size_t dest_len = strlen(dest);
{ size_t sum;
char* save = dest;
size_t dest_len = __strlen_chk(dest, dest_buf_size);
dest += dest_len; // sum = src_len + dest_len + 1 (with overflow protection)
dest_buf_size -= dest_len; if (!safe_add3(&sum, src_len, dest_len, 1U)) {
__fortify_chk_fail("strcat integer overflow",
while ((*dest++ = *src++) != '\0') { BIONIC_EVENT_STRCAT_INTEGER_OVERFLOW);
dest_buf_size--;
if (__predict_false(dest_buf_size == 0)) {
__fortify_chk_fail("strcat buffer overflow",
BIONIC_EVENT_STRCAT_BUFFER_OVERFLOW);
}
} }
return save; if (sum > dest_buf_size) {
__fortify_chk_fail("strcat buffer overflow",
BIONIC_EVENT_STRCAT_BUFFER_OVERFLOW);
}
return strcat(dest, src);
} }

View File

@@ -1,46 +0,0 @@
/*-
* Copyright (c) 1990 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.
*/
#include <string.h>
#include "libc_logging.h"
extern "C" char* __strchr_chk(const char* p, int ch, size_t s_len) {
for (;; ++p, s_len--) {
if (__predict_false(s_len == 0)) {
__fortify_chk_fail("read beyond buffer", 0);
}
if (*p == static_cast<char>(ch)) {
return const_cast<char*>(p);
}
if (*p == '\0') {
return NULL;
}
}
/* NOTREACHED */
}

View File

@@ -44,7 +44,7 @@
extern "C" char *__strcpy_chk (char *dest, const char *src, size_t dest_len) { extern "C" char *__strcpy_chk (char *dest, const char *src, size_t dest_len) {
// TODO: optimize so we don't scan src twice. // TODO: optimize so we don't scan src twice.
size_t src_len = strlen(src) + 1; size_t src_len = strlen(src) + 1;
if (__predict_false(src_len > dest_len)) { if (src_len > dest_len) {
__fortify_chk_fail("strcpy buffer overflow", __fortify_chk_fail("strcpy buffer overflow",
BIONIC_EVENT_STRCPY_BUFFER_OVERFLOW); BIONIC_EVENT_STRCPY_BUFFER_OVERFLOW);
} }

View File

@@ -45,7 +45,7 @@
extern "C" size_t __strlcat_chk(char *dest, const char *src, extern "C" size_t __strlcat_chk(char *dest, const char *src,
size_t supplied_size, size_t dest_len_from_compiler) size_t supplied_size, size_t dest_len_from_compiler)
{ {
if (__predict_false(supplied_size > dest_len_from_compiler)) { if (supplied_size > dest_len_from_compiler) {
__fortify_chk_fail("strlcat buffer overflow", 0); __fortify_chk_fail("strlcat buffer overflow", 0);
} }

View File

@@ -45,7 +45,7 @@
extern "C" size_t __strlcpy_chk(char *dest, const char *src, extern "C" size_t __strlcpy_chk(char *dest, const char *src,
size_t supplied_size, size_t dest_len_from_compiler) size_t supplied_size, size_t dest_len_from_compiler)
{ {
if (__predict_false(supplied_size > dest_len_from_compiler)) { if (supplied_size > dest_len_from_compiler) {
__fortify_chk_fail("strlcpy buffer overflow", 0); __fortify_chk_fail("strlcpy buffer overflow", 0);
} }

View File

@@ -56,7 +56,7 @@
extern "C" size_t __strlen_chk(const char *s, size_t s_len) { extern "C" size_t __strlen_chk(const char *s, size_t s_len) {
size_t ret = strlen(s); size_t ret = strlen(s);
if (__predict_false(ret >= s_len)) { if (__builtin_expect(ret >= s_len, 0)) {
__fortify_chk_fail("strlen read overflow", 0); __fortify_chk_fail("strlen read overflow", 0);
} }

View File

@@ -29,6 +29,7 @@
#include <string.h> #include <string.h>
#include <stdlib.h> #include <stdlib.h>
#include "libc_logging.h" #include "libc_logging.h"
#include <safe_iop.h>
/* /*
* Runtime implementation of __builtin____strncat_chk. * Runtime implementation of __builtin____strncat_chk.
@@ -41,33 +42,27 @@
* This strncat check is called if _FORTIFY_SOURCE is defined and * This strncat check is called if _FORTIFY_SOURCE is defined and
* greater than 0. * greater than 0.
*/ */
extern "C" char *__strncat_chk( extern "C" char *__strncat_chk (char *dest, const char *src,
char* __restrict dest, size_t len, size_t dest_buf_size)
const char* __restrict src,
size_t len, size_t dest_buf_size)
{ {
if (len == 0) { // TODO: optimize so we don't scan src/dest twice.
return dest; size_t dest_len = strlen(dest);
size_t src_len = strlen(src);
if (src_len > len) {
src_len = len;
} }
size_t dest_len = __strlen_chk(dest, dest_buf_size); size_t sum;
char *d = dest + dest_len; // sum = src_len + dest_len + 1 (with overflow protection)
dest_buf_size -= dest_len; if (!safe_add3(&sum, src_len, dest_len, 1U)) {
__fortify_chk_fail("strncat integer overflow",
while (*src != '\0') { BIONIC_EVENT_STRNCAT_INTEGER_OVERFLOW);
*d++ = *src++;
len--; dest_buf_size--;
if (__predict_false(dest_buf_size == 0)) {
__fortify_chk_fail("strncat buffer overflow",
BIONIC_EVENT_STRNCAT_BUFFER_OVERFLOW);
}
if (len == 0) {
break;
}
} }
*d = '\0'; if (sum > dest_buf_size) {
return dest; __fortify_chk_fail("strncat buffer overflow",
BIONIC_EVENT_STRNCAT_BUFFER_OVERFLOW);
}
return strncat(dest, src, len);
} }

View File

@@ -44,7 +44,7 @@
extern "C" char *__strncpy_chk (char *dest, const char *src, extern "C" char *__strncpy_chk (char *dest, const char *src,
size_t len, size_t dest_len) size_t len, size_t dest_len)
{ {
if (__predict_false(len > dest_len)) { if (len > dest_len) {
__fortify_chk_fail("strncpy buffer overflow", __fortify_chk_fail("strncpy buffer overflow",
BIONIC_EVENT_STRNCPY_BUFFER_OVERFLOW); BIONIC_EVENT_STRNCPY_BUFFER_OVERFLOW);
} }

View File

@@ -42,7 +42,7 @@
* greater than 0. * greater than 0.
*/ */
extern "C" mode_t __umask_chk(mode_t mode) { extern "C" mode_t __umask_chk(mode_t mode) {
if (__predict_false((mode & 0777) != mode)) { if ((mode & 0777) != mode) {
__fortify_chk_fail("umask called with invalid mask", 0); __fortify_chk_fail("umask called with invalid mask", 0);
} }

View File

@@ -50,7 +50,7 @@ extern "C" int __vsnprintf_chk(
const char *format, const char *format,
va_list va) va_list va)
{ {
if (__predict_false(supplied_size > dest_len_from_compiler)) { if (supplied_size > dest_len_from_compiler) {
__fortify_chk_fail("vsnprintf buffer overflow", 0); __fortify_chk_fail("vsnprintf buffer overflow", 0);
} }

View File

@@ -27,56 +27,39 @@
*/ */
#include <elf.h> #include <elf.h>
#include <sys/auxv.h>
#include <sys/types.h> #include <sys/types.h>
#include <link.h> #include <link.h>
/* Dynamic binaries get this from the dynamic linker (system/linker), which
* we don't pull in for static bins. We also don't have a list of so's to
* iterate over, since there's really only a single monolithic blob of
* code/data.
*
* All we need to do is to find where the executable is in memory, and grab the
* phdr and phnum from there.
*/
/* ld provides this to us in the default link script */ /* ld provides this to us in the default link script */
extern void* __executable_start; extern void *__executable_start;
int dl_iterate_phdr(int (*cb)(struct dl_phdr_info* info, size_t size, void* data), void* data) { int
Elf32_Ehdr* ehdr = (Elf32_Ehdr*) &__executable_start; dl_iterate_phdr(int (*cb)(struct dl_phdr_info *info, size_t size, void *data),
void *data)
{
struct dl_phdr_info dl_info;
Elf32_Ehdr *ehdr = (Elf32_Ehdr *) &__executable_start;
Elf32_Phdr *phdr = (Elf32_Phdr *)((unsigned long)ehdr + ehdr->e_phoff);
// TODO: again, copied from linker.c. Find a better home for this later. /* TODO: again, copied from linker.c. Find a better home for this
* later. */
if (ehdr->e_ident[EI_MAG0] != ELFMAG0) return -1; if (ehdr->e_ident[EI_MAG0] != ELFMAG0) return -1;
if (ehdr->e_ident[EI_MAG1] != ELFMAG1) return -1; if (ehdr->e_ident[EI_MAG1] != ELFMAG1) return -1;
if (ehdr->e_ident[EI_MAG2] != ELFMAG2) return -1; if (ehdr->e_ident[EI_MAG2] != ELFMAG2) return -1;
if (ehdr->e_ident[EI_MAG3] != ELFMAG3) return -1; if (ehdr->e_ident[EI_MAG3] != ELFMAG3) return -1;
// Dynamic binaries get their dl_iterate_phdr from the dynamic linker, but dl_info.dlpi_addr = 0;
// static binaries get this. We don't have a list of shared objects to dl_info.dlpi_name = NULL;
// iterate over, since there's really only a single monolithic blob of dl_info.dlpi_phdr = phdr;
// code/data, plus optionally a VDSO. dl_info.dlpi_phnum = ehdr->e_phnum;
return cb(&dl_info, sizeof (struct dl_phdr_info), data);
struct dl_phdr_info exe_info;
exe_info.dlpi_addr = 0;
exe_info.dlpi_name = NULL;
exe_info.dlpi_phdr = (Elf32_Phdr*) ((unsigned long) ehdr + ehdr->e_phoff);
exe_info.dlpi_phnum = ehdr->e_phnum;
#ifdef AT_SYSINFO_EHDR
// Try the executable first.
int rc = cb(&exe_info, sizeof(exe_info), data);
if (rc != 0) {
return rc;
}
// Try the VDSO if that didn't work.
Elf32_Ehdr* ehdr_vdso = (Elf32_Ehdr*) getauxval(AT_SYSINFO_EHDR);
struct dl_phdr_info vdso_info;
vdso_info.dlpi_addr = 0;
vdso_info.dlpi_name = NULL;
vdso_info.dlpi_phdr = (Elf32_Phdr*) ((char*) ehdr_vdso + ehdr_vdso->e_phoff);
vdso_info.dlpi_phnum = ehdr_vdso->e_phnum;
for (size_t i = 0; i < vdso_info.dlpi_phnum; ++i) {
if (vdso_info.dlpi_phdr[i].p_type == PT_LOAD) {
vdso_info.dlpi_addr = (Elf32_Addr) ehdr_vdso - vdso_info.dlpi_phdr[i].p_vaddr;
break;
}
}
return cb(&vdso_info, sizeof(vdso_info), data);
#else
// There's only the executable to try.
return cb(&exe_info, sizeof(exe_info), data);
#endif
} }

View File

@@ -28,17 +28,13 @@ static void __bionic_heap_usage_error(const char* function, void* address);
// Ugly inclusion of C file so that bionic specific #defines configure dlmalloc. // Ugly inclusion of C file so that bionic specific #defines configure dlmalloc.
#include "../upstream-dlmalloc/malloc.c" #include "../upstream-dlmalloc/malloc.c"
extern void (*__cleanup)();
static void __bionic_heap_corruption_error(const char* function) { static void __bionic_heap_corruption_error(const char* function) {
__cleanup = NULL; // The heap is corrupt. We can forget trying to shut down stdio. __libc_fatal("@@@ ABORTING: heap corruption detected by %s", function);
__libc_fatal("heap corruption detected by %s", function);
} }
static void __bionic_heap_usage_error(const char* function, void* address) { static void __bionic_heap_usage_error(const char* function, void* address) {
__libc_fatal_no_abort("invalid address or address of corrupt block %p passed to %s", __libc_fatal("@@@ ABORTING: invalid address or address of corrupt block %p passed to %s",
address, function); address, function);
// So that debuggerd gives us a memory dump around the specific address. // So that we can get a memory dump around the specific address.
// TODO: improve the debuggerd protocol so we can tell it to dump an address when we abort.
*((int**) 0xdeadbaad) = (int*) address; *((int**) 0xdeadbaad) = (int*) address;
} }

View File

@@ -27,7 +27,6 @@
#define LOCK_AT_FORK 1 #define LOCK_AT_FORK 1
#define USE_RECURSIVE_LOCK 0 #define USE_RECURSIVE_LOCK 0
#define USE_SPIN_LOCKS 0 #define USE_SPIN_LOCKS 0
#define DEFAULT_MMAP_THRESHOLD (64U * 1024U)
/* Include the proper definitions. */ /* Include the proper definitions. */
#include "../upstream-dlmalloc/malloc.h" #include "../upstream-dlmalloc/malloc.h"

View File

@@ -42,6 +42,7 @@
#include <unistd.h> #include <unistd.h>
static pthread_mutex_t gAbortMsgLock = PTHREAD_MUTEX_INITIALIZER; static pthread_mutex_t gAbortMsgLock = PTHREAD_MUTEX_INITIALIZER;
static pthread_mutex_t gLogInitializationLock = PTHREAD_MUTEX_INITIALIZER;
__LIBC_HIDDEN__ abort_msg_t** __abort_message_ptr; // Accessible to __libc_init_common. __LIBC_HIDDEN__ abort_msg_t** __abort_message_ptr; // Accessible to __libc_init_common.
@@ -347,7 +348,7 @@ static void out_vformat(Out& o, const char* format, va_list args) {
buffer[0] = '0'; buffer[0] = '0';
buffer[1] = 'x'; buffer[1] = 'x';
format_integer(buffer + 2, sizeof(buffer) - 2, value, 'x'); format_integer(buffer + 2, sizeof(buffer) - 2, value, 'x');
} else if (c == 'd' || c == 'i' || c == 'o' || c == 'u' || c == 'x' || c == 'X') { } else if (c == 'd' || c == 'i' || c == 'o' || c == 'x' || c == 'X') {
/* integers - first read value from stack */ /* integers - first read value from stack */
uint64_t value; uint64_t value;
int is_signed = (c == 'd' || c == 'i' || c == 'o'); int is_signed = (c == 'd' || c == 'i' || c == 'o');
@@ -420,9 +421,13 @@ int __libc_format_fd(int fd, const char* format, ...) {
} }
static int __libc_write_log(int priority, const char* tag, const char* msg) { static int __libc_write_log(int priority, const char* tag, const char* msg) {
int main_log_fd = TEMP_FAILURE_RETRY(open("/dev/log/main", O_CLOEXEC | O_WRONLY)); static int main_log_fd = -1;
if (main_log_fd == -1) { if (main_log_fd == -1) {
return -1; ScopedPthreadMutexLocker locker(&gLogInitializationLock);
main_log_fd = TEMP_FAILURE_RETRY(open("/dev/log/main", O_CLOEXEC | O_WRONLY));
if (main_log_fd == -1) {
return -1;
}
} }
iovec vec[3]; iovec vec[3];
@@ -433,9 +438,7 @@ static int __libc_write_log(int priority, const char* tag, const char* msg) {
vec[2].iov_base = const_cast<char*>(msg); vec[2].iov_base = const_cast<char*>(msg);
vec[2].iov_len = strlen(msg) + 1; vec[2].iov_len = strlen(msg) + 1;
int result = TEMP_FAILURE_RETRY(writev(main_log_fd, vec, 3)); return TEMP_FAILURE_RETRY(writev(main_log_fd, vec, 3));
close(main_log_fd);
return result;
} }
int __libc_format_log_va_list(int priority, const char* tag, const char* format, va_list args) { int __libc_format_log_va_list(int priority, const char* tag, const char* format, va_list args) {
@@ -462,13 +465,12 @@ static int __libc_android_log_event(int32_t tag, char type, const void* payload,
vec[2].iov_base = const_cast<void*>(payload); vec[2].iov_base = const_cast<void*>(payload);
vec[2].iov_len = len; vec[2].iov_len = len;
int event_log_fd = TEMP_FAILURE_RETRY(open("/dev/log/events", O_CLOEXEC | O_WRONLY)); static int event_log_fd = -1;
if (event_log_fd == -1) { if (event_log_fd == -1) {
return -1; ScopedPthreadMutexLocker locker(&gLogInitializationLock);
event_log_fd = TEMP_FAILURE_RETRY(open("/dev/log/events", O_CLOEXEC | O_WRONLY));
} }
int result = TEMP_FAILURE_RETRY(writev(event_log_fd, vec, 3)); return TEMP_FAILURE_RETRY(writev(event_log_fd, vec, 3));
close(event_log_fd);
return result;
} }
void __libc_android_log_event_int(int32_t tag, int value) { void __libc_android_log_event_int(int32_t tag, int value) {
@@ -486,10 +488,13 @@ void __fortify_chk_fail(const char *msg, uint32_t tag) {
__libc_fatal("FORTIFY_SOURCE: %s. Calling abort().", msg); __libc_fatal("FORTIFY_SOURCE: %s. Calling abort().", msg);
} }
static void __libc_fatal(const char* format, va_list args) { void __libc_fatal(const char* format, ...) {
char msg[1024]; char msg[1024];
BufferOutputStream os(msg, sizeof(msg)); BufferOutputStream os(msg, sizeof(msg));
va_list args;
va_start(args, format);
out_vformat(os, format, args); out_vformat(os, format, args);
va_end(args);
// TODO: log to stderr for the benefit of "adb shell" users. // TODO: log to stderr for the benefit of "adb shell" users.
@@ -497,20 +502,7 @@ static void __libc_fatal(const char* format, va_list args) {
__libc_write_log(ANDROID_LOG_FATAL, "libc", msg); __libc_write_log(ANDROID_LOG_FATAL, "libc", msg);
__libc_set_abort_message(msg); __libc_set_abort_message(msg);
}
void __libc_fatal_no_abort(const char* format, ...) {
va_list args;
va_start(args, format);
__libc_fatal(format, args);
va_end(args);
}
void __libc_fatal(const char* format, ...) {
va_list args;
va_start(args, format);
__libc_fatal(format, args);
va_end(args);
abort(); abort();
} }

View File

@@ -74,10 +74,6 @@ static void log_message(const char* format, ...) {
struct hdr_t { struct hdr_t {
uint32_t tag; uint32_t tag;
void* base; // Always points to the memory allocated using dlmalloc.
// For memory allocated in chk_memalign, this value will
// not be the same as the location of the start of this
// structure.
hdr_t* prev; hdr_t* prev;
hdr_t* next; hdr_t* next;
uintptr_t bt[MAX_BACKTRACE_DEPTH]; uintptr_t bt[MAX_BACKTRACE_DEPTH];
@@ -86,7 +82,7 @@ struct hdr_t {
int freed_bt_depth; int freed_bt_depth;
size_t size; size_t size;
char front_guard[FRONT_GUARD_LEN]; char front_guard[FRONT_GUARD_LEN];
} __attribute__((packed, aligned(MALLOC_ALIGNMENT))); } __attribute__((packed));
struct ftr_t { struct ftr_t {
char rear_guard[REAR_GUARD_LEN]; char rear_guard[REAR_GUARD_LEN];
@@ -104,26 +100,21 @@ static inline hdr_t* meta(void* user) {
return reinterpret_cast<hdr_t*>(user) - 1; return reinterpret_cast<hdr_t*>(user) - 1;
} }
static inline const hdr_t* const_meta(const void* user) {
return reinterpret_cast<const hdr_t*>(user) - 1;
}
static unsigned gAllocatedBlockCount; static unsigned gAllocatedBlockCount;
static hdr_t* tail; static hdr_t *tail;
static hdr_t* head; static hdr_t *head;
static pthread_mutex_t lock = PTHREAD_MUTEX_INITIALIZER; static pthread_mutex_t lock = PTHREAD_MUTEX_INITIALIZER;
static unsigned backlog_num; static unsigned backlog_num;
static hdr_t* backlog_tail; static hdr_t *backlog_tail;
static hdr_t* backlog_head; static hdr_t *backlog_head;
static pthread_mutex_t backlog_lock = PTHREAD_MUTEX_INITIALIZER; static pthread_mutex_t backlog_lock = PTHREAD_MUTEX_INITIALIZER;
static inline void init_front_guard(hdr_t* hdr) { static inline void init_front_guard(hdr_t *hdr) {
memset(hdr->front_guard, FRONT_GUARD, FRONT_GUARD_LEN); memset(hdr->front_guard, FRONT_GUARD, FRONT_GUARD_LEN);
} }
static inline bool is_front_guard_valid(hdr_t* hdr) { static inline bool is_front_guard_valid(hdr_t *hdr) {
for (size_t i = 0; i < FRONT_GUARD_LEN; i++) { for (size_t i = 0; i < FRONT_GUARD_LEN; i++) {
if (hdr->front_guard[i] != FRONT_GUARD) { if (hdr->front_guard[i] != FRONT_GUARD) {
return 0; return 0;
@@ -132,12 +123,12 @@ static inline bool is_front_guard_valid(hdr_t* hdr) {
return 1; return 1;
} }
static inline void init_rear_guard(hdr_t* hdr) { static inline void init_rear_guard(hdr_t *hdr) {
ftr_t* ftr = to_ftr(hdr); ftr_t* ftr = to_ftr(hdr);
memset(ftr->rear_guard, REAR_GUARD, REAR_GUARD_LEN); memset(ftr->rear_guard, REAR_GUARD, REAR_GUARD_LEN);
} }
static inline bool is_rear_guard_valid(hdr_t* hdr) { static inline bool is_rear_guard_valid(hdr_t *hdr) {
unsigned i; unsigned i;
int valid = 1; int valid = 1;
int first_mismatch = -1; int first_mismatch = -1;
@@ -158,7 +149,7 @@ static inline bool is_rear_guard_valid(hdr_t* hdr) {
return valid; return valid;
} }
static inline void add_locked(hdr_t* hdr, hdr_t** tail, hdr_t** head) { static inline void add_locked(hdr_t *hdr, hdr_t **tail, hdr_t **head) {
hdr->prev = NULL; hdr->prev = NULL;
hdr->next = *head; hdr->next = *head;
if (*head) if (*head)
@@ -168,7 +159,7 @@ static inline void add_locked(hdr_t* hdr, hdr_t** tail, hdr_t** head) {
*head = hdr; *head = hdr;
} }
static inline int del_locked(hdr_t* hdr, hdr_t** tail, hdr_t** head) { static inline int del_locked(hdr_t *hdr, hdr_t **tail, hdr_t **head) {
if (hdr->prev) { if (hdr->prev) {
hdr->prev->next = hdr->next; hdr->prev->next = hdr->next;
} else { } else {
@@ -182,7 +173,7 @@ static inline int del_locked(hdr_t* hdr, hdr_t** tail, hdr_t** head) {
return 0; return 0;
} }
static inline void add(hdr_t* hdr, size_t size) { static inline void add(hdr_t *hdr, size_t size) {
ScopedPthreadMutexLocker locker(&lock); ScopedPthreadMutexLocker locker(&lock);
hdr->tag = ALLOCATION_TAG; hdr->tag = ALLOCATION_TAG;
hdr->size = size; hdr->size = size;
@@ -192,7 +183,7 @@ static inline void add(hdr_t* hdr, size_t size) {
add_locked(hdr, &tail, &head); add_locked(hdr, &tail, &head);
} }
static inline int del(hdr_t* hdr) { static inline int del(hdr_t *hdr) {
if (hdr->tag != ALLOCATION_TAG) { if (hdr->tag != ALLOCATION_TAG) {
return -1; return -1;
} }
@@ -203,13 +194,13 @@ static inline int del(hdr_t* hdr) {
return 0; return 0;
} }
static inline void poison(hdr_t* hdr) { static inline void poison(hdr_t *hdr) {
memset(user(hdr), FREE_POISON, hdr->size); memset(user(hdr), FREE_POISON, hdr->size);
} }
static int was_used_after_free(hdr_t* hdr) { static int was_used_after_free(hdr_t *hdr) {
unsigned i; unsigned i;
const char* data = reinterpret_cast<const char *>(user(hdr)); const char *data = (const char *)user(hdr);
for (i = 0; i < hdr->size; i++) for (i = 0; i < hdr->size; i++)
if (data[i] != FREE_POISON) if (data[i] != FREE_POISON)
return 1; return 1;
@@ -217,7 +208,7 @@ static int was_used_after_free(hdr_t* hdr) {
} }
/* returns 1 if valid, *safe == 1 if safe to dump stack */ /* returns 1 if valid, *safe == 1 if safe to dump stack */
static inline int check_guards(hdr_t* hdr, int* safe) { static inline int check_guards(hdr_t *hdr, int *safe) {
*safe = 1; *safe = 1;
if (!is_front_guard_valid(hdr)) { if (!is_front_guard_valid(hdr)) {
if (hdr->front_guard[0] == FRONT_GUARD) { if (hdr->front_guard[0] == FRONT_GUARD) {
@@ -242,7 +233,7 @@ static inline int check_guards(hdr_t* hdr, int* safe) {
} }
/* returns 1 if valid, *safe == 1 if safe to dump stack */ /* returns 1 if valid, *safe == 1 if safe to dump stack */
static inline int check_allocation_locked(hdr_t* hdr, int* safe) { static inline int check_allocation_locked(hdr_t *hdr, int *safe) {
int valid = 1; int valid = 1;
*safe = 1; *safe = 1;
@@ -279,9 +270,9 @@ static inline int check_allocation_locked(hdr_t* hdr, int* safe) {
return valid; return valid;
} }
static inline int del_and_check_locked(hdr_t* hdr, static inline int del_and_check_locked(hdr_t *hdr,
hdr_t** tail, hdr_t** head, unsigned* cnt, hdr_t **tail, hdr_t **head, unsigned *cnt,
int* safe) { int *safe) {
int valid = check_allocation_locked(hdr, safe); int valid = check_allocation_locked(hdr, safe);
if (safe) { if (safe) {
(*cnt)--; (*cnt)--;
@@ -290,7 +281,7 @@ static inline int del_and_check_locked(hdr_t* hdr,
return valid; return valid;
} }
static inline void del_from_backlog_locked(hdr_t* hdr) { static inline void del_from_backlog_locked(hdr_t *hdr) {
int safe; int safe;
del_and_check_locked(hdr, del_and_check_locked(hdr,
&backlog_tail, &backlog_head, &backlog_num, &backlog_tail, &backlog_head, &backlog_num,
@@ -298,17 +289,17 @@ static inline void del_from_backlog_locked(hdr_t* hdr) {
hdr->tag = 0; /* clear the tag */ hdr->tag = 0; /* clear the tag */
} }
static inline void del_from_backlog(hdr_t* hdr) { static inline void del_from_backlog(hdr_t *hdr) {
ScopedPthreadMutexLocker locker(&backlog_lock); ScopedPthreadMutexLocker locker(&backlog_lock);
del_from_backlog_locked(hdr); del_from_backlog_locked(hdr);
} }
static inline int del_leak(hdr_t* hdr, int* safe) { static inline int del_leak(hdr_t *hdr, int *safe) {
ScopedPthreadMutexLocker locker(&lock); ScopedPthreadMutexLocker locker(&lock);
return del_and_check_locked(hdr, &tail, &head, &gAllocatedBlockCount, safe); return del_and_check_locked(hdr, &tail, &head, &gAllocatedBlockCount, safe);
} }
static inline void add_to_backlog(hdr_t* hdr) { static inline void add_to_backlog(hdr_t *hdr) {
ScopedPthreadMutexLocker locker(&backlog_lock); ScopedPthreadMutexLocker locker(&backlog_lock);
hdr->tag = BACKLOG_TAG; hdr->tag = BACKLOG_TAG;
backlog_num++; backlog_num++;
@@ -316,9 +307,9 @@ static inline void add_to_backlog(hdr_t* hdr) {
poison(hdr); poison(hdr);
/* If we've exceeded the maximum backlog, clear it up */ /* If we've exceeded the maximum backlog, clear it up */
while (backlog_num > gMallocDebugBacklog) { while (backlog_num > gMallocDebugBacklog) {
hdr_t* gone = backlog_tail; hdr_t *gone = backlog_tail;
del_from_backlog_locked(gone); del_from_backlog_locked(gone);
dlfree(gone->base); dlfree(gone);
} }
} }
@@ -327,7 +318,6 @@ extern "C" void* chk_malloc(size_t size) {
hdr_t* hdr = static_cast<hdr_t*>(dlmalloc(sizeof(hdr_t) + size + sizeof(ftr_t))); hdr_t* hdr = static_cast<hdr_t*>(dlmalloc(sizeof(hdr_t) + size + sizeof(ftr_t)));
if (hdr) { if (hdr) {
hdr->base = hdr;
hdr->bt_depth = get_backtrace(hdr->bt, MAX_BACKTRACE_DEPTH); hdr->bt_depth = get_backtrace(hdr->bt, MAX_BACKTRACE_DEPTH);
add(hdr, size); add(hdr, size);
return user(hdr); return user(hdr);
@@ -335,44 +325,13 @@ extern "C" void* chk_malloc(size_t size) {
return NULL; return NULL;
} }
extern "C" void* chk_memalign(size_t alignment, size_t bytes) { extern "C" void* chk_memalign(size_t, size_t bytes) {
if (alignment <= MALLOC_ALIGNMENT) { // log_message("%s: %s\n", __FILE__, __FUNCTION__);
return chk_malloc(bytes); // XXX: it's better to use malloc, than being wrong
} return chk_malloc(bytes);
// Make the alignment a power of two.
if (alignment & (alignment-1)) {
alignment = 1L << (31 - __builtin_clz(alignment));
}
// here, alignment is at least MALLOC_ALIGNMENT<<1 bytes
// we will align by at least MALLOC_ALIGNMENT bytes
// and at most alignment-MALLOC_ALIGNMENT bytes
size_t size = (alignment-MALLOC_ALIGNMENT) + bytes;
if (size < bytes) { // Overflow.
return NULL;
}
void* base = dlmalloc(sizeof(hdr_t) + size + sizeof(ftr_t));
if (base != NULL) {
// Check that the actual pointer that will be returned is aligned
// properly.
uintptr_t ptr = reinterpret_cast<uintptr_t>(user(reinterpret_cast<hdr_t*>(base)));
if ((ptr % alignment) != 0) {
// Align the pointer.
ptr += ((-ptr) % alignment);
}
hdr_t* hdr = meta(reinterpret_cast<void*>(ptr));
hdr->base = base;
hdr->bt_depth = get_backtrace(hdr->bt, MAX_BACKTRACE_DEPTH);
add(hdr, bytes);
return user(hdr);
}
return base;
} }
extern "C" void chk_free(void* ptr) { extern "C" void chk_free(void *ptr) {
// log_message("%s: %s\n", __FILE__, __FUNCTION__); // log_message("%s: %s\n", __FILE__, __FUNCTION__);
if (!ptr) /* ignore free(NULL) */ if (!ptr) /* ignore free(NULL) */
@@ -407,7 +366,7 @@ extern "C" void chk_free(void* ptr) {
} }
} }
extern "C" void* chk_realloc(void* ptr, size_t size) { extern "C" void *chk_realloc(void *ptr, size_t size) {
// log_message("%s: %s\n", __FILE__, __FUNCTION__); // log_message("%s: %s\n", __FILE__, __FUNCTION__);
if (!ptr) { if (!ptr) {
@@ -455,23 +414,8 @@ extern "C" void* chk_realloc(void* ptr, size_t size) {
} }
} }
if (hdr->base != hdr) { hdr = static_cast<hdr_t*>(dlrealloc(hdr, sizeof(hdr_t) + size + sizeof(ftr_t)));
// An allocation from memalign, so create another allocation and
// copy the data out.
void* newMem = dlmalloc(sizeof(hdr_t) + size + sizeof(ftr_t));
if (newMem) {
memcpy(newMem, hdr, sizeof(hdr_t) + hdr->size);
dlfree(hdr->base);
hdr = static_cast<hdr_t*>(newMem);
} else {
dlfree(hdr->base);
hdr = NULL;
}
} else {
hdr = static_cast<hdr_t*>(dlrealloc(hdr, sizeof(hdr_t) + size + sizeof(ftr_t)));
}
if (hdr) { if (hdr) {
hdr->base = hdr;
hdr->bt_depth = get_backtrace(hdr->bt, MAX_BACKTRACE_DEPTH); hdr->bt_depth = get_backtrace(hdr->bt, MAX_BACKTRACE_DEPTH);
add(hdr, size); add(hdr, size);
return user(hdr); return user(hdr);
@@ -480,12 +424,11 @@ extern "C" void* chk_realloc(void* ptr, size_t size) {
return NULL; return NULL;
} }
extern "C" void* chk_calloc(int nmemb, size_t size) { extern "C" void *chk_calloc(int nmemb, size_t size) {
// log_message("%s: %s\n", __FILE__, __FUNCTION__); // log_message("%s: %s\n", __FILE__, __FUNCTION__);
size_t total_size = nmemb * size; size_t total_size = nmemb * size;
hdr_t* hdr = static_cast<hdr_t*>(dlcalloc(1, sizeof(hdr_t) + total_size + sizeof(ftr_t))); hdr_t* hdr = static_cast<hdr_t*>(dlcalloc(1, sizeof(hdr_t) + total_size + sizeof(ftr_t)));
if (hdr) { if (hdr) {
hdr->base = hdr;
hdr->bt_depth = get_backtrace(hdr->bt, MAX_BACKTRACE_DEPTH); hdr->bt_depth = get_backtrace(hdr->bt, MAX_BACKTRACE_DEPTH);
add(hdr, total_size); add(hdr, total_size);
return user(hdr); return user(hdr);
@@ -493,18 +436,6 @@ extern "C" void* chk_calloc(int nmemb, size_t size) {
return NULL; return NULL;
} }
extern "C" size_t chk_malloc_usable_size(const void* ptr) {
// dlmalloc_usable_size returns 0 for NULL and unknown blocks.
if (ptr == NULL)
return 0;
const hdr_t* hdr = const_meta(ptr);
// The sentinel tail is written just after the request block bytes
// so there is no extra room we can report here.
return hdr->size;
}
static void ReportMemoryLeaks() { static void ReportMemoryLeaks() {
// We only track leaks at level 10. // We only track leaks at level 10.
if (gMallocDebugLevel != 10) { if (gMallocDebugLevel != 10) {

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