Differentiate syscall handler by number.

This causes us to panic on the unhandled exit syscall.
This commit is contained in:
Drew Galbraith 2023-05-29 13:06:43 -07:00
parent 6f5b65de30
commit 8d87791fa2
1 changed files with 9 additions and 1 deletions

View File

@ -3,6 +3,7 @@
#include <stdint.h> #include <stdint.h>
#include "debug/debug.h" #include "debug/debug.h"
#include "include/zcall.h"
#include "scheduler/scheduler.h" #include "scheduler/scheduler.h"
#define EFER 0xC0000080 #define EFER 0xC0000080
@ -53,5 +54,12 @@ void InitSyscall() {
} }
extern "C" void SyscallHandler(uint64_t call_id, char* message) { extern "C" void SyscallHandler(uint64_t call_id, char* message) {
dbgln(message); Thread& thread = sched::CurrentThread();
switch (call_id) {
case Z_DEBUG_PRINT:
dbgln("[%u.%u] %s", thread.pid(), thread.tid(), message);
break;
default:
panic("Unhandled syscall number: %u", call_id);
}
} }