wip: IPC and Runtime
This commit is contained in:
@@ -0,0 +1,25 @@
|
||||
#include <OS/Syscall.h>
|
||||
#include <OS/IPC.h>
|
||||
#include <OS/Scheduler.h>
|
||||
#include <OS/Panic.h>
|
||||
#include <Arch/Exceptions.h>
|
||||
|
||||
Address SyscallDispatch(ExceptionsContext* frame) {
|
||||
UInt64 syscallNumber = frame->x8;
|
||||
OSTask* current = SchedulerGetCurrentTask();
|
||||
|
||||
switch (syscallNumber) {
|
||||
case kSyscallSend:
|
||||
frame->x0 = IPCSend(current, frame->x0, frame->x1);
|
||||
break;
|
||||
case kSyscallReceive:
|
||||
IPCReceive(frame);
|
||||
break;
|
||||
default:
|
||||
frame->x0 = -1;
|
||||
break;
|
||||
}
|
||||
|
||||
if (current->state != OSTaskStateRunning) return SchedulerNext((Address)frame);
|
||||
return (Address)frame;
|
||||
}
|
||||
Reference in New Issue
Block a user