From d1ff7bcc91886626dc9060ec5fb67ee102ab7c1d Mon Sep 17 00:00:00 2001 From: Jon Santmyer Date: Mon, 11 Mar 2024 21:30:31 -0400 Subject: usermode capable kernel with logging syscall --- tsk/tasking.h | 25 +++++++++++++++++++++++++ tsk/thread.c | 7 +++++++ tsk/thread.d | 1 + 3 files changed, 33 insertions(+) create mode 100644 tsk/tasking.h create mode 100644 tsk/thread.c create mode 100644 tsk/thread.d (limited to 'tsk') 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 +#include + +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 -- cgit v1.2.1