aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@zytor.com>2006-06-13 13:41:19 -0700
committerH. Peter Anvin <hpa@zytor.com>2006-06-13 13:41:19 -0700
commitce8a41d7f5883f4589b742bf279cc3ab22c60c7b (patch)
tree91485c7a993ae2ea63fbc80d67b16b35c7feaa5f
parentf63975c195cfcac1c360a0db44abaf6902fc63e9 (diff)
downloadklibc-ce8a41d7f5883f4589b742bf279cc3ab22c60c7b.tar.gz
[klibc] ARM: fix EABI and Thumb versions of vfork()klibc-1.3.39
For EABI and Thumb, the system call number is in r7, which is a saved register; we need to save r7 into a clobbered register (using r3) around the system call. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
-rw-r--r--usr/klibc/arch/arm/vfork.S11
1 files changed, 9 insertions, 2 deletions
diff --git a/usr/klibc/arch/arm/vfork.S b/usr/klibc/arch/arm/vfork.S
index 42e85512e7d32..1c39bd653f43a 100644
--- a/usr/klibc/arch/arm/vfork.S
+++ b/usr/klibc/arch/arm/vfork.S
@@ -9,11 +9,17 @@
.type vfork,#function
.globl vfork
#ifndef __thumb__
- /* ARM version - this is executed after the swi */
.balign 4
vfork:
+#ifdef __ARM_EABI__
+ mov r3, r7
+ mov r7, # __NR_vfork
+ swi 0
+ mov r7, r3
+#else
swi # __NR_vfork
+#endif
cmn r0, #4096
rsbcs r2, r0, #0
ldrcs r3, 1f
@@ -26,13 +32,14 @@ vfork:
.word errno
#else
- /* Thumb version - must still load r4 and r5 and run swi */
.thumb_func
.balign 2
vfork:
+ mov r3, r7
mov r7, # __NR_vfork
swi 0
+ mov r7, r3
ldr r1, 2f
cmp r0, r1
bcc 1f