From 1aac36f788834699b6891aea7a83eb950bd5e8f6 Mon Sep 17 00:00:00 2001 From: stefan Date: Sat, 8 Apr 2023 20:42:18 -0400 Subject: no idea whot i changed lol --- sys/kern/spinlock.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 sys/kern/spinlock.c (limited to 'sys/kern/spinlock.c') 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 + +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"); +} -- cgit v1.2.3