mirror of
https://github.com/justinian/jsix.git
synced 2025-12-10 08:24:32 -08:00
Improve syscalls for new task switching
There are a lot of under the hood changes here: - Move syscalls to be a dispatch table, defined by syscalls.inc - Don't need a full process state (push_all) in syscalls now - In push_all, define REGS instead of using offsets - Save TWO stack pointers as well as current saved stack pointer in TCB: - rsp0 is the base of the kernel stack for interrupts - rsp3 is the saved user stack from cpu_data - Update syscall numbers in nulldrv - Some asm-debugging enhancements to the gdb script - fork() still not working
This commit is contained in:
@@ -6,20 +6,12 @@ struct cpu_state;
|
||||
|
||||
enum class syscall : uint64_t
|
||||
{
|
||||
noop = 0x0000,
|
||||
debug = 0x0001,
|
||||
message = 0x0002,
|
||||
pause = 0x0003,
|
||||
sleep = 0x0004,
|
||||
getpid = 0x0005,
|
||||
send = 0x0006,
|
||||
receive = 0x0007,
|
||||
fork = 0x0008,
|
||||
exit = 0x0009,
|
||||
#define SYSCALL(name, nargs) name ,
|
||||
#include "syscalls.inc"
|
||||
#undef SYSCALL
|
||||
|
||||
last_syscall
|
||||
COUNT
|
||||
};
|
||||
|
||||
void syscall_enable();
|
||||
void syscall_dispatch(cpu_state *);
|
||||
|
||||
extern "C" void syscall_invalid(uint64_t call);
|
||||
|
||||
Reference in New Issue
Block a user