Add sys_exit() and fix problem with %rax getting clobbered

This commit is contained in:
Mark
2019-10-29 11:29:08 +02:00
parent 5a3b8621bc
commit b846ee2ad4
10 changed files with 115 additions and 8 deletions
+5
View File
@@ -0,0 +1,5 @@
#pragma once
#include "sys/thread.h"
void sched_add(struct thread *t);
void sched_init(void);
+3
View File
@@ -3,6 +3,7 @@
#include "sys/fs/vfs.h"
#define THREAD_KERNEL (1 << 31)
#define THREAD_STOPPED (1 << 2)
#if defined(ARCH_AMD64)
typedef uint64_t *mm_space_t;
@@ -22,6 +23,8 @@ struct thread {
mm_space_t space;
// TODO: maybe __sched_thread
int cpu;
struct thread *prev;
struct thread *next;
};