summaryrefslogtreecommitdiffstats
path: root/libc/arch-arm/bionic/atomics_arm.S
diff options
context:
space:
mode:
Diffstat (limited to 'libc/arch-arm/bionic/atomics_arm.S')
-rw-r--r--libc/arch-arm/bionic/atomics_arm.S37
1 files changed, 32 insertions, 5 deletions
diff --git a/libc/arch-arm/bionic/atomics_arm.S b/libc/arch-arm/bionic/atomics_arm.S
index 55c642f..047541f 100644
--- a/libc/arch-arm/bionic/atomics_arm.S
+++ b/libc/arch-arm/bionic/atomics_arm.S
@@ -35,10 +35,6 @@
.type __atomic_dec, %function
.global __atomic_inc
.type __atomic_inc, %function
-.global __futex_wait
-.type __futex_wait, %function
-.global __futex_wake
-.type __futex_wake, %function
#define FUTEX_WAIT 0
#define FUTEX_WAKE 1
@@ -159,10 +155,34 @@ __atomic_swap:
bx lr
/* __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}
@@ -187,6 +207,10 @@ __futex_wake:
#else
+__futex_syscall3:
+ swi #__NR_futex
+ bx lr
+
__futex_wait:
mov r3, r2
mov r2, r1
@@ -201,3 +225,6 @@ __futex_wake:
bx lr
#endif
+
+__futex_syscall4:
+ b __futex_syscall3