aboutsummaryrefslogtreecommitdiff
path: root/emu/FreeRTOS/asm-spim.S
diff options
context:
space:
mode:
Diffstat (limited to 'emu/FreeRTOS/asm-spim.S')
-rw-r--r--emu/FreeRTOS/asm-spim.S29
1 files changed, 29 insertions, 0 deletions
diff --git a/emu/FreeRTOS/asm-spim.S b/emu/FreeRTOS/asm-spim.S
new file mode 100644
index 0000000..77ae3d4
--- /dev/null
+++ b/emu/FreeRTOS/asm-spim.S
@@ -0,0 +1,29 @@
+#include <sys/asm.h>
+#include <sys/regdef.h>
+#include <asm/cachectl.h>
+
+
+LEAF(FPsave)
+ cfc1 t0, $31
+ sw t0, 0(a0) /* a0 is argument */
+ j $31
+ END(FPsave)
+
+LEAF(FPrestore)
+ lw t0, 0(a0) /* a0 is argument */
+ ctc1 t0, $31
+ j $31
+ END(FPrestore)
+
+LEAF(_tas)
+ .set noreorder
+1:
+ ll v0,0(a0) /* a0 is argument */
+ or t1, v0, 1
+ sc t1,0(a0)
+ beq t1,zero,1b
+ nop
+ j $31 /* lock held */
+ nop
+ .set reorder
+ END(_tas)