summaryrefslogtreecommitdiffstats
path: root/libc/arch-x86
Commit message (Collapse)AuthorAgeFilesLines
* Sort the syscalls.mk files, give all generated files the same header.Elliott Hughes2013-10-16210-392/+601
| | | | | | No non-comment changes to the .S files. Change-Id: Iafcfd004c3ea92b64268f80ab16df615b97cefac
* Switch sigpending over to rt_sigpending.Elliott Hughes2013-10-162-7/+10
| | | | Change-Id: I7b28984796b5fb343cfbcc47e0afc3a84293d417
* Fix sigsuspend to use rt_sigsuspend on all platforms.Elliott Hughes2013-10-152-10/+7
| | | | Change-Id: I981c1a66d35480d4457a0a08a1b042dac94daa5b
* Clean up the sigprocmask/pthread_sigmask implementation.Elliott Hughes2013-10-152-28/+0
| | | | | | | | | | | Let's have both use rt_sigprocmask, like in glibc. The 64-bit ABIs can share the same code as the 32-bit ABIs. Also, let's test the return side of these calls, not just the setting. Bug: 11069919 Change-Id: I11da99f85b5b481870943c520d05ec929b15eddb
* Clean up the cpuacct cruft.Elliott Hughes2013-10-094-9/+9
| | | | Change-Id: I6ed63af8dfc2368e211420389fa8af4d5dc0908f
* Fix __errno for LP64 and clean up __get_tls.Elliott Hughes2013-10-092-38/+0
| | | | | | | | | | | If __get_tls has the right type, a lot of confusing casting can disappear. It was probably a mistake that __get_tls was exposed as a function for mips and x86 (but not arm), so let's (a) ensure that the __get_tls function always matches the macro, (b) that we have the function for arm too, and (c) that we don't have the function for any 64-bit architecture. Change-Id: Ie9cb989b66e2006524ad7733eb6e1a65055463be
* pthread_exit should call __NR_exit with status 0.Elliott Hughes2013-10-081-3/+3
| | | | | | | We shouldn't have been passing the bottom 32 bits of the address used for pthread_join to the kernel. Change-Id: I487e5002d60c27adba51173719213abbee0f183f
* Clean up the x86 and x86_64 _exit_with_stack_teardown implementations.Elliott Hughes2013-10-071-19/+13
| | | | Change-Id: I4bcbbc53893612bd94643ef07722becb00f91792
* Add arch-x86_64/include/machine.Elliott Hughes2013-10-041-6/+0
| | | | | | | | | | | | | This is basically the other half of I5de76f6c46ac87779f207d568a86bb453e2414de from Pavel Chupin <pavel.v.chupin@intel.com>, but taking the exact upstream _types.h instead of the modified version. (I was confused when I suggested otherwise.) I've also cleaned up the internal_types.h situation; we weren't gaining anything from these empty files, and there is no upstream internal_types.h for x86_64. Change-Id: I802a9a6a8df1c979e820659212c75a47c2ef392e
* Remove useless x86 fallbacks.Elliott Hughes2013-10-034-139/+1
| | | | | | | | | | | The NDK ABI requires that you support SSE2, and the build system won't let you build with ARCH_X86_HAVE_SSE2 set to false. So let's stop pretending this constant is actually a variable, and let's remove the corresponding dead code. Also, the USE_SSE2 and USE_SSE3 macros are unused, so let's not bother setting them. Change-Id: I40b501d998530d22518ce1c4d14575513a8125bb
* Move common arch-* code to arch-common directoryPavel Chupin2013-10-034-142/+0
| | | | | | | Will be helpful on adding x86_64 Change-Id: I96cf6fc7912c02f289c75f07ae0079c32d69173f Signed-off-by: Pavel Chupin <pavel.v.chupin@intel.com>
* Regenerate the system call stubs (to get x86_64).Elliott Hughes2013-10-01210-210/+210
| | | | | | | | This touches the x86 stubs too because arm, x86, and x86_64 now all share the same header (at a source level), which causes a reordering of the #include lines. Change-Id: If9a1e2b2718bd41d8399fea748bce672c513ef84
* Clean up some comments.Elliott Hughes2013-10-011-2/+1
| | | | | | | Copyright headers shouldn't contain the filename (and especially shouldn't contain a different file's filename). Change-Id: I82690a3bf371265402bc16f5d2fbb9299c3a1926
* Make it easier to add syscalls for another architecture.Elliott Hughes2013-09-261-2/+2
| | | | | | | Much of the per-architecture duplication can be removed, so let's do so before we add the 64-bit architectures. Change-Id: Ieb796503c8e5353ea38c3bab768bb9a690c9a767
* Ensure we have the off64_t variant of every function that takes an off_t.Elliott Hughes2013-09-193-0/+59
| | | | Change-Id: Ib2eee0cf13162be3b62559b84e90c6dcf5aab1c3
* Fix strchr for basic non-sse case on x86Pavel Chupin2013-09-031-1/+1
| | | | | | | | | Fix source location. Move declaration of __strchr_chk out of ifdef __BIONIC_FORTIFY which should be available for strchr.cpp compilation when __BIONIC_FORTIFY is not defined. Change-Id: I552a6e16656e59b276b322886cfbf57bbfb2e6a7 Signed-off-by: Pavel Chupin <pavel.v.chupin@intel.com>
* Add ssse3 implementation of __memcmp16.Alexander Ivchenko2013-08-024-30/+357
| | | | | | | | __memcmp16 was missing in x86. Also added C-version for backward compatibility. Added bionic test for __memcmp16 and for wmemcmp. Change-Id: I33718441e7ee343cdb021d91dbeaf9ce2d4d7eb4 Signed-off-by: Alexander Ivchenko <alexander.ivchenko@intel.com>
* Merge "libc: add swapon and swapoff syscalls"Rom Lemarchand2013-06-253-0/+47
|\
| * libc: add swapon and swapoff syscallsRom Lemarchand2013-06-253-0/+47
| | | | | | | | | | Change-Id: Ie79dc8e3f2ff1cd427dd6d95e3850920c4b407b0 Signed-off-by: Rom Lemarchand <romlem@google.com>
* | Update x86 machine/endian.h from upstreamPavel Chupin2013-06-251-19/+9
|/ | | | | | | | | | | | | | After download new version from upstream (OpenBSD 1.17) did the following: * changed all u_int* types to uint* * add #include <sys/types.h> All these changes are Android-specific and had been done before for previous version (1.14). Bug: http://code.google.com/p/android/issues/detail?id=54465 Change-Id: Ieb44e7fce4e794d997bb00ee0dd417fb61521720 Signed-off-by: Pavel Chupin <pavel.v.chupin@intel.com>
* bionic/x86: Optimization for string routinesLiubov Dmitrieva2013-05-3134-579/+13615
| | | | | | | | | | | Optimized strcpy, strcat, strncpy, strncat, strlcpy, strlcat, memchr, memrchr, strchr, strrchr, index, strnlen, strlen, wcslen, wmemcmp, wcscmp, wcschr, wcsrchr, wcscpy, wcscat Change-Id: I82b29132edf9a2e144e0bb3ee4ff5217df8d2a6d Signed-off-by: Liubov Dmitrieva <liubov.dmitrieva@intel.com>
* libc x86: Remove index.S, strcpy.S, strchr.SNick Kralevich2013-05-243-93/+0
| | | | | | These files are never used. Change-Id: Iab8474bdff3bd4d225597c62b3c0f0849f808818
* libc: delete x86 memchr.SNick Kralevich2013-05-241-27/+0
| | | | | | This file is never used. Change-Id: Ief08ad176713b5194048852609613801969e1364
* libc: add timerfd callsTodd Poynor2013-05-144-0/+81
| | | | | | (cherry-pick of 04c0ac14a49e0969333008a9522b64046d58fbdc.) Change-Id: I06d0b6c2a8781602362b81f48faf1cca76b9ec05
* 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