summaryrefslogtreecommitdiff
path: root/sys/kern/spinlock.c
diff options
context:
space:
mode:
authorstefan <stefan@s00.xyz>2023-04-08 20:42:18 -0400
committerstefan <stefan@s00.xyz>2023-04-08 20:42:18 -0400
commit1aac36f788834699b6891aea7a83eb950bd5e8f6 (patch)
tree18e0a6c26b83e71c101193e60149f49b1641daf0 /sys/kern/spinlock.c
parenta1a97aa7b2b0c3d1f3b6766446d605f83de1c561 (diff)
downloadsv-1aac36f788834699b6891aea7a83eb950bd5e8f6.tar.gz
no idea whot i changed lol
Diffstat (limited to 'sys/kern/spinlock.c')
-rw-r--r--sys/kern/spinlock.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/sys/kern/spinlock.c b/sys/kern/spinlock.c
new file mode 100644
index 0000000..a35b8ce
--- /dev/null
+++ b/sys/kern/spinlock.c
@@ -0,0 +1,15 @@
+#include <spinlock.h>
+
+void
+init_locklock(struct spinlock *l, const char *_name)
+{
+ l->name = _name;
+ l->locked = 0;
+ l->cpu = 0;
+}
+
+void
+acquire_lock(struct spinlock *l)
+{
+ asm volatile("csrr sie, zero");
+}