Commit graph

27 commits

Author SHA1 Message Date
Dan Albert
440bd6bcc3 Merge "Replaces vfork() implementation with fork()" 2014-06-10 22:08:45 +00:00
Dan Albert
210331d976 Replaces vfork() implementation with fork()
vfork() was removed from POSIX 2008, so this replaces its implementation
with a call to fork().

Bug: 13935372
Change-Id: I6d99ac9e52a2efc5ee9bda1cab908774b830cedc
2014-06-10 21:38:52 -07:00
Serban Constantinescu
602b4e482c AArch64: Remove Frame Record from ARM64 syscalls
This patch removes the frame record created on svc calls.

Change-Id: I67cf926ba59540e824fb9749d30538e332df7c1e
Signed-off-by: Serban Constantinescu <serban.constantinescu@arm.com>
2014-06-09 11:36:37 -07:00
Elliott Hughes
ebc8cd117a Rename __bionic_clone_entry to __start_thread.
This seems a bit less obscure.

Change-Id: I7dc528c253b73c861694f67556ad8f919bf92136
2014-06-06 15:18:54 -07:00
Christopher Ferris
aa5f32ea1c Merge "Add Aarch64 optimized bzero based on memset" 2014-05-29 21:19:44 +00:00
Bernhard Rosenkraenzer
62d92e1610 Add Aarch64 optimized bzero based on memset
Change-Id: I62cf25bfe23b9d811e00af7307bbd19d89937792
Signed-off-by: Bernhard Rosenkraenzer <Bernhard.Rosenkranzer@linaro.org>
2014-05-29 13:28:55 -07:00
Elliott Hughes
b30aff405a Revert "Revert "Lose the hand-written futex assembler.""
The problem with the original patch was that using syscall(3) means that
errno can be set, but pthread_create(3) was abusing the TLS errno slot as
a pthread_mutex_t for the thread startup handshake.

There was also a mistake in the check for syscall failures --- it should
have checked against -1 instead of 0 (not just because that's the default
idiom, but also here because futex(2) can legitimately return values > 0).

This patch stops abusing the TLS errno slot and adds a pthread_mutex_t to
pthread_internal_t instead. (Note that for LP64 sizeof(pthread_mutex_t) >
sizeof(uintptr_t), so we could potentially clobber other TLS slots too.)

I've also rewritten the LP32 compatibility stubs to directly reuse the
code from the .h file.

This reverts commit 75c55ff84e.

Bug: 15195455
Change-Id: I6ffb13e5cf6a35d8f59f692d94192aae9ab4593d
2014-05-28 18:31:15 -07:00
Narayan Kamath
52f74322b1 Merge "Revert "Lose the hand-written futex assembler."" 2014-05-28 18:04:26 +00:00
Narayan Kamath
75c55ff84e Revert "Lose the hand-written futex assembler."
This reverts commit ced906c849.

Causes issues on art / dalvik due to a broken return value
check and other undiagnosed issues.

bug: 15195455

Change-Id: I5d6bbb389ecefb0e33a5237421a9d56d32a9317c
2014-05-28 18:03:01 +00:00
Ben Cheng
8df0fe0c74 Clear link register in __bionic_clone.
Since __bionic_clone uses tail-call to invoke __bionic_clone_entry,
at runtime the unwinder will reach the stack of the clone() function,
which belongs to the parent thread, if the link register is not cleared.

BUG: 14270816
Change-Id: Ia3711c87f8b619debe73748c28b9fb8691ea698e
2014-05-23 16:35:21 -07:00
Elliott Hughes
ced906c849 Lose the hand-written futex assembler.
Also stop exporting 'futex'.

Bug: 12250341
Change-Id: Icc4fa4296cd04dfe0d1061822c69e2eb40c3433a
2014-05-22 19:49:11 -07:00
Elliott Hughes
d5ed63a6a8 Hide most of the private futex functions.
Also hide part of the system properties compatibility code, since
we needed to touch that to keep it building.

I'll remove __futex_syscall4 and futex in a later patch.

Bug: 11156955
Change-Id: Ibbf42414c5bb07fb9f1c4a169922844778e4eeae
2014-05-21 18:30:00 -07:00
Christopher Ferris
f97d8713a2 Merge "Add cfi directives for arm64 assembler." 2014-05-22 01:08:22 +00:00
Christopher Ferris
df22a121b2 Add cfi directives for arm64 assembler.
Fix syscall generator to add cfi directives and add the directives
for all arm64 assembler.

Bug: 15138290
Change-Id: I7f0e4a16c141ac624e5276917a3a1ed45778e057
2014-05-21 17:46:52 -07:00
Elliott Hughes
f93f50d7ea Remove an unnecessary instruction from arm64 __bionic_clone.
Change-Id: Ib0dd5079d10b3634901d561932259653945176ee
2014-05-21 16:29:55 -07:00
Elliott Hughes
9f0a52e4e5 Merge "Hide __get_sp." 2014-05-21 15:21:16 +00:00
Elliott Hughes
a75869f0b2 Hide __set_tls.
Bug: 11156955
Change-Id: If82c10ae412651361d09591017d1c3a411bd6f0b
2014-05-20 20:32:28 -07:00
Elliott Hughes
c3705f6415 Hide __get_sp.
Bug: 11156955
Change-Id: I55d8d320521e80c2085af28933a18b00cf5c714e
2014-05-20 20:22:50 -07:00
Elliott Hughes
31d0398de6 Hide _exit_with_stack_teardown.
Bug: 11156955
Change-Id: Ida3020343c9975177dc324918cd1f10c455eb173
2014-05-16 16:17:44 -07:00
Elliott Hughes
879180c3ac With libstdc++ in libc, __futex_wait and __futex_wake can be hidden.
This patch is conservative and just touches LP64. (But not because we
know of anyone using this in LP32.)

Bug: 13367666
Change-Id: Id45652debc4534584479b16b501401f6f23acea9
2014-05-16 10:58:59 -07:00
Elliott Hughes
0d236aa3f1 Align the child stack in clone(2).
Also let clone(2) set the TLS for x86.

Also ensure we initialize the TLS before we clone(2) for all architectures.

Change-Id: Ie5fa4466e1c9ee116a281dfedef574c5ba60c0b5
2014-05-09 17:06:51 -07:00
Elliott Hughes
fff3c0fdcf Align arm64 stacks to 16 bytes in __bionic_clone.
Also ensure that arm64/x86-64/x86 assembler uses local labels.
(There are are so many non-local labels in arm that fixing them
seems out of scope.)

Also synchronize the __bionic_clone.S comments.

Change-Id: I03b4f84780d996b54d6637a074638196bbb01cd4
2014-05-09 12:16:20 -07:00
Elliott Hughes
954cf0d4e2 Hide the __bionic_clone and __bionic_clone_entry implementation details.
clone(2) is the public symbol.

Also switch a test from __bionic_clone to clone; testing public API
means the test now works on glibc too.

Change-Id: If59def26a00c3afadb8a6cf9442094c35a59ffde
2014-05-08 19:00:23 -07:00
Elliott Hughes
851e68a240 Unify our assembler macros.
Our <machine/asm.h> files were modified from upstream, to the extent
that no architecture was actually using the upstream ENTRY or END macros,
assuming that architecture even had such a macro upstream. This patch moves
everyone to the same macros, with just a few tweaks remaining in the
<machine/asm.h> files, which no one should now use directly.

I've removed most of the unused cruft from the <machine/asm.h> files, though
there's still rather a lot in the mips/mips64 ones.

Bug: 12229603
Change-Id: I2fff287dc571ac1087abe9070362fb9420d85d6d
2014-02-20 13:51:26 -08:00
Elliott Hughes
09289d92f9 Remove useless _C_LABEL from our assembler source.
Change-Id: I41a9181537c70ecc69ef8035132c9a83811a40d0
2014-02-20 11:51:11 -08:00
Elliott Hughes
a6ecba4d23 Clean up cacheflush.
No cacheflush for LP64; use the GCC builtin instead. Clean up the
32-bit MIPS implementation now we no longer need to worry about
old versions of GCC.

Bug: 12924756
Change-Id: Ie23955b3ec194e226c4b2bce35b11d5e061f4753
2014-02-11 10:24:40 -08:00
Colin Cross
d1973ca513 bionic: rename aarch64 target to arm64
Rename aarch64 build targets to arm64.  The gcc toolchain is still
aarch64.

Change-Id: Ia92d8a50824e5329cf00fd6f4f92eae112b7f3a3
2014-01-23 18:35:39 -08:00