summaryrefslogtreecommitdiffstats
path: root/libcutils/atomic-android-arm.S
diff options
context:
space:
mode:
Diffstat (limited to 'libcutils/atomic-android-arm.S')
-rw-r--r--libcutils/atomic-android-arm.S37
1 files changed, 20 insertions, 17 deletions
diff --git a/libcutils/atomic-android-arm.S b/libcutils/atomic-android-arm.S
index 9a24976..da5c26b 100644
--- a/libcutils/atomic-android-arm.S
+++ b/libcutils/atomic-android-arm.S
@@ -54,23 +54,8 @@
*/
android_atomic_write:
- stmdb sp!, {r4, lr}
- mov r2, r1
- mov r1, r0
-1: @ android_atomic_write
- ldr r0, [r2]
- mov r3, #kernel_atomic_base
-#ifdef __ARM_HAVE_PC_INTERWORK
- add lr, pc, #4
- add pc, r3, #(kernel_cmpxchg - kernel_atomic_base)
-#else
- add r3, r3, #(kernel_cmpxchg - kernel_atomic_base)
- mov lr, pc
- bx r3
-#endif
- bcc 1b
- ldmia sp!, {r4, lr}
- bx lr
+ str r0, [r1]
+ bx lr;
/*
* ----------------------------------------------------------------------------
@@ -80,6 +65,8 @@ android_atomic_write:
*/
android_atomic_inc:
+ .fnstart
+ .save {r4, lr}
stmdb sp!, {r4, lr}
mov r2, r0
1: @ android_atomic_inc
@@ -99,6 +86,7 @@ android_atomic_inc:
sub r0, r1, #1
ldmia sp!, {r4, lr}
bx lr
+ .fnend
/*
* ----------------------------------------------------------------------------
@@ -108,6 +96,8 @@ android_atomic_inc:
*/
android_atomic_dec:
+ .fnstart
+ .save {r4, lr}
stmdb sp!, {r4, lr}
mov r2, r0
1: @ android_atomic_dec
@@ -127,6 +117,7 @@ android_atomic_dec:
add r0, r1, #1
ldmia sp!, {r4, lr}
bx lr
+ .fnend
/*
* ----------------------------------------------------------------------------
@@ -136,6 +127,8 @@ android_atomic_dec:
*/
android_atomic_add:
+ .fnstart
+ .save {r4, lr}
stmdb sp!, {r4, lr}
mov r2, r1
mov r4, r0
@@ -156,6 +149,7 @@ android_atomic_add:
sub r0, r1, r4
ldmia sp!, {r4, lr}
bx lr
+ .fnend
/*
@@ -166,6 +160,8 @@ android_atomic_add:
*/
android_atomic_and:
+ .fnstart
+ .save {r4, r5, lr}
stmdb sp!, {r4, r5, lr}
mov r2, r1 /* r2 = address */
mov r4, r0 /* r4 = the value */
@@ -188,6 +184,7 @@ android_atomic_and:
mov r0, r5
ldmia sp!, {r4, r5, lr}
bx lr
+ .fnend
/*
* ----------------------------------------------------------------------------
@@ -197,6 +194,8 @@ android_atomic_and:
*/
android_atomic_or:
+ .fnstart
+ .save {r4, r5, lr}
stmdb sp!, {r4, r5, lr}
mov r2, r1 /* r2 = address */
mov r4, r0 /* r4 = the value */
@@ -219,6 +218,7 @@ android_atomic_or:
mov r0, r5
ldmia sp!, {r4, r5, lr}
bx lr
+ .fnend
/*
* ----------------------------------------------------------------------------
@@ -249,6 +249,8 @@ android_atomic_swap:
*/
android_atomic_cmpxchg:
+ .fnstart
+ .save {r4, lr}
stmdb sp!, {r4, lr}
mov r4, r0 /* r4 = save oldvalue */
1: @ android_atomic_cmpxchg
@@ -270,6 +272,7 @@ android_atomic_cmpxchg:
2: @ android_atomic_cmpxchg
ldmia sp!, {r4, lr}
bx lr
+ .fnend
/*
* ----------------------------------------------------------------------------