From 93bf62580a68533dc8252b9a2a055c02f34ecb67 Mon Sep 17 00:00:00 2001 From: Christian Cunningham Date: Thu, 24 Mar 2022 09:38:08 -0700 Subject: Modularized --- kernel/util/lock.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 kernel/util/lock.c (limited to 'kernel/util/lock.c') diff --git a/kernel/util/lock.c b/kernel/util/lock.c new file mode 100644 index 0000000..c9fe654 --- /dev/null +++ b/kernel/util/lock.c @@ -0,0 +1,20 @@ +#include +#include +#include +#include + +void lock(struct Lock* l) +{ + unsigned long mode = getmode() & 0x1F; + if (mode == 0x10) { + sys1(SYS_LOCK, l); + } +} + +void unlock(struct Lock* l) +{ + unsigned long mode = getmode() & 0x1F; + if (mode == 0x10) { + sys1(SYS_UNLOCK, l); + } +} -- cgit v1.2.1