summaryrefslogtreecommitdiff
path: root/sys/src/libc
diff options
context:
space:
mode:
authoradventuresin9 <adventuresin9@gmail.com>2023-03-08 05:14:31 +0000
committeradventuresin9 <adventuresin9@gmail.com>2023-03-08 05:14:31 +0000
commitb68eeefef34d4a742124d922e2a23613b9bcb1e5 (patch)
tree5d23922732e9c0a756a8cbaa650c211fa5ac8fc5 /sys/src/libc
parent6fe654f50c536a61c94a43ce2fcb147625da1d09 (diff)
sys/src/libc/mips/tas.s: _tas() for spim
Diffstat (limited to 'sys/src/libc')
-rw-r--r--sys/src/libc/spim/tas.s18
1 files changed, 18 insertions, 0 deletions
diff --git a/sys/src/libc/spim/tas.s b/sys/src/libc/spim/tas.s
new file mode 100644
index 000000000..807fd121d
--- /dev/null
+++ b/sys/src/libc/spim/tas.s
@@ -0,0 +1,18 @@
+/*
+ * 4K tas for spim
+ */
+
+#define LL(base, rt) WORD $((060<<26)|((base)<<21)|((rt)<<16))
+#define SC(base, rt) WORD $((070<<26)|((base)<<21)|((rt)<<16))
+#define NOOP WORD $0x27
+
+ TEXT _tas(SB), $0
+ MOVW R1, R2 /* address of key */
+tas1:
+ MOVW $1, R3
+ LL(2, 1)
+ NOOP
+ SC(2, 3)
+ NOOP
+ BEQ R3, tas1
+ RET