summaryrefslogtreecommitdiffstats
path: root/libc/arch-x86
Commit message (Collapse)AuthorAgeFilesLines
* Replace unnecessary x86 uses of <sys/linux-syscalls.h> with <asm/unistd.h>.Elliott Hughes2013-03-214-4/+4
| | | | Change-Id: I9d016ee8e8329cccf244d27c336d9524348af996
* The SYS_ constants should cover all __NR_ values.Elliott Hughes2013-03-21204-209/+204
| | | | | | | | | | | <sys/linux-syscalls.h> only contains constants for the syscalls we're generating stubs for. We want all the syscalls available on the architecture in question. Keep using <sys/linux-syscalls.h> on ARM for now because the __NR_ARM_set_tls and __NR_ARM_cacheflush values aren't in <asm/unistd.h>. Change-Id: I66683950d87d9b18d6107d0acc0ed238a4496f44
* Drop unnecessary execution permission for .cpp/.c/.hKito Cheng2013-03-225-0/+0
| | | | Change-Id: I9ac2b9d8f6bdb4fab8962210c5ec8f9c3e8c0ebf
* Expose wait4 as wait4 rather than __wait4.Elliott Hughes2013-03-212-3/+3
| | | | | | This helps strace(1) compile with one fewer hack. Change-Id: I5296d0cfec5546709cda990abd705ad33d7c4626
* Merge "Use the kernel's MAX_ERRNO in the syscall stubs."Elliott Hughes2013-03-13203-203/+406
|\
| * Use the kernel's MAX_ERRNO in the syscall stubs.Elliott Hughes2013-03-12203-203/+406
| | | | | | | | | | Bug: http://code.google.com/p/android/issues/detail?id=53104 Change-Id: Iaabf7025b153e96dc5eca231a33a32d4cb7d8116
* | Break bionic implementations into arch versions.Christopher Ferris2013-03-121-0/+27
|/ | | | | | | | | | | | Move arch specific code for arm, mips, x86 into separate makefiles. In addition, add different arm cpu versions of memcpy/memset. Bug: 8005082 Merge from internal master (acdde8c1cf8e8beed98c052757d96695b820b50c). Change-Id: I04f3d0715104fab618e1abf7cf8f7eec9bec79df
* Stop advertising rindex(3), which is both deprecated and unimplemented.Elliott Hughes2013-02-212-32/+0
| | | | Change-Id: I3c775d9974e49c3f76a53e46e022659657b89034
* libc: remove bcmp prototypeNick Kralevich2013-02-211-33/+0
| | | | | | | | | | AFAIK, bionic only ever provided an implementation of bcmp for x86, and even then, the code was never actually compiled. Remove the prototype. bcmp() has been obsoleted and replaced by memcmp() Change-Id: I549d02ab6a9241a9acbbbfade0d98a9a02c2eaee
* Fix the pthread_setname_np test.Elliott Hughes2013-02-151-1/+1
| | | | | | | | | | | | | | | Fix the pthread_setname_np test to take into account that emulator kernels are so old that they don't support setting the name of other threads. The CLONE_DETACHED thread is obsolete since 2.5 kernels. Rename kernel_id to tid. Fix the signature of __pthread_clone. Clean up the clone and pthread_setname_np implementations slightly. Change-Id: I16c2ff8845b67530544bbda9aa6618058603066d
* ffs was not being built for x86.Elliott Hughes2013-02-131-0/+0
| | | | Change-Id: I53e92273664a4d0a13536c2fa1aeb87e1f3cf4e8
* Add a bunch more missing ENDs to assembler routines.Elliott Hughes2013-02-1316-3/+20
| | | | | | This isn't everything; I've missed out those x86 files that are Change-Id: Idb7bb1a68796d6c0b70ea2b5c3300e49da6c62d2
* Fix __pthread_clone and __bionic_clone error handling on x86.Elliott Hughes2013-02-121-14/+26
| | | | | Bug: 3461078 Change-Id: I93c151e27411211dd32717f206745c62c08c21ee
* Use ENTRY/END in custom x86 assembler too.Elliott Hughes2013-02-116-68/+34
| | | | Change-Id: Ic2e482e5daff29c65d3b2ab0b2111c996bbc6226
* Fix __pthread_clone on ARM to set errno on failure.Elliott Hughes2013-02-111-4/+1
| | | | | | | | | | MIPS and x86 appear to have been correct already. (Also fix unit tests that ASSERT_EQ with errno so that the arguments are in the retarded junit order.) Bug: 3461078 Change-Id: I2418ea98927b56e15b4ba9cfec97f5e7094c6291
* Fix x86 build, remove void* arithmetic.Elliott Hughes2013-02-071-1/+2
| | | | Change-Id: Idc7f14af2e094ac33de315e808176237af063bb8
* Merge "Clean up the argc/argv/envp/auxv handling."Elliott Hughes2013-02-071-22/+7
|\
| * Clean up the argc/argv/envp/auxv handling.Elliott Hughes2013-02-071-22/+7
| | | | | | | | | | | | | | | | There's now only one place where we deal with this stuff, it only needs to be parsed once by the dynamic linker (rather than by each recipient), and it's now easier for us to get hold of auxv data early on. Change-Id: I6314224257c736547aac2e2a650e66f2ea53bef5
* | Switch x86 syscall stubs over to the ENTER/END style of the ARM stubs.Elliott Hughes2013-02-06204-1261/+736
|/ | | | | | | | | Also update the x86 asm.h to support this; we need it for libm assembler anyway. Also clean up the _FBSDID hack in <sys/cdefs.h>. Change-Id: Iababd977b8110ec022bf7c93f4d62ece47630e7c
* Upgrade libm.Elliott Hughes2013-02-011-0/+2
| | | | | | | | | | | | | | | | | | | This brings us up to date with FreeBSD HEAD, fixes various bugs, unifies the set of functions we support on ARM, MIPS, and x86, fixes "long double", adds ISO C99 support, and adds basic unit tests. It turns out that our "long double" functions have always been broken for non-normal numbers. This patch fixes that by not using the upstream implementations and just forwarding to the regular "double" implementation instead (since "long double" on Android is just "double" anyway, which is what BSD doesn't support). All the tests pass on ARM, MIPS, and x86, plus glibc on x86-64. Bug: 3169850 Bug: 8012787 Bug: https://code.google.com/p/android/issues/detail?id=6697 Change-Id: If0c343030959c24bfc50d4d21c9530052c581837
* Use the NetBSD <sys/exec_elf.h>.Elliott Hughes2013-01-291-0/+63
| | | | | | | | Replace a kernel header file dependency with files from NetBSD. They're more complete, and ELF is ELF, whether you're on Linux or a BSD. Bug: 7973611 Change-Id: I83ee719e7efdf432ec2ddbe8be271d05b2f558d7
* Add signalfd call to bionicRom Lemarchand2013-01-102-0/+33
| | | | | | | | | | | | | | | | | | | Add signalfd() call to bionic. Adding the signalfd call was done in 3 steps: - add signalfd4 system call (function name and syscall number) to libc/SYSCALLS.TXT - generate all necessary headers by calling libc/tools/gensyscalls.py. This patch is adding the generated files since the build system does not call gensyscalls.py. - create the signalfd wrapper in signalfd.cpp and add the function prototype to sys/signalfd.h (cherry-pick of 0c11611c11f4dc1b6d43587b72c3ccbe8c51a51c, modified to work with older versions of GCC still in use on some branches.) Change-Id: I4c6c3f12199559af8be63f93a5336851b7e63355
* Fix <endian.h> and <sys/endian.h>.Elliott Hughes2012-12-111-0/+0
| | | | | | | | | | | Previously we'd been relying on getting the machine-specific <endian.h> instead of the top-level <endian.h>, and <sys/endian.h> was basically broken. Now, with this patch and the previous patch we should have <endian.h> and <sys/endian.h> behaving the same. This is basically how NetBSD's endian.h works, and was probably how ours was originally intended to work. Bug: http://code.google.com/p/android/issues/detail?id=39824 Change-Id: I71de5a507e633de166013a658b5764df9e1aa09c
* Merge "Replace .S version of x86 crtfiles with .c version"Elliott Hughes2012-11-306-330/+111
|\
| * Replace .S version of x86 crtfiles with .c versionPavel Chupin2012-11-306-330/+111
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch replaces .S versions of x86 crtfiles with .c which are much easier to support. Some of the files are matching .c version of Arm crtfiles. x86 files required some cleanup anyway and this cleanup actually led to matching Arm files. I didn't change anything to share the same crt*.c between x86 and Arm. I prefer to keep them separate for a while in case any change is required for one of the arch, but it's good thing to do in the following patches. Change-Id: Ibcf033f8d15aa5b10c05c879fd4b79a64dfc70f3 Signed-off-by: Pavel Chupin <pavel.v.chupin@intel.com>
* | Remove (near-)duplicate definitions of size_t and ssize_t.Elliott Hughes2012-11-291-23/+0
| | | | | | | | | | | | | | | | The near duplicates upset fussier compilers that insist that typedefs be exactly the same, but the fix isn't to make all copies identical... Change-Id: Icfdace41726f36ec33c9ae919dbb5a54d3529cc9
* | Clean up _BYTE_ORDER definitions for better x86 portability.Elliott Hughes2012-11-271-0/+1
|/ | | | | | | | | | | | We'd manually hacked _BYTE_ORDER into the arm and mips "_types.h" headers, but not into the x86 one. Judging by upstream, _BYTE_ORDER should be in the "endian.h" headers instead, so let's uniformly do that. I've also ironed out some of the other differences between the different architectures' header files too. Bug: http://code.google.com/p/android/issues/detail?id=39824 Change-Id: I19d3af7ffd74e1c02b1b6886aec0f0d11f44ab8d
* Revert "libc: Provide ucontext_t/mcontext_t/<sys/ucontext.h>"David 'Digit' Turner2012-10-172-251/+0
| | | | | | | | | This creates build issues in the internal Android tree. Will investigate later. Original patch: https://android-review.googlesource.com/#/c/38875/ Change-Id: I12c5995ebf172890051af42a5d3b31014c9c5117
* libc: Provide ucontext_t/mcontext_t/<sys/ucontext.h>David 'Digit' Turner2012-10-172-0/+251
| | | | | | | | | | | | | | | | This patch updates the C library headers to provide ucontext_t definitions for three architectures. + Fix <signal.h> to always define 'struct sigcontext'. The new declarations are announced with new macros defined in <sys/cdefs.h> in order to make it easier to adapt client code that already defines its own, incompatible, versions of the structures seen here. http://code.google.com/p/android/issues/detail?id=34784 Change-Id: Ie78c48690a4ce61c50593f6c39639be7fead3596
* Add mlockall and munlockall for Google TV.Elliott Hughes2012-09-063-0/+45
| | | | Change-Id: I10e961d701e74aab07211ec7975f61167e387853
* Add getsid system call to bionicIrina Tirdea2012-09-032-0/+24
| | | | | | | | | | | | | | | | | | Add getsid() system call to bionic for all architectures. This is needed for various tools (e.g. perf). Adding the getsid system call was done in 3 steps: () add getsid system call (function name and syscall number) to libc/SYSCALLS.TXT () generate all necessary headers by calling libc/tools/gensyscalls.py. This patch is adding the generated files since the build system does not call gensyscalls.py. () add the system call signature to libc/include/unistd.h Change-Id: Id69a257e13ec02e1a44085a6b217a3f19ab025b1 Signed-off-by: Irina Tirdea <irina.tirdea@intel.com>
* Use unambiguous mnemonicsKevin Schoedel2012-08-211-111/+111
| | | | | | Change-Id: I8da0af54cc3cbf69d9e485eb71bc44a6976b1adc Author: Kevin P Schoedel <kevin.p.schoedel@intel.com> Reviewed-by: Edwin Vane <edwin.vane@intel.com>
* enable clone system call for x86Jin Wei2012-08-151-4/+57
| | | | | | | | | | | | Add __bionic_clone function for x86, which will be used for clone system call. Change-Id: I889dc9bf4b7ebb4358476e17e6f3233e26491f4d Signed-off-by: Jin Wei <wei.a.jin@intel.com> Signed-off-by: Xiaokang Qin <xiaokang.qin@intel.com> Signed-off-by: Beare, Bruce J <bruce.j.beare@intel.com> Signed-off-by: Jack Ren <jack.ren@intel.com> Author-tracking-BZ: 51414
* Add unshare() syscall.Jeff Sharkey2012-08-102-0/+24
| | | | | | | (cherry-pick of 5467f25f82934d611c60f8bc57a05114f3c1bea0.) Bug: 6925012 Change-Id: Ic5ea2fbd606311087de05d7a3594df2fa9b2fef9
* Merge "Remove an awkward #include that is no longer upstream."Elliott Hughes2012-08-061-2/+0
|\
| * Remove an awkward #include that is no longer upstream.Elliott Hughes2012-08-021-2/+0
| | | | | | | | | | | | This was causing trouble in https://android-review.googlesource.com/#/c/37590/. Change-Id: Ib7cb4fbaef6e9c1470c59f67d24bd24c7ce90bcc
* | bionic: modify syscall to use 6 registers to pass parameter.Jin Wei2012-08-031-16/+25
|/ | | | | | | | | | | | | Kernel allows to use 6 registers(exclude eax) to pass parameter. But in syscall's implementation, it only uses five registers. It will lead to error when 6 parameters passed. Change-Id: I92d663194e6334c3847f0c0c257ca3b9dee0edef Author: Jin Wei <wei.a.jin@intel.com> Signed-off-by: Xiaokang Qin <xiaokang.qin@intel.com> Signed-off-by: Beare, Bruce J <bruce.j.beare@intel.com> Signed-off-by: Jack Ren <jack.ren@intel.com> Author-tracking-BZ: 30838
* MIPS support for libc.Raghu Gandham2012-08-021-74/+0
| | | | | | Change-Id: I2864dea04b3faf2d919165dcaa600af5b16c41c8 Signed-off-by: Chris Dearman <chris@mips.com> Signed-off-by: Raghu Gandham <raghu@mips.com>
* arm: rewrite crtbegin* as C files.Nick Kralevich2012-06-012-0/+80
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Rewrite crtbegin.S -> crtbegin.c crtbegin_so.S -> crtbegin_so.c This change allows us to generate PIC code without relying on text relocations. As a consequence of this rewrite, also rewrite __dso_handle.S -> __dso_handle.c __dso_handle_so.S -> __dso_handle_so.c atexit.S -> atexit.c In crtbegin.c _start, place the __PREINIT_ARRAY__, __INIT_ARRAY__, __FINI_ARRAY__, and __CTOR_LIST__ variables onto the stack, instead of passing a pointer to the text section of the binary. This change appears sorta wonky, as I attempted to preserve, as much as possible, the structure of the original assembly. As a result, you have C files including other C files, and other programming uglyness. Result: This change reduces the number of files with text-relocations from 315 to 19 on my Android build. Before: $ scanelf -aR $OUT/system | grep TEXTREL | wc -l 315 After: $ scanelf -aR $OUT/system | grep TEXTREL | wc -l 19 Change-Id: Ib9f98107c0eeabcb606e1ddc7ed7fc4eba01c9c4
* crtbegin: eliminate duplicate codeNick Kralevich2012-05-302-140/+1
| | | | | | | | | crtbegin_dynamic and crtbegin_static are essentially identical, minus a few trivial differences (comments and whitespace). Eliminate duplicates. Change-Id: Ic9fae6bc9695004974493b53bfc07cd3bb904480
* am 4f05d1c7: Merge "bionic/x86: Optimization for memcpy"Elliott Hughes2012-05-101-578/+1963
|\ | | | | | | | | * commit '4f05d1c758ba141c617f25251a661ecb66627e9e': bionic/x86: Optimization for memcpy
| * bionic/x86: Optimization for memcpyJack Ren2012-05-081-578/+1963
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Signed-off-by: Liubov Dmitrieva <liubov.dmitrieva@intel.com> Signed-off-by: H.J. Lu <hongjiu.lu@intel.com> Signed-off-by: Wei A Jin <wei.a.jin@intel.com> Signed-off-by: Jack Ren <jack.ren@intel.com> Signed-off-by: Bruce Beare <bruce.j.beare@intel.com> Conflicts: libc/arch-x86/string/ssse3-memcpy5.S Change-Id: I41e70d1d19d5457e65c89b64da452fbdaf3a00a7
| * Cherry-pick "generate PIC code".Nick Kralevich2012-05-082-7/+7
| | | | | | | | Change-Id: I7d5f2e5663df263493f65e364c959e663fc4d13a
* | resolved conflicts for merge of ef987656 to masterElliott Hughes2012-04-161-2/+8
|\ \ | |/ | | | | Change-Id: I3854de8f4cddaf344444efa6f9da027642a237d9
| * Merge "Bionic: Fix wrong prototype of system call clock_nanosleep"Elliott Hughes2012-04-161-2/+8
| |\
| | * Bionic: Fix wrong prototype of system call clock_nanosleepJack Ren2012-04-161-2/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In bionic/libc/SYSCALLS.TXT, the prototype of system call clock_nanosleep is incorrect. According to man page: int clock_nanosleep(clockid_t clock_id, int flags, const struct timespec *request, struct timespec *remain); Change-Id: Ic44c6db3d632293aa17998035554eacd664c2d57 Signed-off-by: Jin Wei <wei.a.jin@intel.com> Signed-off-by: Jack Ren <jack.ren@intel.com> Signed-off-by: Bruce Beare <bruce.j.beare@intel.com>
* | | resolved conflicts for merge of 6b8fd054 to masterElliott Hughes2012-04-162-0/+18
|\ \ \ | |/ / | | | | | | Change-Id: Ifc5a10d9c2f7764ad80d64cc552aad81d5fbf5eb
| * | bionic: Fix wrong prototype of system call getresuid/getresgidJack Ren2012-04-162-0/+18
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | In bionic/libc/SYSCALLS.TXT, the prototypes of system call getresuid/getresgid are incorrect. According to man page, they should be: int getresuid(uid_t *ruid, uid_t *euid, uid_t *suid); int getresgid(gid_t *rgid, gid_t *egid, gid_t *sgid); Change-Id: I676098868bb05a9e1fe45419b234cf397626fdad Signed-off-by: Jin Wei <wei.a.jin@intel.com> Signed-off-by: Jack Ren <jack.ren@intel.com> Signed-off-by: Bruce Beare <bruce.j.beare@intel.com>
* | Add faccessat to syscall listKenny Root2012-04-132-0/+33
| | | | | | | | Change-Id: I427a18811089cb280769ac8da3ed8adc00a65a10
* | am cd834618: am 63b14755: Merge "libc/x86: ensure the stack 16-byte aligned ↵Elliott Hughes2012-03-303-5/+14
|\ \ | |/ | | | | | | | | | | when tasks created" * commit 'cd834618c4752b61d54ff4005a8baa8219b822e4': libc/x86: ensure the stack 16-byte aligned when tasks created