thread: add kthreads

Signed-off-by: Michael Shaw <m@michaelsshaw.com>
This commit is contained in:
Michael Shaw 2026-08-12 22:03:52 -04:00
commit 54803ed29b
Signed by: michaelsshaw
GPG key ID: 5A5E0FB20708A9E7
6 changed files with 79 additions and 36 deletions

View file

@ -12,6 +12,8 @@
struct ehdr;
struct phdr;
extern mem_cache_t *thread_slab;
#define THREAD_STATE_RUNNING 0
#define THREAD_STATE_WAITING 1
#define THREAD_STATE_DNS 2
@ -74,6 +76,8 @@ void thread_mmap(struct thread *thread, paddr_t p, vaddr_t v, size_t len, u64 fl
ssize_t thread_load_file(const char *file, struct thread *thread);
struct thread *thread_create(void);
struct thread *thread_fork(struct thread *parent);
int thread_set_entry(struct thread *thread, uaddr_t entry);
struct thread *thread_kthread(void (*fn)(void *), void *arg, const char *name);
void thread_free(struct thread *thread);
void thread_init();
tid_t alloc_tid();