First pass at message syscalls

This commit is contained in:
Justin C. Miller
2019-02-07 18:19:22 -08:00
parent 8e85ae5318
commit aca442ee87
5 changed files with 141 additions and 8 deletions

View File

@@ -92,6 +92,31 @@ syscall_dispatch(uintptr_t return_rsp, cpu_state &regs)
regs.rax = p->pid;
break;
case syscall::send:
{
uint32_t target = regs.rdi;
cons->set_color(11);
cons->printf("\nProcess %u: Received SEND syscall, target %u\n", p->pid, target);
cons->set_color();
if (p->wait_on_send(target))
return_rsp = s.schedule(return_rsp);
}
break;
case syscall::receive:
{
uint32_t source = regs.rdi;
cons->set_color(11);
cons->printf("\nProcess %u: Received RECEIVE syscall, source %u\n", p->pid, source);
cons->set_color();
if (p->wait_on_receive(source))
return_rsp = s.schedule(return_rsp);
}
break;
default:
cons->set_color(9);