summaryrefslogtreecommitdiff
path: root/src/pkg/runtime/atomic_arm.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/pkg/runtime/atomic_arm.c')
-rw-r--r--src/pkg/runtime/atomic_arm.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/pkg/runtime/atomic_arm.c b/src/pkg/runtime/atomic_arm.c
index b1e97b27d..d914475c7 100644
--- a/src/pkg/runtime/atomic_arm.c
+++ b/src/pkg/runtime/atomic_arm.c
@@ -42,6 +42,19 @@ runtime·xchg(uint32 volatile* addr, uint32 v)
}
#pragma textflag NOSPLIT
+void*
+runtime·xchgp(void* volatile* addr, void* v)
+{
+ void *old;
+
+ for(;;) {
+ old = *addr;
+ if(runtime·casp(addr, old, v))
+ return old;
+ }
+}
+
+#pragma textflag NOSPLIT
void
runtime·procyield(uint32 cnt)
{