Add thread and process states.

Add a thread exit call.
This commit is contained in:
Drew Galbraith 2023-05-29 13:51:00 -07:00
parent 8d87791fa2
commit a06c9dced4
8 changed files with 78 additions and 9 deletions

View file

@ -56,8 +56,12 @@ void InitSyscall() {
extern "C" void SyscallHandler(uint64_t call_id, char* message) {
Thread& thread = sched::CurrentThread();
switch (call_id) {
case Z_THREAD_EXIT:
thread.Exit();
panic("Returned from thread exit");
break;
case Z_DEBUG_PRINT:
dbgln("[%u.%u] %s", thread.pid(), thread.tid(), message);
dbgln("[%u.%u] [Debug] %s", thread.pid(), thread.tid(), message);
break;
default:
panic("Unhandled syscall number: %u", call_id);