Compare commits

...

377 Commits

Author SHA1 Message Date
Mike Lockwood
3f14ff34df DO NOT MERGE: Update USB accessory kernel header to include serial number support
Change-Id: I61d889b107bd5e052ebac393883b87dac730ea6a
Signed-off-by: Mike Lockwood <lockwood@android.com>
2011-03-14 19:16:28 -04:00
Mike Lockwood
6139fa33ab DO NOT MERGE: linux/usb/f_accessory.h: Update USB accessory kernel header
For bugs b/4079236, b/4073248 and b/4080288

Change-Id: Id9cdbe95d7dd892bf38e16e7da505ee0eae26b99
Signed-off-by: Mike Lockwood <lockwood@android.com>
2011-03-11 19:02:16 -05:00
Mike Lockwood
6bd73ed417 Add linux/usb/f_accessory.h header for USB accessory driver DO NOT MERGE
Change-Id: I972d28065ee7e77e93699512310fcd6d5742ed0d
Signed-off-by: Mike Lockwood <lockwood@android.com>
2011-02-21 12:35:22 -05:00
David Turner
2081fda69a Merge "Only look up A records if the system has IPv4." into gingerbread 2011-01-18 17:32:02 -08:00
Lorenzo Colitti
ba96e30fa0 Only look up A records if the system has IPv4.
getaddrinfo only asks DNS for IPv6 addresses if the system
has IPv6 connectivity, but always asks for IPv4 addresses.
Don't ask for IPv4 addresses if there is no IPv4
connectivity.

Change-Id: Iefe9fcb006fabe60b4b11dd4653a7c4a406506f4
2011-01-15 19:02:58 -08:00
Steinar H. Gunderson
2e23e29245 Backport (simple cherry-pick) d33019030c
to gingerbread.

Implement RFC3484 policy table changes from draft-ietf-6man-rfc3484-revise-01.

The changes in a nutshell:

 - Handle v4-mapped as different from v4-compat (this was probably
   an existing bug in our code).
 - Add policy entries for ULA, above most everything else.
 - Put v4-compat, old-style IPv6 site-local and 6bone addresses
   way down in the preference table.

The rest is just shuffling numbers around (no actual changes to
priority).
2011-01-14 21:41:18 +01:00
Steinar H. Gunderson
f4dca7be3b Backport (simple cherry-pick) 64b6c43379
to gingerbread.

Add a new #define IN6_IS_ADDR_ULA, for testing for Universal Local IPv6 Unicast addresses (ULAs). These replace the old site-local IPv6 addresses.
2011-01-14 21:40:57 +01:00
Steinar H. Gunderson
a798b9f0e1 Backport (simple cherry-pick) d1624add2b
to gingerbread.

Don't treat private IPv4 addresses as being in a non-global scope. The effect of this change is essentially to prefer NATed IPv4 over 6to4.
2011-01-14 21:40:34 +01:00
Nick Pelly
7bbd4580af Add pn544.h clean kernel header
Allows pn544 hardware reset

Change-Id: I6d6d22b16c228f03a70a14a4655a41005761b5d6
Signed-off-by: Nick Pelly <npelly@google.com>
2010-11-01 15:49:19 -05:00
David 'Digit' Turner
1df986c21e libc: fix executable destruction support.
This change allows an executable to call its destructor functions
(declared with __attribute__((destructor))) to be properly called
when it normally exits.

Note that this is different from calling the destructors of a shared
library when it is unloaded with dlclose() or through program exit,
which are already supported.

Bug: 3106500
Change-Id: I1412ef5407f13b613fc6cb6103e0a691dbee4b1a
2010-10-21 04:16:50 +02:00
David 'Digit' Turner
d3f0638aee libc: fix typo in waitid() declaration.
The implementation file uses the correct spelling.

Change-Id: I572e336f8695a9754267c8d2e0a67b1b69bacb06
2010-10-13 15:46:55 +02:00
David 'Digit' Turner
1aa6708cc2 Fix the build. Oops.
(We remove the declaration for on_exit() from the C library headers,
so do the same for the C++ <cstdlib>)

Change-Id: I31a21d5643068cd160724908dd8156863a44d95a
2010-10-11 15:27:39 +02:00
David 'Digit' Turner
b8d2233e8a Merge "libc: tag missing functions in system headers." into gingerbread 2010-10-11 06:01:52 -07:00
David 'Digit' Turner
bb5581ad6e libc: tag missing functions in system headers.
This matches recent changes in the NDK header.
We enclose missing functions in #if 0 .. #endif blocks
with a clear "MISSING" in comments in order to locate
them later.

Change-Id: I87b3a62e777897e75c9243360fb0a82bcc53d9fb
2010-10-09 17:56:55 +02:00
David 'Digit' Turner
5b81b91817 libc: optimize memmove() with memcpy() if possible.
Change-Id: I90e578fdc82e427caee8fa4157ce3f8c6c99926d
2010-10-07 11:03:32 +02:00
Marco Nelissen
af00228b70 Revert "libc: memmove(): non-overlapping block optim."
This reverts commit 80fba9a2fe,
which caused the system to not boot anymore, aborting with:
"java.lang.RuntimeException: Missing static main on com.android.server.SystemServer".

Change-Id: I745e0a23c728cccf5f95a3c7642d544478a4e57e
2010-09-28 10:24:20 -07:00
David 'Digit' Turner
defd162212 libc: add <sys/eventfd.h> and corresponding implementations.
Change-Id: Ide040884c456190226e580513099fdb8377e015b
2010-09-28 09:20:37 +02:00
David 'Digit' Turner
9973a56422 libc: Add missing waitid() implementation.
Change-Id: I312ee608dbf9249e4886a10d45d13e3cda8a9042
2010-09-28 09:18:26 +02:00
David 'Digit' Turner
a3ae60d343 libc: Add missing fdatasync() implementation
Change-Id: I04bb655d77e414021e1f2a973329167ad76ca1c4
2010-09-28 09:17:17 +02:00
David 'Digit' Turner
307aadb847 Merge "libc: Add missing C++ guards to <pathconf.h>" into gingerbread 2010-09-28 00:15:23 -07:00
David 'Digit' Turner
79260746db Merge "libc: memmove(): non-overlapping block optim." into gingerbread 2010-09-28 00:15:05 -07:00
David 'Digit' Turner
032a713549 Merge "libc: add missing O_CLOEXEC from <fcntl.h>" into gingerbread 2010-09-28 00:12:13 -07:00
David 'Digit' Turner
223ddfcfc4 Merge "libc: Add missing pipe2() declaration and implementation." into gingerbread 2010-09-28 00:12:08 -07:00
David 'Digit' Turner
9df22a5a5f Merge "libm: remove aliasing issue." into gingerbread 2010-09-28 00:11:58 -07:00
David 'Digit' Turner
ce2ebf8d73 libm: remove aliasing issue.
See http://code.google.com/p/android/issues/detail?id=6697
for details about this change.

Change-Id: I516f00c6f3bc99b22be51669e4573246bdd6e33d
2010-09-27 17:35:48 +02:00
David 'Digit' Turner
bd8d987b3c libc: remove C++ comments from public headers.
Change-Id: I4af84f912062cd2ff34711c25122fb323f20c032
2010-09-27 17:35:26 +02:00
David 'Digit' Turner
80fba9a2fe libc: memmove(): non-overlapping block optim.
Change-Id: I5652f4f97ca59d95176443fc27c737ef76258183
2010-09-27 17:34:41 +02:00
David 'Digit' Turner
00eea3f8a0 libc: add missing O_CLOEXEC from <fcntl.h>
Change-Id: Ie7ad57898e67800a9fe92bb52589d67ec30e1cd9
2010-09-27 17:33:40 +02:00
David 'Digit' Turner
275cd48511 libc: Add missing pipe2() declaration and implementation.
Change-Id: Iacb914bd6ac5adc60c5671e6fef680ede21f9b0c
2010-09-27 17:33:08 +02:00
David 'Digit' Turner
f33a7700a5 libc: Add missing C++ guards to <pathconf.h>
Change-Id: I94dad48678181d8b02431b1c1f5d507beafb5406
2010-09-27 17:27:14 +02:00
Wink Saville
b9e49ad56e Use a recursive lock for pthread_once. DO NOT MERGE.
Backport change I9fc8b790 from Master to Gingerbread

Change-Id: I5cf48fcd4efb7991ed82f87d9365c19655dc9b7f
2010-09-22 14:51:53 -07:00
Brian Swetland
fedbcde6ef add /vendor support
- add /vendor/lib to front of default library search path
- remove long-obsolete /lib from default library search path

Change-Id: I7d33bf899be018e7cc4c213d5790bbd991023a62
2010-09-19 03:39:13 -07:00
Kenny Root
cb99ab98c9 Add wmemcmp to Android.mk
Change-Id: I9dc96d72b2becdd31981b4d176a13358aef6dcb9
2010-09-10 12:20:58 -07:00
rich cannings
6e42398dd6 Merge "Fix return value." into gingerbread 2010-08-31 15:48:25 -07:00
rich cannings
e44cb1a35c Fix return value.
Return a valid pointer (not NULL) when the character "c" is at the end of "src".

Change-Id: Iab0b677943f2c8a9fbb255c44689f5d6dc3535d7
Example:
  memccpy(dest, "xzy", 'y', 3) should return dest+3 rather than null.
2010-08-31 15:19:38 -07:00
Jesse Wilson
cc6b182910 Merge "Make timezones available to the host build." into gingerbread 2010-08-31 14:01:13 -07:00
Jesse Wilson
e77d54d98a Make timezones available to the host build.
Change-Id: Ib2c89ac13b03f07c6c712a544bc0d5d1c9dc57df
2010-08-31 13:16:25 -07:00
David 'Digit' Turner
6a51defa03 Fix __get_tls() in static C library to use kernel helpers.
This is needed to fix gdbserver's handling of threaded programs,
among other things.

Change-Id: I823387c602cef9891532da946a01db14be780ab0
2010-08-27 08:19:19 -07:00
Brian Carlstrom
22f1e3d4fa Apply https://android-git.corp.google.com/g/60855 to dalvik-dev.
(We've been missing the zoneinfo.* files for the host dalvikvm. My fix for
gingerbread will have to wait for someone to return from vacation, but I can
commit here in advance, and I need to so that I can submit
https://android-git.corp.google.com/g/60790 which -- amongst other things --
makes lack of time zone data a hard failure, rather than just silently
pretending all time zones are UTC.)

Bug: 2870945

git cherry-pick --no-commit 18a859aff4

Change-Id: I66647e824c5fee9b8d2c63085e2a58e5910a5544
2010-08-18 00:33:52 -07:00
Dima Zavin
a716190241 linker: fix overwriting the real linker error string
Change-Id: Ia9165fd9aa1951b2bb81d0ac8f5bb3057aded8bd
Signed-off-by: Dima Zavin <dima@android.com>
2010-08-17 15:57:55 -07:00
Christopher Tate
52e7d3d91a Bulletproof leak dump against null hash entries
Previously, the malloc leak checking code would crash in qsort()
if null entries existed in its bookkeeping table.  This change
makes the comparison function detect null entries and sort them
to the end safely.

Change-Id: I88244a7df1e289dd9d7992ce29606d505bd63079
2010-08-09 13:43:46 -07:00
Dima Zavin
18c5bcc66a Revert "Set SA_RESTORER in sigaction()"
This reverts commit e4fa46e75c.
2010-07-29 19:12:04 -07:00
Wu-cheng Li
7ed132a1ae bionic: update processed kernel header msm_camera.h
Change-Id: If66422d538d0fb0c6ae8a7399c62911635d1fd13
2010-07-27 14:26:21 -07:00
Eric Fischer
cd7014fd06 Update time zone data to the new version 2010k.
Change-Id: If657e1783e3f96c52bfe613bad027482d8373c67
2010-07-26 15:53:24 -07:00
David 'Digit' Turner
6774809b62 linker: Support dlopen(NULL, ...) properly.
Change-Id: Icba37823cb350c34848cc466d144c3a0af87c94c
2010-07-23 12:16:15 -07:00
Wu-cheng Li
9d1f5afc34 bionic: update processed kernel header msm_camera.h
Change-Id: I25598b08e9cafe98a86cdb2e40481d9aedc8dcee
2010-07-19 09:03:18 -07:00
The Android Open Source Project
b97c44dc9e add meta-files about 3rd party projects
Change-Id: I399d7811a07f82a6819d3973681f8b35b655dbd1
2010-07-16 11:41:33 -07:00
David 'Digit' Turner
cb7e8c5ef3 libc: update alarm() implementation to return 0 on error.
This matches the GLibc behaviour, and allows alarm(0xFFFFFFFF) to return 0.

Change-Id: I419aa71b27d6bb2015d15ba6b6112bf62eadcbb8
2010-07-08 17:20:29 -07:00
David 'Digit' Turner
ab8b54101e libc: fix fstatfs() implementation.
The syscall expects the size of the buffer as the second argument.

Change-Id: I99ede2fec7fcd385ca03ff022c2cffa4297bea8d
2010-07-08 16:52:27 -07:00
David 'Digit' Turner
d466780c7c Add missing SMP barriers to libstdc++
Change-Id: I20a8dcd2e3316ac60237e800c682cacc8e59e187
2010-07-07 14:18:20 -07:00
David 'Digit' Turner
519763265e libc: Fix sem_post() implementation to wake up all waiting threads.
This also allows us to optimize the case where we increment an
uncontended semaphore (no need to call futex_wake() then).

Change-Id: Iad48efe8551dc66dc89d3e3f18c001e5a6c1939f
2010-07-02 15:09:57 -07:00
David 'Digit' Turner
a02b93bd75 libc: add sanity checks to pthread_mutex_destroy()
Change-Id: Iddb2204fa792fa9aca5f19838926dddbb09b74a2
2010-06-28 14:20:22 -07:00
David 'Digit' Turner
0621a279ad libstdc++: use extern "C++" in all our C++ system headers.
This is needed to build an independent toolchain with g++ that doesn't think
that all these headers are in C.

Change-Id: Ie9a8ccfcab7780d6a4e5722777d61c2b1b312001
2010-06-25 16:53:37 -07:00
Nick Pelly
fa5755ae98 Merge "Add clean headers for 7x30 video codec." into gingerbread 2010-06-23 17:56:38 -07:00
Nick Pelly
21baae3d71 Add clean headers for 7x30 video codec.
Change-Id: Id4faa5bacb03cc42377527e05c53c6392c776e7d
2010-06-23 16:17:58 -07:00
David 'Digit' Turner
50ace4fec5 Remove compiler warnings when building Bionic.
Also add missing declarations to misc. functions.
Fix clearerr() implementation (previous was broken).
Handle feature test macros like _POSIX_C_SOURCE properly.

Change-Id: Icdc973a6b9d550a166fc2545f727ea837fe800c4
2010-06-22 17:51:41 -07:00
David 'Digit' Turner
6a9b888d7c Allow static C++ destructors to be properly called on dlclose().
With this patch, _and_ an upcoming build/ patch, the destruction
of static C++ objects contained in shared libraries will happen
properly when dlclose() is called.

Note that this change introduces crtbegin_so.S and crtend_so.S which
are currently ignored by the build system.

+ move definition of __dso_handle to the right place
  (before that, all shared libraries used the __dso_handle
   global variable from the C library).

  Note that we keep a 'weak' __dso_handle in aeabi.c to avoid
  breaking the build until the next patch to build/core/combo/
  appears. We will be able to remove that later.

+ move bionic/aeabi.c to arch-arm/bionic/ (its proper location)

Change-Id: Ie771aa204e3acbdf02fd30ebd4150373a1398f39
NOTE: The NDK will need to be modified to enable this feature in
      the shared libraries that are generated through it.
2010-06-18 16:07:10 -07:00
David 'Digit' Turner
6a09cfd9f9 Merge "wchar.h: improve wchar_t support in Bionic" into kraken 2010-06-15 07:05:21 -07:00
David 'Digit' Turner
3527fd6f0d wchar.h: improve wchar_t support in Bionic
Change-Id: Iffd41046fd0933c66542abf7627a1569522dfcb2
2010-06-15 07:04:41 -07:00
David 'Digit' Turner
a24bc688c0 Merge "linker: remove libcutils dependency by re-implementing simpler socket_local_client." into kraken 2010-06-15 06:54:45 -07:00
David 'Digit' Turner
da3019b553 libc: add missing truncate() declaration
Change-Id: Icb3601bbc9365b75b05ff443a39192f9cd3cbfb7
2010-06-11 14:40:02 -07:00
David 'Digit' Turner
ecb6d41334 libc: Add missing <termio.h> header
Change-Id: Id4e020ed330b3eabf09324f9b6d44d3a0f336d87
2010-06-11 14:39:39 -07:00
David 'Digit' Turner
6c8a2f2a5b libc: remove cutils dependencies
We simply copy the stuff we need from cutils headers.

A future patch will change cutils to include the private <bionic_atomic_inline.h>

Change-Id: Ib6fd9a03bc9e337ce867bd606dc94c2b4438480a
2010-06-11 13:49:09 -07:00
David 'Digit' Turner
8bff9a31aa linker: remove libcutils dependency by re-implementing simpler socket_local_client.
Change-Id: I87f29fd59454d713b9ddfb13e6cf114822f52efd
2010-06-10 22:58:22 -07:00
David 'Digit' Turner
038fbae518 sysconf(): Fix line parser for /proc files.
Change-Id: I2678010ee95933de19c8a8e3b2fe65ceb9b86400
2010-06-09 18:15:57 -07:00
Bruce Beare
9205fdf8c6 Add missing termios defns to bring on par with ARM - DO NOT MERGE
Change-Id: I6e16e7ab117b6df07ef24f092de1511fe1e9e7b1
2010-06-09 15:52:28 -07:00
David 'Digit' Turner
2beac0f5c6 DO NOT MERGE - add sincos.c to libm compilation
For some reason, a previous backport from master didn't get this.

Change-Id: I59eb96ad9de495a659808fdfb557033476c3d123
2010-06-09 15:49:35 -07:00
David 'Digit' Turner
20783c1428 Update libthread_db for gdb-7.0 - DO NOT MERGE
Change-Id: Id02b29314109ad1bf6de3388f856af6da3f90d33
2010-06-09 14:43:39 -07:00
David 'Digit' Turner
410b2ae7fb Add sincosl() function to bionic. So that sincos optimization can - DO NOT MERGE
be enabled.

Change-Id: I672cb319689aa4fb3f1f7cd868dda76842bebae9
2010-06-09 14:35:29 -07:00
Jing Yu
506b13d910 Remove a gcc-4.5 compilation warning:
bionic/libc/include/../include/stdlib.h: In function 'int grantpt(int)':
bionic/libc/include/../include/stdlib.h:138:23: warning: parameter '__fd' set but not used [-Wunused-but-set-parameter]

By adding __attribute((unused)) to __fd, the warning is gone, and this
attribute is compatible with gcc-4.4.0, gcc-4.3.1 gcc-4.2.1.
There is no any side effect.

Change-Id: I385f0f4da1013ffd1499e391eac9123aafe1f7a5
2010-06-09 13:24:22 -07:00
David 'Digit' Turner
b8e6c50cfa Fix setjmp()/longjmp() to save FP registers on ARMv7. - DO NOT MERGE
Change-Id: I3a0c2c05e295ac05ed51a531dabda668be204ca0
2010-06-09 13:18:29 -07:00
David 'Digit' Turner
aa4b1d0429 Add missing sysinfo() implementation (already declared in <sys/sysinfo.h>) - DO NOT MERGE
Change-Id: Iac4eb5911ffe4a7ab72b84df44e907685ac816af
2010-06-09 13:12:15 -07:00
David 'Digit' Turner
6304d8b218 Use private futexes for semaphores, unless they are initialized with pshared != 0.
Change-Id: I534e36a7171cd37037ae03b910ba71ea6968286d
Note: previously, sem_init() would return an error if pshared != 0.
2010-06-08 17:04:49 -07:00
Jean-Baptiste Queru
a8a2148863 resolved conflicts for merge of 7b6e6fa5 to kraken
Change-Id: I2b9b80a7fa32c56be2b85ff8be0d6e7ac1848afe
2010-06-03 15:05:04 -07:00
The Android Open Source Project
7b6e6fa572 merge from open-source master
Change-Id: Ib7fc9c6f79f9b13e2175da137005d8968ea85eaf
2010-06-03 14:39:20 -07:00
David Turner
f982f03832 Merge "pthread: introduce pthread_setname_np() as a mean to give names to threads" 2010-06-03 13:11:52 -07:00
Andy McFadden
fcd00ebbdf Atomic/SMP update, part 3.
Update ARM atomic ops to use LDREX/STREX.  Stripped out #if 0 chunk.

Insert explicit memory barriers in pthread and semaphore code.

For bug 2721865.

Change-Id: I0f153b797753a655702d8be41679273d1d5d6ae7
2010-05-28 16:12:01 -07:00
Andy McFadden
4fdbadde92 Atomic/SMP update.
Added an underscore to _ARM_HAVE_LDREX_STREX to make it match the others.

Added __ARM_HAVE_DMB and __ARM_HAVE_LDREXD when appropriate.

Fixed some typos.

Change-Id: I2f55febcff4aeb7de572a514fb2cd2f820dca27c
2010-05-20 15:59:32 -07:00
André Goddard Rosa
78c1c04ced pthread: introduce pthread_setname_np() as a mean to give names to threads
... so that each cloned process at the kernel level can be named
independently. Tools like 'top' can display the CPU/memory statistics
for each process's thread if "Show Threads" mode is on.

With this function in place, we can convert dalvik/Thread.c setThreadName()
function over this function. This feature ought to be provided by the
underlying C library and not coded directly in Dalvik.

Change-Id: Ifa997665dbaa114e0b126f8c667708be9a4137fd
Signed-off-by: André Goddard Rosa <andre.goddard@gmail.com>
2010-05-19 23:17:16 -03:00
David 'Digit' Turner
8a1d2cf142 Add pthread_rwlock_t implementation to the C library (DO NOT MERGE)
Change-Id: I756d8c26afc37cd7b71117ddbaa02a2cb40fdecb
2010-05-19 14:53:18 -07:00
The Android Open Source Project
8e1ee7fd01 merge from open-source master
Change-Id: I5804d8850f2d4fb7b5d5c53d51e153f7ced9646e
2010-05-17 10:22:35 -07:00
André Goddard Rosa
a910abcd19 improve readability of stdio: fix indentation and remove trailing spaces
Change-Id: Ic51e58a7c75d20bf770dc0ebd7f97a338fbe0036
Signed-off-by: André Goddard Rosa <andre.goddard@gmail.com>
2010-05-17 09:34:13 -07:00
The Android Open Source Project
fdf2454db2 merge from open-source master
Change-Id: I9c926a3cd680a96ece026cdec71c6e0fb0b7ad7c
2010-05-14 13:30:10 -07:00
David Turner
1297428e89 Merge "Add declaration for sys_signame[] forgotten in change 12489" 2010-05-14 12:12:24 -07:00
The Android Open Source Project
4aef0ae660 merge from open-source master
Change-Id: I2be62bce462ee53fe9519f433523bd7a44a73d40
2010-05-13 14:31:02 -07:00
Matt Fischer
e4fa46e75c Set SA_RESTORER in sigaction()
GDB looks for specific opcode sequences when trying to recognize a stack
frame as a signal trampoline.  The sequences it looks for happen to be those
created when SA_RESTORER is set, since glibc always sets a restorer.  This
patch does the same here, so that the trampolines can be correctly identified.

Change-Id: I0ac574a68818cb24d939c3527f3aaeb04b853d04
2010-05-12 14:18:36 -05:00
Jean-Baptiste Queru
f439445830 fix build
Change-Id: I243c98e20a250e0d40d481f16af481ff070219fd
2010-05-12 10:05:59 -07:00
The Android Open Source Project
bb7928ccda merge from open-source master
Change-Id: Iecfd2bd3069f70bbe508042cc249fcf7ff24800d
2010-05-12 09:22:50 -07:00
Jean-Baptiste Queru
c3581dc78a Merge "Sometimes the compiler is very right! Found bug in bessel routines for float." 2010-05-11 10:43:56 -07:00
David Turner
7911e057a5 Merge "Reduce compiler anxiety." 2010-05-11 10:20:15 -07:00
David Turner
16b59c4c38 Merge "Added support for LD_PRELOAD" 2010-05-11 10:17:00 -07:00
David Turner
6ba5efd59a Merge "stdio: simplify __fremovelock()" 2010-05-10 16:04:02 -07:00
Jean-Baptiste Queru
161232820c Merge "Reversed order of const and static to hush warning from compiler." 2010-05-10 16:00:22 -07:00
André Goddard Rosa
051ea9bc07 stdio: simplify __fremovelock()
... by removing extraneous NULL check, as free() already does it.

Signed-off-by: André Goddard Rosa <andre.goddard@gmail.com>
Change-Id: I0445f35c7ad0a049a0e4aee1fbe002ed2f13b94b
2010-05-10 15:42:47 -07:00
Matt Fischer
4fd42c1dc0 Added support for LD_PRELOAD
The LD_PRELOAD environment variable allows the user to specify a list of
libraries which should be unconditionally loaded before any others.  This
makes possible some useful tricks, such as library interposers.

Change-Id: I433d775ab08ef63a5fbe7b21f87a5642954fc32f
2010-05-10 15:09:19 -07:00
David Turner
d791da7943 Merge "string: tidy up strndup()" 2010-05-10 14:52:02 -07:00
Scott Turner
c1f8dd9f0b Sometimes the compiler is very right! Found bug in bessel routines for float.
Original compiler error:

target arm C: libm <= bionic/libm/src/e_j0f.c
bionic/libm/src/e_j0f.c: In function 'j0f':
bionic/libm/src/e_j0f.c:66: warning: comparison between signed and unsigned integer expressions
bionic/libm/src/e_j0f.c: In function 'y0f':
bionic/libm/src/e_j0f.c:140: warning: comparison between signed and unsigned integer expressions
target arm C: libm <= bionic/libm/src/e_j1.c

It's subtle but ix is masked with 0x7f000000 so it can never ever have a value
greater than 0x80000000. So I switched to using the unmasked hx and added a
cast as a reward to the compiler for being right.

I checked the original routines that e_j0f.c was ported from (in e_j0.c) and
the double's don't use 0x80000000 so this issue didn't exist there.

Let that be a warning to those that just slap on casts to shut up the compiler,
sometimes it's sniffed out a bug for you. :-)

Similar fixes in the other functions.

Change-Id: I7a776e5d4721fc3a9e3bd89179b67e9af3a2ebfa
2010-05-07 15:02:36 -07:00
The Android Open Source Project
f450fa5f99 merge from open-source master
Change-Id: If02d33af51017dbd85e91c79ac2e848eda6cf253
2010-05-03 15:33:05 -07:00
David Turner
0be7eda75a Merge "Fix log channel initialization at bionic/logd_write.c." 2010-05-01 15:31:39 -07:00
Jean-Baptiste Queru
716e06071a Merge "added headers for SuperH which automatically generate by update_all.py" 2010-04-29 08:01:50 -07:00
Yi Sun
3472348067 linker: fix the undefined weak symbols issue
I'm not sure if this is a correct fix or not.
Also need to find out why 1.6 does not have this issue.

Change-Id: If46c844834bda1e2cbf084a1a45a1832119b3ae3
2010-04-29 07:50:04 -07:00
André Goddard Rosa
5751c54bf1 bionic: add missing NULL check from memory allocation on record_backtrace()
Signed-off-by: André Goddard Rosa <andre.goddard@gmail.com>

Change-Id: I739c63c5a7344fff1775580044dc647edf246ebf
2010-04-29 07:37:42 -07:00
André Goddard Rosa
c8a850bcd1 stdio: simplify vasprintf()
... by removing unneeded NULL check, as free() already does it.
By the way, we don't need to set a stack variable back to NULL.

Signed-off-by: André Goddard Rosa <andre.goddard@gmail.com>

Change-Id: Id90eb8f042b5c922c5ff139b11ff8366fb404566
2010-04-29 07:33:40 -07:00
André Goddard Rosa
6aed4288eb stdio: simplify asprintf()
... by removing unneeded NULL check, as free() already does it.
By the way, we don't need to set a stack variable back to NULL.

Signed-off-by: André Goddard Rosa <andre.goddard@gmail.com>

Change-Id: Id1f72e872f73366dddcea4abc75885a3d9a318c6
2010-04-29 07:31:44 -07:00
André Goddard Rosa
e734769276 improve readability of stdlib: fix indentation and remove trailing spaces
Signed-off-by: André Goddard Rosa <andre.goddard@gmail.com>

Change-Id: I7dd90a0816b5376ffc1de4499d56935e0bd574a1
2010-04-29 07:29:06 -07:00
The Android Open Source Project
5ef5272be9 merge from open-source master
Change-Id: I518bb4ae9d7269957365561d4d609f22cde519db
2010-04-21 09:10:08 -07:00
The Android Open Source Project
95faecefde merge from open-source master
Change-Id: If77618a329fc7b497c44c2585e644bc50e7e1406
2010-04-08 11:11:53 -07:00
Matt Fischer
1698d9ebfc Fixed support for RTLD_NEXT in dlsym()
The previous implementation of this flag was broken--it behaved identically
to RTLD_DEFAULT.  This adds a proper implementation, which examines the address
of the calling function, and uses it to determine which library to use to begin
the symbol search process.

Change-Id: I2ad2b46363f68932af63a3828a22f9c7987eea67
2010-04-08 10:14:47 -05:00
San Mehat
f1cd18bdec am 91638721: kernel_headers: Update rtnetlink/pkt_sched headers for 2.6.32
Merge commit '9163872132a3e92f986b1d684badb1dd4482ad8e' into froyo-plus-aosp

* commit '9163872132a3e92f986b1d684badb1dd4482ad8e':
  kernel_headers: Update rtnetlink/pkt_sched headers for 2.6.32
2010-04-06 22:02:48 -07:00
San Mehat
9163872132 kernel_headers: Update rtnetlink/pkt_sched headers for 2.6.32
For: For http://b/issue?id=2576057

Change-Id: I553ca14974aaec4434e384979e0bb7007dcf6033
Signed-off-by: San Mehat <san@google.com>
2010-04-06 18:54:22 -07:00
Thorsten Glaser
81569aa72c Add declaration for sys_signame[] forgotten in change 12489 2010-04-05 21:08:30 +02:00
The Android Open Source Project
1d168621a5 merge from open-source master
Change-Id: I950e9aca87cbb0c35099b1d53cff6378bd0f26f4
2010-03-31 14:24:25 -07:00
The Android Open Source Project
d046725133 merge from open-source master
Change-Id: I483fedf77d978b1c6e52d73eebc14f011bb9f809
2010-03-31 14:19:51 -07:00
The Android Open Source Project
5ffedb22c8 merge from open-source master
Change-Id: I076e0df8656fdf58c229cc9a168cd6d8e16b6d8e
2010-03-31 14:15:30 -07:00
André Goddard Rosa
350bb359fa bionic: fix memory leak in get_malloc_leak_info() error path
Signed-off-by: André Goddard Rosa <andre.goddard@gmail.com>
2010-03-29 21:21:26 -03:00
David Turner
f8916e2e45 Merge "bionic: clear only the part of the buffer which is not overwritten afterward" 2010-03-30 14:52:14 -07:00
David Turner
4ad72f89b1 Merge "linker: fix the undefined weak symbols issue" 2010-03-29 15:49:42 -07:00
Min-su, Kim
3cab22c8cf linker: fix the undefined weak symbols issue 2010-03-29 15:43:09 -07:00
David Turner
8ab5b02b5f Merge changes Ibdc6e3c8,I9bcb91a2
* changes:
  Correct generic memset implementation
  Generic memcpy should define MEMCOPY before including bcopy.c
2010-03-29 15:05:47 -07:00
David Turner
87ae0da817 Merge "Atom optimized string and memory routines" 2010-03-29 14:40:05 -07:00
The Android Open Source Project
62ac0dc457 merge from open-source master
Change-Id: I96d2cd063f084fd17116bf7ee08fa7109a3c1ceb
2010-03-29 11:01:59 -07:00
André Goddard Rosa
3f61212781 bionic: clear only the part of the buffer which is not overwritten afterward
Change-Id: I5ddd93f0557e5a7401460dc9fc8a55b330a79c3a
Signed-off-by: André Goddard Rosa <andre.goddard@gmail.com>
2010-03-28 21:32:36 -03:00
André Goddard Rosa
acdb052030 stdlib: optimize bsearch()
... by checking most probable condition first (elements do differ)

Change-Id: I424eab9c32a6d9eb82b686ca04025ec8c9097035
Signed-off-by: André Goddard Rosa <andre.goddard@gmail.com>
2010-03-28 21:18:56 -03:00
Bruce Beare
8ff1a2759a Atom optimized string and memory routines
Change-Id: I27b68bb28551c75c9ac84bb9730e2cd8254d8991
2010-03-26 10:54:07 -07:00
Bruce Beare
58f0326362 Android hack for size_t
Change-Id: I3c967fca60f542459dc17be84da47b3b6a26242b
2010-03-26 09:36:01 -07:00
Kenny Root
7e0bfb511e Fix comparison of IPv6 prefixes
Typo assigned prefixlen1 twice instead of to the two different variables
for comparison and difference computation.

Change-Id: I6631b8269ca6aae264c8d7d414127b756838df96
2010-03-24 18:07:26 -07:00
Dima Zavin
4e383b81d0 libc: kernel: update msm_kgsl.h
Change-Id: I8cd5a186071892bdc2b2b29061dd6c1fd927c0f5
Signed-off-by: Dima Zavin <dima@android.com>
2010-03-24 14:13:10 -07:00
David 'Digit' Turner
5207d78c32 Fix typo that broke recursive mutexes implementation.
Change-Id: I832901604b487c6a50304c311b5ba135e153530d
2010-03-23 05:30:55 -07:00
David 'Digit' Turner
b5e4a41606 pthread: Use private futexes by default in condition variables
Now that the system properly uses shared condvars when needed, we
can enable the use of private futexes for them too.

Change-Id: Icf8351fc0a2309f764cba45c65bc3af047720cdf
2010-03-22 17:31:50 -07:00
The Android Open Source Project
377d4c979d merge from open-source master
Change-Id: I70266ee8c520b216773f267e46c8273d2334c31d
2010-03-22 15:55:09 -07:00
David 'Digit' Turner
709a898de8 Merge "Fix strtod security bug." 2010-03-22 15:45:32 -07:00
David 'Digit' Turner
88f06cd84a Use private futexes for pthread_mutex_t.
This does not change the implementation of conditional variables
since we're waiting for other system components to properly use
pthread_condattr_init/setpshared before that.

Also remove an obsolete x86 source file.

Change-Id: Ia3e3fbac35b87a534fb04d4381c3c66b975bc8f7
2010-03-18 17:13:41 -07:00
David Turner
1825fb5d5f Merge "bionic: on pthread_join(), avoid extra check in case we find the thread" 2010-03-18 16:42:49 -07:00
David Turner
c0e464268d Merge "bionic: ftell() returns a long, not an int" 2010-03-18 16:35:42 -07:00
David 'Digit' Turner
ee7b077abf Add pthread_condattr_init/destroy/setpshared/getpshared
Note that this does not change the implementation of conditional variables
which still use shared futexes, independent on the flags being selected.

This will be fixed in a later patch, once our system is modified to use
pthread_condattr_setpshared(attr, PTHREAD_PROCESS_SHARED) properly.

Change-Id: I935de50964cd41f97a13dbfd6626d3407b0406c3
2010-03-18 14:07:42 -07:00
Matt Fischer
e2a8b1fd19 Added support for dladdr()
dladdr() is a GNU extension function, which allows the caller to retrieve
symbol information for a specified memory address.  It is useful for things
like generating backtrace information at runtime.

Change-Id: I3a1def1a6c9c666d93e1e97b7d260dfa5b9b79a9
2010-03-17 16:11:37 -05:00
David Turner
ede2e75f49 Merge "x86 syscall system call implementation" 2010-03-17 14:07:27 -07:00
David Turner
b0ae864dff Merge "Fix pread()/pwrite() stubs" 2010-03-17 14:00:20 -07:00
David 'Digit' Turner
40e6b82286 Fix indentation in pthread mutex implementation.
This is preliminary work to simplify later changes to support
private futexes.

Change-Id: I06750936a93747a5e3f5a10228cbdc29e39c528c
2010-03-17 11:25:46 -07:00
David Turner
a9c41a8e0a Merge "bionic: remove unneeded variable from chk_realloc()" 2010-03-16 17:26:44 -07:00
David Turner
3f192f55f0 Merge "bionic: equalize the <unknown> program name between ssp.c and libc_init_common.c" 2010-03-16 17:25:53 -07:00
David Turner
dd8f3c80f1 Merge "improve readability of string: fix indentation and remove trailing spaces" 2010-03-16 17:25:04 -07:00
David Turner
5586838bab Merge "optimize delete/delete[] operators by removing unneeded branch" 2010-03-16 17:21:52 -07:00
Fabrice Di Meglio
8641833b62 Revert "bionic: pthread: use private futexes by default for mutexes and condvars"
This reverts commit ba9c6f0989.
2010-03-11 14:47:47 -08:00
David 'Digit' Turner
ba9c6f0989 bionic: pthread: use private futexes by default for mutexes and condvars
Private futexes are a recent kernel addition: faster futexes that cannot be
shared between processes. This patch uses them by default, unless the PROCESS_SHARED
attribute flag is used when creating a mutex and/or conditional variable.

Also introduces pthread_condattr_init/destroy/setpshared/getpshared.

Change-Id: I3a0e2116f467072b046524cb5babc00e41057a53
2010-03-11 11:48:38 -08:00
Colin Cross
1cfbda826c Merge "Only use NEON memcpy if __ARM_NEON__ is defined" 2010-03-10 18:14:25 -08:00
Colin Cross
ecede40222 Only use NEON memcpy if __ARM_NEON__ is defined
Change-Id: I32e6b9385d46efeec15dee8e395a82eef24ba3ea
2010-03-09 16:23:51 -08:00
David 'Digit' Turner
8132626b71 Fix strtod security bug.
To avoid introducing NULL checks everytime a Bigint computation
is performed, introduce a special value (BIGINT_INVALID) and only
check for it when absolutely needed (which means when the code
needs to access the Bigint's internal structure fields).

Change-Id: Ie3954523b0985b6a8cb62340802d8dcf63cbf16f
2010-03-09 15:27:50 -08:00
David 'Digit' Turner
92e712f60d Merge "Fix spurious DNS lookups in the C library." 2010-03-09 11:13:35 -08:00
Jean-Baptiste Queru
55cd975f34 Add an empty CleanSpec.mk
Change-Id: Id233ea6f854253776f57e64196e262c5a057e654
2010-03-08 18:04:02 -08:00
David 'Digit' Turner
d378c68d74 Fix spurious DNS lookups in the C library.
The problem was that the 'defdname' field of res_state structure
was not properly initialized in __res_vinit(). This field is used
to store the default domain name, which is normally build from
calling gethostname() (see line 549 of res_init.c).

Unfortunately, in the typical Android case, gethostname() returns
an error (the hostname is configured) and a random stack string is
used later to build the DNS search list (see lines 556+ in res_init.c)

For the sake of illustration, let's say the search list is set to
a random value like 'xWLK'.

The end result is that when trying to result an unknown domain name
(e.g. 'www.ptn'), the query fails then the resolver tries to make a
new query with the DNS search list path(s) appended (e.g. 'www.ptn.xWLK').

The patch simply initializes 'defdname' to an empty string to avoid
this when the net.dns.search system property is not set.

Also contains whitespace/formatting fixes
2010-03-08 15:22:13 -08:00
David 'Digit' Turner
d7ed1ae982 Fix timezone management in the C library
Define 'timezone' and 'daylight' global variables that are already
defined in <time.h>

Properly update the 'tm_gmtoff' field in 'struct tm' values.
2010-03-05 14:17:35 -08:00
Bruce Beare
3c543e1da9 x86 syscall system call implementation 2010-03-04 10:29:38 -08:00
Gloria Wang
cb58a8221c Merge "QUalcomm H.264 encoder support." 2010-03-03 18:02:33 -08:00
Gloria Wang
f199d2d503 QUalcomm H.264 encoder support. 2010-03-03 17:16:48 -08:00
Dan Bornstein
2e5491b8f2 am 71fbeecd: (-s ours) am fd5b1bb8: Add stdlib functions mbstowcs() and wcstombs(). DO NOT MERGE.
Merge commit '71fbeecdbd7bcf2282e4b032ceb2f6ead13dc9cb'

* commit '71fbeecdbd7bcf2282e4b032ceb2f6ead13dc9cb':
  Add stdlib functions mbstowcs() and wcstombs(). DO NOT MERGE.
2010-03-03 11:07:09 -08:00
Dan Bornstein
71fbeecdbd am fd5b1bb8: Add stdlib functions mbstowcs() and wcstombs(). DO NOT MERGE.
Merge commit 'fd5b1bb85d0a971fd8469112a157380c4d3a146f' into eclair-mr2-plus-aosp

* commit 'fd5b1bb85d0a971fd8469112a157380c4d3a146f':
  Add stdlib functions mbstowcs() and wcstombs(). DO NOT MERGE.
2010-03-03 10:51:34 -08:00
Dan Bornstein
fd5b1bb85d Add stdlib functions mbstowcs() and wcstombs(). DO NOT MERGE.
As with the other wchar functions in Bionic, these are really
minimally functional stubs.
2010-03-03 10:25:29 -08:00
Mike Chan
9f6915631b bonic: libc: cpuacct support for setuid functions
Any of the setuid functions now updates /acct/uid/ with its own tid
before changing users. This is so we can properly account for cpu time
per uid.

Change-Id: I34186cf4d5228cac8439e582a9e26c01ef3011e4
Signed-off-by: Mike Chan <mike@android.com>
2010-03-02 18:18:04 -08:00
Dima Zavin
bd9a90c443 libc: kernel: update pmem header with cache flush ioctl
Change-Id: Ied08844035d4526175dcdcb7f219f9f90c4679d2
Signed-off-by: Dima Zavin <dima@android.com>
2010-03-02 16:10:34 -08:00
Andrei Popescu
eb9d5ed347 add sigaltstack syscall 2010-03-02 11:43:24 +00:00
David 'Digit' Turner
8f8b5310d2 Fix pthread_sigmask() to return correct error values.
Before that, it returned -1 on error and set errno (not Posix)
After the patch, it returns the error code and leaves errno untouched.
2010-03-01 11:30:40 -08:00
David Turner
1f6f493963 Merge "Implement support for RFC 3484 (address selection/sorting) in bionic. (The Java changes required not to mess up the ordering from bionic will arrive in a later commit.) In particular, this will give us more correct behavior when on a 6to4 network, in that IPv4 will usually be preferred over 6to4." 2010-02-24 10:04:09 -08:00
Steinar H. Gunderson
9ab75d4cc8 Implement support for RFC 3484 (address selection/sorting) in bionic. (The
Java changes required not to mess up the ordering from bionic will arrive in a
later commit.) In particular, this will give us more correct behavior when on a
6to4 network, in that IPv4 will usually be preferred over 6to4.

Most of RFC 3484 is implemented -- what's not is rule 3 (avoid deprecated
addresses), 4 (prefer home addresses) and 7 (prefer native transport) as they
require low-level access to the kernel routing table via netlink. (glibc also
started out this way, and these rules are primarily useful in pretty obscure
circumstances, so we should be fine for the time being.)

Also, rule 9 (use longest matching prefix) has been modified so it does not try
to sort IPv4 addresses; given current IPv4 addressing practice these rules are
pretty much meaningless. Finally, I've added support for Teredo as a separate
label, with slightly lower preference than 6to4. (Vista puts the preference
below IPv4 by default. glibc puts the preference together with non-tunneled
IPv6.)

Note that this patch removes support for the "sortlist" directive in
resolv.conf; I've never seen it in actual use, it's irrelevant for Android
(since we don't use resolv.conf anyway), and it's not clear how it would be
implemented alongside RFC 3484.
2010-02-24 11:49:17 +01:00
San Mehat
75c5e25ae3 bionic: syscalls: Add ioprio_set/ioprio_get syscall wrappers
Signed-off-by: San Mehat <san@google.com>
2010-02-23 15:55:29 -08:00
Vladimir Chtchetkine
b55462328f Merge "Merge memory checking functionality from sandbox" 2010-02-17 13:43:15 -08:00
Vladimir Chtchetkine
75fba6888a Merge memory checking functionality from sandbox
Change-Id: I304c789a752c9f4af4944ca14b9bf1e7644da15a
2010-02-16 11:43:18 -08:00
Matt Fischer
e31c1d0b48 Fix pread()/pwrite() stubs
On ARM EABI, 64-bit function parameters must be aligned
to an even/odd register pair.  The weird way these stubs
were written (using separate lo/hi parameters) prevented
this alignment from being enforced by the compiler.
2010-02-12 16:13:46 -06:00
Niko Catania
f31fceaae6 Merge "Changed __get_h_errno linkage to "C"." 2010-02-12 13:46:31 -08:00
David 'Digit' Turner
4f920f685b Fix sem_post() behaviour to wake up multiple waiting threads. 2010-02-12 12:50:32 -08:00
David 'Digit' Turner
294dd0b86b Fix sem_trywait() implementation + update changelog. 2010-02-12 12:18:37 -08:00
Nicolas Catania
2e1a03c16f Changed __get_h_errno linkage to "C".
Bug:2441631
2010-02-12 11:37:25 -08:00
David 'Digit' Turner
1dcf07a84c Fix android_id_from_name to accept "app_0" as a valid ID.
This fixes getpwnam and getpwgrp which returned NULL for "app_0".
"app_0" corresponds to uid/gid 10000 and is perfectly valid.
2010-02-12 11:35:38 -08:00
David 'Digit' Turner
5c734644ee Fix debug output in the dynamic linker.
This provides a mini-printf implementation that reduces the
size of the dynamic linker by 25 KB, by preventing the drag of
formatting-related routines from the C library.

Also allow traces to be sent to the log, instead of stdout.

NOTE: You now need to modify Android.mk to enable/disable debug
      output.
2010-02-11 10:46:48 -08:00
Iliyan Malchev
e100f52f4a bionic/linker: rename ba_prelink to ba_nonprelink
-- fixes b/2432550
-- ba_prelink is used to manage non-prelinked libraries, hence ba_nonprelink is
   a more appropriate name for it

Signed-off-by: Iliyan Malchev <malchev@google.com>
2010-02-10 19:14:35 -08:00
David Turner
16f7d16f9f Merge "Fix <sys/epoll.h> and <sys/system_properties.h> to include proper C++ inclusion guards" 2010-02-09 14:50:57 -08:00
David 'Digit' Turner
49f0a8f23b Fix <sys/epoll.h> and <sys/system_properties.h> to include proper C++ inclusion guards 2010-02-09 14:05:43 -08:00
Iliyan Malchev
53691d7df2 am 58060c50: am ee424e23: bionic: update processed kernel header a1026.h
Merge commit '58060c50bc4228a7d0253338cae0437211759959'

* commit '58060c50bc4228a7d0253338cae0437211759959':
  bionic: update processed kernel header a1026.h
2010-02-09 09:32:25 -08:00
Iliyan Malchev
58060c50bc am ee424e23: bionic: update processed kernel header a1026.h
Merge commit 'ee424e23c10c051ee4760177c85f6003ff20108c' into eclair-plus-aosp

* commit 'ee424e23c10c051ee4760177c85f6003ff20108c':
  bionic: update processed kernel header a1026.h
2010-02-09 09:25:57 -08:00
Iliyan Malchev
ee424e23c1 bionic: update processed kernel header a1026.h
Signed-off-by: Iliyan Malchev <malchev@google.com>
2010-02-08 15:57:09 -08:00
Chris Dearman
bdc6e3c83f Correct generic memset implementation
Signed-off-by: Chris Dearman <chris@mips.com>
2010-02-05 15:13:55 -08:00
Chris Dearman
9bcb91a212 Generic memcpy should define MEMCOPY before including bcopy.c
Signed-off-by: Chris Dearman <chris@mips.com>
2010-02-05 15:13:55 -08:00
The Android Open Source Project
34e6991c97 am 1db87472: am ba8bfedd: reconcile main tree with open-source eclair
Merge commit '1db874720a58ff7e3684116d59ad08bc73db26d9'

* commit '1db874720a58ff7e3684116d59ad08bc73db26d9':
  android-2.1_r1 snapshot
2010-02-05 14:14:46 -08:00
André Goddard Rosa
699237baf5 bionic: equalize the <unknown> program name between ssp.c and libc_init_common.c
... for the consistency sake.

Signed-off-by: André Goddard Rosa <andre.goddard@gmail.com>
2010-02-05 17:48:07 -02:00
André Goddard Rosa
291100c795 bionic: remove unneeded variable from chk_realloc()
... and simplify the generated code.

Signed-off-by: André Goddard Rosa <andre.goddard@gmail.com>
2010-02-05 16:32:56 -02:00
André Goddard Rosa
a28336c735 bionic: on pthread_join(), avoid extra check in case we find the thread
... by using similar logic as used in pthread_detach().

Signed-off-by: André Goddard Rosa <andre.goddard@gmail.com>
2010-02-05 16:21:07 -02:00
André Goddard Rosa
3b06c128cf bionic: ftell() returns a long, not an int
Signed-off-by: André Goddard Rosa <andre.goddard@gmail.com>
2010-02-05 16:05:52 -02:00
The Android Open Source Project
1db874720a am ba8bfedd: reconcile main tree with open-source eclair
Merge commit 'ba8bfedd04824eea944236ffc885f866c5e9c651' into eclair-plus-aosp

* commit 'ba8bfedd04824eea944236ffc885f866c5e9c651':
  android-2.1_r1 snapshot
2010-02-05 08:44:18 -08:00
The Android Open Source Project
ba8bfedd04 reconcile main tree with open-source eclair 2010-02-05 08:09:31 -08:00
Iliyan Malchev
2721fbd208 am c0472409: am d0996bb4: bionic: update processed kernel header tpa2018d1.h
Merge commit 'c0472409d14eebf797df962dd78fc31afbc4bd07'

* commit 'c0472409d14eebf797df962dd78fc31afbc4bd07':
  bionic: update processed kernel header tpa2018d1.h
2010-02-02 16:22:10 -08:00
Iliyan Malchev
34f411e5fd am 7ec87a19: am 276313ec: bionic: add processed kernel headers a1026.h and tpa2018d1.h
Merge commit '7ec87a1926250d3c1f74193bf36417707e691e10'

* commit '7ec87a1926250d3c1f74193bf36417707e691e10':
  bionic: add processed kernel headers a1026.h and tpa2018d1.h
2010-02-02 16:22:06 -08:00
Iliyan Malchev
c0472409d1 am d0996bb4: bionic: update processed kernel header tpa2018d1.h
Merge commit 'd0996bb4cd6b6d0fa7c643a809f01e33adc2638d' into eclair-plus-aosp

* commit 'd0996bb4cd6b6d0fa7c643a809f01e33adc2638d':
  bionic: update processed kernel header tpa2018d1.h
2010-02-02 14:21:05 -08:00
Iliyan Malchev
7ec87a1926 am 276313ec: bionic: add processed kernel headers a1026.h and tpa2018d1.h
Merge commit '276313ec18c18a07e867dffe568a377583cfd905' into eclair-plus-aosp

* commit '276313ec18c18a07e867dffe568a377583cfd905':
  bionic: add processed kernel headers a1026.h and tpa2018d1.h
2010-02-02 14:21:02 -08:00
Iliyan Malchev
d0996bb4cd bionic: update processed kernel header tpa2018d1.h
Signed-off-by: Iliyan Malchev <malchev@google.com>
2010-02-02 13:42:55 -08:00
Iliyan Malchev
276313ec18 bionic: add processed kernel headers a1026.h and tpa2018d1.h
Signed-off-by: Iliyan Malchev <malchev@google.com>
2010-02-02 11:56:29 -08:00
Tony SIM
1d7a8944d8 added headers for SuperH which automatically generate by update_all.py
base on kernel 2.6.27 arch/sh/include/asm/
2010-02-01 16:06:40 +09:00
Iliyan Malchev
cdcc2648ba bionic: update processed kernel header msm_camera.h
Signed-off-by: Iliyan Malchev <malchev@google.com>
2010-01-31 17:22:25 -08:00
André Goddard Rosa
aba3ee7d32 string: tidy up strndup()
It decreases code size:
   text    data     bss     dec     hex filename
    161       0       0     161      a1 strndup-BEFORE.o
    153       0       0     153      99 strndup-AFTER.o

Signed-off-by: André Goddard Rosa <andre.goddard@gmail.com>
2010-01-30 22:29:59 -02:00
André Goddard Rosa
30a419afc3 improve readability of string: fix indentation and remove trailing spaces
Signed-off-by: André Goddard Rosa <andre.goddard@gmail.com>
2010-01-30 22:28:49 -02:00
André Goddard Rosa
8f92500fa9 optimize delete/delete[] operators by removing unneeded branch
Remove redundant not NULL check already done in free().

Signed-off-by: André Goddard Rosa <andre.goddard@gmail.com>
2010-01-30 22:26:30 -02:00
The Android Open Source Project
e964f3a095 reconcile android-2.1_r1 snapshot 2010-01-29 14:07:31 -08:00
David Turner
f597049b40 Merge "Implement clone() C library function properly." 2010-01-25 14:30:17 -08:00
David 'Digit' Turner
97cf7f3394 Implement clone() C library function properly.
Only provide an implementation for ARM at the moment, since
it requires specific assembly fragments (the standard syscall
stubs cannot be used because the child returns in a different
stack).
2010-01-25 11:18:30 -08:00
Doug Kwan
90f82e5868 Fix typo in a comment. 2010-01-25 11:09:31 -08:00
Doug Kwan
1a2917ca95 Align TEXT section to 4K boundary so that we can use both ld and gold. 2010-01-25 10:24:50 -08:00
David 'Digit' Turner
d6bf8f9229 Add Bionic Changelog in libc/docs/CHANGES.TXT 2010-01-21 16:25:38 -08:00
Scott Turner
72d3489612 Reduce compiler anxiety.
Warning from compiler:

target arm C: libm <= bionic/libm/src/e_atan2.c
bionic/libm/src/e_atan2.c: In function 'atan2':
bionic/libm/src/e_atan2.c:71: warning: suggest parentheses around arithmetic in operand of '|'
target arm C: libm <= bionic/libm/src/e_atan2f.c
2010-01-16 10:39:00 -05:00
Scott Turner
fb02ec25e9 Reversed order of const and static to hush warning from compiler. 2010-01-16 10:23:18 -05:00
Colin Cross
fc10b24acc Add implementation of fdprintf, clearenv, and stubs for ttyname_r, *usershell
Change-Id:	I5fe7e8b6ee5edbb49e707c3b6737a58563781fa3
2010-01-15 16:52:35 -08:00
Colin Cross
8c59d96e24 Add killpg function
Change-Id:	I9bc347d264fe38faf2d0f9935d2ebb43a353196e
2010-01-15 16:27:04 -08:00
Colin Cross
64ceac3f49 Add fts, err, and sys/queue for grep
Change-Id:	Id47514a1812d828e95efa2fab0e9c15c5b682b58
2010-01-15 15:57:02 -08:00
Colin Cross
c29731a491 mntent.h requires stdio.h
Change-Id:	If69f64cf088dedb19602bf47627d03400abb9095
2010-01-15 15:57:02 -08:00
Colin Cross
e9d08ba523 Add definition of rlim_t
Change-Id:	Ie8c2451360cbcce9fc1587528a95aca09a03d0de
2010-01-15 15:57:02 -08:00
Colin Cross
2497f65fee Import change from ctype.h revision 1.20 from openbsd
Fixes builds with gcc >= 4.3 with -std=gnu99

Change-Id:	I8729b7f4237fd7a99a82b2fe60573a7afe66b435
2010-01-15 15:57:02 -08:00
Colin Cross
d1cfc947f9 Import include/arpa/telnet.h from BSD
Change-Id:	I684251bfb8ef04f0706866ea55dceebcd2a5b0e1
2010-01-15 15:15:52 -08:00
Colin Cross
4fa7b10564 Import regex from OpenBSD
Change-Id: I7ad7d907ef65e4e345f94777d730813b1270a612
2010-01-15 15:01:44 -08:00
Colin Cross
3839580cd9 Merge "Use correct TLS codepath for linker" 2010-01-15 14:07:40 -08:00
Gary King
278d157f43 Use correct TLS codepath for linker
Replicate ARM libc build's HAVE_ARM_TLS_REGISTER preprocessor definition
logic, to ensure that the runtime linker uses the correct codepath for
accessing the TLS address
2010-01-12 17:37:44 -08:00
The Android Open Source Project
a809abb086 android-2.1_r1 snapshot 2010-01-12 15:18:05 -08:00
Colin Cross
6458c49c96 Fix ptsname_r(3) return type to match glibc
The gHardy man pages specify the return type of ptsname_r to be char*, but the
return value to be 0 on success, negative on error and the gHardy stdlib.h
defines extern int ptsname_r(...).

Busybox telnetd fails to run successfully without this change.
2010-01-12 12:58:12 -08:00
Elliott Hughes
0b5db51ea6 Merge "Fix usleep(3) return type to be POSIX-compliant." 2010-01-07 15:54:35 -08:00
Ben Cheng
ee84231886 Add user-space ptrace data structure to dump VFP registers and status word. 2009-12-17 12:46:45 -08:00
Android Git Automerger
70b5ddafd4 Merge commit 'goog/eclair-plus-aosp' 2009-12-15 00:44:05 -08:00
Elliott Hughes
99d7907611 Fix usleep(3) return type to be POSIX-compliant.
POSIX usleep(3) returns 0 on successful completion, -1 otherwise:
  http://www.opengroup.org/onlinepubs/007908799/xsh/usleep.html

This was found by an external user porting native code:
  http://groups.google.com/group/android-porting/browse_thread/thread/674848f001db0292
2009-12-14 17:07:19 -08:00
Mathias Agopian
278d960aae am f197147a: am ca07064c: am 5f53a182: Revert "Add qsort_r() implementation to the C library."
Merge commit 'f197147a787d7415e6e0a1bad15566836c55befb'

* commit 'f197147a787d7415e6e0a1bad15566836c55befb':
  Revert "Add qsort_r() implementation to the C library."
2009-12-04 04:31:23 -08:00
David 'Digit' Turner
44358b9fed am be71c814: am 20b3097d: am 754c178a: Add qsort_r() implementation to the C library.
Merge commit 'be71c8142d4225dd9af4742ec050f30fcbc2aa5e'

* commit 'be71c8142d4225dd9af4742ec050f30fcbc2aa5e':
  Add qsort_r() implementation to the C library.
2009-12-04 04:29:36 -08:00
Dima Zavin
4cf30fb534 am a0783df1: am df55c642: am e1e68492: Merge change Ifa58a406 into eclair
Merge commit 'a0783df14eaf9b0d858dd42d4e8a64a738314900'

* commit 'a0783df14eaf9b0d858dd42d4e8a64a738314900':
  libc: kernel: Update msm_kgsl.h header
2009-12-03 17:21:46 -08:00
Mathias Agopian
f197147a78 am ca07064c: am 5f53a182: Revert "Add qsort_r() implementation to the C library."
Merge commit 'ca07064c9ebd8523ed88fa09e97feaaafb7e9c15' into eclair-mr2-plus-aosp

* commit 'ca07064c9ebd8523ed88fa09e97feaaafb7e9c15':
  Revert "Add qsort_r() implementation to the C library."
2009-12-03 17:15:16 -08:00
Mathias Agopian
caa17a905a am 5f53a182: Revert "Add qsort_r() implementation to the C library."
Merge commit '5f53a18204ec991f5a77872806eeaa185936aa8c' into eclair-plus-aosp

* commit '5f53a18204ec991f5a77872806eeaa185936aa8c':
  Revert "Add qsort_r() implementation to the C library."
2009-12-03 17:10:45 -08:00
Mathias Agopian
ca07064c9e am 5f53a182: Revert "Add qsort_r() implementation to the C library."
Merge commit '5f53a18204ec991f5a77872806eeaa185936aa8c' into eclair-mr2

* commit '5f53a18204ec991f5a77872806eeaa185936aa8c':
  Revert "Add qsort_r() implementation to the C library."
2009-12-03 17:10:14 -08:00
David 'Digit' Turner
be71c8142d am 20b3097d: am 754c178a: Add qsort_r() implementation to the C library.
Merge commit '20b3097d4cc225d948dac38e778a9d3b3b1549db' into eclair-mr2-plus-aosp

* commit '20b3097d4cc225d948dac38e778a9d3b3b1549db':
  Add qsort_r() implementation to the C library.
2009-12-03 16:44:43 -08:00
Doug Kwan
d548a265ca Add missing symbol type directives. 2009-12-03 16:26:04 -08:00
David 'Digit' Turner
20b3097d4c am 754c178a: Add qsort_r() implementation to the C library.
Merge commit '754c178ae551aedcbbfd3bfd1c1c3b710d9ad989' into eclair-mr2

* commit '754c178ae551aedcbbfd3bfd1c1c3b710d9ad989':
  Add qsort_r() implementation to the C library.
2009-12-03 16:00:48 -08:00
David 'Digit' Turner
f7ee5739fa am 754c178a: Add qsort_r() implementation to the C library.
Merge commit '754c178ae551aedcbbfd3bfd1c1c3b710d9ad989' into eclair-plus-aosp

* commit '754c178ae551aedcbbfd3bfd1c1c3b710d9ad989':
  Add qsort_r() implementation to the C library.
2009-12-03 16:00:26 -08:00
Dima Zavin
a0783df14e am df55c642: am e1e68492: Merge change Ifa58a406 into eclair
Merge commit 'df55c64203ac96fa0447357d1d19e6adee52c8d1' into eclair-mr2-plus-aosp

* commit 'df55c64203ac96fa0447357d1d19e6adee52c8d1':
  libc: kernel: Update msm_kgsl.h header
2009-12-03 02:20:57 -08:00
Dima Zavin
ece132df48 am e1e68492: Merge change Ifa58a406 into eclair
Merge commit 'e1e684920f3bea04f7cccee9f2d7ecd8b9a1ba47' into eclair-plus-aosp

* commit 'e1e684920f3bea04f7cccee9f2d7ecd8b9a1ba47':
  libc: kernel: Update msm_kgsl.h header
2009-12-03 02:14:57 -08:00
Dima Zavin
df55c64203 am e1e68492: Merge change Ifa58a406 into eclair
Merge commit 'e1e684920f3bea04f7cccee9f2d7ecd8b9a1ba47' into eclair-mr2

* commit 'e1e684920f3bea04f7cccee9f2d7ecd8b9a1ba47':
  libc: kernel: Update msm_kgsl.h header
2009-12-03 02:14:56 -08:00
David 'Digit' Turner
ff3c8dfced am aeebf717: am db63eff2: am fe62de1a: Add support for R_ARM_REL32 to the dynamic linker.
Merge commit 'aeebf717ad596f144d7ba8f8d5778bdbbd51cbe7'

* commit 'aeebf717ad596f144d7ba8f8d5778bdbbd51cbe7':
  Add support for R_ARM_REL32 to the dynamic linker.
2009-12-02 20:31:36 -08:00
Alexey Tarasov
c22da7ed32 Fix log channel initialization at bionic/logd_write.c.
log_channel_t contains fd member, which is file descriptor for
exact logging channel. change cc05d12716
lacks initialization of this member in __write_to_log_init(), thus
logging code is not working, although not crashable.

Additional details may be found in comments here:
http://review.source.android.com/5617
2009-12-03 11:37:22 +10:00
David 'Digit' Turner
aeebf717ad am db63eff2: am fe62de1a: Add support for R_ARM_REL32 to the dynamic linker.
Merge commit 'db63eff2d5790d40577baefea1d1895e3004fd22' into eclair-mr2-plus-aosp

* commit 'db63eff2d5790d40577baefea1d1895e3004fd22':
  Add support for R_ARM_REL32 to the dynamic linker.
2009-12-02 11:23:26 -08:00
David 'Digit' Turner
a3de55c831 am fe62de1a: Add support for R_ARM_REL32 to the dynamic linker.
Merge commit 'fe62de1ad036a1417df44b7b1a7c65cc79dc7091' into eclair-plus-aosp

* commit 'fe62de1ad036a1417df44b7b1a7c65cc79dc7091':
  Add support for R_ARM_REL32 to the dynamic linker.
2009-12-02 11:17:29 -08:00
David 'Digit' Turner
db63eff2d5 am fe62de1a: Add support for R_ARM_REL32 to the dynamic linker.
Merge commit 'fe62de1ad036a1417df44b7b1a7c65cc79dc7091' into eclair-mr2

* commit 'fe62de1ad036a1417df44b7b1a7c65cc79dc7091':
  Add support for R_ARM_REL32 to the dynamic linker.
2009-12-02 11:16:57 -08:00
Andy McFadden
5cdb2b73d2 Fix libc logging implementation.
The file descriptor wasn't getting set, so the writev() call was
silently failing.

There's a parallel implementation over in system/core/liblog, but it's
still using the old approach and didn't have this problem.
2009-11-30 17:09:45 -08:00
Android (Google) Code Review
3bbac05726 Merge change Ic1202510
* changes:
  Added a comment.
2009-11-25 16:25:04 -08:00
Andy McFadden
c1202510b6 Added a comment.
The structs for stdin/stdout/stderr are formed with a static initializer
that needs to be updated if something in FILE is changed.
2009-11-25 14:16:53 -08:00
Eric Fischer
780775c812 am ae77aae8: am 07401a68: am cd5df2d9: Rebuild the time zone data files in 32-bit format instead of 64-bit.
Merge commit 'ae77aae80cb78b33f32e65c43a473d5e297b866b'

* commit 'ae77aae80cb78b33f32e65c43a473d5e297b866b':
  Rebuild the time zone data files in 32-bit format instead of 64-bit.
2009-11-24 14:14:02 -08:00
Eric Fischer
ae77aae80c am 07401a68: am cd5df2d9: Rebuild the time zone data files in 32-bit format instead of 64-bit.
Merge commit '07401a681f7530a8126fb0fd07a097828337b30a' into eclair-mr2-plus-aosp

* commit '07401a681f7530a8126fb0fd07a097828337b30a':
  Rebuild the time zone data files in 32-bit format instead of 64-bit.
2009-11-24 14:09:34 -08:00
Eric Fischer
07401a681f am cd5df2d9: Rebuild the time zone data files in 32-bit format instead of 64-bit.
Merge commit 'cd5df2d92c3adeac41e27aab5ba0f999c753c4c4' into eclair-mr2

* commit 'cd5df2d92c3adeac41e27aab5ba0f999c753c4c4':
  Rebuild the time zone data files in 32-bit format instead of 64-bit.
2009-11-24 14:02:30 -08:00
Eric Fischer
157cdf42d7 am cd5df2d9: Rebuild the time zone data files in 32-bit format instead of 64-bit.
Merge commit 'cd5df2d92c3adeac41e27aab5ba0f999c753c4c4' into eclair-plus-aosp

* commit 'cd5df2d92c3adeac41e27aab5ba0f999c753c4c4':
  Rebuild the time zone data files in 32-bit format instead of 64-bit.
2009-11-24 14:01:54 -08:00
Eric Fischer
00da948b09 am a5d96513: am 8d7c6953: am 7e617899: Correct the raw offsets in the time zone index for a few zones.
Merge commit 'a5d9651368779ae054f4184c5881566fdee85003'

* commit 'a5d9651368779ae054f4184c5881566fdee85003':
  Correct the raw offsets in the time zone index for a few zones.
2009-11-23 17:12:28 -08:00
Eric Fischer
a5d9651368 am 8d7c6953: am 7e617899: Correct the raw offsets in the time zone index for a few zones.
Merge commit '8d7c6953373b4e2c6f49dfff741bf0da09030760' into eclair-mr2-plus-aosp

* commit '8d7c6953373b4e2c6f49dfff741bf0da09030760':
  Correct the raw offsets in the time zone index for a few zones.
2009-11-23 17:08:20 -08:00
Eric Fischer
21195bbaf1 am 7e617899: Correct the raw offsets in the time zone index for a few zones.
Merge commit '7e6178998507f993eedf6bec726b0c28881f0485' into eclair-plus-aosp

* commit '7e6178998507f993eedf6bec726b0c28881f0485':
  Correct the raw offsets in the time zone index for a few zones.
2009-11-23 17:04:43 -08:00
Eric Fischer
8d7c695337 am 7e617899: Correct the raw offsets in the time zone index for a few zones.
Merge commit '7e6178998507f993eedf6bec726b0c28881f0485' into eclair-mr2

* commit '7e6178998507f993eedf6bec726b0c28881f0485':
  Correct the raw offsets in the time zone index for a few zones.
2009-11-23 17:04:18 -08:00
Fred Fettinger
25f8ea4d40 am 01a1f8b0: am b5239ed1: libc: allow usage of time64.h from cpp code
Merge commit '01a1f8b080d9d4e619ce00039f195f6fa3aa2045'

* commit '01a1f8b080d9d4e619ce00039f195f6fa3aa2045':
  libc: allow usage of time64.h from cpp code
2009-11-23 13:43:42 -08:00
Fred Fettinger
01a1f8b080 am b5239ed1: libc: allow usage of time64.h from cpp code
Merge commit 'b5239ed16aeba648f1c9bcb7a4887b8a41670326' into eclair-mr2-plus-aosp

* commit 'b5239ed16aeba648f1c9bcb7a4887b8a41670326':
  libc: allow usage of time64.h from cpp code
2009-11-23 13:39:03 -08:00
Fred Fettinger
b5239ed16a libc: allow usage of time64.h from cpp code
Wrapped declarations in time64.h with __BEGIN_DECLS/__END_DECLS so that
the prototypes are correctly identified as extern C.

Change-Id: I253453307831c929a6c7174b28b48bceef946fed
Signed-off-by: Fred Fettinger <fred.fettinger@motorola.com>
Signed-off-by: Mike Lockwood <lockwood@android.com>
2009-11-23 16:25:32 -05:00
Eric Fischer
62a1bb5acf am 9cb69cf4: am 25a3a3ea: am a6083b77: Update zoneinfo time zone data to version 2009s
Merge commit '9cb69cf4dc8962204715a7662c7d0e778a7ee113'

* commit '9cb69cf4dc8962204715a7662c7d0e778a7ee113':
  Update zoneinfo time zone data to version 2009s
2009-11-20 15:55:50 -08:00
Eric Fischer
9cb69cf4dc am 25a3a3ea: am a6083b77: Update zoneinfo time zone data to version 2009s
Merge commit '25a3a3ea8cb234bead6d80a71823713b80acfea8' into eclair-mr2-plus-aosp

* commit '25a3a3ea8cb234bead6d80a71823713b80acfea8':
  Update zoneinfo time zone data to version 2009s
2009-11-20 15:47:49 -08:00
Eric Fischer
8a2658a342 am a6083b77: Update zoneinfo time zone data to version 2009s
Merge commit 'a6083b7768a2d1efc52805ff7ce049866186c744' into eclair-plus-aosp

* commit 'a6083b7768a2d1efc52805ff7ce049866186c744':
  Update zoneinfo time zone data to version 2009s
2009-11-20 15:42:15 -08:00
Eric Fischer
25a3a3ea8c am a6083b77: Update zoneinfo time zone data to version 2009s
Merge commit 'a6083b7768a2d1efc52805ff7ce049866186c744' into eclair-mr2

* commit 'a6083b7768a2d1efc52805ff7ce049866186c744':
  Update zoneinfo time zone data to version 2009s
2009-11-20 15:42:11 -08:00
Vladimir Chtchetkine
870fa11830 am fdfa1677: am 362b2aab: Merge change Ib4550a04 into eclair-mr2
Merge commit 'fdfa16776ca8f33f671cbac5dd9fa8bd761e16a8'

* commit 'fdfa16776ca8f33f671cbac5dd9fa8bd761e16a8':
  Split libc_debug.so into two .so modules loaded on demand from libc.so
2009-11-19 17:37:46 -08:00
Vladimir Chtchetkine
fdfa16776c am 362b2aab: Merge change Ib4550a04 into eclair-mr2
Merge commit '362b2aabee2dd04e04a3ad9c09f0ad0212569be4' into eclair-mr2-plus-aosp

* commit '362b2aabee2dd04e04a3ad9c09f0ad0212569be4':
  Split libc_debug.so into two .so modules loaded on demand from libc.so
2009-11-19 11:28:22 -08:00
Android (Google) Code Review
362b2aabee Merge change Ib4550a04 into eclair-mr2
* changes:
  Split libc_debug.so into two .so modules loaded on demand from libc.so
2009-11-19 11:24:10 -08:00
Vladimir Chtchetkine
b74ceb25aa Split libc_debug.so into two .so modules loaded on demand from libc.so
This change is intended to eliminate need to replace libc.so with libc_debug.so in order to enablememory allocation debugging.
This is also the first step towards implementing extended memoryallocation debugging using emulator's capabilities in monitoring memory access.
2009-11-18 10:36:25 -08:00
David 'Digit' Turner
83d3d7491a am ebf3ea00: am 34ea5117: Add support for R_ARM_REL32 to the dynamic linker.
Merge commit 'ebf3ea006e5367fff93d2491eec24c4b1a633805'

* commit 'ebf3ea006e5367fff93d2491eec24c4b1a633805':
  Add support for R_ARM_REL32 to the dynamic linker.
2009-11-17 16:16:52 -08:00
David 'Digit' Turner
ebf3ea006e am 34ea5117: Add support for R_ARM_REL32 to the dynamic linker.
Merge commit '34ea5117dbeba41ae5dfdfb2c2ec8cae23388b66' into eclair-mr2-plus-aosp

* commit '34ea5117dbeba41ae5dfdfb2c2ec8cae23388b66':
  Add support for R_ARM_REL32 to the dynamic linker.
2009-11-17 16:06:26 -08:00
David 'Digit' Turner
34ea5117db Add support for R_ARM_REL32 to the dynamic linker. 2009-11-17 14:56:26 -08:00
Jean-Baptiste Queru
0493b61c1a am a7f8f312: merge from open-source master
Merge commit 'a7f8f312e0791509b2382f90861fe9f373bd4f0b'

* commit 'a7f8f312e0791509b2382f90861fe9f373bd4f0b':
  eclair snapshot
2009-11-15 15:03:49 -08:00
Jean-Baptiste Queru
a7f8f312e0 merge from open-source master 2009-11-15 14:55:00 -08:00
Jean-Baptiste Queru
2db97868f8 merge from open-source master
Merge commit 'goog/stage-korg-master' into HEAD
2009-11-15 14:05:54 -08:00
Jean-Baptiste Queru
95604529ec merge from eclair 2009-11-15 12:05:31 -08:00
Jean-Baptiste Queru
0896a3a9f0 am 817b4c45: merge from open-source master
Merge commit '817b4c45f05c613a4a1ac5940687a2ed24f3b093'

* commit '817b4c45f05c613a4a1ac5940687a2ed24f3b093':
  modified SYSCALLS.TXT to support SuperH architecture
2009-11-15 11:30:50 -08:00
Jean-Baptiste Queru
817b4c45f0 merge from open-source master 2009-11-15 10:58:55 -08:00
Dima Zavin
84adfb759c am 195082ab: am e8870ffc: am 110044b1: libc: kernel: Update msm_kgsl.h header
Merge commit '195082ab52090aeaebf00b845e0944388dcd92e7'

* commit '195082ab52090aeaebf00b845e0944388dcd92e7':
  libc: kernel: Update msm_kgsl.h header
2009-11-13 04:15:28 -08:00
Dima Zavin
195082ab52 am e8870ffc: am 110044b1: libc: kernel: Update msm_kgsl.h header
Merge commit 'e8870ffc965d553a885f63b26e724da279728b72' into eclair-mr2-plus-aosp

* commit 'e8870ffc965d553a885f63b26e724da279728b72':
  libc: kernel: Update msm_kgsl.h header
2009-11-13 04:08:01 -08:00
Dima Zavin
e8870ffc96 am 110044b1: libc: kernel: Update msm_kgsl.h header
Merge commit '110044b131122e6886b962d5d16b1031695c374b' into eclair-mr2

* commit '110044b131122e6886b962d5d16b1031695c374b':
  libc: kernel: Update msm_kgsl.h header
2009-11-13 04:01:52 -08:00
Dima Zavin
a7b5e20e9c am 110044b1: libc: kernel: Update msm_kgsl.h header
Merge commit '110044b131122e6886b962d5d16b1031695c374b' into eclair-plus-aosp

* commit '110044b131122e6886b962d5d16b1031695c374b':
  libc: kernel: Update msm_kgsl.h header
2009-11-13 03:51:47 -08:00
Jean-Baptiste Queru
194d3fa048 eclair snapshot 2009-11-12 18:45:14 -08:00
Jean-Baptiste Queru
9d52bdfb95 merge from open-source master 2009-11-11 08:19:07 -08:00
Dan Bornstein
03c643b493 Add stdlib functions mbstowcs() and wcstombs().
As with the other wchar functions in Bionic, these are really
minimally functional stubs.

Change-Id: I805bc5642e7bc22d9d730cfc18f9fb4a5f164416
2009-11-10 12:15:33 -08:00
Android Code Review
71c0aeb44f Merge change I37d0317d
* changes:
  modified SYSCALLS.TXT to support SuperH architecture
2009-11-09 15:21:09 -08:00
Jean-Baptiste Queru
b152dde4ca am 83362689: merge from open-source master
Merge commit '83362689f5b1f6393d376d242fe29541b63ead2d'

* commit '83362689f5b1f6393d376d242fe29541b63ead2d':
  added and modified linker to support SuperH architecture
  Add the BSD sys_signame array.
  added and modified bionic code to support SuperH architecture
2009-11-09 12:07:54 -08:00
Jean-Baptiste Queru
83362689f5 merge from open-source master 2009-11-09 08:04:48 -08:00
Jean-Baptiste Queru
10be95cffc merge from open-source master 2009-11-08 16:09:17 -08:00
Shin-ichiro KAWASAKI
ad13c57298 added and modified linker to support SuperH architecture 2009-11-06 10:36:37 +09:00
Thorsten Glaser
92b10af793 Add the BSD sys_signame array.
Signed-off-by: Thorsten Glaser <tg@mirbsd.org>
2009-11-05 15:50:05 -08:00
Mathias Agopian
2d04a78477 am ecac54db: am 3ba822cc: am 199f9d92: Improve memcpy performance from 290 MiB/s to 340 MiB/s (17% improvment)
Merge commit 'ecac54db21256952b4b4a9c6f17604ec31743183'

* commit 'ecac54db21256952b4b4a9c6f17604ec31743183':
  Improve memcpy performance from 290 MiB/s to 340 MiB/s (17% improvment)
2009-10-29 20:13:12 -07:00
Mathias Agopian
ecac54db21 am 3ba822cc: am 199f9d92: Improve memcpy performance from 290 MiB/s to 340 MiB/s (17% improvment)
Merge commit '3ba822cc3f0a252db73cf63cb8390e46fc0ceb0a' into eclair-mr2-plus-aosp

* commit '3ba822cc3f0a252db73cf63cb8390e46fc0ceb0a':
  Improve memcpy performance from 290 MiB/s to 340 MiB/s (17% improvment)
2009-10-29 19:53:39 -07:00
Mathias Agopian
3ba822cc3f am 199f9d92: Improve memcpy performance from 290 MiB/s to 340 MiB/s (17% improvment)
Merge commit '199f9d923804d74e021dd80e48ec75c0a96dba77' into eclair-mr2

* commit '199f9d923804d74e021dd80e48ec75c0a96dba77':
  Improve memcpy performance from 290 MiB/s to 340 MiB/s (17% improvment)
2009-10-29 19:27:07 -07:00
Mathias Agopian
47c5e30b61 am 199f9d92: Improve memcpy performance from 290 MiB/s to 340 MiB/s (17% improvment)
Merge commit '199f9d923804d74e021dd80e48ec75c0a96dba77' into eclair-plus-aosp

* commit '199f9d923804d74e021dd80e48ec75c0a96dba77':
  Improve memcpy performance from 290 MiB/s to 340 MiB/s (17% improvment)
2009-10-29 02:44:15 -07:00
Doug Kwan
e823807dc2 Add weak symbol support. Also fix a bug caused by a typo. 2009-10-26 12:05:23 -07:00
Iliyan Malchev
f1729553e3 am 9e78de3e: am 70bba516: am 763ac283: Merge changes Ibcba4b4f,I9af341e1 into eclair
Merge commit '9e78de3e3c90ec3c2970431d8eae7378fdc0dac6'

* commit '9e78de3e3c90ec3c2970431d8eae7378fdc0dac6':
  bionic/linker: make the buddy allocator compute max_order on its own
  bionic/linker: change the buddy allocator to take a handle to the managed area
2009-10-23 18:58:19 -07:00
Iliyan Malchev
9e78de3e3c am 70bba516: am 763ac283: Merge changes Ibcba4b4f,I9af341e1 into eclair
Merge commit '70bba5160f83ecd6251c4539f747ae39e9ed469c' into eclair-mr2-plus-aosp

* commit '70bba5160f83ecd6251c4539f747ae39e9ed469c':
  bionic/linker: make the buddy allocator compute max_order on its own
  bionic/linker: change the buddy allocator to take a handle to the managed area
2009-10-23 18:49:14 -07:00
Iliyan Malchev
53b32f8b7e am 763ac283: Merge changes Ibcba4b4f,I9af341e1 into eclair
Merge commit '763ac28357f604e0e4196e0a7ad5b0f5cdcf274a' into eclair-plus-aosp

* commit '763ac28357f604e0e4196e0a7ad5b0f5cdcf274a':
  bionic/linker: make the buddy allocator compute max_order on its own
  bionic/linker: change the buddy allocator to take a handle to the managed area
2009-10-23 18:39:30 -07:00
Iliyan Malchev
70bba5160f am 763ac283: Merge changes Ibcba4b4f,I9af341e1 into eclair
Merge commit '763ac28357f604e0e4196e0a7ad5b0f5cdcf274a' into eclair-mr2

* commit '763ac28357f604e0e4196e0a7ad5b0f5cdcf274a':
  bionic/linker: make the buddy allocator compute max_order on its own
  bionic/linker: change the buddy allocator to take a handle to the managed area
2009-10-23 18:38:35 -07:00
Doug Kwan
943043583a Clean up some linker code. 2009-10-23 18:11:40 -07:00
Andy McFadden
a6210dc510 am 05324b36: am 18af6efe: am 96bbbe21: Wrap ARM abort() to improve stack trace.
Merge commit '05324b36c1372cba6348ad5c75a96b3adfc4d9fe'

* commit '05324b36c1372cba6348ad5c75a96b3adfc4d9fe':
  Wrap ARM abort() to improve stack trace.
2009-10-22 09:36:39 -07:00
Andy McFadden
05324b36c1 am 18af6efe: am 96bbbe21: Wrap ARM abort() to improve stack trace.
Merge commit '18af6efefae2f0dd5d918f16636fb2b401e09a56' into eclair-mr2-plus-aosp

* commit '18af6efefae2f0dd5d918f16636fb2b401e09a56':
  Wrap ARM abort() to improve stack trace.
2009-10-22 09:26:55 -07:00
Andy McFadden
18af6efefa am 96bbbe21: Wrap ARM abort() to improve stack trace.
Merge commit '96bbbe21778fc3f4a932822c2436238d6ce5721b' into eclair-mr2

* commit '96bbbe21778fc3f4a932822c2436238d6ce5721b':
  Wrap ARM abort() to improve stack trace.
2009-10-22 06:46:54 -07:00
Andy McFadden
0703efeae2 am 96bbbe21: Wrap ARM abort() to improve stack trace.
Merge commit '96bbbe21778fc3f4a932822c2436238d6ce5721b' into eclair-plus-aosp

* commit '96bbbe21778fc3f4a932822c2436238d6ce5721b':
  Wrap ARM abort() to improve stack trace.
2009-10-21 12:18:54 -07:00
Mathias Agopian
50d233fdce am 581f4305: am 76ef331c: am 7e7d6c48: use local symbols in memset so it doesn\'t screw up profiling
Merge commit '581f43056b594429b3df4678d87989c93d8f81d2'

* commit '581f43056b594429b3df4678d87989c93d8f81d2':
  use local symbols in memset so it doesn't screw up profiling
2009-10-19 17:30:11 -07:00
Mathias Agopian
581f43056b am 76ef331c: am 7e7d6c48: use local symbols in memset so it doesn\'t screw up profiling
Merge commit '76ef331cd6967ca8f5af779d25c8b634f8cdd2b6' into eclair-mr2-plus-aosp

* commit '76ef331cd6967ca8f5af779d25c8b634f8cdd2b6':
  use local symbols in memset so it doesn't screw up profiling
2009-10-19 17:19:37 -07:00
Mathias Agopian
214dec2811 am 7e7d6c48: use local symbols in memset so it doesn\'t screw up profiling
Merge commit '7e7d6c48a064af82f0ec39f47b9eb803a6e1df4c' into eclair-plus-aosp

* commit '7e7d6c48a064af82f0ec39f47b9eb803a6e1df4c':
  use local symbols in memset so it doesn't screw up profiling
2009-10-19 17:09:51 -07:00
Mathias Agopian
76ef331cd6 am 7e7d6c48: use local symbols in memset so it doesn\'t screw up profiling
Merge commit '7e7d6c48a064af82f0ec39f47b9eb803a6e1df4c' into eclair-mr2

* commit '7e7d6c48a064af82f0ec39f47b9eb803a6e1df4c':
  use local symbols in memset so it doesn't screw up profiling
2009-10-19 17:09:31 -07:00
David 'Digit' Turner
dfb93b8914 am b3cfdb62: am eeaf6544: Merge change I7934a799 into eclair-mr2
Merge commit 'b3cfdb6220b9ce8ec6d25984ef086fa06f157236'

* commit 'b3cfdb6220b9ce8ec6d25984ef086fa06f157236':
  Prevent spurious EINTR to freeze process debugging
2009-10-19 15:15:52 -07:00
David 'Digit' Turner
b3cfdb6220 am eeaf6544: Merge change I7934a799 into eclair-mr2
Merge commit 'eeaf6544b676f68ccdd70a3fa78f44789a1bf69c' into eclair-mr2-plus-aosp

* commit 'eeaf6544b676f68ccdd70a3fa78f44789a1bf69c':
  Prevent spurious EINTR to freeze process debugging
2009-10-19 15:03:31 -07:00
Android (Google) Code Review
eeaf6544b6 Merge change I7934a799 into eclair-mr2
* changes:
  Prevent spurious EINTR to freeze process debugging
2009-10-19 17:55:08 -04:00
David 'Digit' Turner
79d23e28ed am 5d436ddc: am 8213d5c3: am ff7b46b8: Merge change I3c998761 into eclair
Merge commit '5d436ddcae640e2b2af30a5654bec33273b7a9c3'

* commit '5d436ddcae640e2b2af30a5654bec33273b7a9c3':
  Allow the dynamic linker to relocate references to thumb symbols in NDK libraries.
2009-10-16 12:57:19 -07:00
David 'Digit' Turner
5d436ddcae am 8213d5c3: am ff7b46b8: Merge change I3c998761 into eclair
Merge commit '8213d5c3c072b23f5cc1922d232efe7338091d9b' into eclair-mr2-plus-aosp

* commit '8213d5c3c072b23f5cc1922d232efe7338091d9b':
  Allow the dynamic linker to relocate references to thumb symbols in NDK libraries.
2009-10-16 12:46:51 -07:00
David 'Digit' Turner
cd23098828 am ff7b46b8: Merge change I3c998761 into eclair
Merge commit 'ff7b46b87c4d85881d88c2105a94be6c6accb628' into eclair-plus-aosp

* commit 'ff7b46b87c4d85881d88c2105a94be6c6accb628':
  Allow the dynamic linker to relocate references to thumb symbols in NDK libraries.
2009-10-16 12:36:27 -07:00
David 'Digit' Turner
8213d5c3c0 am ff7b46b8: Merge change I3c998761 into eclair
Merge commit 'ff7b46b87c4d85881d88c2105a94be6c6accb628' into eclair-mr2

* commit 'ff7b46b87c4d85881d88c2105a94be6c6accb628':
  Allow the dynamic linker to relocate references to thumb symbols in NDK libraries.
2009-10-16 12:35:31 -07:00
David 'Digit' Turner
7934a799e1 Prevent spurious EINTR to freeze process debugging 2009-10-16 12:14:04 -07:00
Andy McFadden
9c46315800 am b63e4e88: am 5f32207a: Wrap ARM abort() to improve stack trace.
Merge commit 'b63e4e88b0d13afa431864190b3515a549c16d85'

* commit 'b63e4e88b0d13afa431864190b3515a549c16d85':
  Wrap ARM abort() to improve stack trace.
2009-10-16 07:38:41 -07:00
Andy McFadden
b63e4e88b0 am 5f32207a: Wrap ARM abort() to improve stack trace.
Merge commit '5f32207a3db0bea3ca1c7f4b2b563c11b895f276' into eclair-mr2-plus-aosp

* commit '5f32207a3db0bea3ca1c7f4b2b563c11b895f276':
  Wrap ARM abort() to improve stack trace.
2009-10-16 07:28:34 -07:00
Andy McFadden
5f32207a3d Wrap ARM abort() to improve stack trace.
The code generated for Thumb and Thumb2 targets has different handling
for abort().  Because abort() is "noreturn", it doesn't need to preserve
the callee-save registers.  The Thumb2 version trashes LR and makes it
impossible to figure out who called abort().

This inserts a trivial stub function; net effect is stack traces are
reasonable after an abort().

For bug 2191452.
2009-10-15 16:29:22 -07:00
Jean-Baptiste Queru
35af95026e am 73981476: merge from open-source master
Merge commit '73981476a389847e8537cca37503c43e107fadc9'

* commit '73981476a389847e8537cca37503c43e107fadc9':
  Fill l_ld of linkmaps with value from soinfo::dynamic.
  modified kernel headers re-generate tools to support SuperH architecture
  added syscalls for SuperH which automatically generate by gensyscalls.py
2009-10-14 16:18:14 -07:00
Dima Zavin
051736be13 am 60c221cc: am 5c328268: libc: kernel: add linux/msm_q6venc.h kernel include for qsd8k h/w video encode
Merge commit '60c221ccfaf67bdd9cadfd151d0bad9d3f8482ce'

* commit '60c221ccfaf67bdd9cadfd151d0bad9d3f8482ce':
2009-10-14 16:18:06 -07:00
Iliyan Malchev
539f046a55 am 0619f2e7: am 0e24d2c9: update msm_camera.h
Merge commit '0619f2e744b239942841f7e0993d594d074a83f8'

* commit '0619f2e744b239942841f7e0993d594d074a83f8':
2009-10-14 16:18:03 -07:00
Dima Zavin
6ffc625a7a am d704c4d7: am 9a96aaa8: libc: kernel: Update linux/msm_kgsl.h to latest
Merge commit 'd704c4d7112919f26243a2a24858332bf1fb2f5c'

* commit 'd704c4d7112919f26243a2a24858332bf1fb2f5c':
2009-10-14 16:18:00 -07:00
Mathias Agopian
72540134bd am ab9a0025: am e3650267: fix [2170898] abort() doesn\'t print a stack tarce
Merge commit 'ab9a0025d58dde406b25d30388ecb5c9fa268e1f'

* commit 'ab9a0025d58dde406b25d30388ecb5c9fa268e1f':
2009-10-14 16:17:57 -07:00
David 'Digit' Turner
b9c37d7186 am 1f2a381e: am fdc5c1f5: Re-enable ARMv7 memcpy implementation.
Merge commit '1f2a381e844abfb364af7cfc48d8a2cb1e194637'

* commit '1f2a381e844abfb364af7cfc48d8a2cb1e194637':
2009-10-14 16:17:54 -07:00
David 'Digit' Turner
1902b53152 am 5be45ce0: am 1e40783d: Fix armv7-user builds by disabling the ARMv7-optimized memcpy.
Merge commit '5be45ce0cf81a3904c697a77fa3e73bf85aead8b'

* commit '5be45ce0cf81a3904c697a77fa3e73bf85aead8b':
2009-10-14 16:17:50 -07:00
Jean-Baptiste Queru
73981476a3 merge from open-source master 2009-10-14 08:18:23 -07:00
Dima Zavin
a8f96cf3f9 am 5c328268: libc: kernel: add linux/msm_q6venc.h kernel include for qsd8k h/w video encode
Merge commit '5c32826841460294cfba98ff713b4804512bacd1'

* commit '5c32826841460294cfba98ff713b4804512bacd1':
  libc: kernel: add linux/msm_q6venc.h kernel include for qsd8k h/w video encode
2009-10-14 07:56:26 -07:00
Iliyan Malchev
7fbe3c8b78 am 0e24d2c9: update msm_camera.h
Merge commit '0e24d2c944e2eacd2f9ccefbfbda904fab7cf273'

* commit '0e24d2c944e2eacd2f9ccefbfbda904fab7cf273':
  update msm_camera.h
2009-10-14 07:56:22 -07:00
Dima Zavin
60c221ccfa am 5c328268: libc: kernel: add linux/msm_q6venc.h kernel include for qsd8k h/w video encode
Merge commit '5c32826841460294cfba98ff713b4804512bacd1' into eclair-plus-aosp

* commit '5c32826841460294cfba98ff713b4804512bacd1':
  libc: kernel: add linux/msm_q6venc.h kernel include for qsd8k h/w video encode
2009-10-13 22:40:14 -07:00
Iliyan Malchev
0619f2e744 am 0e24d2c9: update msm_camera.h
Merge commit '0e24d2c944e2eacd2f9ccefbfbda904fab7cf273' into eclair-plus-aosp

* commit '0e24d2c944e2eacd2f9ccefbfbda904fab7cf273':
  update msm_camera.h
2009-10-13 21:00:37 -07:00
Dima Zavin
f3b3c91e7d am 9a96aaa8: libc: kernel: Update linux/msm_kgsl.h to latest
Merge commit '9a96aaa8efcde245ac4ba23228b8a8d61e008d91'

* commit '9a96aaa8efcde245ac4ba23228b8a8d61e008d91':
  libc: kernel: Update linux/msm_kgsl.h to latest
2009-10-13 11:51:39 -07:00
Mathias Agopian
0d19cef4c1 am e3650267: fix [2170898] abort() doesn\'t print a stack tarce
Merge commit 'e36502673d98df089acbc645f077ee0c2be20c5d'

* commit 'e36502673d98df089acbc645f077ee0c2be20c5d':
  fix [2170898] abort() doesn't print a stack tarce
2009-10-12 11:48:19 -07:00
David 'Digit' Turner
51192d546d am fdc5c1f5: Re-enable ARMv7 memcpy implementation.
Merge commit 'fdc5c1f56f9d21034badb8e4b092c47098f19613'

* commit 'fdc5c1f56f9d21034badb8e4b092c47098f19613':
  Re-enable ARMv7 memcpy implementation.
2009-10-12 11:32:51 -07:00
David 'Digit' Turner
f406a20519 am 1e40783d: Fix armv7-user builds by disabling the ARMv7-optimized memcpy.
Merge commit '1e40783d9ad29c88a4d547774e05080fc4327a2e'

* commit '1e40783d9ad29c88a4d547774e05080fc4327a2e':
  Fix armv7-user builds by disabling the ARMv7-optimized memcpy.
2009-10-12 11:24:01 -07:00
Dima Zavin
d704c4d711 am 9a96aaa8: libc: kernel: Update linux/msm_kgsl.h to latest
Merge commit '9a96aaa8efcde245ac4ba23228b8a8d61e008d91' into eclair-plus-aosp

* commit '9a96aaa8efcde245ac4ba23228b8a8d61e008d91':
  libc: kernel: Update linux/msm_kgsl.h to latest
2009-10-07 21:43:42 -07:00
Mathias Agopian
ab9a0025d5 am e3650267: fix [2170898] abort() doesn\'t print a stack tarce
Merge commit 'e36502673d98df089acbc645f077ee0c2be20c5d' into eclair-plus-aosp

* commit 'e36502673d98df089acbc645f077ee0c2be20c5d':
  fix [2170898] abort() doesn't print a stack tarce
2009-10-07 11:58:25 -07:00
David 'Digit' Turner
1f2a381e84 am fdc5c1f5: Re-enable ARMv7 memcpy implementation.
Merge commit 'fdc5c1f56f9d21034badb8e4b092c47098f19613' into eclair-plus-aosp

* commit 'fdc5c1f56f9d21034badb8e4b092c47098f19613':
  Re-enable ARMv7 memcpy implementation.
2009-10-07 11:48:11 -07:00
David 'Digit' Turner
5be45ce0cf am 1e40783d: Fix armv7-user builds by disabling the ARMv7-optimized memcpy.
Merge commit '1e40783d9ad29c88a4d547774e05080fc4327a2e' into eclair-plus-aosp

* commit '1e40783d9ad29c88a4d547774e05080fc4327a2e':
  Fix armv7-user builds by disabling the ARMv7-optimized memcpy.
2009-10-07 11:42:33 -07:00
Elliott Hughes
cf399f77b8 Add a GNU-compatible TEMP_FAILURE_RETRY.
I wondered about #ifndef, but the other macros in here don't use it.

I also wondered about __GNUC__, since this macro uses two GCC extensions.
2009-10-05 13:19:05 -07:00
Iliyan Malchev
44e55ba8eb am fe46030c: Merge changes I3bd27087,I0c9ec550,I3a0e5e86 into eclair
Merge commit 'fe46030cdd97f9cf810630541df367dd2b85cae9' into eclair-plus-aosp

* commit 'fe46030cdd97f9cf810630541df367dd2b85cae9':
  bionic/linker: allow resolving of symbols from library back to executable
  bionic/linker: change lookup() to return soinfo, not base
  Revert "Revert "bionic/linker: fix symbol lookup during relocations""
2009-09-29 15:28:53 -07:00
David 'Digit' Turner
0893d49187 am 7a9e06fa: Merge change I2a7ad975 into eclair
Merge commit '7a9e06fa7e4e533074cde314f25dff3024f34a5d' into eclair-plus-aosp

* commit '7a9e06fa7e4e533074cde314f25dff3024f34a5d':
  Fix ABI breakage in libc.so and libm.so between 1.6 and Eclair.
2009-09-29 15:13:15 -07:00
Mathias Agopian
2d77d4dbd6 am ee223d02: NEON optimized memcpy.
Merge commit 'ee223d02d96815c989b62043ff1237b1cd4e14b0' into eclair-plus-aosp

* commit 'ee223d02d96815c989b62043ff1237b1cd4e14b0':
  NEON optimized memcpy.
2009-09-29 13:31:57 -07:00
Shin-ichiro KAWASAKI
10093276e9 added and modified bionic code to support SuperH architecture
modified:   libc/Android.mk
    new files:   libc/arch-sh/bionic/*
    new files:   libc/arch-sh/include/*
2009-09-28 16:11:39 +09:00
Mathias Agopian
468fc8c533 am 33acbf07: Revert "bionic/linker: fix symbol lookup during relocations"
Merge commit '33acbf0719c4f3db059bc9e1f52cf554a5d0295f' into eclair-plus-aosp

* commit '33acbf0719c4f3db059bc9e1f52cf554a5d0295f':
  Revert "bionic/linker: fix symbol lookup during relocations"
2009-09-27 22:20:08 -07:00
Iliyan Malchev
76e3d69330 am 4e5a965d: Merge change 27075 into eclair
Merge commit '4e5a965d6a4c4a0c7977cc9b90755027130c1e46' into eclair-plus-aosp

* commit '4e5a965d6a4c4a0c7977cc9b90755027130c1e46':
  bionic/linker: fix symbol lookup during relocations
2009-09-27 17:35:01 -07:00
David 'Digit' Turner
dfa87a200f am f355096a: Remove NEON optimizations for memcpy
Merge commit 'f355096a64b74c8e869527de55f7e908873e3128' into eclair-plus-aosp

* commit 'f355096a64b74c8e869527de55f7e908873e3128':
  Remove NEON optimizations for memcpy
2009-09-27 07:19:59 -07:00
David 'Digit' Turner
7e5e9f4270 am bc10cd29: Fix a typo that resulted in a crash in the boot sequence
Merge commit 'bc10cd2900cdb7fed077163b6a33e0f8572b2b19' into eclair-plus-aosp

* commit 'bc10cd2900cdb7fed077163b6a33e0f8572b2b19':
  Fix a typo that resulted in a crash in the boot sequence
2009-09-23 16:09:39 -07:00
David 'Digit' Turner
9641805419 am d154954f: Merge change 26419 into eclair
Merge commit 'd154954f02691618fdf73a5a97336e64cad37af0' into eclair-plus-aosp

* commit 'd154954f02691618fdf73a5a97336e64cad37af0':
  Add pthread_mutex_lock_timeout_np
2009-09-23 12:20:52 -07:00
David 'Digit' Turner
7910e39d19 resolved conflicts for merge of 4a05d12c to eclair-plus-aosp 2009-09-22 15:41:36 -07:00
Android Code Review
4e30c09e57 Merge change 10538
* changes:
  added syscalls for SuperH which automatically generate by gensyscalls.py
2009-09-20 23:39:18 -07:00
Dima Zavin
7ed086eb99 am 916edf2a: libc: kernel-headers: update msm_mdp.h to include premultiplied alpha
Merge commit '916edf2a3fc60e08a5f29cd322d9f2a04d15cb49' into eclair-plus-aosp

* commit '916edf2a3fc60e08a5f29cd322d9f2a04d15cb49':
  libc: kernel-headers: update msm_mdp.h to include premultiplied alpha
2009-09-20 19:21:11 -07:00
Android Code Review
5632aeb838 Merge change 10539
* changes:
  modified kernel headers re-generate tools to support SuperH architecture
2009-09-17 13:43:08 -07:00
Android Code Review
5672726b44 Merge change 10587
* changes:
  Fill l_ld of linkmaps with value from soinfo::dynamic.
2009-09-16 17:40:39 -07:00
Jean-Baptiste Queru
895244b2ab merge from open-source master 2009-09-16 16:21:35 -07:00
vinay harugop
a246a71975 Linux kernel helpers support is provided to android for its TLS implementation. This fix addresses this by modifying
the TLS access functions to use the kernel helper.
This Fix is verified on ST Ericsson's U8500 platform and Submitted on behalf of a third-party:
Surinder-pal SINGH from STMicroelectronics.
2009-09-16 14:38:40 -07:00
Thinker K.F Li
5cf640c926 Fill l_ld of linkmaps with value from soinfo::dynamic.
GDB will try to read l_ld of linkmaps and compare the value to vma of
.dynamic sections from shared objects.  Since linker does not assign l_ld,
GDB will complain about and re-compute l_addr from l_ld.  And, GDB will get a
wrong value.
2009-09-15 17:05:55 -07:00
Android Code Review
c7f65a01e5 Merge change 10541
* changes:
  added and modified libdl to support SuperH architecture
2009-09-15 16:53:18 -07:00
Android Code Review
77e9c05988 Merge change 10542
* changes:
  added and modified libm to support SuperH architecture
2009-09-15 16:53:01 -07:00
Android Code Review
252c576d7e Merge change 11671
* changes:
  Define 64 bit types if compiling with -std=c99
2009-09-15 16:43:44 -07:00
Ben Cheng
b8a18d059b am bd192b47: Add stack unwinding directives to assembly leaf functions.
Merge commit 'bd192b470b69e00e9313680b70c5572a609e535d' into eclair-plus-aosp

* commit 'bd192b470b69e00e9313680b70c5572a609e535d':
  Add stack unwinding directives to assembly leaf functions.
2009-09-15 14:51:10 -07:00
Jean-Baptiste Queru
cdeb4c8afa merge from open-source master 2009-09-15 07:51:39 -07:00
Matthieu CASTET
a4e67f4512 Remove code duplication for pthread_cond_timeout_np : use __pthread_cond_timedwait_relative helper 2009-09-14 09:19:42 -07:00
Martin Storsjo
c88110e284 Define 64 bit types if compiling with -std=c99
Compiling with -std=c99 defines __STRICT_ANSI__, but the 64 bit types
and type macros should still be defined in this case.

This helps compiling third party code that needs -std=c99 with the NDK.
2009-09-14 16:45:50 +02:00
Iliyan Malchev
664dac1e95 am 82420129: bionic: update processed msm_camera.h
Merge commit '824201294b5f3c3ad6ca9d9751d96f78142c5409' into eclair-plus-aosp

* commit '824201294b5f3c3ad6ca9d9751d96f78142c5409':
  bionic: update processed msm_camera.h
2009-09-11 00:39:49 -07:00
David 'Digit' Turner
0dfd94cff4 am 4e57cf3f: Merge change 24463 into eclair
Merge commit '4e57cf3f8c0b696f117579c8165b13c8d32b9b5d' into eclair-plus-aosp

* commit '4e57cf3f8c0b696f117579c8165b13c8d32b9b5d':
  Fix an infinite loop in time2sub.
2009-09-09 18:01:11 -07:00
Erik Gilling
842cdcd2f6 am 9e74f697: libc: add void to clock() function prototype
Merge commit '9e74f697e0178a0e9b6133a2b270cc7fed9920bf' into eclair-plus-aosp

* commit '9e74f697e0178a0e9b6133a2b270cc7fed9920bf':
  libc: add void to clock() function prototype
2009-09-09 15:13:56 -07:00
vinay harugop
76ec6891e2 ARM architecture reference manuals for ARMv6 & ARMv7 state that the use of 'swp' instruction is deprecated
ARMv6 onwards. These architectures provide the load-linked, store-conditional pair of ldrex/strex whose use
is recommended in place of 'swp'. Also, the description of the 'swp' instruction in the ARMv6 reference
manual states that the swap operation does not include any memory barrier guarantees.This fix attempts to
address these issues by providing an atomic swap implementation using ldrex/strex under _ARM_HAVE_LDREX_STREX
macro.  This Fix is verified on ST Ericsson's U8500 platform and Submitted on behalf of a third-party:
Surinder-pal SINGH from STMicroelectronics.
2009-09-09 21:01:46 +05:30
David 'Digit' Turner
c0ed422958 am b4423ff7: Merge change 22848 into eclair
Merge commit 'b4423ff7dfd8c97688cbf87ba8ce22f5b54fa89c' into eclair-plus-aosp

* commit 'b4423ff7dfd8c97688cbf87ba8ce22f5b54fa89c':
  Neon-optimized versions of memcpy.
2009-09-02 15:09:19 -07:00
Jean-Baptiste Queru
00fb8b45d9 merge from open-source master 2009-09-01 08:27:42 -07:00
Shin-ichiro KAWASAKI
ce0595d01d modified SYSCALLS.TXT to support SuperH architecture 2009-09-01 19:03:06 +09:00
Chih-Wei Huang
a90528ad34 Include <endian.h> instead of <sys/endian.h>,
since the later doesn't define byte order.
2009-08-31 15:42:09 +08:00
Shin-ichiro KAWASAKI
efecfde19a added and modified libdl to support SuperH architecture 2009-08-31 16:39:32 +09:00
Shin-ichiro KAWASAKI
d87945b4e7 added and modified libm to support SuperH architecture 2009-08-31 16:25:42 +09:00
Alexey Tarasov
cc05d12716 Changed logging functions in bionic/logd_write.c.
Main differences from original code:
1. now log channel for LOG_ID_MAIN may exist even if LOG_ID_RADIO
   facility failed.
2. __write_to_log_null() now acts as always successful function.
3. it's more simplier to add new logging channels now

ammended commit fixes my typo on line 130
2009-08-25 10:27:26 -07:00
Android Code Review
8f53951b05 Merge change 10749
* changes:
  Make sure size_t is defined before used in strings.h
2009-08-21 11:25:21 -07:00
Android Code Review
f76b577fed Merge change 10757
* changes:
  Add an 's and a . to the bionic/libc README.
2009-08-21 11:24:58 -07:00
Joe LaPenna
1d763d50e7 Add an 's and a . to the bionic/libc README. 2009-07-23 17:41:47 -07:00
Martin Storsjo
70f1280ca9 Make sure size_t is defined before used in strings.h
Otherwise, including strings.h as the first file in a C file yields errors.

This fixes issue 3332.
2009-07-22 11:41:02 +02:00
Shin-ichiro KAWASAKI
37429fff41 modified kernel headers re-generate tools to support SuperH architecture 2009-07-01 15:41:52 +09:00
Tony Sim
336efb5267 added syscalls for SuperH which automatically generate by gensyscalls.py 2009-07-01 15:35:27 +09:00
701 changed files with 40794 additions and 2309 deletions

1
.gitignore vendored
View File

@@ -1,2 +1,3 @@
*.pyc
*.*~
libc/kernel/original

View File

@@ -14,6 +14,11 @@
# limitations under the License.
#
LOCAL_PATH := $(call my-dir)
ifneq ($(TARGET_SIMULATOR),true)
include $(call all-subdir-makefiles)
else
# The host dalvikvm needs Android's concatenated & indexed timezone data.
include $(LOCAL_PATH)/libc/zoneinfo/Android.mk
endif

49
CleanSpec.mk Normal file
View File

@@ -0,0 +1,49 @@
# Copyright (C) 2007 The Android Open Source Project
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# If you don't need to do a full clean build but would like to touch
# a file or delete some intermediate files, add a clean step to the end
# of the list. These steps will only be run once, if they haven't been
# run before.
#
# E.g.:
# $(call add-clean-step, touch -c external/sqlite/sqlite3.h)
# $(call add-clean-step, rm -rf $(PRODUCT_OUT)/obj/STATIC_LIBRARIES/libz_intermediates)
#
# Always use "touch -c" and "rm -f" or "rm -rf" to gracefully deal with
# files that are missing or have been moved.
#
# Use $(PRODUCT_OUT) to get to the "out/target/product/blah/" directory.
# Use $(OUT_DIR) to refer to the "out" directory.
#
# If you need to re-do something that's already mentioned, just copy
# the command and add it to the bottom of the list. E.g., if a change
# that you made last week required touching a file and a change you
# made today requires touching the same file, just copy the old
# touch step and add it to the end of the list.
#
# ************************************************
# NEWER CLEAN STEPS MUST BE AT THE END OF THE LIST
# ************************************************
# For example:
#$(call add-clean-step, rm -rf $(OUT_DIR)/target/common/obj/APPS/AndroidTests_intermediates)
#$(call add-clean-step, rm -rf $(OUT_DIR)/target/common/obj/JAVA_LIBRARIES/core_intermediates)
#$(call add-clean-step, find $(OUT_DIR) -type f -name "IGTalkSession*" -print0 | xargs -0 rm -f)
#$(call add-clean-step, rm -rf $(PRODUCT_OUT)/data/*)
# ************************************************
# NEWER CLEAN STEPS MUST BE AT THE END OF THE LIST
# ************************************************

6
MAINTAINERS Normal file
View File

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

10
ThirdPartyProject.prop Normal file
View File

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

View File

@@ -11,9 +11,11 @@ libc_common_src_files := \
unistd/brk.c \
unistd/creat.c \
unistd/daemon.c \
unistd/eventfd.c \
unistd/exec.c \
unistd/fcntl.c \
unistd/fnmatch.c \
unistd/fstatfs.c \
unistd/ftime.c \
unistd/ftok.c \
unistd/getcwd.c \
@@ -26,6 +28,7 @@ libc_common_src_files := \
unistd/initgroups.c \
unistd/isatty.c \
unistd/issetugid.c \
unistd/killpg.c \
unistd/lseek64.c \
unistd/mmap.c \
unistd/nice.c \
@@ -46,19 +49,22 @@ libc_common_src_files := \
unistd/sbrk.c \
unistd/send.c \
unistd/setegid.c \
unistd/setuid.c \
unistd/seteuid.c \
unistd/setreuid.c \
unistd/setresuid.c \
unistd/setpgrp.c \
unistd/sigblock.c \
unistd/siginterrupt.c \
unistd/siglist.c \
unistd/signal.c \
unistd/signame.c \
unistd/sigsetmask.c \
unistd/sigsuspend.c \
unistd/sigwait.c \
unistd/sleep.c \
unistd/statfs.c \
unistd/strsignal.c \
unistd/sysconf.c \
unistd/syslog.c \
unistd/system.c \
unistd/tcgetpgrp.c \
@@ -170,19 +176,16 @@ libc_common_src_files := \
stdlib/tolower_.c \
stdlib/toupper_.c \
stdlib/wchar.c \
string/bcopy.c \
string/index.c \
string/memccpy.c \
string/memchr.c \
string/memmem.c \
string/memmove.c.arm \
string/memrchr.c \
string/memswap.c \
string/strcasecmp.c \
string/strcasestr.c \
string/strcat.c \
string/strchr.c \
string/strcmp.c \
string/strcoll.c \
string/strcpy.c \
string/strcspn.c \
@@ -192,7 +195,6 @@ libc_common_src_files := \
string/strlcat.c \
string/strlcpy.c \
string/strncat.c \
string/strncmp.c \
string/strncpy.c \
string/strndup.c \
string/strnlen.c \
@@ -204,6 +206,35 @@ libc_common_src_files := \
string/strtok.c \
string/strtotimeval.c \
string/strxfrm.c \
wchar/wcpcpy.c \
wchar/wcpncpy.c \
wchar/wcscasecmp.c \
wchar/wcscat.c \
wchar/wcschr.c \
wchar/wcscmp.c \
wchar/wcscoll.c \
wchar/wcscpy.c \
wchar/wcscspn.c \
wchar/wcsdup.c \
wchar/wcslcat.c \
wchar/wcslcpy.c \
wchar/wcslen.c \
wchar/wcsncasecmp.c \
wchar/wcsncat.c \
wchar/wcsncmp.c \
wchar/wcsncpy.c \
wchar/wcsnlen.c \
wchar/wcspbrk.c \
wchar/wcsrchr.c \
wchar/wcsspn.c \
wchar/wcsstr.c \
wchar/wcstok.c \
wchar/wcswidth.c \
wchar/wmemchr.c \
wchar/wmemcmp.c \
wchar/wmemcpy.c \
wchar/wmemmove.c \
wchar/wmemset.c \
inet/bindresvport.c \
inet/inet_addr.c \
inet/inet_aton.c \
@@ -215,17 +246,21 @@ libc_common_src_files := \
tzcode/localtime.c \
tzcode/strftime.c \
tzcode/strptime.c \
bionic/__errno.c \
bionic/__set_errno.c \
bionic/_rand48.c \
bionic/cpuacct.c \
bionic/arc4random.c \
bionic/basename.c \
bionic/basename_r.c \
bionic/clearenv.c \
bionic/dirname.c \
bionic/dirname_r.c \
bionic/drand48.c \
bionic/erand48.c \
bionic/err.c \
bionic/fdprintf.c \
bionic/fork.c \
bionic/fts.c \
bionic/if_nametoindex.c \
bionic/if_indextoname.c \
bionic/ioctl.c \
@@ -259,7 +294,7 @@ libc_common_src_files := \
netbsd/resolv/res_mkquery.c \
netbsd/resolv/res_query.c \
netbsd/resolv/res_send.c \
netbsd/resolv/res_state.c.arm \
netbsd/resolv/res_state.c \
netbsd/resolv/res_cache.c \
netbsd/net/nsdispatch.c \
netbsd/net/getaddrinfo.c \
@@ -273,19 +308,41 @@ libc_common_src_files := \
netbsd/nameser/ns_ttl.c \
netbsd/nameser/ns_netint.c \
netbsd/nameser/ns_print.c \
netbsd/nameser/ns_samedomain.c
netbsd/nameser/ns_samedomain.c \
regex/regcomp.c \
regex/regerror.c \
regex/regexec.c \
regex/regfree.c \
# The following files are common, but must be compiled
# with different C flags when building a static C library.
#
# The reason for this is the implementation of __get_tls()
# that will differ between the shared and static versions
# of the library.
#
# See comments in private/bionic_tls.h for more details.
#
# NOTE: bionic/pthread.c is added later to this list
# because it needs special handling on ARM, see
# below.
#
libc_static_common_src_files := \
unistd/sysconf.c \
bionic/__errno.c \
# Architecture specific source files go here
# =========================================================
ifeq ($(TARGET_ARCH),arm)
libc_common_src_files += \
bionic/eabi.c \
bionic/bionic_clone.c \
arch-arm/bionic/__get_pc.S \
arch-arm/bionic/__get_sp.S \
arch-arm/bionic/_exit_with_stack_teardown.S \
arch-arm/bionic/_setjmp.S \
arch-arm/bionic/atomics_arm.S \
arch-arm/bionic/clone.S \
arch-arm/bionic/eabi.c \
arch-arm/bionic/ffs.S \
arch-arm/bionic/kill.S \
arch-arm/bionic/libgcc_compat.c \
@@ -298,16 +355,23 @@ libc_common_src_files += \
arch-arm/bionic/sigsetjmp.S \
arch-arm/bionic/strlen.c.arm \
arch-arm/bionic/syscall.S \
string/memmove.c.arm \
string/bcopy.c \
string/strcmp.c \
string/strncmp.c \
unistd/socketcalls.c
# These files need to be arm so that gdbserver
# can set breakpoints in them without messing
# up any thumb code.
libc_common_src_files += \
bionic/pthread.c.arm \
bionic/pthread-rwlocks.c.arm \
bionic/pthread-timers.c.arm \
bionic/ptrace.c.arm
libc_static_common_src_files += \
bionic/pthread.c.arm \
# these are used by the static and dynamic versions of the libc
# respectively
libc_arch_static_src_files := \
@@ -328,21 +392,66 @@ libc_common_src_files += \
arch-x86/bionic/setjmp.S \
arch-x86/bionic/_setjmp.S \
arch-x86/bionic/vfork.S \
arch-x86/string/bzero.S \
arch-x86/string/memset.S \
arch-x86/string/memcmp.S \
arch-x86/string/memcpy.S \
arch-x86/bionic/syscall.S \
arch-x86/string/bcopy_wrapper.S \
arch-x86/string/memcpy_wrapper.S \
arch-x86/string/memmove_wrapper.S \
arch-x86/string/bzero_wrapper.S \
arch-x86/string/memcmp_wrapper.S \
arch-x86/string/memset_wrapper.S \
arch-x86/string/strcmp_wrapper.S \
arch-x86/string/strncmp_wrapper.S \
arch-x86/string/strlen.S \
bionic/pthread.c \
bionic/pthread-rwlocks.c \
bionic/pthread-timers.c \
bionic/ptrace.c
libc_static_common_src_files += \
bionic/pthread.c \
# this is needed for static versions of libc
libc_arch_static_src_files := \
arch-x86/bionic/dl_iterate_phdr_static.c
libc_arch_dynamic_src_files :=
endif # x86
else # !x86
ifeq ($(TARGET_ARCH),sh)
libc_common_src_files += \
arch-sh/bionic/__get_pc.S \
arch-sh/bionic/__get_sp.S \
arch-sh/bionic/_exit_with_stack_teardown.S \
arch-sh/bionic/_setjmp.S \
arch-sh/bionic/atomics_sh.c \
arch-sh/bionic/atomic_cmpxchg.S \
arch-sh/bionic/clone.S \
arch-sh/bionic/pipe.S \
arch-sh/bionic/memcpy.S \
arch-sh/bionic/memset.S \
arch-sh/bionic/bzero.S \
arch-sh/bionic/setjmp.S \
arch-sh/bionic/sigsetjmp.S \
arch-sh/bionic/syscall.S \
arch-sh/bionic/memmove.S \
arch-sh/bionic/__set_tls.c \
arch-sh/bionic/__get_tls.c \
arch-sh/bionic/ffs.S \
string/bcopy.c \
string/strcmp.c \
string/strncmp.c \
string/memcmp.c \
string/strlen.c \
bionic/pthread-rwlocks.c \
bionic/pthread-timers.c \
bionic/ptrace.c \
unistd/socketcalls.c
libc_static_common_src_files += \
bionic/pthread.c \
endif # sh
endif # !x86
endif # !arm
# Define some common cflags
@@ -355,10 +464,18 @@ libc_common_cflags := \
-D_LIBC=1 \
-DSOFTFLOAT \
-DFLOATING_POINT \
-DNEED_PSELECT=1 \
-DINET6 \
-I$(LOCAL_PATH)/private \
-DUSE_DL_PREFIX
-DUSE_DL_PREFIX \
-DPOSIX_MISTAKE
# 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)
libc_common_cflags += -DDEBUG
@@ -380,9 +497,25 @@ ifeq ($(TARGET_ARCH),arm)
else # !arm
ifeq ($(TARGET_ARCH),x86)
libc_crt_target_cflags := -m32
# Enable recent IA friendly memory routines (such as for Atom)
# These will not work on the earlier x86 machines
libc_common_cflags += -mtune=i686 -DUSE_SSSE3 -DUSE_SSE2
endif # x86
endif # !arm
# Define ANDROID_SMP appropriately.
ifeq ($(TARGET_CPU_SMP),true)
libc_common_cflags += -DANDROID_SMP=1
else
libc_common_cflags += -DANDROID_SMP=0
endif
# Needed to access private/__dso_handle.S from
# crtbegin_xxx.S and crtend_xxx.S
#
libc_crt_target_cflags += -I$(LOCAL_PATH)/private
# Define some common includes
# ========================================================
libc_common_c_includes := \
@@ -396,10 +529,17 @@ libc_common_c_includes := \
# executables)
# ==========================================================================
ifeq ($(TARGET_ARCH),x86)
# we only need begin_so/end_so for x86, since it needs an appropriate .init
# section in the shared library with a function to call all the entries in
# .ctors section. ARM uses init_array, and does not need the function.
ifneq ($(filter arm x86,$(TARGET_ARCH)),)
# ARM and x86 need crtbegin_so/crtend_so.
#
# For x86, the .init section must point to a function that calls all
# entries in the .ctors section. (on ARM this is done through the
# .init_array section instead).
#
# For both platforms, the .fini_array section must point to a function
# that will call __cxa_finalize(&__dso_handle) in order to ensure that
# static C++ destructors are properly called on dlclose().
#
GEN := $(TARGET_OUT_STATIC_LIBRARIES)/crtbegin_so.o
$(GEN): $(LOCAL_PATH)/arch-$(TARGET_ARCH)/bionic/crtbegin_so.S
@mkdir -p $(dir $@)
@@ -468,10 +608,12 @@ include $(CLEAR_VARS)
LOCAL_SRC_FILES := \
$(libc_arch_static_src_files) \
$(libc_static_common_src_files) \
bionic/libc_init_static.c
LOCAL_C_INCLUDES := $(libc_common_c_includes)
LOCAL_CFLAGS := $(libc_common_cflags)
LOCAL_CFLAGS := $(libc_common_cflags) \
-DLIBC_STATIC
LOCAL_MODULE := libc_nomalloc
LOCAL_WHOLE_STATIC_LIBRARIES := libc_common
@@ -487,18 +629,14 @@ include $(CLEAR_VARS)
LOCAL_SRC_FILES := \
$(libc_arch_static_src_files) \
$(libc_static_common_src_files) \
bionic/dlmalloc.c \
bionic/malloc_debug_common.c \
bionic/libc_init_static.c
LOCAL_CFLAGS := $(libc_common_cflags)
ifeq ($(WITH_MALLOC_CHECK_LIBC_A),true)
LOCAL_CFLAGS += -DMALLOC_LEAK_CHECK
LOCAL_SRC_FILES += bionic/malloc_leak.c.arm
endif
LOCAL_CFLAGS := $(libc_common_cflags) \
-DLIBC_STATIC
LOCAL_C_INCLUDES := $(libc_common_c_includes)
LOCAL_MODULE := libc
LOCAL_WHOLE_STATIC_LIBRARIES := libc_common
LOCAL_SYSTEM_SHARED_LIBRARIES :=
@@ -516,8 +654,9 @@ LOCAL_C_INCLUDES := $(libc_common_c_includes)
LOCAL_SRC_FILES := \
$(libc_arch_dynamic_src_files) \
$(libc_static_common_src_files) \
bionic/dlmalloc.c \
bionic/malloc_leak.c.arm \
bionic/malloc_debug_common.c \
bionic/libc_init_dynamic.c
LOCAL_MODULE:= libc
@@ -537,8 +676,16 @@ LOCAL_SYSTEM_SHARED_LIBRARIES :=
include $(BUILD_SHARED_LIBRARY)
# For all builds, except for the -user build we will enable memory
# allocation checking (including memory leaks, buffer overwrites, etc.)
# Note that all these checks are also controlled by env. settings
# that can enable, or disable specific checks. Note also that some of
# the checks are available only in emulator and are implemeted in
# libc_malloc_qemu_instrumented.so.
ifneq ($(TARGET_BUILD_VARIANT),user)
# ========================================================
# libc_debug.so
# libc_malloc_debug_leak.so
# ========================================================
include $(CLEAR_VARS)
@@ -549,30 +696,49 @@ LOCAL_CFLAGS := \
LOCAL_C_INCLUDES := $(libc_common_c_includes)
LOCAL_SRC_FILES := \
$(libc_arch_dynamic_src_files) \
bionic/dlmalloc.c \
bionic/malloc_leak.c.arm \
bionic/libc_init_dynamic.c
bionic/malloc_debug_leak.c
LOCAL_MODULE:= libc_debug
LOCAL_MODULE:= libc_malloc_debug_leak
# WARNING: The only library libc.so should depend on is libdl.so! If you add other libraries,
# make sure to add -Wl,--exclude-libs=libgcc.a to the LOCAL_LDFLAGS for those libraries. This
# ensures that symbols that are pulled into those new libraries from libgcc.a are not declared
# external; if that were the case, then libc would not pull those symbols from libgcc.a as it
# should, instead relying on the external symbols from the dependent libraries. That would
# create an "cloaked" dependency on libgcc.a in libc though the libraries, which is not what
# you wanted!
LOCAL_SHARED_LIBRARIES := libdl
LOCAL_SHARED_LIBRARIES := libc
LOCAL_WHOLE_STATIC_LIBRARIES := libc_common
LOCAL_SYSTEM_SHARED_LIBRARIES :=
# Don't prelink
LOCAL_PRELINK_MODULE := false
# Don't install on release build
LOCAL_MODULE_TAGS := eng
LOCAL_MODULE_TAGS := eng debug
include $(BUILD_SHARED_LIBRARY)
# ========================================================
# libc_malloc_debug_qemu.so
# ========================================================
include $(CLEAR_VARS)
LOCAL_CFLAGS := \
$(libc_common_cflags) \
-DMALLOC_QEMU_INSTRUMENT
LOCAL_C_INCLUDES := $(libc_common_c_includes)
LOCAL_SRC_FILES := \
bionic/malloc_debug_qemu.c
LOCAL_MODULE:= libc_malloc_debug_qemu
LOCAL_SHARED_LIBRARIES := libc
LOCAL_WHOLE_STATIC_LIBRARIES := libc_common
LOCAL_SYSTEM_SHARED_LIBRARIES :=
# Don't prelink
LOCAL_PRELINK_MODULE := false
# Don't install on release build
LOCAL_MODULE_TAGS := eng debug
include $(BUILD_SHARED_LIBRARY)
endif #!user
# ========================================================
include $(call all-makefiles-under,$(LOCAL_PATH))

View File

@@ -1,4 +1,5 @@
Welcome to Bionic, Android small and custom C library for the Android platform
Welcome to Bionic, Android's small and custom C library for the Android
platform.
Bionic is mainly a port of the BSD C library to our Linux kernel with the
following additions/changes:

View File

@@ -22,6 +22,9 @@
# assembler template for the syscall; it's up to the bionic implementation to provide
# a relevant C stub
#
# - additionally, if the syscall number is different amoung ARM, x86 and SuperH, use:
# return_type funcname[:syscall_name](parameters) arm_number,x86_number,superh_number
#
# the file is processed by a python script named gensyscalls.py
#
@@ -30,11 +33,16 @@ void _exit:exit_group (int) 248,252
void _exit_thread:exit (int) 1
pid_t __fork:fork (void) 2
pid_t _waitpid:waitpid (pid_t, int*, int, struct rusage*) -1,7
int waitid(int, pid_t, struct siginfo_t*, int,void*) 280,284
pid_t __clone:clone(int (*fn)(void*), void *child_stack, int flags, void *arg) 120
int __waitid:waitid(int, pid_t, struct siginfo_t*, int,void*) 280,284
# NOTE: this system call is never called directly, but we list it there
# to have __NR_clone properly defined.
#
pid_t __sys_clone:clone (int, void*, int*, void*, int*) 120
int execve (const char*, char* const*, char* const*) 11
int setuid:setuid32 (uid_t) 213
int __setuid:setuid32 (uid_t) 213
uid_t getuid:getuid32 () 199
gid_t getgid:getgid32 () 200
uid_t geteuid:geteuid32 () 201
@@ -48,8 +56,8 @@ pid_t getppid() 64
pid_t setsid() 66
int setgid:setgid32(gid_t) 214
int seteuid:seteuid32(uid_t) stub
int setreuid:setreuid32(uid_t, uid_t) 203
int setresuid:setresuid32(uid_t, uid_t, uid_t) 208
int __setreuid:setreuid32(uid_t, uid_t) 203
int __setresuid:setresuid32(uid_t, uid_t, uid_t) 208
int setresgid:setresgid32(gid_t, gid_t, gid_t) 210
void* __brk:brk(void*) 45
# see comments in arch-arm/bionic/kill.S to understand why we don't generate an ARM stub for kill/tkill
@@ -65,12 +73,13 @@ int getrusage(int who, struct rusage* r_usage) 77
int setgroups:setgroups32(int, const gid_t *) 206
pid_t getpgrp(void) stub
int setpgid(pid_t, pid_t) 57
pid_t vfork(void) 190,-1
pid_t vfork(void) 190,-1,190
int setregid:setregid32(gid_t, gid_t) 204
int chroot(const char *) 61
int prctl(int option, unsigned int arg2, unsigned int arg3, unsigned int arg4, unsigned int arg5) 172
int capget(cap_user_header_t header, cap_user_data_t data) 184
int capset(cap_user_header_t header, const cap_user_data_t data) 185
int sigaltstack(const stack_t*, stack_t*) 186
int acct(const char* filepath) 51
# file descriptors
@@ -102,16 +111,18 @@ int __fcntl:fcntl(int, int, void*) 55
int flock(int, int) 143
int fchmod(int, mode_t) 94
int dup(int) 41
int pipe(int *) 42
int pipe(int *) 42,42,-1
int pipe2(int *, int) 359,331
int dup2(int, int) 63
int select:_newselect(int, struct fd_set *, struct fd_set *, struct fd_set *, struct timeval *) 142
int ftruncate(int, off_t) 93
int getdents:getdents64(unsigned int, struct dirent *, unsigned int) 217,220
int fsync(int) 118
int fdatasync(int) 148
int fchown:fchown32(int, uid_t, gid_t) 207
void sync(void) 36
int __fcntl64:fcntl64(int, int, void *) 221
int fstatfs:fstatfs64(int, size_t, struct statfs *) 267,269
int __fstatfs64:fstatfs64(int, size_t, struct statfs *) 267,269
ssize_t sendfile(int out_fd, int in_fd, off_t *offset, size_t count) 187
int fstatat:fstatat64(int dirfd, const char *path, struct stat *buf, int flags) 327,300
int mkdirat(int dirfd, const char *pathname, mode_t mode) 323,296
@@ -190,21 +201,24 @@ int sendmsg(int, const struct msghdr *, unsigned int) 296,-1
int recvmsg(int, struct msghdr *, unsigned int) 297,-1
# sockets for x86. These are done as an "indexed" call to socketcall syscall.
int socket:socketcall:1 (int, int, int) -1,102
int bind:socketcall:2 (int, struct sockaddr *, int) -1,102
int connect:socketcall:3(int, struct sockaddr *, socklen_t) -1,102
int listen:socketcall:4(int, int) -1,102
int accept:socketcall:5(int, struct sockaddr *, socklen_t *) -1,102
int getsockname:socketcall:6(int, struct sockaddr *, socklen_t *) -1,102
int getpeername:socketcall:7(int, struct sockaddr *, socklen_t *) -1,102
int socketpair:socketcall:8(int, int, int, int*) -1,102
int sendto:socketcall:11(int, const void *, size_t, int, const struct sockaddr *, socklen_t) -1,102
int recvfrom:socketcall:12(int, void *, size_t, unsigned int, struct sockaddr *, socklen_t *) -1,102
int shutdown:socketcall:13(int, int) -1,102
int setsockopt:socketcall:14(int, int, int, const void *, socklen_t) -1,102
int getsockopt:socketcall:15(int, int, int, void *, socklen_t *) -1,102
int sendmsg:socketcall:16(int, const struct msghdr *, unsigned int) -1,102
int recvmsg:socketcall:17(int, struct msghdr *, unsigned int) -1,102
int socket:socketcall:1 (int, int, int) -1,102,-1
int bind:socketcall:2 (int, struct sockaddr *, int) -1,102,-1
int connect:socketcall:3(int, struct sockaddr *, socklen_t) -1,102,-1
int listen:socketcall:4(int, int) -1,102,-1
int accept:socketcall:5(int, struct sockaddr *, socklen_t *) -1,102,-1
int getsockname:socketcall:6(int, struct sockaddr *, socklen_t *) -1,102,-1
int getpeername:socketcall:7(int, struct sockaddr *, socklen_t *) -1,102,-1
int socketpair:socketcall:8(int, int, int, int*) -1,102,-1
int sendto:socketcall:11(int, const void *, size_t, int, const struct sockaddr *, socklen_t) -1,102,-1
int recvfrom:socketcall:12(int, void *, size_t, unsigned int, struct sockaddr *, socklen_t *) -1,102,-1
int shutdown:socketcall:13(int, int) -1,102,-1
int setsockopt:socketcall:14(int, int, int, const void *, socklen_t) -1,102,-1
int getsockopt:socketcall:15(int, int, int, void *, socklen_t *) -1,102,-1
int sendmsg:socketcall:16(int, const struct msghdr *, unsigned int) -1,102,-1
int recvmsg:socketcall:17(int, struct msghdr *, unsigned int) -1,102,-1
# sockets for sh.
int __socketcall:__socketcall(int, unsigned long*) -1,-1,102
# scheduler & real-time
int sched_setscheduler(pid_t pid, int policy, const struct sched_param *param) 156
@@ -216,6 +230,10 @@ int sched_get_priority_max(int policy) 159
int sched_get_priority_min(int policy) 160
int sched_rr_get_interval(pid_t pid, struct timespec *interval) 161
# io priorities
int ioprio_set(int which, int who, int ioprio) 314,289,288
int ioprio_get(int which, int who) 315,290,289
# other
int uname(struct utsname *) 122
pid_t __wait4:wait4(pid_t pid, int *status, int options, struct rusage *rusage) 114
@@ -225,6 +243,7 @@ int __syslog:syslog(int, char *, int) 103
int init_module(void *, unsigned long, const char *) 128
int delete_module(const char*, unsigned int) 129
int klogctl:syslog(int, char *, int) 103
int sysinfo(struct sysinfo *) 116
# futex
int futex(void *, int, int, void *, void *, int) 240
@@ -234,12 +253,14 @@ int epoll_create(int size) 250,254
int epoll_ctl(int epfd, int op, int fd, struct epoll_event *event) 251,255
int epoll_wait(int epfd, struct epoll_event *events, int max, int timeout) 252,256
int inotify_init(void) 316,291
int inotify_add_watch(int, const char *, unsigned int) 317,292
int inotify_rm_watch(int, unsigned int) 318,293
int inotify_init(void) 316,291,290
int inotify_add_watch(int, const char *, unsigned int) 317,292,291
int inotify_rm_watch(int, unsigned int) 318,293,292
int poll(struct pollfd *, unsigned int, long) 168
int eventfd:eventfd2(unsigned int, int) 356,328
# ARM-specific ARM_NR_BASE == 0x0f0000 == 983040
int __set_tls:ARM_set_tls(void*) 983045,-1
int cacheflush:ARM_cacheflush(long start, long end, long flags) 983042,-1

View File

@@ -26,6 +26,7 @@
* SUCH DAMAGE.
*/
.global __get_pc
.type __get_pc, %function
__get_pc:
mov r0, pc

View File

@@ -26,6 +26,7 @@
* SUCH DAMAGE.
*/
.global __get_sp
.type __get_sp, %function
__get_sp:
mov r0, sp

View File

@@ -3,6 +3,7 @@
/*
* Copyright (c) 1997 Mark Brinicombe
* Copyright (c) 2010 Android Open Source Project.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -35,6 +36,7 @@
#include <machine/asm.h>
#include <machine/setjmp.h>
#include <machine/cpu-features.h>
/*
* C library -- _setjmp, _longjmp
@@ -51,18 +53,20 @@
ENTRY(_setjmp)
ldr r1, .L_setjmp_magic
str r1, [r0], #4
#ifdef SOFTFLOAT
add r0, r0, #52
#else
/* Store fp registers */
sfm f4, 4, [r0], #48
/* Store fpsr */
rfs r1
str r1, [r0], #0x0004
#endif /* SOFTFLOAT */
/* Store integer registers */
stmia r0, {r4-r14}
str r1, [r0, #(_JB_MAGIC * 4)]
/* Store core registers */
add r1, r0, #(_JB_CORE_BASE * 4)
stmia r1, {r4-r14}
#ifdef __ARM_HAVE_VFP
/* Store floating-point registers */
add r1, r0, #(_JB_FLOAT_BASE * 4)
vstmia r1, {d8-d15}
/* Store floating-point state */
fmrx r1, fpscr
str r1, [r0, #(_JB_FLOAT_STATE * 4)]
#endif /* __ARM_HAVE_VFP */
mov r0, #0x00000000
bx lr
@@ -72,21 +76,22 @@ ENTRY(_setjmp)
ENTRY(_longjmp)
ldr r2, .L_setjmp_magic
ldr r3, [r0], #4
ldr r3, [r0, #(_JB_MAGIC * 4)]
teq r2, r3
bne botch
#ifdef SOFTFLOAT
add r0, r0, #52
#else
/* Restore fp registers */
lfm f4, 4, [r0], #48
/* Restore fpsr */
ldr r4, [r0], #0x0004
wfs r4
#endif /* SOFTFLOAT */
/* Restore integer registers */
ldmia r0, {r4-r14}
#ifdef __ARM_HAVE_VFP
/* Restore floating-point registers */
add r2, r0, #(_JB_FLOAT_BASE * 4)
vldmia r2, {d8-d15}
/* Restore floating-point state */
ldr r2, [r0, #(_JB_FLOAT_STATE * 4)]
fmxr fpscr, r2
#endif /* __ARM_HAVE_VFP */
/* Restore core registers */
add r2, r0, #(_JB_CORE_BASE * 4)
ldmia r2, {r4-r14}
/* Validate sp and r14 */
teq sp, #0

View File

@@ -26,20 +26,87 @@
* SUCH DAMAGE.
*/
#include <sys/linux-syscalls.h>
#include <machine/cpu-features.h>
.global __atomic_cmpxchg
.type __atomic_cmpxchg, %function
.global __atomic_swap
.type __atomic_swap, %function
.global __atomic_dec
.type __atomic_dec, %function
.global __atomic_inc
.global __futex_wait
.global __futex_wake
.type __atomic_inc, %function
#define FUTEX_WAIT 0
#define FUTEX_WAKE 1
#if 1
.equ kernel_cmpxchg, 0xFFFF0FC0
.equ kernel_atomic_base, 0xFFFF0FFF
#if defined(__ARM_HAVE_LDREX_STREX)
/*
* ===========================================================================
* ARMv6+ implementation
* ===========================================================================
*/
/* r0(addr) -> r0(old) */
__atomic_dec:
.fnstart
mov r1, r0 @ copy addr so we don't clobber it
1: ldrex r0, [r1] @ load current value into r0
sub r2, r0, #1 @ generate new value into r2
strex r3, r2, [r1] @ try to store new value; result in r3
cmp r3, #0 @ success?
bxeq lr @ yes, return
b 1b @ no, retry
.fnend
/* r0(addr) -> r0(old) */
__atomic_inc:
.fnstart
mov r1, r0
1: ldrex r0, [r1]
add r2, r0, #1
strex r3, r2, [r1]
cmp r3, #0
bxeq lr
b 1b
.fnend
/* r0(old) r1(new) r2(addr) -> r0(zero_if_succeeded) */
__atomic_cmpxchg:
.fnstart
1: mov ip, #2 @ ip=2 means "new != old"
ldrex r3, [r2] @ load current value into r3
teq r0, r3 @ new == old?
strexeq ip, r1, [r2] @ yes, try store, set ip to 0 or 1
teq ip, #1 @ strex failure?
beq 1b @ yes, retry
mov r0, ip @ return 0 on success, 2 on failure
bx lr
.fnend
/* r0(new) r1(addr) -> r0(old) */
__atomic_swap:
.fnstart
1: ldrex r2, [r1]
strex r3, r0, [r1]
teq r3, #0
bne 1b
mov r0, r2
bx lr
.fnend
#else /*not defined __ARM_HAVE_LDREX_STREX*/
/*
* ===========================================================================
* Pre-ARMv6 implementation
* ===========================================================================
*/
/* int __kernel_cmpxchg(int oldval, int newval, int* ptr) */
.equ kernel_cmpxchg, 0xFFFF0FC0
.equ kernel_atomic_base, 0xFFFF0FFF
/* r0(addr) -> r0(old) */
__atomic_dec:
.fnstart
.save {r4, lr}
@@ -57,6 +124,7 @@ __atomic_dec:
bx lr
.fnend
/* r0(addr) -> r0(old) */
__atomic_inc:
.fnstart
.save {r4, lr}
@@ -93,60 +161,46 @@ __atomic_cmpxchg:
ldmia sp!, {r4, lr}
bx lr
.fnend
#else
#define KUSER_CMPXCHG 0xffffffc0
/* r0(old) r1(new) r2(addr) -> r0(zero_if_succeeded) */
__atomic_cmpxchg:
stmdb sp!, {r4, lr}
mov r4, r0 /* r4 = save oldvalue */
1: add lr, pc, #4
mov r0, r4 /* r0 = oldvalue */
mov pc, #KUSER_CMPXCHG
bcs 2f /* swap was made. we're good, return. */
ldr r3, [r2] /* swap not made, see if it's because *ptr!=oldvalue */
cmp r3, r4
beq 1b
2: ldmia sp!, {r4, lr}
bx lr
/* r0(addr) -> r0(old) */
__atomic_dec:
stmdb sp!, {r4, lr}
mov r2, r0 /* address */
1: ldr r0, [r2] /* oldvalue */
add lr, pc, #4
sub r1, r0, #1 /* newvalue = oldvalue - 1 */
mov pc, #KUSER_CMPXCHG
bcc 1b /* no swap, try again until we get it right */
mov r0, ip /* swapped, return the old value */
ldmia sp!, {r4, lr}
bx lr
/* r0(addr) -> r0(old) */
__atomic_inc:
stmdb sp!, {r4, lr}
mov r2, r0 /* address */
1: ldr r0, [r2] /* oldvalue */
add lr, pc, #4
add r1, r0, #1 /* newvalue = oldvalue + 1 */
mov pc, #KUSER_CMPXCHG
bcc 1b /* no swap, try again until we get it right */
mov r0, ip /* swapped, return the old value */
ldmia sp!, {r4, lr}
bx lr
#endif
/* r0(new) r1(addr) -> r0(old) */
__atomic_swap:
.fnstart
swp r0, r0, [r1]
bx lr
.fnend
#endif /*not defined __ARM_HAVE_LDREX_STREX*/
/* __futex_wait(*ftx, val, *timespec) */
/* __futex_syscall(*ftx, op, val, *timespec, *addr2, val3) */
/* __futex_wake(*ftx, counter) */
/* __futex_syscall3(*ftx, op, val) */
/* __futex_syscall4(*ftx, op, val, *timespec) */
.global __futex_wait
.type __futex_wait, %function
.global __futex_wake
.type __futex_wake, %function
.global __futex_syscall3
.type __futex_syscall3, %function
.global __futex_syscall4
.type __futex_syscall4, %function
#if __ARM_EABI__
__futex_syscall3:
.fnstart
stmdb sp!, {r4, r7}
.save {r4, r7}
ldr r7, =__NR_futex
swi #0
ldmia sp!, {r4, r7}
bx lr
.fnend
__futex_wait:
.fnstart
stmdb sp!, {r4, r7}
@@ -161,6 +215,8 @@ __futex_wait:
.fnend
__futex_wake:
.fnstart
.save {r4, r7}
stmdb sp!, {r4, r7}
mov r2, r1
mov r1, #FUTEX_WAKE
@@ -168,9 +224,14 @@ __futex_wake:
swi #0
ldmia sp!, {r4, r7}
bx lr
.fnend
#else
__futex_syscall3:
swi #__NR_futex
bx lr
__futex_wait:
mov r3, r2
mov r2, r1
@@ -185,3 +246,6 @@ __futex_wake:
bx lr
#endif
__futex_syscall4:
b __futex_syscall3

View File

@@ -1,5 +1,5 @@
/*
* Copyright (C) 2008 The Android Open Source Project
* Copyright (C) 2008-2010 The Android Open Source Project
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -27,48 +27,102 @@
*/
#include <sys/linux-syscalls.h>
.text
.type __pthread_clone, #function
.global __pthread_clone
.align 4
__pthread_clone:
@ insert the args onto the new stack
str r0, [r1, #-4]
str r3, [r1, #-8]
.text
.type __pthread_clone, #function
.global __pthread_clone
.align 4
.fnstart
__pthread_clone:
@ insert the args onto the new stack
str r0, [r1, #-4]
str r3, [r1, #-8]
@ do the system call
@ get flags
@ do the system call
@ get flags
mov r0, r2
@ new sp is already in r1
#if __ARM_EABI__
stmfd sp!, {r4, r7}
ldr r7, =__NR_clone
swi #0
swi #0
#else
swi #__NR_clone
swi #__NR_clone
#endif
movs r0, r0
movs r0, r0
#if __ARM_EABI__
ldmnefd sp!, {r4, r7}
#endif
blt __error
bxne lr
blt __error
bxne lr
@ 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
@ 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
ldr r0, [sp, #-4]
ldr r1, [sp, #-8]
mov r2, sp @ __thread_entry needs the TLS pointer
b __thread_entry
ldr r0, [sp, #-4]
ldr r1, [sp, #-8]
mov r2, sp @ __thread_entry needs the TLS pointer
b __thread_entry
__error:
mov r0, #-1
bx lr
mov r0, #-1
bx lr
.fnend
#
# This function is defined as:
#
# pid_t __bionic_clone( int flags, void *child_stack,
# pid_t *pid, void *tls, pid_t *ctid,
# int (*fn)(void *), void* arg );
#
# NOTE: This is not the same signature than the GLibc
# __clone function here !! Placing 'fn' and 'arg'
# at the end of the parameter list makes the
# implementation much simpler.
#
.type __bionic_clone, #function
.globl __bionic_clone
.align 4
.fnstart
__bionic_clone:
mov ip, sp
.save {r4, r5, r6, r7}
# save registers to parent stack
stmfd sp!, {r4, r5, r6, r7}
# load extra parameters
ldmfd ip, {r4, r5, r6}
# store 'fn' and 'arg' to the child stack
str r5, [r1, #-4]
str r6, [r1, #-8]
# system call
ldr r7, =__NR_clone
swi #0
movs r0, r0
beq 1f
# in parent, reload saved registers
# then either exit or error
#
ldmfd sp!, {r4, r5, r6, r7}
bxne lr
b __set_syscall_errno
1: # in the child - pick arguments
ldr r0, [sp, #-4]
ldr r1, [sp, #-8]
b __bionic_clone_entry
.fnend

View File

@@ -31,7 +31,7 @@
.globl _start
# this is the small startup code that is first run when
# any executable that is statically-linked with Bionic
# any executable that is dynamically-linked with Bionic
# runs.
#
# it's purpose is to call __libc_init with appropriate
@@ -63,13 +63,7 @@ _start:
.long __INIT_ARRAY__
.long __FINI_ARRAY__
.long __CTOR_LIST__
# the .ctors section contains a list of pointers to "constructor"
# functions that need to be called in order during C library initialization,
# just before the program is being run. This is a C++ requirement
#
# the last entry shall be 0, and is defined in crtend.S
#
.section .preinit_array, "aw"
.globl __PREINIT_ARRAY__
__PREINIT_ARRAY__:
@@ -90,3 +84,4 @@ __FINI_ARRAY__:
__CTOR_LIST__:
.long -1
#include "__dso_handle.S"

View File

@@ -0,0 +1,55 @@
/*
* Copyright (C) 2008 The Android Open Source Project
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
# Implement static C++ destructors when the shared
# library is unloaded through dlclose().
#
# A call to this function must be the first entry
# in the .fini_array. See 3.3.5.3.C of C++ ABI
# standard.
#
__on_dlclose:
adr r0, 0f
ldr r0, [r0]
b __cxa_finalize
0:
.long __dso_handle
.section .init_array, "aw"
.globl __INIT_ARRAY__
__INIT_ARRAY__:
.long -1
.section .fini_array, "aw"
.globl __FINI_ARRAY__
__FINI_ARRAY__:
.long -1
.long __on_dlclose
#include "__dso_handle.S"

View File

@@ -63,13 +63,7 @@ _start:
.long __INIT_ARRAY__
.long __FINI_ARRAY__
.long __CTOR_LIST__
# the .ctors section contains a list of pointers to "constructor"
# functions that need to be called in order during C library initialization,
# just before the program is being run. This is a C++ requirement
#
# the last entry shall be 0, and is defined in crtend.S
#
.section .preinit_array, "aw"
.globl __PREINIT_ARRAY__
__PREINIT_ARRAY__:
@@ -90,3 +84,5 @@ __FINI_ARRAY__:
__CTOR_LIST__:
.long -1
#include "__dso_handle.S"

View File

@@ -0,0 +1,38 @@
/*
* Copyright (C) 2010 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.
*/
/* This is the same than crtend.S except that a shared library
* cannot have a .preinit_array
*/
.section .init_array, "aw"
.long 0
.section .fini_array, "aw"
.long 0

View File

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

View File

@@ -28,7 +28,7 @@
#include <machine/cpu-features.h>
#if __ARM_ARCH__ == 7 || defined(__ARM_NEON__)
#if defined(__ARM_NEON__)
.text
.fpu neon

View File

@@ -3,6 +3,7 @@
/*
* Copyright (c) 1997 Mark Brinicombe
* Copyright (c) 2010 Android Open Source Project.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -35,6 +36,7 @@
#include <machine/asm.h>
#include <machine/setjmp.h>
#include <machine/cpu-features.h>
/*
* C library -- setjmp, longjmp
@@ -57,24 +59,26 @@ ENTRY(setjmp)
ldmfd sp!, {r0, r14}
/* Store signal mask */
str r1, [r0, #(25 * 4)]
str r1, [r0, #(_JB_SIGMASK * 4)]
ldr r1, .Lsetjmp_magic
str r1, [r0], #4
str r1, [r0, #(_JB_MAGIC * 4)]
#ifdef SOFTFLOAT
add r0, r0, #52
#else
/* Store fp registers */
sfm f4, 4, [r0], #48
/* Store fpsr */
rfs r1
str r1, [r0], #0x0004
#endif /*SOFTFLOAT*/
/* Store integer registers */
stmia r0, {r4-r14}
mov r0, #0x00000000
bx lr
/* Store core registers */
add r1, r0, #(_JB_CORE_BASE * 4)
stmia r1, {r4-r14}
#ifdef __ARM_HAVE_VFP
/* Store floating-point registers */
add r1, r0, #(_JB_FLOAT_BASE * 4)
vstmia r1, {d8-d15}
/* Store floating-point state */
fmrx r1, fpscr
str r1, [r0, #(_JB_FLOAT_STATE * 4)]
#endif /* __ARM_HAVE_VFP */
mov r0, #0x00000000
bx lr
.Lsetjmp_magic:
.word _JB_MAGIC_SETJMP
@@ -82,12 +86,12 @@ ENTRY(setjmp)
ENTRY(longjmp)
ldr r2, .Lsetjmp_magic
ldr r3, [r0]
ldr r3, [r0, #(_JB_MAGIC * 4)]
teq r2, r3
bne botch
/* Fetch signal mask */
ldr r2, [r0, #(25 * 4)]
ldr r2, [r0, #(_JB_SIGMASK * 4)]
/* Set signal mask */
stmfd sp!, {r0, r1, r14}
@@ -99,18 +103,18 @@ ENTRY(longjmp)
add sp, sp, #4 /* unalign the stack */
ldmfd sp!, {r0, r1, r14}
add r0, r0, #4
#ifdef SOFTFLOAT
add r0, r0, #52
#else
/* Restore fp registers */
lfm f4, 4, [r0], #48
/* Restore FPSR */
ldr r4, [r0], #0x0004
wfs r4
#endif /* SOFTFLOAT */
/* Restore integer registers */
ldmia r0, {r4-r14}
#ifdef __ARM_HAVE_VFP
/* Restore floating-point registers */
add r2, r0, #(_JB_FLOAT_BASE * 4)
vldmia r2, {d8-d15}
/* Restore floating-point state */
ldr r2, [r0, #(_JB_FLOAT_STATE * 4)]
fmxr fpscr, r2
#endif /* __ARM_HAVE_VFP */
/* Restore core registers */
add r2, r0, #(_JB_CORE_BASE * 4)
ldmia r2, {r4-r14}
/* Validate sp and r14 */
teq sp, #0

View File

@@ -46,8 +46,6 @@ typedef long ssize_t;
typedef long ptrdiff_t;
#endif
//#include <linux/types.h>
/* 7.18.1.1 Exact-width integer types */
typedef __signed char __int8_t;
typedef unsigned char __uint8_t;

View File

@@ -38,7 +38,7 @@
* IMPORTANT: We have no intention to support anything below an ARMv4T !
*/
/* _ARM_ARCH_REVISION is a number corresponding to the ARM revision
/* __ARM_ARCH__ is a number corresponding to the ARM revision
* we're going to support
*
* it looks like our toolchain doesn't define __ARM_ARCH__
@@ -142,13 +142,48 @@
*
* ldr pc, [<some address>]
*
* note that this affects any instruction that explicitely changes the
* note that this affects any instruction that explicitly changes the
* value of the pc register, including ldm { ...,pc } or 'add pc, #offset'
*/
#if __ARM_ARCH__ >= 5
# define __ARM_HAVE_PC_INTERWORK
#endif
/* define __ARM_HAVE_LDREX_STREX for ARMv6 and ARMv7 architecture to be
* used in replacement of deprecated swp instruction
*/
#if __ARM_ARCH__ >= 6
# define __ARM_HAVE_LDREX_STREX
#endif
/* define __ARM_HAVE_DMB for ARMv7 architecture
*/
#if __ARM_ARCH__ >= 7
# define __ARM_HAVE_DMB
#endif
/* define __ARM_HAVE_LDREXD for ARMv7 architecture
* (also present in ARMv6K, but not implemented in ARMv7-M, neither of which
* we care about)
*/
#if __ARM_ARCH__ >= 7
# define __ARM_HAVE_LDREXD
#endif
/* define _ARM_HAVE_VFP if we have VFPv3
*/
#if __ARM_ARCH__ >= 7 && defined __VFP_FP__
# define __ARM_HAVE_VFP
#endif
/* define _ARM_HAVE_NEON for ARMv7 architecture if we support the
* Neon SIMD instruction set extensions. This also implies
* that VFPv3-D32 is supported.
*/
#if __ARM_ARCH__ >= 7 && defined __ARM_NEON__
# define __ARM_HAVE_NEON
#endif
/* Assembly-only macros */
/* define a handy PLD(address) macro since the cache preload

View File

@@ -1,87 +1,82 @@
/* $OpenBSD: setjmp.h,v 1.1 2004/02/01 05:09:49 drahn Exp $ */
/* $NetBSD: setjmp.h,v 1.2 2001/08/25 14:45:59 bjh21 Exp $ */
/*
* Copyright (C) 2010 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.
*/
/*
* machine/setjmp.h: machine dependent setjmp-related information.
*/
#ifdef __ELF__
#define _JBLEN 64 /* size, in longs, of a jmp_buf */
#else
#define _JBLEN 29 /* size, in longs, of a jmp_buf */
#endif
/*
* NOTE: The internal structure of a jmp_buf is *PRIVATE*
* This information is provided as there is software
* that fiddles with this with obtain the stack pointer
* (yes really ! and its commercial !).
/* _JBLEN is the size of a jmp_buf in longs.
* Do not modify this value or you will break the ABI !
*
* Description of the setjmp buffer
*
* word 0 magic number (dependant on creator)
* 1 - 3 f4 fp register 4
* 4 - 6 f5 fp register 5
* 7 - 9 f6 fp register 6
* 10 - 12 f7 fp register 7
* 13 fpsr fp status register
* 14 r4 register 4
* 15 r5 register 5
* 16 r6 register 6
* 17 r7 register 7
* 18 r8 register 8
* 19 r9 register 9
* 20 r10 register 10 (sl)
* 21 r11 register 11 (fp)
* 22 r12 register 12 (ip)
* 23 r13 register 13 (sp)
* 24 r14 register 14 (lr)
* 25 signal mask (dependant on magic)
* 26 (con't)
* 27 (con't)
* 28 (con't)
*
* The magic number number identifies the jmp_buf and
* how the buffer was created as well as providing
* a sanity check
*
* A side note I should mention - Please do not tamper
* with the floating point fields. While they are
* always saved and restored at the moment this cannot
* be garenteed especially if the compiler happens
* to be generating soft-float code so no fp
* registers will be used.
*
* Whilst this can be seen an encouraging people to
* use the setjmp buffer in this way I think that it
* is for the best then if changes occur compiles will
* break rather than just having new builds falling over
* mysteriously.
* This value comes from the original OpenBSD ARM-specific header
* that was replaced by this one.
*/
#define _JBLEN 64
/* According to the ARM AAPCS document, we only need to save
* the following registers:
*
* Core r4-r14
*
* VFP d8-d15 (see section 5.1.2.1)
*
* Registers s16-s31 (d8-d15, q4-q7) must be preserved across subroutine
* calls; registers s0-s15 (d0-d7, q0-q3) do not need to be preserved
* (and can be used for passing arguments or returning results in standard
* procedure-call variants). Registers d16-d31 (q8-q15), if present, do
* not need to be preserved.
*
* FPSCR saved because GLibc does saves it too.
*
*/
/* The internal structure of a jmp_buf is totally private.
* Current layout (may change in the future):
*
* word name description
* 0 magic magic number
* 1 sigmask signal mask (not used with _setjmp / _longjmp)
* 2 float_base base of float registers (d8 to d15)
* 18 float_state floating-point status and control register
* 19 core_base base of core registers (r4 to r14)
* 30 reserved reserved entries (room to grow)
* 64
*
* NOTE: float_base must be at an even word index, since the
* FP registers will be loaded/stored with instructions
* that expect 8-byte alignment.
*/
#define _JB_MAGIC 0
#define _JB_SIGMASK (_JB_MAGIC+1)
#define _JB_FLOAT_BASE (_JB_SIGMASK+1)
#define _JB_FLOAT_STATE (_JB_FLOAT_BASE + (15-8+1)*2)
#define _JB_CORE_BASE (_JB_FLOAT_STATE+1)
#define _JB_MAGIC__SETJMP 0x4278f500
#define _JB_MAGIC_SETJMP 0x4278f501
/* Valid for all jmp_buf's */
#define _JB_MAGIC 0
#define _JB_REG_F4 1
#define _JB_REG_F5 4
#define _JB_REG_F6 7
#define _JB_REG_F7 10
#define _JB_REG_FPSR 13
#define _JB_REG_R4 14
#define _JB_REG_R5 15
#define _JB_REG_R6 16
#define _JB_REG_R7 17
#define _JB_REG_R8 18
#define _JB_REG_R9 19
#define _JB_REG_R10 20
#define _JB_REG_R11 21
#define _JB_REG_R12 22
#define _JB_REG_R13 23
#define _JB_REG_R14 24
/* Only valid with the _JB_MAGIC_SETJMP magic */
#define _JB_SIGMASK 25

View File

@@ -3,10 +3,10 @@ syscall_src :=
syscall_src += arch-arm/syscalls/_exit.S
syscall_src += arch-arm/syscalls/_exit_thread.S
syscall_src += arch-arm/syscalls/__fork.S
syscall_src += arch-arm/syscalls/waitid.S
syscall_src += arch-arm/syscalls/__clone.S
syscall_src += arch-arm/syscalls/__waitid.S
syscall_src += arch-arm/syscalls/__sys_clone.S
syscall_src += arch-arm/syscalls/execve.S
syscall_src += arch-arm/syscalls/setuid.S
syscall_src += arch-arm/syscalls/__setuid.S
syscall_src += arch-arm/syscalls/getuid.S
syscall_src += arch-arm/syscalls/getgid.S
syscall_src += arch-arm/syscalls/geteuid.S
@@ -19,8 +19,8 @@ syscall_src += arch-arm/syscalls/getpgid.S
syscall_src += arch-arm/syscalls/getppid.S
syscall_src += arch-arm/syscalls/setsid.S
syscall_src += arch-arm/syscalls/setgid.S
syscall_src += arch-arm/syscalls/setreuid.S
syscall_src += arch-arm/syscalls/setresuid.S
syscall_src += arch-arm/syscalls/__setreuid.S
syscall_src += arch-arm/syscalls/__setresuid.S
syscall_src += arch-arm/syscalls/setresgid.S
syscall_src += arch-arm/syscalls/__brk.S
syscall_src += arch-arm/syscalls/__ptrace.S
@@ -37,6 +37,7 @@ syscall_src += arch-arm/syscalls/chroot.S
syscall_src += arch-arm/syscalls/prctl.S
syscall_src += arch-arm/syscalls/capget.S
syscall_src += arch-arm/syscalls/capset.S
syscall_src += arch-arm/syscalls/sigaltstack.S
syscall_src += arch-arm/syscalls/acct.S
syscall_src += arch-arm/syscalls/read.S
syscall_src += arch-arm/syscalls/write.S
@@ -65,15 +66,17 @@ syscall_src += arch-arm/syscalls/flock.S
syscall_src += arch-arm/syscalls/fchmod.S
syscall_src += arch-arm/syscalls/dup.S
syscall_src += arch-arm/syscalls/pipe.S
syscall_src += arch-arm/syscalls/pipe2.S
syscall_src += arch-arm/syscalls/dup2.S
syscall_src += arch-arm/syscalls/select.S
syscall_src += arch-arm/syscalls/ftruncate.S
syscall_src += arch-arm/syscalls/getdents.S
syscall_src += arch-arm/syscalls/fsync.S
syscall_src += arch-arm/syscalls/fdatasync.S
syscall_src += arch-arm/syscalls/fchown.S
syscall_src += arch-arm/syscalls/sync.S
syscall_src += arch-arm/syscalls/__fcntl64.S
syscall_src += arch-arm/syscalls/fstatfs.S
syscall_src += arch-arm/syscalls/__fstatfs64.S
syscall_src += arch-arm/syscalls/sendfile.S
syscall_src += arch-arm/syscalls/fstatat.S
syscall_src += arch-arm/syscalls/mkdirat.S
@@ -150,6 +153,8 @@ syscall_src += arch-arm/syscalls/sched_getparam.S
syscall_src += arch-arm/syscalls/sched_get_priority_max.S
syscall_src += arch-arm/syscalls/sched_get_priority_min.S
syscall_src += arch-arm/syscalls/sched_rr_get_interval.S
syscall_src += arch-arm/syscalls/ioprio_set.S
syscall_src += arch-arm/syscalls/ioprio_get.S
syscall_src += arch-arm/syscalls/uname.S
syscall_src += arch-arm/syscalls/__wait4.S
syscall_src += arch-arm/syscalls/umask.S
@@ -158,6 +163,7 @@ syscall_src += arch-arm/syscalls/__syslog.S
syscall_src += arch-arm/syscalls/init_module.S
syscall_src += arch-arm/syscalls/delete_module.S
syscall_src += arch-arm/syscalls/klogctl.S
syscall_src += arch-arm/syscalls/sysinfo.S
syscall_src += arch-arm/syscalls/futex.S
syscall_src += arch-arm/syscalls/epoll_create.S
syscall_src += arch-arm/syscalls/epoll_ctl.S
@@ -166,5 +172,6 @@ syscall_src += arch-arm/syscalls/inotify_init.S
syscall_src += arch-arm/syscalls/inotify_add_watch.S
syscall_src += arch-arm/syscalls/inotify_rm_watch.S
syscall_src += arch-arm/syscalls/poll.S
syscall_src += arch-arm/syscalls/eventfd.S
syscall_src += arch-arm/syscalls/__set_tls.S
syscall_src += arch-arm/syscalls/cacheflush.S

View File

@@ -2,12 +2,12 @@
#include <sys/linux-syscalls.h>
.text
.type fstatfs, #function
.globl fstatfs
.type __fstatfs64, #function
.globl __fstatfs64
.align 4
.fnstart
fstatfs:
__fstatfs64:
.save {r4, r7}
stmfd sp!, {r4, r7}
ldr r7, =__NR_fstatfs64

View File

@@ -2,12 +2,12 @@
#include <sys/linux-syscalls.h>
.text
.type setresuid, #function
.globl setresuid
.type __setresuid, #function
.globl __setresuid
.align 4
.fnstart
setresuid:
__setresuid:
.save {r4, r7}
stmfd sp!, {r4, r7}
ldr r7, =__NR_setresuid32

View File

@@ -2,12 +2,12 @@
#include <sys/linux-syscalls.h>
.text
.type setreuid, #function
.globl setreuid
.type __setreuid, #function
.globl __setreuid
.align 4
.fnstart
setreuid:
__setreuid:
.save {r4, r7}
stmfd sp!, {r4, r7}
ldr r7, =__NR_setreuid32

View File

@@ -2,12 +2,12 @@
#include <sys/linux-syscalls.h>
.text
.type setuid, #function
.globl setuid
.type __setuid, #function
.globl __setuid
.align 4
.fnstart
setuid:
__setuid:
.save {r4, r7}
stmfd sp!, {r4, r7}
ldr r7, =__NR_setuid32

View File

@@ -0,0 +1,21 @@
/* autogenerated by gensyscalls.py */
#include <sys/linux-syscalls.h>
.text
.type __sys_clone, #function
.globl __sys_clone
.align 4
.fnstart
__sys_clone:
mov ip, sp
.save {r4, r5, r6, r7}
stmfd sp!, {r4, r5, r6, r7}
ldmfd ip, {r4, r5, r6}
ldr r7, =__NR_clone
swi #0
ldmfd sp!, {r4, r5, r6, r7}
movs r0, r0
bxpl lr
b __set_syscall_errno
.fnend

View File

@@ -2,12 +2,12 @@
#include <sys/linux-syscalls.h>
.text
.type waitid, #function
.globl waitid
.type __waitid, #function
.globl __waitid
.align 4
.fnstart
waitid:
__waitid:
mov ip, sp
.save {r4, r5, r6, r7}
stmfd sp!, {r4, r5, r6, r7}

View File

@@ -0,0 +1,19 @@
/* autogenerated by gensyscalls.py */
#include <sys/linux-syscalls.h>
.text
.type eventfd, #function
.globl eventfd
.align 4
.fnstart
eventfd:
.save {r4, r7}
stmfd sp!, {r4, r7}
ldr r7, =__NR_eventfd2
swi #0
ldmfd sp!, {r4, r7}
movs r0, r0
bxpl lr
b __set_syscall_errno
.fnend

View File

@@ -0,0 +1,19 @@
/* autogenerated by gensyscalls.py */
#include <sys/linux-syscalls.h>
.text
.type fdatasync, #function
.globl fdatasync
.align 4
.fnstart
fdatasync:
.save {r4, r7}
stmfd sp!, {r4, r7}
ldr r7, =__NR_fdatasync
swi #0
ldmfd sp!, {r4, r7}
movs r0, r0
bxpl lr
b __set_syscall_errno
.fnend

View File

@@ -0,0 +1,19 @@
/* autogenerated by gensyscalls.py */
#include <sys/linux-syscalls.h>
.text
.type ioprio_get, #function
.globl ioprio_get
.align 4
.fnstart
ioprio_get:
.save {r4, r7}
stmfd sp!, {r4, r7}
ldr r7, =__NR_ioprio_get
swi #0
ldmfd sp!, {r4, r7}
movs r0, r0
bxpl lr
b __set_syscall_errno
.fnend

View File

@@ -0,0 +1,19 @@
/* autogenerated by gensyscalls.py */
#include <sys/linux-syscalls.h>
.text
.type ioprio_set, #function
.globl ioprio_set
.align 4
.fnstart
ioprio_set:
.save {r4, r7}
stmfd sp!, {r4, r7}
ldr r7, =__NR_ioprio_set
swi #0
ldmfd sp!, {r4, r7}
movs r0, r0
bxpl lr
b __set_syscall_errno
.fnend

View File

@@ -2,15 +2,15 @@
#include <sys/linux-syscalls.h>
.text
.type __clone, #function
.globl __clone
.type pipe2, #function
.globl pipe2
.align 4
.fnstart
__clone:
pipe2:
.save {r4, r7}
stmfd sp!, {r4, r7}
ldr r7, =__NR_clone
ldr r7, =__NR_pipe2
swi #0
ldmfd sp!, {r4, r7}
movs r0, r0

View File

@@ -0,0 +1,19 @@
/* autogenerated by gensyscalls.py */
#include <sys/linux-syscalls.h>
.text
.type sigaltstack, #function
.globl sigaltstack
.align 4
.fnstart
sigaltstack:
.save {r4, r7}
stmfd sp!, {r4, r7}
ldr r7, =__NR_sigaltstack
swi #0
ldmfd sp!, {r4, r7}
movs r0, r0
bxpl lr
b __set_syscall_errno
.fnend

View File

@@ -0,0 +1,19 @@
/* autogenerated by gensyscalls.py */
#include <sys/linux-syscalls.h>
.text
.type sysinfo, #function
.globl sysinfo
.align 4
.fnstart
sysinfo:
.save {r4, r7}
stmfd sp!, {r4, r7}
ldr r7, =__NR_sysinfo
swi #0
ldmfd sp!, {r4, r7}
movs r0, r0
bxpl lr
b __set_syscall_errno
.fnend

View File

@@ -0,0 +1,37 @@
/*
* Copyright (C) 2009 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
.type __get_pc, @function
.globl __get_pc
.align 4
__get_pc:
mova 1f, r0
rts
1: nop

View File

@@ -0,0 +1,36 @@
/*
* Copyright (C) 2009 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
.type __get_sp, @function
.globl __get_sp
.align 4
__get_sp:
rts
mov r15, r0

View File

@@ -0,0 +1,37 @@
/*
* Copyright (C) 2009 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.
*/
/* see the implementation of __set_tls and pthread.c to understand this
* code. Basically, the content of fs:[0] always is a pointer to the base
* address of the tls region
*/
void *__get_tls(void)
{
void *tls;
asm volatile("stc gbr, %0" : "=r"(tls));
return tls;
}

View File

@@ -0,0 +1,37 @@
/*
* Copyright (C) 2009 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 <pthread.h>
/*
* Simply set tls address into GBR.
*/
int __set_tls(void *ptr)
{
asm volatile("ldc %0, gbr" : /* no output */ : "r" (ptr));
return 0;
}

View File

@@ -0,0 +1,52 @@
/*
* Copyright (C) 2009 The Android Open Source Project
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
#include <asm/unistd.h>
.text
.type _exit_with_stack_teardown, @function
.globl _exit_with_stack_teardown
.align 4
# void _exit_with_stack_teardown(void * stackBase, int stackSize, int retCode)
_exit_with_stack_teardown:
mov r6, r8 /* save retCode : breaks r8 value */
mov.l 0f, r3 /* system call number */
trapa #(2 + 0x10) /* invoke system call with num of args */
mov r8, r4 /* restore retCode */
mov.l 1f, r3 /* system call number */
trapa #(1 + 0x10) /* invoke system call with num of args */
/* exit() should never return, cause a crash if it does */
mov #0, r0
mov.l @r0, r0
.align 2
0: .long __NR_munmap
1: .long __NR_exit

View File

@@ -0,0 +1,125 @@
/* $OpenBSD: _setjmp.S,v 1.2 2007/03/02 06:11:54 miod Exp $ */
/* $NetBSD: _setjmp.S,v 1.7 2006/01/05 02:04:41 uwe Exp $ */
/*-
* Copyright (c) 1990 The Regents of the University of California.
* All rights reserved.
*
* This code is derived from software contributed to Berkeley by
* William Jolitz.
*
* 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.
*
* from: @(#)_setjmp.s 5.1 (Berkeley) 4/23/90
*/
#include <machine/asm.h>
#include <machine/setjmp.h>
/*
* C library -- _setjmp, _longjmp
*
* _longjmp(a,v)
* will generate a "return(v)" from the last call to
* _setjmp(a)
* by restoring registers from the stack.
* The previous signal state is NOT restored.
*/
ENTRY(_setjmp)
xor r0, r0
#if defined(__SH4__) && !defined(__SH4_NOFPU__)
add #(_JBLEN * 4), r4
sts fpscr, r1
mov.l r1, @-r4
lds r0, fpscr
sts.l fpul, @-r4
fmov.s fr15, @-r4
fmov.s fr14, @-r4
fmov.s fr13, @-r4
fmov.s fr12, @-r4
frchg
fmov.s fr15, @-r4
fmov.s fr14, @-r4
fmov.s fr13, @-r4
fmov.s fr12, @-r4
lds r1, fpscr
#else
add #((_JBLEN - 10) * 4), r4
#endif
sts.l mach, @-r4
sts.l macl, @-r4
mov.l r15, @-r4
mov.l r14, @-r4
mov.l r13, @-r4
mov.l r12, @-r4
mov.l r11, @-r4
mov.l r10, @-r4
mov.l r9, @-r4
mov.l r8, @-r4
sts.l pr, @-r4
mov.l r0, @-r4 /* dummy signal mask */
rts
mov.l r0, @-r4 /* no saved signal mask */
SET_ENTRY_SIZE(_setjmp)
ENTRY(_longjmp)
add #8, r4
lds.l @r4+, pr
mov.l @r4+, r8
mov.l @r4+, r9
mov.l @r4+, r10
mov.l @r4+, r11
mov.l @r4+, r12
mov.l @r4+, r13
mov.l @r4+, r14
mov.l @r4+, r15
lds.l @r4+, macl
lds.l @r4+, mach
#if defined(__SH4__) && !defined(__SH4_NOFPU__)
xor r0, r0
lds r0, fpscr
frchg
fmov.s @r4+, fr12
fmov.s @r4+, fr13
fmov.s @r4+, fr14
fmov.s @r4+, fr15
frchg
fmov.s @r4+, fr12
fmov.s @r4+, fr13
fmov.s @r4+, fr14
fmov.s @r4+, fr15
lds.l @r4+, fpul
lds.l @r4+, fpscr
#endif
mov r5, r0
tst r0, r0
bf .L0
add #1, r0
.L0:
rts
nop
SET_ENTRY_SIZE(_longjmp)

View File

@@ -0,0 +1,50 @@
/*
* Copyright (C) 2009 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
.type __atomic_cmpxchg, @function
.globl __atomic_cmpxchg
.align 4
__atomic_cmpxchg:
mova 1f, r0
nop
mov r15, r1
mov #-8, r15 /* critical region start */
0: mov.l @r6, r2
cmp/eq r2, r4
bt not_yet_modified
mov #1, r0
bra done
nop
not_yet_modified:
mov #0, r0
mov.l r5, @r6
done:
1: mov r1, r15 /* critical region end */
rts
nop

View File

@@ -0,0 +1,110 @@
/*
* Copyright (C) 2009 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 <pthread.h>
#include <linux/futex.h>
#define SWAP_LOCK_COUNT 32U
static pthread_mutex_t _swap_locks[SWAP_LOCK_COUNT];
#define SWAP_LOCK(addr) \
&_swap_locks[((unsigned)(void *)(addr) >> 3U) % SWAP_LOCK_COUNT]
#if 0
/*
* Only this function is moved to atomic_cmpxchg.S, and
* implemented with gUSA framework.
*/
int __atomic_cmpxchg(int old, int _new, volatile int *ptr)
{
int result;
pthread_mutex_t *lock = SWAP_LOCK(ptr);
pthread_mutex_lock(lock);
if (*ptr == old) {
*ptr = _new;
result = 0;
} else {
result = 1;
}
pthread_mutex_unlock(lock);
return result;
}
#else
extern int __atomic_cmpxchg(int old, int _new, volatile int *ptr);
#endif
int __atomic_swap(int _new, volatile int *ptr)
{
int oldValue;
do {
oldValue = *ptr;
} while (__atomic_cmpxchg(oldValue, _new, ptr));
return oldValue;
}
int __atomic_dec(volatile int *ptr)
{
int oldValue;
do {
oldValue = *ptr;
} while (__atomic_cmpxchg(oldValue, oldValue-1, ptr));
return oldValue;
}
int __atomic_inc(volatile int *ptr)
{
int32_t oldValue;
do {
oldValue = *ptr;
} while (__atomic_cmpxchg(oldValue, oldValue+1, ptr));
return oldValue;
}
extern int futex(volatile void *, int, int, void *, void *, int);
int __futex_wait(volatile void *ftx, int val, const struct timespec *timeout)
{
return futex(ftx, FUTEX_WAIT, val, (void *)timeout, NULL, 0);
}
int __futex_wake(volatile void *ftx, int count)
{
return futex(ftx, FUTEX_WAKE, count, NULL, NULL, 0);
}
int __futex_syscall3(volatile void *ftx, int op, int val)
{
return futex(ftx, op, val, NULL, NULL, 0);
}
int __futex_syscall4(volative void *ftx, int op, int val, const struct timespec *timeout)
{
return futex(ftx, op, val, (void *)timeout, NULL, 0);
}

View File

@@ -0,0 +1,29 @@
/*
* Copyright (C) 2009 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.
*/
#define BZERO
#include "memset.S"

View File

@@ -0,0 +1,79 @@
/*
* Copyright (C) 2009 The Android Open Source Project
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
#include <sys/linux-syscalls.h>
.text
.type __pthread_clone, @function
.globl __pthread_clone
.align 4
__pthread_clone:
/* insert the args onto the new stack */
mov r5, r0
mov.l r4, @-r0 /* func */
mov.l r7, @-r0 /* arg */
/* do the system call */
mov r6, r4 /* Set clone_flags. new sp is ready in r5. */
mov.l 0f, r3
trapa #(4 + 0x10)
/* check error */
cmp/pz r0
bf __error
/* check if parent or child */
cmp/pl r0
bt __return
/* prepare args for __thread_entry */
mov #8, r1
sub r1, r15 /* -8 */
mov.l @r15+, r5 /* +4 */ /* arg */
mov.l @r15+, r4 /* +4 */ /* func */
mov r15, r6 /* tls */
/* jump to __thread_entry */
mov.l 1f, r0
jmp @r0
nop
__error:
mov #-1, r0
__return:
rts
nop
.align 2
0: .long __NR_clone
1: .long __thread_entry
/* XXX: TODO: Add __bionic_clone here
* See bionic/bionic_clone.c and arch-arm/bionic/clone.S
* for more details...
*/

View File

@@ -0,0 +1,97 @@
/*
* Copyright (C) 2009-2010 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
# this is the small startup code that is first run when
# any executable that is dynamically-linked with Bionic
# runs.
#
# it's purpose is to call __libc_init with appropriate
# arguments, which are:
#
# - the address of the raw data block setup by the Linux
# kernel ELF loader
#
# - address of an "onexit" function, not used on any
# platform supported by Bionic
#
# - address of the "main" function of the program. We
# can't hard-code it in the adr pseudo instruction
# so we use a tiny trampoline that will get relocated
# by the dynamic linker before this code runs
#
# - address of the constructor list
#
_start:
mov r15, r4
mov #0, r5
mov.l 0f, r6
mova 2f, r0
mov r0, r7
mov.l 1f, r0
jmp @r0
nop
.balign 4
0: .long main
1: .long __libc_init
2: .long __PREINIT_ARRAY__
.long __INIT_ARRAY__
.long __FINI_ARRAY__
.long __CTOR_LIST__
# the .ctors section contains a list of pointers to "constructor"
# functions that need to be called in order during C library initialization,
# just before the program is being run. This is a C++ requirement
#
# the last entry shall be 0, and is defined in crtend.S
#
.section .preinit_array, "aw"
.globl __PREINIT_ARRAY__
__PREINIT_ARRAY__:
.long -1
.section .init_array, "aw"
.globl __INIT_ARRAY__
__INIT_ARRAY__:
.long -1
.section .fini_array, "aw"
.globl __FINI_ARRAY__
__FINI_ARRAY__:
.long -1
.section .ctors, "aw"
.globl __CTOR_LIST__
__CTOR_LIST__:
.long -1
#include "__dso_handle.S"

View File

@@ -0,0 +1,91 @@
/*
* Copyright (C) 2009-2010 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
# 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. We
# can't hard-code it in the adr pseudo instruction
# so we use a tiny trampoline that will get relocated
# by the dynamic linker before this code runs
#
# - address of the constructor list
#
_start:
mov r15, r4
mov #0, r5
mov.l 0f, r6
mova 2f, r0
mov r0, r7
mov.l 1f, r0
jmp @r0
nop
.balign 4
0: .long main
1: .long __libc_init
2: .long __PREINIT_ARRAY__
.long __INIT_ARRAY__
.long __FINI_ARRAY__
.long __CTOR_LIST__
.section .preinit_array, "aw"
.globl __PREINIT_ARRAY__
__PREINIT_ARRAY__:
.long -1
.section .init_array, "aw"
.globl __INIT_ARRAY__
__INIT_ARRAY__:
.long -1
.section .fini_array, "aw"
.globl __FINI_ARRAY__
__FINI_ARRAY__:
.long -1
.section .ctors, "aw"
.globl __CTOR_LIST__
__CTOR_LIST__:
.long -1
#include "__dso_handle.S"

View File

@@ -0,0 +1,39 @@
/*
* Copyright (C) 2009 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.
*/
.section .preinit_array, "aw"
.long 0
.section .init_array, "aw"
.long 0
.section .fini_array, "aw"
.long 0
.section .ctors, "aw"
.long 0

103
libc/arch-sh/bionic/ffs.S Normal file
View File

@@ -0,0 +1,103 @@
/* $NetBSD: ffs.S,v 1.1 2005/12/20 19:28:50 christos Exp $ */
/*-
* Copyright (c) 2002 The NetBSD Foundation, Inc.
* All rights reserved.
*
* This code is derived from software contributed to The NetBSD Foundation
* by ITOH Yasufumi.
*
* 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. 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
* ``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 FOUNDATION OR CONTRIBUTORS
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
#include <machine/asm.h>
#if defined(LIBC_SCCS) && !defined(lint)
RCSID("$NetBSD: ffs.S,v 1.1 2005/12/20 19:28:50 christos Exp $")
#endif
/*
* ffs - find first bit set
*
* This code makes use of ``test 8bit'' and ``shift 8bit'' instructions.
* The remaining 8bit is tested in every 2bit.
*/
ENTRY(ffs)
mov r4,r0 ! using r0 specific instructions
tst #0xff,r0
bf/s L8bit
mov #0+1,r1 ! ret = 1..8
tst r0,r0 ! ffs(0) is 0
bt Lzero ! testing here to accelerate ret=1..8 cases
shlr8 r0
tst #0xff,r0
bf/s L8bit
mov #8+1,r1 ! ret = 9..16
shlr8 r0
tst #0xff,r0
bf/s L8bit
mov #16+1,r1 ! ret = 17..24
shlr8 r0
mov #24+1,r1 ! ret = 25..32
L8bit:
tst #0x0f,r0
bt 4f
tst #0x03,r0
bt 2f
tst #0x01,r0 ! not bit 0 -> T
mov #0,r0
rts
addc r1,r0 ! 0 + r1 + T -> r0
2: tst #0x04,r0
mov #2,r0
rts
addc r1,r0
4: tst #0x30,r0
bt 6f
tst #0x10,r0
mov #4,r0
rts
addc r1,r0
6: tst #0x40,r0
mov #6,r0
rts
addc r1,r0
Lzero: rts
nop

View File

@@ -0,0 +1,268 @@
/* $OpenBSD: memcpy.S,v 1.1.1.1 2006/10/10 22:07:10 miod Exp $ */
/* $NetBSD: memcpy.S,v 1.2 2006/04/22 23:53:47 uwe Exp $ */
/*
* Copyright (c) 2000 SHIMIZU Ryo <ryo@misakimix.org>
* 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 author may not be used to endorse or promote products
* derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
* IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include <machine/asm.h>
#if !defined(MEMCOPY) && !defined(MEMMOVE) && !defined(BCOPY)
#define MEMCOPY
#endif
#if defined(MEMCOPY) || defined(MEMMOVE)
#define REG_DST0 r3
#define REG_SRC r5
#define REG_DST r4
#else
#define REG_SRC r4
#define REG_DST r5
#endif
#define REG_LEN r6
#if defined(MEMCOPY)
ENTRY(memcpy)
#elif defined(MEMMOVE)
ENTRY(memmove)
#elif defined(BCOPY)
ENTRY(bcopy)
#endif
#ifdef REG_DST0
mov REG_DST,REG_DST0
#endif
cmp/eq REG_DST,REG_SRC /* if ( src == dst ) return; */
bt/s bcopy_return
cmp/hi REG_DST,REG_SRC
bf/s bcopy_overlap
mov REG_SRC,r0
xor REG_DST,r0
and #3,r0
mov r0,r1
tst r0,r0 /* (src ^ dst) & 3 */
bf/s word_align
longword_align:
tst REG_LEN,REG_LEN /* if ( len==0 ) return; */
bt/s bcopy_return
mov REG_SRC,r0
tst #1,r0 /* if ( src & 1 ) */
bt 1f
mov.b @REG_SRC+,r0 /* *dst++ = *src++; */
add #-1,REG_LEN
mov.b r0,@REG_DST
add #1,REG_DST
1:
mov #1,r0
cmp/hi r0,REG_LEN /* if ( (len > 1) && */
bf/s 1f
mov REG_SRC,r0
tst #2,r0 /* (src & 2) { */
bt 1f
mov.w @REG_SRC+,r0 /* *((unsigned short*)dst)++ = *((unsigned short*)src)++; */
add #-2,REG_LEN /* len -= 2; */
mov.w r0,@REG_DST
add #2,REG_DST /* } */
1:
mov #3,r1
cmp/hi r1,REG_LEN /* while ( len > 3 ) { */
bf/s no_align_delay
tst REG_LEN,REG_LEN
2:
mov.l @REG_SRC+,r0 /* *((unsigned long*)dst)++ = *((unsigned long*)src)++; */
add #-4,REG_LEN /* len -= 4; */
mov.l r0,@REG_DST
cmp/hi r1,REG_LEN
bt/s 2b
add #4,REG_DST /* } */
bra no_align_delay
tst REG_LEN,REG_LEN
word_align:
mov r1,r0
tst #1,r0
bf/s no_align_delay
tst REG_LEN,REG_LEN /* if ( len == 0 ) return; */
bt bcopy_return
mov REG_SRC,r0 /* if ( src & 1 ) */
tst #1,r0
bt 1f
mov.b @REG_SRC+,r0 /* *dst++ = *src++; */
add #-1,REG_LEN
mov.b r0,@REG_DST
add #1,REG_DST
1:
mov #1,r1
cmp/hi r1,REG_LEN /* while ( len > 1 ) { */
bf/s no_align_delay
tst REG_LEN,REG_LEN
2:
mov.w @REG_SRC+,r0 /* *((unsigned short*)dst)++ = *((unsigned short*)src)++; */
add #-2,REG_LEN /* len -= 2; */
mov.w r0,@REG_DST
cmp/hi r1,REG_LEN
bt/s 2b
add #2,REG_DST /* } */
no_align:
tst REG_LEN,REG_LEN /* while ( len!= ) { */
no_align_delay:
bt bcopy_return
1:
mov.b @REG_SRC+,r0 /* *dst++ = *src++; */
add #-1,REG_LEN /* len--; */
mov.b r0,@REG_DST
tst REG_LEN,REG_LEN
bf/s 1b
add #1,REG_DST /* } */
bcopy_return:
rts
#ifdef REG_DST0
mov REG_DST0,r0
#else
nop
#endif
bcopy_overlap:
add REG_LEN,REG_SRC
add REG_LEN,REG_DST
mov REG_SRC,r0
xor REG_DST,r0
and #3,r0
mov r0,r1
tst r0,r0 /* (src ^ dst) & 3 */
bf/s ov_word_align
ov_longword_align:
tst REG_LEN,REG_LEN /* if ( len==0 ) return; */
bt/s bcopy_return
mov REG_SRC,r0
tst #1,r0 /* if ( src & 1 ) */
bt 1f
add #-1,REG_SRC /* *--dst = *--src; */
mov.b @REG_SRC,r0
mov.b r0,@-REG_DST
add #-1,REG_LEN
1:
mov #1,r0
cmp/hi r0,REG_LEN /* if ( (len > 1) && */
bf/s 1f
mov REG_SRC,r0
tst #2,r0 /* (src & 2) { */
bt 1f
add #-2,REG_SRC /* *--((unsigned short*)dst) = *--((unsigned short*)src); */
mov.w @REG_SRC,r0
add #-2,REG_LEN /* len -= 2; */
mov.w r0,@-REG_DST /* } */
1:
mov #3,r1
cmp/hi r1,REG_LEN /* while ( len > 3 ) { */
bf/s ov_no_align_delay
tst REG_LEN,REG_LEN
2:
add #-4,REG_SRC
mov.l @REG_SRC,r0 /* *((unsigned long*)dst)++ = *((unsigned long*)src)++; */
add #-4,REG_LEN /* len -= 4; */
cmp/hi r1,REG_LEN
bt/s 2b
mov.l r0,@-REG_DST /* } */
bra ov_no_align_delay
tst REG_LEN,REG_LEN
ov_word_align:
mov r1,r0
tst #1,r0
bf/s ov_no_align_delay
tst REG_LEN,REG_LEN /* if ( len == 0 ) return; */
bt bcopy_return
mov REG_SRC,r0 /* if ( src & 1 ) */
tst #1,r0
bt 1f
add #-1,REG_SRC
mov.b @REG_SRC,r0 /* *--dst = *--src; */
add #-1,REG_LEN
mov.b r0,@-REG_DST
1:
mov #1,r1
cmp/hi r1,REG_LEN /* while ( len > 1 ) { */
bf/s ov_no_align_delay
tst REG_LEN,REG_LEN
2:
add #-2,REG_SRC
mov.w @REG_SRC,r0 /* *--((unsigned short*)dst) = *--((unsigned short*)src); */
add #-2,REG_LEN /* len -= 2; */
cmp/hi r1,REG_LEN
bt/s 2b
mov.w r0,@-REG_DST /* } */
ov_no_align:
tst REG_LEN,REG_LEN /* while ( len!= ) { */
ov_no_align_delay:
bt 9f
1:
add #-1,REG_SRC
mov.b @REG_SRC,r0 /* *--dst = *--src; */
add #-1,REG_LEN /* len--; */
tst REG_LEN,REG_LEN
bf/s 1b
mov.b r0,@-REG_DST /* } */
9:
rts
#ifdef REG_DST0
mov REG_DST0,r0
#else
nop
#endif

View File

@@ -0,0 +1,5 @@
/* $OpenBSD: memmove.S,v 1.1.1.1 2006/10/10 22:07:10 miod Exp $ */
/* $NetBSD: memmove.S,v 1.2 2006/04/22 23:53:47 uwe Exp $ */
#define MEMMOVE
#include "memcpy.S"

View File

@@ -0,0 +1,295 @@
/* $OpenBSD: memset.S,v 1.1.1.1 2006/10/10 22:07:10 miod Exp $ */
/* $NetBSD: memset.S,v 1.1 2005/12/20 19:28:50 christos Exp $ */
/*-
* Copyright (c) 2002 SHIMIZU Ryo. 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 author may not be used to endorse or promote products
* derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
* IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include <machine/asm.h>
#define REG_PTR r0
#define REG_TMP1 r1
#ifdef BZERO
# define REG_C r2
# define REG_DST r4
# define REG_LEN r5
#else
# define REG_DST0 r3
# define REG_DST r4
# define REG_C r5
# define REG_LEN r6
#endif
#ifdef BZERO
ENTRY(bzero)
#else
ENTRY(memset)
mov REG_DST,REG_DST0 /* for return value */
#endif
/* small amount to fill ? */
mov #28,REG_TMP1
cmp/hs REG_TMP1,REG_LEN /* if (len >= 28) goto large; */
bt/s large
mov #12,REG_TMP1 /* if (len >= 12) goto small; */
cmp/hs REG_TMP1,REG_LEN
bt/s small
#ifdef BZERO
mov #0,REG_C
#endif
/* very little fill (0 ~ 11 bytes) */
tst REG_LEN,REG_LEN
add REG_DST,REG_LEN
bt/s done
add #1,REG_DST
/* unroll 4 loops */
cmp/eq REG_DST,REG_LEN
1: mov.b REG_C,@-REG_LEN
bt/s done
cmp/eq REG_DST,REG_LEN
mov.b REG_C,@-REG_LEN
bt/s done
cmp/eq REG_DST,REG_LEN
mov.b REG_C,@-REG_LEN
bt/s done
cmp/eq REG_DST,REG_LEN
mov.b REG_C,@-REG_LEN
bf/s 1b
cmp/eq REG_DST,REG_LEN
done:
#ifdef BZERO
rts
nop
#else
rts
mov REG_DST0,r0
#endif
small:
mov REG_DST,r0
tst #1,r0
bt/s small_aligned
mov REG_DST,REG_TMP1
shll REG_LEN
mova 1f,r0 /* 1f must be 4bytes aligned! */
add #16,REG_TMP1 /* REG_TMP1 = dst+16; */
sub REG_LEN,r0
jmp @r0
mov REG_C,r0
.align 2
mov.b r0,@(15,REG_TMP1)
mov.b r0,@(14,REG_TMP1)
mov.b r0,@(13,REG_TMP1)
mov.b r0,@(12,REG_TMP1)
mov.b r0,@(11,REG_TMP1)
mov.b r0,@(10,REG_TMP1)
mov.b r0,@(9,REG_TMP1)
mov.b r0,@(8,REG_TMP1)
mov.b r0,@(7,REG_TMP1)
mov.b r0,@(6,REG_TMP1)
mov.b r0,@(5,REG_TMP1)
mov.b r0,@(4,REG_TMP1)
mov.b r0,@(3,REG_TMP1)
mov.b r0,@(2,REG_TMP1)
mov.b r0,@(1,REG_TMP1)
mov.b r0,@REG_TMP1
mov.b r0,@(15,REG_DST)
mov.b r0,@(14,REG_DST)
mov.b r0,@(13,REG_DST)
mov.b r0,@(12,REG_DST)
mov.b r0,@(11,REG_DST)
mov.b r0,@(10,REG_DST)
mov.b r0,@(9,REG_DST)
mov.b r0,@(8,REG_DST)
mov.b r0,@(7,REG_DST)
mov.b r0,@(6,REG_DST)
mov.b r0,@(5,REG_DST)
mov.b r0,@(4,REG_DST)
mov.b r0,@(3,REG_DST)
mov.b r0,@(2,REG_DST)
mov.b r0,@(1,REG_DST)
#ifdef BZERO
rts
1: mov.b r0,@REG_DST
#else
mov.b r0,@REG_DST
1: rts
mov REG_DST0,r0
#endif
/* 2 bytes aligned small fill */
small_aligned:
#ifndef BZERO
extu.b REG_C,REG_TMP1 /* REG_C = ??????xx, REG_TMP1 = ????00xx */
shll8 REG_C /* REG_C = ????xx00, REG_TMP1 = ????00xx */
or REG_TMP1,REG_C /* REG_C = ????xxxx */
#endif
mov REG_LEN,r0
tst #1,r0 /* len is aligned? */
bt/s 1f
add #-1,r0
mov.b REG_C,@(r0,REG_DST) /* fill last a byte */
mov r0,REG_LEN
1:
mova 1f,r0 /* 1f must be 4bytes aligned! */
sub REG_LEN,r0
jmp @r0
mov REG_C,r0
.align 2
mov.w r0,@(30,REG_DST)
mov.w r0,@(28,REG_DST)
mov.w r0,@(26,REG_DST)
mov.w r0,@(24,REG_DST)
mov.w r0,@(22,REG_DST)
mov.w r0,@(20,REG_DST)
mov.w r0,@(18,REG_DST)
mov.w r0,@(16,REG_DST)
mov.w r0,@(14,REG_DST)
mov.w r0,@(12,REG_DST)
mov.w r0,@(10,REG_DST)
mov.w r0,@(8,REG_DST)
mov.w r0,@(6,REG_DST)
mov.w r0,@(4,REG_DST)
mov.w r0,@(2,REG_DST)
#ifdef BZERO
rts
1: mov.w r0,@REG_DST
#else
mov.w r0,@REG_DST
1: rts
mov REG_DST0,r0
#endif
.align 2
large:
#ifdef BZERO
mov #0,REG_C
#else
extu.b REG_C,REG_TMP1 /* REG_C = ??????xx, REG_TMP1 = ????00xx */
shll8 REG_C /* REG_C = ????xx00, REG_TMP1 = ????00xx */
or REG_C,REG_TMP1 /* REG_C = ????xx00, REG_TMP1 = ????xxxx */
swap.w REG_TMP1,REG_C /* REG_C = xxxx????, REG_TMP1 = ????xxxx */
xtrct REG_TMP1,REG_C /* REG_C = xxxxxxxx */
#endif
mov #3,REG_TMP1
tst REG_TMP1,REG_DST
mov REG_DST,REG_PTR
bf/s unaligned_dst
add REG_LEN,REG_PTR /* REG_PTR = dst + len; */
tst REG_TMP1,REG_LEN
bf/s unaligned_len
aligned:
/* fill 32*n bytes */
mov #32,REG_TMP1
cmp/hi REG_LEN,REG_TMP1
bt 9f
.align 2
1: sub REG_TMP1,REG_PTR
mov.l REG_C,@REG_PTR
sub REG_TMP1,REG_LEN
mov.l REG_C,@(4,REG_PTR)
cmp/hi REG_LEN,REG_TMP1
mov.l REG_C,@(8,REG_PTR)
mov.l REG_C,@(12,REG_PTR)
mov.l REG_C,@(16,REG_PTR)
mov.l REG_C,@(20,REG_PTR)
mov.l REG_C,@(24,REG_PTR)
bf/s 1b
mov.l REG_C,@(28,REG_PTR)
9:
/* fill left 4*n bytes */
cmp/eq REG_DST,REG_PTR
bt 9f
add #4,REG_DST
cmp/eq REG_DST,REG_PTR
1: mov.l REG_C,@-REG_PTR
bt/s 9f
cmp/eq REG_DST,REG_PTR
mov.l REG_C,@-REG_PTR
bt/s 9f
cmp/eq REG_DST,REG_PTR
mov.l REG_C,@-REG_PTR
bt/s 9f
cmp/eq REG_DST,REG_PTR
mov.l REG_C,@-REG_PTR
bf/s 1b
cmp/eq REG_DST,REG_PTR
9:
#ifdef BZERO
rts
nop
#else
rts
mov REG_DST0,r0
#endif
unaligned_dst:
mov #1,REG_TMP1
tst REG_TMP1,REG_DST /* if (dst & 1) { */
add #1,REG_TMP1
bt/s 2f
tst REG_TMP1,REG_DST
mov.b REG_C,@REG_DST /* *dst++ = c; */
add #1,REG_DST
tst REG_TMP1,REG_DST
2: /* } */
/* if (dst & 2) { */
bt 4f
mov.w REG_C,@REG_DST /* *(u_int16_t*)dst++ = c; */
add #2,REG_DST
4: /* } */
tst #3,REG_PTR /* if (ptr & 3) { */
bt/s 4f /* */
unaligned_len:
tst #1,REG_PTR /* if (ptr & 1) { */
bt/s 2f
tst #2,REG_PTR
mov.b REG_C,@-REG_PTR /* --ptr = c; */
2: /* } */
/* if (ptr & 2) { */
bt 4f
mov.w REG_C,@-REG_PTR /* *--(u_int16_t*)ptr = c; */
4: /* } */
/* } */
mov REG_PTR,REG_LEN
bra aligned
sub REG_DST,REG_LEN

View File

@@ -0,0 +1,63 @@
/*
* Copyright (C) 2009 The Android Open Source Project
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
#include <sys/linux-syscalls.h>
.text
.type pipe, @function
.globl pipe
.align 4
pipe:
/* invoke trap */
mov.l 0f, r3 /* trap num */
trapa #(0 + 0x10)
/* check return value */
cmp/pz r0
bt setfds
/* keep error number */
sts.l pr, @-r15
mov.l 1f, r1
jsr @r1
mov r0, r4
lds.l @r15+, pr
bra end
nop
setfds:
mov.l r0, @r4
add #4, r4
mov.l r1, @r4
end:
rts
nop
.align 2
0: .long __NR_pipe
1: .long __set_syscall_errno

View File

@@ -0,0 +1,167 @@
/* $OpenBSD: setjmp.S,v 1.2 2007/03/02 06:11:54 miod Exp $ */
/* $NetBSD: setjmp.S,v 1.10 2006/01/05 19:21:37 uwe Exp $ */
/*-
* Copyright (c) 1990 The Regents of the University of California.
* All rights reserved.
*
* This code is derived from software contributed to Berkeley by
* William Jolitz.
*
* 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.
*
* from: @(#)setjmp.s 5.1 (Berkeley) 4/23/90
*/
#include <machine/asm.h>
#include <machine/setjmp.h>
/*
* C library -- setjmp, longjmp
*
* longjmp(a,v)
* will generate a "return(v)" from the last call to
* setjmp(a)
* by restoring registers from the stack.
* The previous signal state is restored.
*/
ENTRY(setjmp)
PIC_PROLOGUE(.L_got_1)
sts.l pr, @-sp
mov.l r4, @-sp
mov.l .L_sigprocmask_1, r0
mov r4, r6
mov #1, r4 /* how = SIG_BLOCK */
mov #0, r5 /* new = NULL */
1: CALL r0
add #4, r6 /* old = &sigmask */
mov.l @sp+, r4
lds.l @sp+, pr
PIC_EPILOGUE
/* identical to _setjmp except that the first word is non-zero */
#if defined(__SH4__) && !defined(__SH4_NOFPU__)
add #(_JBLEN * 4), r4
sts fpscr, r1
xor r0, r0
mov.l r1, @-r4
lds r0, fpscr
sts.l fpul, @-r4
fmov.s fr15, @-r4
fmov.s fr14, @-r4
fmov.s fr13, @-r4
fmov.s fr12, @-r4
frchg
fmov.s fr15, @-r4
fmov.s fr14, @-r4
fmov.s fr13, @-r4
fmov.s fr12, @-r4
lds r1, fpscr
#else
add #((_JBLEN - 10) * 4), r4
#endif
sts.l mach, @-r4
sts.l macl, @-r4
mov.l r15, @-r4
mov.l r14, @-r4
mov.l r13, @-r4
mov.l r12, @-r4
mov.l r11, @-r4
mov.l r10, @-r4
mov.l r9, @-r4
mov.l r8, @-r4
sts.l pr, @-r4
add #-4, r4 /* skip signal mask */
mov #1, r0
mov.l r0, @-r4 /* has signal mask */
rts
xor r0, r0
.align 2
.L_got_1: PIC_GOT_DATUM
.L_sigprocmask_1: CALL_DATUM(_C_LABEL(sigprocmask), 1b)
SET_ENTRY_SIZE(setjmp)
ENTRY(longjmp)
/* we won't return here, so we don't need to save pr and r12 */
PIC_PROLOGUE_NOSAVE(.L_got_2)
mov.l r5, @-sp
mov.l r4, @-sp
mov.l .L_sigprocmask_2, r0
mov r4, r5
mov #3, r4 /* how = SIG_SETMASK */
add #4, r5 /* new = &sigmask */
1: CALL r0
mov #0, r6 /* old = NULL */
mov.l @sp+, r4
mov.l @sp+, r5
/* identical to _longjmp */
add #8, r4
lds.l @r4+, pr
mov.l @r4+, r8
mov.l @r4+, r9
mov.l @r4+, r10
mov.l @r4+, r11
mov.l @r4+, r12
mov.l @r4+, r13
mov.l @r4+, r14
mov.l @r4+, r15
lds.l @r4+, macl
lds.l @r4+, mach
#if defined(__SH4__) && !defined(__SH4_NOFPU__)
xor r0, r0
lds r0, fpscr
frchg
fmov.s @r4+, fr12
fmov.s @r4+, fr13
fmov.s @r4+, fr14
fmov.s @r4+, fr15
frchg
fmov.s @r4+, fr12
fmov.s @r4+, fr13
fmov.s @r4+, fr14
fmov.s @r4+, fr15
lds.l @r4+, fpul
lds.l @r4+, fpscr
#endif
mov r5, r0
tst r0, r0 /* make sure return value is non-zero */
bf .L0
add #1, r0
.L0:
rts
nop
.align 2
.L_got_2: PIC_GOT_DATUM
.L_sigprocmask_2: CALL_DATUM(_C_LABEL(sigprocmask), 1b)
SET_ENTRY_SIZE(longjmp)

View File

@@ -0,0 +1,166 @@
/* $OpenBSD: sigsetjmp.S,v 1.2 2007/03/02 06:11:54 miod Exp $ */
/* $NetBSD: sigsetjmp.S,v 1.9 2006/01/05 19:21:37 uwe Exp $ */
/*-
* Copyright (c) 1990 The Regents of the University of California.
* All rights reserved.
*
* This code is derived from software contributed to Berkeley by
* William Jolitz.
*
* 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.
*
* from: @(#)setjmp.s 5.1 (Berkeley) 4/23/90
*/
#include <machine/asm.h>
#include <machine/setjmp.h>
ENTRY(sigsetjmp)
tst r5, r5 /* if (savemask == 0) */
bt 2f
/* identical to setjmp */
PIC_PROLOGUE(.L_got_1)
sts.l pr, @-sp
mov.l r4, @-sp
mov.l r5, @-sp
mov.l .L_sigprocmask_1, r0
mov r4, r6
mov #1, r4 /* how = SIG_BLOCK */
mov #0, r5 /* new = NULL */
1: CALL r0
add #4, r6 /* old = &sigmask */
mov.l @sp+, r5
mov.l @sp+, r4
lds.l @sp+, pr
PIC_EPILOGUE
2: /* identical to _setjmp except that first word is in r5 */
#if defined(__SH4__) && !defined(__SH4_NOFPU__)
add #(_JBLEN * 4), r4
sts fpscr, r1
xor r0, r0
mov.l r1, @-r4
lds r0, fpscr
sts.l fpul, @-r4
fmov.s fr15, @-r4
fmov.s fr14, @-r4
fmov.s fr13, @-r4
fmov.s fr12, @-r4
frchg
fmov.s fr15, @-r4
fmov.s fr14, @-r4
fmov.s fr13, @-r4
fmov.s fr12, @-r4
lds r1, fpscr
#else
add #((_JBLEN - 10) * 4), r4
#endif
sts.l mach, @-r4
sts.l macl, @-r4
mov.l r15, @-r4
mov.l r14, @-r4
mov.l r13, @-r4
mov.l r12, @-r4
mov.l r11, @-r4
mov.l r10, @-r4
mov.l r9, @-r4
mov.l r8, @-r4
sts.l pr, @-r4
add #-4, r4 /* skip signal mask */
mov.l r5, @-r4 /* has signal mask? */
rts
xor r0, r0
.align 2
.L_got_1: PIC_GOT_DATUM
.L_sigprocmask_1: CALL_DATUM(_C_LABEL(sigprocmask), 1b)
SET_ENTRY_SIZE(sigsetjmp)
ENTRY(siglongjmp)
mov.l @r4+, r0
tst r0, r0
bt 2f /* if no mask */
/* identical to longjmp */
/* we won't return here, so we don't need to save pr and r12 */
PIC_PROLOGUE_NOSAVE(.L_got_2)
mov.l r5, @-sp
mov.l r4, @-sp
mov.l .L_sigprocmask_2, r0
mov r4, r5 /* new = &sigmask */
mov #3, r4 /* how = SIG_SETMASK */
1: CALL r0
mov #0, r6 /* old = NULL */
mov.l @sp+, r4
mov.l @sp+, r5
2: /* identical to _longjmp */
add #4, r4
lds.l @r4+, pr
mov.l @r4+, r8
mov.l @r4+, r9
mov.l @r4+, r10
mov.l @r4+, r11
mov.l @r4+, r12
mov.l @r4+, r13
mov.l @r4+, r14
mov.l @r4+, r15
lds.l @r4+, macl
lds.l @r4+, mach
#if defined(__SH4__) && !defined(__SH4_NOFPU__)
xor r0, r0
lds r0, fpscr
frchg
fmov.s @r4+, fr12
fmov.s @r4+, fr13
fmov.s @r4+, fr14
fmov.s @r4+, fr15
frchg
fmov.s @r4+, fr12
fmov.s @r4+, fr13
fmov.s @r4+, fr14
fmov.s @r4+, fr15
lds.l @r4+, fpul
lds.l @r4+, fpscr
#endif
mov r5, r0
tst r0, r0 /* make sure return value is non-zero */
bf .L0
add #1, r0
.L0:
rts
nop
.align 2
.L_got_2: PIC_GOT_DATUM
.L_sigprocmask_2: CALL_DATUM(_C_LABEL(sigprocmask), 1b)
SET_ENTRY_SIZE(siglongjmp)

View File

@@ -0,0 +1,69 @@
/*
* Copyright (C) 2009 The Android Open Source Project
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
#include <sys/linux-syscalls.h>
.text
.type syscall, @function
.globl syscall
.align 4
/*
* Current implementation assumes that the all syscall
* has maximum 7 arguments.
*/
syscall:
/* get args */
mov r4, r3 /* system call number */
mov r5, r4
mov r6, r5
mov r7, r6
mov.l @r15, r7
mov.l @(4, r15), r0
mov.l @(8, r15), r1
mov.l @(12, r15), r2
/* invoke trap */
trapa #(7 + 0x10) /* assuming 7 arguments */
/* check return value */
cmp/pz r0
bt end
/* keep error number */
mov.l r0, @-r15
mov.l 0f, r1
jsr @r1
mov r0, r4
mov.l @r15+, r0
end:
rts
nop
.align 2
0: .long __set_errno

View File

@@ -0,0 +1,30 @@
/*
* Copyright (C) 2009 The Android Open Source Project
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
typedef long unsigned int *_Unwind_Ptr;

View File

@@ -0,0 +1,39 @@
/* $OpenBSD: endian.h,v 1.1.1.1 2006/10/06 21:02:55 miod Exp $ */
/* $NetBSD: endian.h,v 1.4 2000/03/17 00:09:25 mycroft Exp $ */
/* Written by Manuel Bouyer. Public domain */
#ifndef _SH_ENDIAN_H_
#define _SH_ENDIAN_H_
#ifdef __GNUC__
#define __swap64md __swap64gen
#define __swap16md(x) ({ \
uint16_t rval; \
\
__asm volatile ("swap.b %1,%0" : "=r"(rval) : "r"(x)); \
\
rval; \
})
#define __swap32md(x) ({ \
uint32_t rval; \
\
__asm volatile ("swap.b %1,%0; swap.w %0,%0; swap.b %0,%0" \
: "=r"(rval) : "r"(x)); \
\
rval; \
})
#define MD_SWAP
#endif /* __GNUC_ */
#define _BYTE_ORDER _LITTLE_ENDIAN
#include <sys/endian.h>
#define __STRICT_ALIGNMENT
#endif /* !_SH_ENDIAN_H_ */

View File

@@ -0,0 +1,126 @@
/* $OpenBSD: _types.h,v 1.6 2008/07/21 20:50:55 martynas Exp $ */
/*-
* Copyright (c) 1990, 1993
* The Regents of the University of California. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* @(#)types.h 8.3 (Berkeley) 1/5/94
* @(#)ansi.h 8.2 (Berkeley) 1/4/94
*/
#ifndef _SH__TYPES_H_
#define _SH__TYPES_H_
#if defined(_KERNEL)
typedef struct label_t {
int val[9];
} label_t;
#endif
/* 7.18.1.1 Exact-width integer types */
typedef __signed char __int8_t;
typedef unsigned char __uint8_t;
typedef short __int16_t;
typedef unsigned short __uint16_t;
typedef int __int32_t;
typedef unsigned int __uint32_t;
/* LONGLONG */
typedef long long __int64_t;
/* LONGLONG */
typedef unsigned long long __uint64_t;
/* 7.18.1.2 Minimum-width integer types */
typedef __int8_t __int_least8_t;
typedef __uint8_t __uint_least8_t;
typedef __int16_t __int_least16_t;
typedef __uint16_t __uint_least16_t;
typedef __int32_t __int_least32_t;
typedef __uint32_t __uint_least32_t;
typedef __int64_t __int_least64_t;
typedef __uint64_t __uint_least64_t;
/* 7.18.1.3 Fastest minimum-width integer types */
typedef __int32_t __int_fast8_t;
typedef __uint32_t __uint_fast8_t;
typedef __int32_t __int_fast16_t;
typedef __uint32_t __uint_fast16_t;
typedef __int32_t __int_fast32_t;
typedef __uint32_t __uint_fast32_t;
typedef __int64_t __int_fast64_t;
typedef __uint64_t __uint_fast64_t;
/* 7.18.1.4 Integer types capable of holding object pointers */
typedef long __intptr_t;
typedef unsigned long __uintptr_t;
/* 7.18.1.5 Greatest-width integer types */
typedef __int64_t __intmax_t;
typedef __uint64_t __uintmax_t;
/* Register size */
typedef __uint32_t __register_t;
/* VM system types */
typedef unsigned long __vaddr_t;
typedef unsigned long __paddr_t;
typedef unsigned long __vsize_t;
typedef unsigned long __psize_t;
/* Standard system types */
typedef int __clock_t;
typedef int __clockid_t;
typedef double __double_t;
typedef float __float_t;
typedef long long __off_t;
typedef long __ptrdiff_t;
#if 0
/* cut it off for Android-SH */
typedef unsigned long __size_t;
#endif
typedef long __ssize_t;
typedef int __time_t;
typedef int __timer_t;
#if defined(__GNUC__) && __GNUC__ >= 3
typedef __builtin_va_list __va_list;
#else
struct __va_list_tag;
typedef struct __va_list_tag * __va_list;
#endif
/* Wide character support types */
#ifndef __cplusplus
typedef int __wchar_t;
#endif
typedef int __wint_t;
typedef int __rune_t;
typedef void * __wctrans_t;
typedef void * __wctype_t;
/* Feature test macros */
#define __HAVE_GENERIC_SOFT_INTERRUPTS
#endif /* _SH__TYPES_H_ */

View File

@@ -0,0 +1,217 @@
/* $OpenBSD: asm.h,v 1.1.1.1 2006/10/06 21:02:55 miod Exp $ */
/* $NetBSD: asm.h,v 1.25 2006/01/20 22:02:40 christos Exp $ */
/*-
* Copyright (c) 1990 The Regents of the University of California.
* All rights reserved.
*
* This code is derived from software contributed to Berkeley by
* William Jolitz.
*
* 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.
*
* @(#)asm.h 5.5 (Berkeley) 5/7/91
*/
#ifndef _SH_ASM_H_
#define _SH_ASM_H_
#ifdef __ELF__
# define _C_LABEL(x) x
#else
#ifdef __STDC__
# define _C_LABEL(x) _ ## x
#else
# define _C_LABEL(x) _/**/x
#endif
#endif
#define _ASM_LABEL(x) x
#ifdef __STDC__
# define __CONCAT(x,y) x ## y
# define __STRING(x) #x
#else
# define __CONCAT(x,y) x/**/y
# define __STRING(x) "x"
#endif
/* let kernels and others override entrypoint alignment */
#ifndef _ALIGN_TEXT
# define _ALIGN_TEXT .align 2
#endif
#ifdef __ELF__
#define _ENTRY(x) \
.text ;\
_ALIGN_TEXT ;\
.globl x ;\
.type x,@function ;\
x:
#else /* !__ELF__ */
#define _ENTRY(x) \
.text ;\
_ALIGN_TEXT ;\
.globl x ;\
x:
#endif /* !__ELF__ */
#ifdef GPROF
#define _PROF_PROLOGUE \
mov.l 1f,r1 ; \
mova 2f,r0 ; \
jmp @r1 ; \
nop ; \
.align 2 ; \
1: .long __mcount ; \
2:
#else /* !GPROF */
#define _PROF_PROLOGUE
#endif /* !GPROF */
#define ENTRY(y) _ENTRY(_C_LABEL(y)) _PROF_PROLOGUE
#define NENTRY(y) _ENTRY(_C_LABEL(y))
#define ASENTRY(y) _ENTRY(_ASM_LABEL(y)) _PROF_PROLOGUE
#define SET_ENTRY_SIZE(y) \
.size _C_LABEL(y), . - _C_LABEL(y)
#define SET_ASENTRY_SIZE(y) \
.size _ASM_LABEL(y), . - _ASM_LABEL(y)
#ifdef __ELF__
#define ALTENTRY(name) \
.globl _C_LABEL(name) ;\
.type _C_LABEL(name),@function ;\
_C_LABEL(name):
#else
#define ALTENTRY(name) \
.globl _C_LABEL(name) ;\
_C_LABEL(name):
#endif
/*
* Hide the gory details of PIC calls vs. normal calls. Use as in the
* following example:
*
* sts.l pr, @-sp
* PIC_PROLOGUE(.L_got, r0) ! saves old r12 on stack
* ...
* mov.l .L_function_1, r0
* 1: CALL r0 ! each call site needs a label
* nop
* ...
* mov.l .L_function_2, r0
* 2: CALL r0
* nop
* ...
* PIC_EPILOGUE ! restores r12 from stack
* lds.l @sp+, pr ! so call in right order
* rts
* nop
*
* .align 2
* .L_got:
* PIC_GOT_DATUM
* .L_function_1: ! if you call the same function twice
* CALL_DATUM(function, 1b) ! provide call datum for each call
* .L_function_2:
* CALL_DATUM(function, 2b)
*/
#ifdef PIC
#define PIC_PLT(x) x@PLT
#define PIC_GOT(x) x@GOT
#define PIC_GOTOFF(x) x@GOTOFF
#define PIC_PROLOGUE(got) \
mov.l r12, @-sp; \
PIC_PROLOGUE_NOSAVE(got)
/*
* Functions that do non local jumps don't need to preserve r12,
* so we can shave off two instructions to save/restore it.
*/
#define PIC_PROLOGUE_NOSAVE(got) \
mov.l got, r12; \
mova got, r0; \
add r0, r12
#define PIC_EPILOGUE \
mov.l @sp+, r12
#define PIC_EPILOGUE_SLOT \
PIC_EPILOGUE
#define PIC_GOT_DATUM \
.long _GLOBAL_OFFSET_TABLE_
#define CALL bsrf
#define JUMP braf
#define CALL_DATUM(function, lpcs) \
.long PIC_PLT(function) - ((lpcs) + 4 - (.))
/*
* This will result in text relocations in the shared library,
* unless the function is local or has hidden or protected visibility.
* Does not require PIC prologue.
*/
#define CALL_DATUM_LOCAL(function, lpcs) \
.long function - ((lpcs) + 4)
#else /* !PIC */
#define PIC_PROLOGUE(label)
#define PIC_PROLOGUE_NOSAVE(label)
#define PIC_EPILOGUE
#define PIC_EPILOGUE_SLOT nop
#define PIC_GOT_DATUM
#define CALL jsr @
#define JUMP jmp @
#define CALL_DATUM(function, lpcs) \
.long function
#define CALL_DATUM_LOCAL(function, lpcs) \
.long function
#endif /* !PIC */
#define ASMSTR .asciz
#ifdef __ELF__
#define WEAK_ALIAS(alias,sym) \
.weak _C_LABEL(alias); \
_C_LABEL(alias) = _C_LABEL(sym)
#endif
#define WARN_REFERENCES(_sym,_msg) \
.section .gnu.warning._sym; .ascii _msg; .previous
#endif /* !_SH_ASM_H_ */

View File

@@ -0,0 +1,35 @@
/* $OpenBSD: exec.h,v 1.2 2006/11/10 20:34:06 drahn Exp $ */
/* $NetBSD: elf_machdep.h,v 1.8 2002/04/28 17:10:34 uch Exp $ */
#define __LDPGSZ 4096
#define NATIVE_EXEC_ELF
#define ARCH_ELFSIZE 32 /* MD native binary size */
#define ELF_TARG_CLASS ELFCLASS32
#ifdef __LITTLE_ENDIAN__
#define ELF_TARG_DATA ELFDATA2LSB
#else
#define ELF_TARG_DATA ELFDATA2MSB
#endif
#define ELF_TARG_MACH EM_SH
#define _KERN_DO_ELF
#define _NLIST_DO_ELF
/*
* SuperH ELF header flags.
*/
#define EF_SH_MACH_MASK 0x1f
#define EF_SH_UNKNOWN 0x00
#define EF_SH_SH1 0x01
#define EF_SH_SH2 0x02
#define EF_SH_SH3 0x03
#define EF_SH_DSP 0x04
#define EF_SH_SH3_DSP 0x05
#define EF_SH_SH3E 0x08
#define EF_SH_SH4 0x09
#define EF_SH_HAS_DSP(x) ((x) & EF_SH_DSP)
#define EF_SH_HAS_FP(x) ((x) & EF_SH_SH3E)

View File

@@ -0,0 +1,132 @@
/* $OpenBSD: ieee.h,v 1.2 2006/11/10 20:29:36 otto Exp $ */
/*
* Copyright (c) 1992, 1993
* The Regents of the University of California. All rights reserved.
*
* This software was developed by the Computer Systems Engineering group
* at Lawrence Berkeley Laboratory under DARPA contract BG 91-66 and
* contributed to Berkeley.
*
* All advertising materials mentioning features or use of this software
* must display the following acknowledgement:
* This product includes software developed by the University of
* California, Lawrence Berkeley Laboratory.
*
* 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.
*
* @(#)ieee.h 8.1 (Berkeley) 6/11/93
*/
/*
* ieee.h defines the machine-dependent layout of the machine's IEEE
* floating point. It does *not* define (yet?) any of the rounding
* mode bits, exceptions, and so forth.
*/
/*
* Define the number of bits in each fraction and exponent.
*
* k k+1
* Note that 1.0 x 2 == 0.1 x 2 and that denorms are represented
*
* (-exp_bias+1)
* as fractions that look like 0.fffff x 2 . This means that
*
* -126
* the number 0.10000 x 2 , for instance, is the same as the normalized
*
* -127 -128
* float 1.0 x 2 . Thus, to represent 2 , we need one leading zero
*
* -129
* in the fraction; to represent 2 , we need two, and so on. This
*
* (-exp_bias-fracbits+1)
* implies that the smallest denormalized number is 2
*
* for whichever format we are talking about: for single precision, for
*
* -126 -149
* instance, we get .00000000000000000000001 x 2 , or 1.0 x 2 , and
*
* -149 == -127 - 23 + 1.
*/
#define SNG_EXPBITS 8
#define SNG_FRACBITS 23
#define DBL_EXPBITS 11
#define DBL_FRACBITS 52
#define EXT_EXPBITS 15
#define EXT_FRACBITS 112
struct ieee_single {
u_int sng_frac:23;
u_int sng_exp:8;
u_int sng_sign:1;
};
struct ieee_double {
u_int dbl_fracl;
u_int dbl_frach:20;
u_int dbl_exp:11;
u_int dbl_sign:1;
};
struct ieee_ext {
u_int ext_sign:1;
u_int ext_exp:15;
u_int ext_frach:16;
u_int ext_frachm;
u_int ext_fraclm;
u_int ext_fracl;
};
/*
* Floats whose exponent is in [1..INFNAN) (of whatever type) are
* `normal'. Floats whose exponent is INFNAN are either Inf or NaN.
* Floats whose exponent is zero are either zero (iff all fraction
* bits are zero) or subnormal values.
*
* A NaN is a `signalling NaN' if its QUIETNAN bit is clear in its
* high fraction; if the bit is set, it is a `quiet NaN'.
*/
#define SNG_EXP_INFNAN 255
#define DBL_EXP_INFNAN 2047
#define EXT_EXP_INFNAN 32767
#if 0
#define SNG_QUIETNAN (1 << 22)
#define DBL_QUIETNAN (1 << 19)
#define EXT_QUIETNAN (1 << 15)
#endif
/*
* Exponent biases.
*/
#define SNG_EXP_BIAS 127
#define DBL_EXP_BIAS 1023
#define EXT_EXP_BIAS 16383

View File

@@ -0,0 +1,6 @@
/* $OpenBSD: internal_types.h,v 1.1.1.1 2006/10/06 21:02:55 miod Exp $ */
/* Public domain */
#ifndef _SH_INTERNAL_TYPES_H_
#define _SH_INTERNAL_TYPES_H_
#endif

View File

@@ -0,0 +1,42 @@
/*
* Copyright (C) 2009 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.
*/
#ifndef _ARCH_SH_KERNEL_H
#define _ARCH_SH_KERNEL_H
/* this file contains kernel-specific definitions that were optimized out of
our processed kernel headers, but still useful nonetheless... */
typedef unsigned long __kernel_blkcnt_t;
typedef unsigned long __kernel_blksize_t;
/* these aren't really defined by the kernel headers though... */
typedef unsigned long __kernel_fsblkcnt_t;
typedef unsigned long __kernel_fsfilcnt_t;
typedef unsigned int __kernel_id_t;
#endif /* _ARCH_SH_KERNEL_H */

View File

@@ -0,0 +1,60 @@
/* $OpenBSD: limits.h,v 1.1.1.1 2006/10/06 21:02:55 miod Exp $ */
/* $NetBSD: limits.h,v 1.1 1996/09/30 16:34:28 ws Exp $ */
/*-
* Copyright (C) 1995, 1996 Wolfgang Solfrank.
* Copyright (C) 1995, 1996 TooLs GmbH.
* 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. All advertising materials mentioning features or use of this software
* must display the following acknowledgement:
* This product includes software developed by TooLs GmbH.
* 4. The name of TooLs GmbH may not be used to endorse or promote products
* derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY TOOLS GMBH ``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 TOOLS GMBH 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 _SH_LIMITS_H_
#define _SH_LIMITS_H_
#include <sys/cdefs.h>
#define MB_LEN_MAX 1 /* no multibyte characters */
#ifndef SIZE_MAX
#define SIZE_MAX UINT_MAX /* max value for a size_t */
#endif
#define SSIZE_MAX INT_MAX /* max value for a ssize_t */
#if __BSD_VISIBLE
#define SIZE_T_MAX UINT_MAX /* max value for a size_t (historic) */
#define UQUAD_MAX 0xffffffffffffffffULL /* max unsigned quad */
#define QUAD_MAX 0x7fffffffffffffffLL /* max signed quad */
#define QUAD_MIN (-0x7fffffffffffffffLL-1) /* min signed quad */
#endif /* __BSD_VISIBLE */
#define LONGLONG_BIT 64
#define LONGLONG_MIN (-9223372036854775807LL-1)
#define LONGLONG_MAX 9223372036854775807LL
#define ULONGLONG_MAX 18446744073709551615ULL
#endif /* _SH_LIMITS_H_ */

View File

@@ -0,0 +1,7 @@
/* $OpenBSD: setjmp.h,v 1.2 2007/03/02 06:11:54 miod Exp $ */
/* $NetBSD: setjmp.h,v 1.3 2006/01/05 00:50:23 uwe Exp $ */
/*
* machine/setjmp.h: machine dependent setjmp-related information.
*/

164
libc/arch-sh/syscalls.mk Normal file
View File

@@ -0,0 +1,164 @@
# auto-generated by gensyscalls.py, do not touch
syscall_src :=
syscall_src += arch-sh/syscalls/_exit.S
syscall_src += arch-sh/syscalls/_exit_thread.S
syscall_src += arch-sh/syscalls/__fork.S
syscall_src += arch-sh/syscalls/_waitpid.S
syscall_src += arch-sh/syscalls/__waitid.S
syscall_src += arch-sh/syscalls/__sys_clone.S
syscall_src += arch-sh/syscalls/execve.S
syscall_src += arch-sh/syscalls/__setuid.S
syscall_src += arch-sh/syscalls/getuid.S
syscall_src += arch-sh/syscalls/getgid.S
syscall_src += arch-sh/syscalls/geteuid.S
syscall_src += arch-sh/syscalls/getegid.S
syscall_src += arch-sh/syscalls/getresuid.S
syscall_src += arch-sh/syscalls/getresgid.S
syscall_src += arch-sh/syscalls/gettid.S
syscall_src += arch-sh/syscalls/getgroups.S
syscall_src += arch-sh/syscalls/getpgid.S
syscall_src += arch-sh/syscalls/getppid.S
syscall_src += arch-sh/syscalls/setsid.S
syscall_src += arch-sh/syscalls/setgid.S
syscall_src += arch-sh/syscalls/__setreuid.S
syscall_src += arch-sh/syscalls/__setresuid.S
syscall_src += arch-sh/syscalls/setresgid.S
syscall_src += arch-sh/syscalls/__brk.S
syscall_src += arch-sh/syscalls/kill.S
syscall_src += arch-sh/syscalls/tkill.S
syscall_src += arch-sh/syscalls/__ptrace.S
syscall_src += arch-sh/syscalls/__set_thread_area.S
syscall_src += arch-sh/syscalls/__getpriority.S
syscall_src += arch-sh/syscalls/setpriority.S
syscall_src += arch-sh/syscalls/setrlimit.S
syscall_src += arch-sh/syscalls/getrlimit.S
syscall_src += arch-sh/syscalls/getrusage.S
syscall_src += arch-sh/syscalls/setgroups.S
syscall_src += arch-sh/syscalls/setpgid.S
syscall_src += arch-sh/syscalls/vfork.S
syscall_src += arch-sh/syscalls/setregid.S
syscall_src += arch-sh/syscalls/chroot.S
syscall_src += arch-sh/syscalls/prctl.S
syscall_src += arch-sh/syscalls/capget.S
syscall_src += arch-sh/syscalls/capset.S
syscall_src += arch-sh/syscalls/sigaltstack.S
syscall_src += arch-sh/syscalls/acct.S
syscall_src += arch-sh/syscalls/read.S
syscall_src += arch-sh/syscalls/write.S
syscall_src += arch-sh/syscalls/__pread64.S
syscall_src += arch-sh/syscalls/__pwrite64.S
syscall_src += arch-sh/syscalls/__open.S
syscall_src += arch-sh/syscalls/__openat.S
syscall_src += arch-sh/syscalls/close.S
syscall_src += arch-sh/syscalls/lseek.S
syscall_src += arch-sh/syscalls/__llseek.S
syscall_src += arch-sh/syscalls/getpid.S
syscall_src += arch-sh/syscalls/__mmap2.S
syscall_src += arch-sh/syscalls/munmap.S
syscall_src += arch-sh/syscalls/mremap.S
syscall_src += arch-sh/syscalls/msync.S
syscall_src += arch-sh/syscalls/mprotect.S
syscall_src += arch-sh/syscalls/madvise.S
syscall_src += arch-sh/syscalls/mlock.S
syscall_src += arch-sh/syscalls/munlock.S
syscall_src += arch-sh/syscalls/mincore.S
syscall_src += arch-sh/syscalls/__ioctl.S
syscall_src += arch-sh/syscalls/readv.S
syscall_src += arch-sh/syscalls/writev.S
syscall_src += arch-sh/syscalls/__fcntl.S
syscall_src += arch-sh/syscalls/flock.S
syscall_src += arch-sh/syscalls/fchmod.S
syscall_src += arch-sh/syscalls/dup.S
syscall_src += arch-sh/syscalls/pipe2.S
syscall_src += arch-sh/syscalls/dup2.S
syscall_src += arch-sh/syscalls/select.S
syscall_src += arch-sh/syscalls/ftruncate.S
syscall_src += arch-sh/syscalls/getdents.S
syscall_src += arch-sh/syscalls/fsync.S
syscall_src += arch-sh/syscalls/fdatasync.S
syscall_src += arch-sh/syscalls/fchown.S
syscall_src += arch-sh/syscalls/sync.S
syscall_src += arch-sh/syscalls/__fcntl64.S
syscall_src += arch-sh/syscalls/__fstatfs64.S
syscall_src += arch-sh/syscalls/sendfile.S
syscall_src += arch-sh/syscalls/fstatat.S
syscall_src += arch-sh/syscalls/mkdirat.S
syscall_src += arch-sh/syscalls/fchownat.S
syscall_src += arch-sh/syscalls/fchmodat.S
syscall_src += arch-sh/syscalls/renameat.S
syscall_src += arch-sh/syscalls/link.S
syscall_src += arch-sh/syscalls/unlink.S
syscall_src += arch-sh/syscalls/unlinkat.S
syscall_src += arch-sh/syscalls/chdir.S
syscall_src += arch-sh/syscalls/mknod.S
syscall_src += arch-sh/syscalls/chmod.S
syscall_src += arch-sh/syscalls/chown.S
syscall_src += arch-sh/syscalls/lchown.S
syscall_src += arch-sh/syscalls/mount.S
syscall_src += arch-sh/syscalls/umount2.S
syscall_src += arch-sh/syscalls/fstat.S
syscall_src += arch-sh/syscalls/stat.S
syscall_src += arch-sh/syscalls/lstat.S
syscall_src += arch-sh/syscalls/mkdir.S
syscall_src += arch-sh/syscalls/readlink.S
syscall_src += arch-sh/syscalls/rmdir.S
syscall_src += arch-sh/syscalls/rename.S
syscall_src += arch-sh/syscalls/__getcwd.S
syscall_src += arch-sh/syscalls/access.S
syscall_src += arch-sh/syscalls/symlink.S
syscall_src += arch-sh/syscalls/fchdir.S
syscall_src += arch-sh/syscalls/truncate.S
syscall_src += arch-sh/syscalls/__statfs64.S
syscall_src += arch-sh/syscalls/pause.S
syscall_src += arch-sh/syscalls/gettimeofday.S
syscall_src += arch-sh/syscalls/settimeofday.S
syscall_src += arch-sh/syscalls/times.S
syscall_src += arch-sh/syscalls/nanosleep.S
syscall_src += arch-sh/syscalls/clock_gettime.S
syscall_src += arch-sh/syscalls/clock_settime.S
syscall_src += arch-sh/syscalls/clock_getres.S
syscall_src += arch-sh/syscalls/clock_nanosleep.S
syscall_src += arch-sh/syscalls/getitimer.S
syscall_src += arch-sh/syscalls/setitimer.S
syscall_src += arch-sh/syscalls/__timer_create.S
syscall_src += arch-sh/syscalls/__timer_settime.S
syscall_src += arch-sh/syscalls/__timer_gettime.S
syscall_src += arch-sh/syscalls/__timer_getoverrun.S
syscall_src += arch-sh/syscalls/__timer_delete.S
syscall_src += arch-sh/syscalls/utimes.S
syscall_src += arch-sh/syscalls/sigaction.S
syscall_src += arch-sh/syscalls/sigprocmask.S
syscall_src += arch-sh/syscalls/__sigsuspend.S
syscall_src += arch-sh/syscalls/__rt_sigaction.S
syscall_src += arch-sh/syscalls/__rt_sigprocmask.S
syscall_src += arch-sh/syscalls/__rt_sigtimedwait.S
syscall_src += arch-sh/syscalls/sigpending.S
syscall_src += arch-sh/syscalls/__socketcall.S
syscall_src += arch-sh/syscalls/sched_setscheduler.S
syscall_src += arch-sh/syscalls/sched_getscheduler.S
syscall_src += arch-sh/syscalls/sched_yield.S
syscall_src += arch-sh/syscalls/sched_setparam.S
syscall_src += arch-sh/syscalls/sched_getparam.S
syscall_src += arch-sh/syscalls/sched_get_priority_max.S
syscall_src += arch-sh/syscalls/sched_get_priority_min.S
syscall_src += arch-sh/syscalls/sched_rr_get_interval.S
syscall_src += arch-sh/syscalls/ioprio_set.S
syscall_src += arch-sh/syscalls/ioprio_get.S
syscall_src += arch-sh/syscalls/uname.S
syscall_src += arch-sh/syscalls/__wait4.S
syscall_src += arch-sh/syscalls/umask.S
syscall_src += arch-sh/syscalls/__reboot.S
syscall_src += arch-sh/syscalls/__syslog.S
syscall_src += arch-sh/syscalls/init_module.S
syscall_src += arch-sh/syscalls/delete_module.S
syscall_src += arch-sh/syscalls/klogctl.S
syscall_src += arch-sh/syscalls/sysinfo.S
syscall_src += arch-sh/syscalls/futex.S
syscall_src += arch-sh/syscalls/epoll_create.S
syscall_src += arch-sh/syscalls/epoll_ctl.S
syscall_src += arch-sh/syscalls/epoll_wait.S
syscall_src += arch-sh/syscalls/inotify_init.S
syscall_src += arch-sh/syscalls/inotify_add_watch.S
syscall_src += arch-sh/syscalls/inotify_rm_watch.S
syscall_src += arch-sh/syscalls/poll.S
syscall_src += arch-sh/syscalls/eventfd.S

View File

@@ -0,0 +1,32 @@
/* autogenerated by gensyscalls.py */
#include <sys/linux-syscalls.h>
.text
.type __brk, @function
.globl __brk
.align 4
__brk:
/* invoke trap */
mov.l 0f, r3 /* trap num */
trapa #(1 + 0x10)
/* check return value */
cmp/pz r0
bt __NR_brk_end
/* keep error number */
sts.l pr, @-r15
mov.l 1f, r1
jsr @r1
mov r0, r4
lds.l @r15+, pr
__NR_brk_end:
rts
nop
.align 2
0: .long __NR_brk
1: .long __set_syscall_errno

View File

@@ -0,0 +1,32 @@
/* autogenerated by gensyscalls.py */
#include <sys/linux-syscalls.h>
.text
.type __fcntl, @function
.globl __fcntl
.align 4
__fcntl:
/* invoke trap */
mov.l 0f, r3 /* trap num */
trapa #(3 + 0x10)
/* check return value */
cmp/pz r0
bt __NR_fcntl_end
/* keep error number */
sts.l pr, @-r15
mov.l 1f, r1
jsr @r1
mov r0, r4
lds.l @r15+, pr
__NR_fcntl_end:
rts
nop
.align 2
0: .long __NR_fcntl
1: .long __set_syscall_errno

View File

@@ -0,0 +1,32 @@
/* autogenerated by gensyscalls.py */
#include <sys/linux-syscalls.h>
.text
.type __fcntl64, @function
.globl __fcntl64
.align 4
__fcntl64:
/* invoke trap */
mov.l 0f, r3 /* trap num */
trapa #(3 + 0x10)
/* check return value */
cmp/pz r0
bt __NR_fcntl64_end
/* keep error number */
sts.l pr, @-r15
mov.l 1f, r1
jsr @r1
mov r0, r4
lds.l @r15+, pr
__NR_fcntl64_end:
rts
nop
.align 2
0: .long __NR_fcntl64
1: .long __set_syscall_errno

View File

@@ -0,0 +1,32 @@
/* autogenerated by gensyscalls.py */
#include <sys/linux-syscalls.h>
.text
.type __fork, @function
.globl __fork
.align 4
__fork:
/* invoke trap */
mov.l 0f, r3 /* trap num */
trapa #(1 + 0x10)
/* check return value */
cmp/pz r0
bt __NR_fork_end
/* keep error number */
sts.l pr, @-r15
mov.l 1f, r1
jsr @r1
mov r0, r4
lds.l @r15+, pr
__NR_fork_end:
rts
nop
.align 2
0: .long __NR_fork
1: .long __set_syscall_errno

View File

@@ -0,0 +1,32 @@
/* autogenerated by gensyscalls.py */
#include <sys/linux-syscalls.h>
.text
.type __fstatfs64, @function
.globl __fstatfs64
.align 4
__fstatfs64:
/* invoke trap */
mov.l 0f, r3 /* trap num */
trapa #(3 + 0x10)
/* check return value */
cmp/pz r0
bt __NR_fstatfs64_end
/* keep error number */
sts.l pr, @-r15
mov.l 1f, r1
jsr @r1
mov r0, r4
lds.l @r15+, pr
__NR_fstatfs64_end:
rts
nop
.align 2
0: .long __NR_fstatfs64
1: .long __set_syscall_errno

View File

@@ -0,0 +1,32 @@
/* autogenerated by gensyscalls.py */
#include <sys/linux-syscalls.h>
.text
.type __getcwd, @function
.globl __getcwd
.align 4
__getcwd:
/* invoke trap */
mov.l 0f, r3 /* trap num */
trapa #(2 + 0x10)
/* check return value */
cmp/pz r0
bt __NR_getcwd_end
/* keep error number */
sts.l pr, @-r15
mov.l 1f, r1
jsr @r1
mov r0, r4
lds.l @r15+, pr
__NR_getcwd_end:
rts
nop
.align 2
0: .long __NR_getcwd
1: .long __set_syscall_errno

View File

@@ -0,0 +1,32 @@
/* autogenerated by gensyscalls.py */
#include <sys/linux-syscalls.h>
.text
.type __getpriority, @function
.globl __getpriority
.align 4
__getpriority:
/* invoke trap */
mov.l 0f, r3 /* trap num */
trapa #(2 + 0x10)
/* check return value */
cmp/pz r0
bt __NR_getpriority_end
/* keep error number */
sts.l pr, @-r15
mov.l 1f, r1
jsr @r1
mov r0, r4
lds.l @r15+, pr
__NR_getpriority_end:
rts
nop
.align 2
0: .long __NR_getpriority
1: .long __set_syscall_errno

View File

@@ -0,0 +1,32 @@
/* autogenerated by gensyscalls.py */
#include <sys/linux-syscalls.h>
.text
.type __ioctl, @function
.globl __ioctl
.align 4
__ioctl:
/* invoke trap */
mov.l 0f, r3 /* trap num */
trapa #(3 + 0x10)
/* check return value */
cmp/pz r0
bt __NR_ioctl_end
/* keep error number */
sts.l pr, @-r15
mov.l 1f, r1
jsr @r1
mov r0, r4
lds.l @r15+, pr
__NR_ioctl_end:
rts
nop
.align 2
0: .long __NR_ioctl
1: .long __set_syscall_errno

View File

@@ -0,0 +1,35 @@
/* autogenerated by gensyscalls.py */
#include <sys/linux-syscalls.h>
.text
.type __llseek, @function
.globl __llseek
.align 4
__llseek:
/* get ready for additonal arg */
mov.l @r15, r0
/* invoke trap */
mov.l 0f, r3 /* trap num */
trapa #(5 + 0x10)
/* check return value */
cmp/pz r0
bt __NR__llseek_end
/* keep error number */
sts.l pr, @-r15
mov.l 1f, r1
jsr @r1
mov r0, r4
lds.l @r15+, pr
__NR__llseek_end:
rts
nop
.align 2
0: .long __NR__llseek
1: .long __set_syscall_errno

View File

@@ -0,0 +1,36 @@
/* autogenerated by gensyscalls.py */
#include <sys/linux-syscalls.h>
.text
.type __mmap2, @function
.globl __mmap2
.align 4
__mmap2:
/* get ready for additonal arg */
mov.l @r15, r0
mov.l @(4, r15), r1
/* invoke trap */
mov.l 0f, r3 /* trap num */
trapa #(6 + 0x10)
/* check return value */
cmp/pz r0
bt __NR_mmap2_end
/* keep error number */
sts.l pr, @-r15
mov.l 1f, r1
jsr @r1
mov r0, r4
lds.l @r15+, pr
__NR_mmap2_end:
rts
nop
.align 2
0: .long __NR_mmap2
1: .long __set_syscall_errno

View File

@@ -0,0 +1,32 @@
/* autogenerated by gensyscalls.py */
#include <sys/linux-syscalls.h>
.text
.type __open, @function
.globl __open
.align 4
__open:
/* invoke trap */
mov.l 0f, r3 /* trap num */
trapa #(3 + 0x10)
/* check return value */
cmp/pz r0
bt __NR_open_end
/* keep error number */
sts.l pr, @-r15
mov.l 1f, r1
jsr @r1
mov r0, r4
lds.l @r15+, pr
__NR_open_end:
rts
nop
.align 2
0: .long __NR_open
1: .long __set_syscall_errno

View File

@@ -0,0 +1,32 @@
/* autogenerated by gensyscalls.py */
#include <sys/linux-syscalls.h>
.text
.type __openat, @function
.globl __openat
.align 4
__openat:
/* invoke trap */
mov.l 0f, r3 /* trap num */
trapa #(4 + 0x10)
/* check return value */
cmp/pz r0
bt __NR_openat_end
/* keep error number */
sts.l pr, @-r15
mov.l 1f, r1
jsr @r1
mov r0, r4
lds.l @r15+, pr
__NR_openat_end:
rts
nop
.align 2
0: .long __NR_openat
1: .long __set_syscall_errno

View File

@@ -0,0 +1,35 @@
/* autogenerated by gensyscalls.py */
#include <sys/linux-syscalls.h>
.text
.type __pread64, @function
.globl __pread64
.align 4
__pread64:
/* get ready for additonal arg */
mov.l @r15, r0
/* invoke trap */
mov.l 0f, r3 /* trap num */
trapa #(5 + 0x10)
/* check return value */
cmp/pz r0
bt __NR_pread64_end
/* keep error number */
sts.l pr, @-r15
mov.l 1f, r1
jsr @r1
mov r0, r4
lds.l @r15+, pr
__NR_pread64_end:
rts
nop
.align 2
0: .long __NR_pread64
1: .long __set_syscall_errno

View File

@@ -0,0 +1,32 @@
/* autogenerated by gensyscalls.py */
#include <sys/linux-syscalls.h>
.text
.type __ptrace, @function
.globl __ptrace
.align 4
__ptrace:
/* invoke trap */
mov.l 0f, r3 /* trap num */
trapa #(4 + 0x10)
/* check return value */
cmp/pz r0
bt __NR_ptrace_end
/* keep error number */
sts.l pr, @-r15
mov.l 1f, r1
jsr @r1
mov r0, r4
lds.l @r15+, pr
__NR_ptrace_end:
rts
nop
.align 2
0: .long __NR_ptrace
1: .long __set_syscall_errno

View File

@@ -0,0 +1,35 @@
/* autogenerated by gensyscalls.py */
#include <sys/linux-syscalls.h>
.text
.type __pwrite64, @function
.globl __pwrite64
.align 4
__pwrite64:
/* get ready for additonal arg */
mov.l @r15, r0
/* invoke trap */
mov.l 0f, r3 /* trap num */
trapa #(5 + 0x10)
/* check return value */
cmp/pz r0
bt __NR_pwrite64_end
/* keep error number */
sts.l pr, @-r15
mov.l 1f, r1
jsr @r1
mov r0, r4
lds.l @r15+, pr
__NR_pwrite64_end:
rts
nop
.align 2
0: .long __NR_pwrite64
1: .long __set_syscall_errno

View File

@@ -0,0 +1,32 @@
/* autogenerated by gensyscalls.py */
#include <sys/linux-syscalls.h>
.text
.type __reboot, @function
.globl __reboot
.align 4
__reboot:
/* invoke trap */
mov.l 0f, r3 /* trap num */
trapa #(4 + 0x10)
/* check return value */
cmp/pz r0
bt __NR_reboot_end
/* keep error number */
sts.l pr, @-r15
mov.l 1f, r1
jsr @r1
mov r0, r4
lds.l @r15+, pr
__NR_reboot_end:
rts
nop
.align 2
0: .long __NR_reboot
1: .long __set_syscall_errno

View File

@@ -0,0 +1,32 @@
/* autogenerated by gensyscalls.py */
#include <sys/linux-syscalls.h>
.text
.type __rt_sigaction, @function
.globl __rt_sigaction
.align 4
__rt_sigaction:
/* invoke trap */
mov.l 0f, r3 /* trap num */
trapa #(4 + 0x10)
/* check return value */
cmp/pz r0
bt __NR_rt_sigaction_end
/* keep error number */
sts.l pr, @-r15
mov.l 1f, r1
jsr @r1
mov r0, r4
lds.l @r15+, pr
__NR_rt_sigaction_end:
rts
nop
.align 2
0: .long __NR_rt_sigaction
1: .long __set_syscall_errno

View File

@@ -0,0 +1,32 @@
/* autogenerated by gensyscalls.py */
#include <sys/linux-syscalls.h>
.text
.type __rt_sigprocmask, @function
.globl __rt_sigprocmask
.align 4
__rt_sigprocmask:
/* invoke trap */
mov.l 0f, r3 /* trap num */
trapa #(4 + 0x10)
/* check return value */
cmp/pz r0
bt __NR_rt_sigprocmask_end
/* keep error number */
sts.l pr, @-r15
mov.l 1f, r1
jsr @r1
mov r0, r4
lds.l @r15+, pr
__NR_rt_sigprocmask_end:
rts
nop
.align 2
0: .long __NR_rt_sigprocmask
1: .long __set_syscall_errno

View File

@@ -0,0 +1,32 @@
/* autogenerated by gensyscalls.py */
#include <sys/linux-syscalls.h>
.text
.type __rt_sigtimedwait, @function
.globl __rt_sigtimedwait
.align 4
__rt_sigtimedwait:
/* invoke trap */
mov.l 0f, r3 /* trap num */
trapa #(4 + 0x10)
/* check return value */
cmp/pz r0
bt __NR_rt_sigtimedwait_end
/* keep error number */
sts.l pr, @-r15
mov.l 1f, r1
jsr @r1
mov r0, r4
lds.l @r15+, pr
__NR_rt_sigtimedwait_end:
rts
nop
.align 2
0: .long __NR_rt_sigtimedwait
1: .long __set_syscall_errno

View File

@@ -0,0 +1,32 @@
/* autogenerated by gensyscalls.py */
#include <sys/linux-syscalls.h>
.text
.type __set_thread_area, @function
.globl __set_thread_area
.align 4
__set_thread_area:
/* invoke trap */
mov.l 0f, r3 /* trap num */
trapa #(1 + 0x10)
/* check return value */
cmp/pz r0
bt __NR_set_thread_area_end
/* keep error number */
sts.l pr, @-r15
mov.l 1f, r1
jsr @r1
mov r0, r4
lds.l @r15+, pr
__NR_set_thread_area_end:
rts
nop
.align 2
0: .long __NR_set_thread_area
1: .long __set_syscall_errno

View File

@@ -0,0 +1,32 @@
/* autogenerated by gensyscalls.py */
#include <sys/linux-syscalls.h>
.text
.type __setresuid, @function
.globl __setresuid
.align 4
__setresuid:
/* invoke trap */
mov.l 0f, r3 /* trap num */
trapa #(3 + 0x10)
/* check return value */
cmp/pz r0
bt __NR_setresuid32_end
/* keep error number */
sts.l pr, @-r15
mov.l 1f, r1
jsr @r1
mov r0, r4
lds.l @r15+, pr
__NR_setresuid32_end:
rts
nop
.align 2
0: .long __NR_setresuid32
1: .long __set_syscall_errno

View File

@@ -0,0 +1,32 @@
/* autogenerated by gensyscalls.py */
#include <sys/linux-syscalls.h>
.text
.type __setreuid, @function
.globl __setreuid
.align 4
__setreuid:
/* invoke trap */
mov.l 0f, r3 /* trap num */
trapa #(2 + 0x10)
/* check return value */
cmp/pz r0
bt __NR_setreuid32_end
/* keep error number */
sts.l pr, @-r15
mov.l 1f, r1
jsr @r1
mov r0, r4
lds.l @r15+, pr
__NR_setreuid32_end:
rts
nop
.align 2
0: .long __NR_setreuid32
1: .long __set_syscall_errno

View File

@@ -0,0 +1,32 @@
/* autogenerated by gensyscalls.py */
#include <sys/linux-syscalls.h>
.text
.type __setuid, @function
.globl __setuid
.align 4
__setuid:
/* invoke trap */
mov.l 0f, r3 /* trap num */
trapa #(1 + 0x10)
/* check return value */
cmp/pz r0
bt __NR_setuid32_end
/* keep error number */
sts.l pr, @-r15
mov.l 1f, r1
jsr @r1
mov r0, r4
lds.l @r15+, pr
__NR_setuid32_end:
rts
nop
.align 2
0: .long __NR_setuid32
1: .long __set_syscall_errno

View File

@@ -0,0 +1,32 @@
/* autogenerated by gensyscalls.py */
#include <sys/linux-syscalls.h>
.text
.type __sigsuspend, @function
.globl __sigsuspend
.align 4
__sigsuspend:
/* invoke trap */
mov.l 0f, r3 /* trap num */
trapa #(3 + 0x10)
/* check return value */
cmp/pz r0
bt __NR_sigsuspend_end
/* keep error number */
sts.l pr, @-r15
mov.l 1f, r1
jsr @r1
mov r0, r4
lds.l @r15+, pr
__NR_sigsuspend_end:
rts
nop
.align 2
0: .long __NR_sigsuspend
1: .long __set_syscall_errno

View File

@@ -0,0 +1,32 @@
/* autogenerated by gensyscalls.py */
#include <sys/linux-syscalls.h>
.text
.type __socketcall, @function
.globl __socketcall
.align 4
__socketcall:
/* invoke trap */
mov.l 0f, r3 /* trap num */
trapa #(2 + 0x10)
/* check return value */
cmp/pz r0
bt __NR___socketcall_end
/* keep error number */
sts.l pr, @-r15
mov.l 1f, r1
jsr @r1
mov r0, r4
lds.l @r15+, pr
__NR___socketcall_end:
rts
nop
.align 2
0: .long __NR___socketcall
1: .long __set_syscall_errno

View File

@@ -0,0 +1,32 @@
/* autogenerated by gensyscalls.py */
#include <sys/linux-syscalls.h>
.text
.type __statfs64, @function
.globl __statfs64
.align 4
__statfs64:
/* invoke trap */
mov.l 0f, r3 /* trap num */
trapa #(3 + 0x10)
/* check return value */
cmp/pz r0
bt __NR_statfs64_end
/* keep error number */
sts.l pr, @-r15
mov.l 1f, r1
jsr @r1
mov r0, r4
lds.l @r15+, pr
__NR_statfs64_end:
rts
nop
.align 2
0: .long __NR_statfs64
1: .long __set_syscall_errno

View File

@@ -0,0 +1,35 @@
/* autogenerated by gensyscalls.py */
#include <sys/linux-syscalls.h>
.text
.type __sys_clone, @function
.globl __sys_clone
.align 4
__sys_clone:
/* get ready for additonal arg */
mov.l @r15, r0
/* invoke trap */
mov.l 0f, r3 /* trap num */
trapa #(5 + 0x10)
/* check return value */
cmp/pz r0
bt __NR_clone_end
/* keep error number */
sts.l pr, @-r15
mov.l 1f, r1
jsr @r1
mov r0, r4
lds.l @r15+, pr
__NR_clone_end:
rts
nop
.align 2
0: .long __NR_clone
1: .long __set_syscall_errno

View File

@@ -0,0 +1,32 @@
/* autogenerated by gensyscalls.py */
#include <sys/linux-syscalls.h>
.text
.type __syslog, @function
.globl __syslog
.align 4
__syslog:
/* invoke trap */
mov.l 0f, r3 /* trap num */
trapa #(3 + 0x10)
/* check return value */
cmp/pz r0
bt __NR_syslog_end
/* keep error number */
sts.l pr, @-r15
mov.l 1f, r1
jsr @r1
mov r0, r4
lds.l @r15+, pr
__NR_syslog_end:
rts
nop
.align 2
0: .long __NR_syslog
1: .long __set_syscall_errno

View File

@@ -0,0 +1,32 @@
/* autogenerated by gensyscalls.py */
#include <sys/linux-syscalls.h>
.text
.type __timer_create, @function
.globl __timer_create
.align 4
__timer_create:
/* invoke trap */
mov.l 0f, r3 /* trap num */
trapa #(3 + 0x10)
/* check return value */
cmp/pz r0
bt __NR_timer_create_end
/* keep error number */
sts.l pr, @-r15
mov.l 1f, r1
jsr @r1
mov r0, r4
lds.l @r15+, pr
__NR_timer_create_end:
rts
nop
.align 2
0: .long __NR_timer_create
1: .long __set_syscall_errno

View File

@@ -0,0 +1,32 @@
/* autogenerated by gensyscalls.py */
#include <sys/linux-syscalls.h>
.text
.type __timer_delete, @function
.globl __timer_delete
.align 4
__timer_delete:
/* invoke trap */
mov.l 0f, r3 /* trap num */
trapa #(1 + 0x10)
/* check return value */
cmp/pz r0
bt __NR_timer_delete_end
/* keep error number */
sts.l pr, @-r15
mov.l 1f, r1
jsr @r1
mov r0, r4
lds.l @r15+, pr
__NR_timer_delete_end:
rts
nop
.align 2
0: .long __NR_timer_delete
1: .long __set_syscall_errno

View File

@@ -0,0 +1,32 @@
/* autogenerated by gensyscalls.py */
#include <sys/linux-syscalls.h>
.text
.type __timer_getoverrun, @function
.globl __timer_getoverrun
.align 4
__timer_getoverrun:
/* invoke trap */
mov.l 0f, r3 /* trap num */
trapa #(1 + 0x10)
/* check return value */
cmp/pz r0
bt __NR_timer_getoverrun_end
/* keep error number */
sts.l pr, @-r15
mov.l 1f, r1
jsr @r1
mov r0, r4
lds.l @r15+, pr
__NR_timer_getoverrun_end:
rts
nop
.align 2
0: .long __NR_timer_getoverrun
1: .long __set_syscall_errno

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