summaryrefslogtreecommitdiff
path: root/arch/arm/src/atomics.s
diff options
context:
space:
mode:
authorRich Felker <dalias@aerifal.cx>2016-01-20 02:31:06 +0000
committerRich Felker <dalias@aerifal.cx>2016-01-20 02:31:06 +0000
commitb6363bb70aad402be7c548a7ec053b124db076d9 (patch)
tree24f84b86d5c430430edad5557e7699b496411151 /arch/arm/src/atomics.s
parentaf21a82ccc8687aa16e85def7db95efeae4cf72e (diff)
downloadmusl-b6363bb70aad402be7c548a7ec053b124db076d9.tar.gz
fix build regression for arm pre-v7 from out-of-tree build patch
commit 2f853dd6b9a95d5b13ee8f9df762125e0588df5d failed to replicate the old makefile logic that caused arch/arm/src/arm/atomics.s to be built. since this was the only .s file under arch/*/src, rather than trying to reproduce the old logic, I'm just moving it up a level and adjusting the glob pattern in the makefile to catch it. eventually arch/*/src will probably be removed in favor of moving all these files to appropriate src/*/$(ARCH) locations.
Diffstat (limited to 'arch/arm/src/atomics.s')
-rw-r--r--arch/arm/src/atomics.s111
1 files changed, 111 insertions, 0 deletions
diff --git a/arch/arm/src/atomics.s b/arch/arm/src/atomics.s
new file mode 100644
index 00000000..5c5b0e3e
--- /dev/null
+++ b/arch/arm/src/atomics.s
@@ -0,0 +1,111 @@
+.syntax unified
+.text
+
+.global __a_barrier
+.hidden __a_barrier
+.type __a_barrier,%function
+__a_barrier:
+ ldr ip,1f
+ ldr ip,[pc,ip]
+ add pc,pc,ip
+1: .word __a_barrier_ptr-1b
+.global __a_barrier_dummy
+.hidden __a_barrier_dummy
+__a_barrier_dummy:
+ bx lr
+.global __a_barrier_oldkuser
+.hidden __a_barrier_oldkuser
+__a_barrier_oldkuser:
+ push {r0,r1,r2,r3,ip,lr}
+ mov r1,r0
+ mov r2,sp
+ ldr ip,=0xffff0fc0
+ mov lr,pc
+ mov pc,ip
+ pop {r0,r1,r2,r3,ip,lr}
+ bx lr
+.global __a_barrier_v6
+.hidden __a_barrier_v6
+__a_barrier_v6:
+ mcr p15,0,r0,c7,c10,5
+ bx lr
+.global __a_barrier_v7
+.hidden __a_barrier_v7
+__a_barrier_v7:
+ .word 0xf57ff05b /* dmb ish */
+ bx lr
+
+.global __a_cas
+.hidden __a_cas
+.type __a_cas,%function
+__a_cas:
+ ldr ip,1f
+ ldr ip,[pc,ip]
+ add pc,pc,ip
+1: .word __a_cas_ptr-1b
+.global __a_cas_dummy
+.hidden __a_cas_dummy
+__a_cas_dummy:
+ mov r3,r0
+ ldr r0,[r2]
+ subs r0,r3,r0
+ streq r1,[r2]
+ bx lr
+.global __a_cas_v6
+.hidden __a_cas_v6
+__a_cas_v6:
+ mov r3,r0
+ mcr p15,0,r0,c7,c10,5
+1: .word 0xe1920f9f /* ldrex r0,[r2] */
+ subs r0,r3,r0
+ .word 0x01820f91 /* strexeq r0,r1,[r2] */
+ teqeq r0,#1
+ beq 1b
+ mcr p15,0,r0,c7,c10,5
+ bx lr
+.global __a_cas_v7
+.hidden __a_cas_v7
+__a_cas_v7:
+ mov r3,r0
+ .word 0xf57ff05b /* dmb ish */
+1: .word 0xe1920f9f /* ldrex r0,[r2] */
+ subs r0,r3,r0
+ .word 0x01820f91 /* strexeq r0,r1,[r2] */
+ teqeq r0,#1
+ beq 1b
+ .word 0xf57ff05b /* dmb ish */
+ bx lr
+
+.global __aeabi_read_tp
+.type __aeabi_read_tp,%function
+__aeabi_read_tp:
+
+.global __a_gettp
+.hidden __a_gettp
+.type __a_gettp,%function
+__a_gettp:
+ ldr r0,1f
+ ldr r0,[pc,r0]
+ add pc,pc,r0
+1: .word __a_gettp_ptr-1b
+.global __a_gettp_dummy
+.hidden __a_gettp_dummy
+__a_gettp_dummy:
+ mrc p15,0,r0,c13,c0,3
+ bx lr
+
+.data
+.global __a_barrier_ptr
+.hidden __a_barrier_ptr
+__a_barrier_ptr:
+ .word 0
+
+.global __a_cas_ptr
+.hidden __a_cas_ptr
+__a_cas_ptr:
+ .word 0
+
+.global __a_gettp_ptr
+.hidden __a_gettp_ptr
+__a_gettp_ptr:
+ .word 0