summaryrefslogtreecommitdiff
path: root/sys/kern/spinlock.c
diff options
context:
space:
mode:
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");
+}