summaryrefslogtreecommitdiffstats
path: root/tsk
diff options
context:
space:
mode:
authorJon Santmyer <jon@jonsantmyer.com>2024-03-11 21:30:31 -0400
committerJon Santmyer <jon@jonsantmyer.com>2024-03-11 21:30:31 -0400
commitd1ff7bcc91886626dc9060ec5fb67ee102ab7c1d (patch)
tree8f0b5cd8aad31089131785dc6e37b659490f9955 /tsk
downloadjove-kernel-d1ff7bcc91886626dc9060ec5fb67ee102ab7c1d.tar.gz
jove-kernel-d1ff7bcc91886626dc9060ec5fb67ee102ab7c1d.tar.bz2
jove-kernel-d1ff7bcc91886626dc9060ec5fb67ee102ab7c1d.zip
usermode capable kernel with logging syscall
Diffstat (limited to 'tsk')
-rw-r--r--tsk/tasking.h25
-rw-r--r--tsk/thread.c7
-rw-r--r--tsk/thread.d1
3 files changed, 33 insertions, 0 deletions
diff --git a/tsk/tasking.h b/tsk/tasking.h
new file mode 100644
index 0000000..d217171
--- /dev/null
+++ b/tsk/tasking.h
@@ -0,0 +1,25 @@
+#ifndef JOVE_TASKING_H
+#define JOVE_TASKING_H 1
+
+#include <stddef.h>
+#include <stdint.h>
+
+typedef size_t tid_t;
+
+struct Thread
+{
+ struct Thread *next;
+ tid_t id;
+ uintptr_t kbp;
+ size_t perm;
+};
+
+extern struct Thread *thread_current;
+
+void tasking_setup(void);
+
+struct Thread *thread_new(struct Thread *parent);
+struct Thread *thread_get(tid_t id);
+void thread_perm_release(struct Thread *thread, size_t mask);
+
+#endif
diff --git a/tsk/thread.c b/tsk/thread.c
new file mode 100644
index 0000000..7fbafa6
--- /dev/null
+++ b/tsk/thread.c
@@ -0,0 +1,7 @@
+#include "tasking.h"
+
+void
+thread_perm_release(struct Thread *thread, size_t mask)
+{
+ thread->perm &= ~mask;
+}
diff --git a/tsk/thread.d b/tsk/thread.d
new file mode 100644
index 0000000..1869275
--- /dev/null
+++ b/tsk/thread.d
@@ -0,0 +1 @@
+tsk/thread.o: tsk/thread.c tsk/tasking.h