diff options
author | cinap_lenrek <cinap_lenrek@felloff.net> | 2015-07-07 19:24:10 +0200 |
---|---|---|
committer | cinap_lenrek <cinap_lenrek@felloff.net> | 2015-07-07 19:24:10 +0200 |
commit | 65061470665b3f91f01d23bad6a54704e8aa5851 (patch) | |
tree | 67c87158d11de0e65bd0a3e62d70594dd53af142 /sys/src/libc/arm/cas.s | |
parent | 5458506881d9ff73287df354d3be75b35d339f24 (diff) |
libc/arm: implement _tas() with LDREX/STREX, execute memory barrier on smp systems (zynq)
Diffstat (limited to 'sys/src/libc/arm/cas.s')
-rw-r--r-- | sys/src/libc/arm/cas.s | 28 |
1 files changed, 0 insertions, 28 deletions
diff --git a/sys/src/libc/arm/cas.s b/sys/src/libc/arm/cas.s deleted file mode 100644 index 7bb3a05f7..000000000 --- a/sys/src/libc/arm/cas.s +++ /dev/null @@ -1,28 +0,0 @@ - -/* - * int swp(int r, int *p); - * uchar swpb(uchar r, uchar *p); - * - * int cas(uintptr *p, uintptr ov, uintptr nv); - */ - -#define LDREX(a,r) WORD $(0xe<<28|0x01900f9f | (a)<<16 | (r)<<12) -#define STREX(a,v,r) WORD $(0xe<<28|0x01800f90 | (a)<<16 | (r)<<12 | (v)<<0) - -TEXT cas+0(SB),0,$12 /* r0 holds p */ - MOVW ov+4(FP), R1 - MOVW nv+8(FP), R2 -spin: -/* LDREX 0(R0),R3 */ - LDREX(0,3) - CMP.S R3, R1 - BNE fail -/* STREX 0(R0),R2,R4 */ - STREX(0,2,4) - CMP.S $0, R4 - BNE spin - MOVW $1, R0 - RET -fail: - MOVW $0, R0 - RET |