diff options
Diffstat (limited to 'tsk')
-rw-r--r-- | tsk/tasking.h | 25 | ||||
-rw-r--r-- | tsk/thread.c | 7 | ||||
-rw-r--r-- | tsk/thread.d | 1 |
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 |