Endpoint syscalls implemented
This commit is contained in:
parent
69501bfe01
commit
c064af5fa7
27 changed files with 391 additions and 42 deletions
22
zion/syscall/reply_port.cpp
Normal file
22
zion/syscall/reply_port.cpp
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
#include "syscall/reply_port.h"
|
||||
|
||||
#include "object/reply_port.h"
|
||||
#include "scheduler/scheduler.h"
|
||||
|
||||
glcr::ErrorCode ReplyPortSend(ZReplyPortSendReq* req) {
|
||||
auto& proc = gScheduler->CurrentProcess();
|
||||
auto reply_port_cap = proc.GetCapability(req->reply_port_cap);
|
||||
ValidateCapability<ReplyPort>(reply_port_cap, ZC_WRITE);
|
||||
auto reply_port = reply_port_cap->obj<ReplyPort>();
|
||||
|
||||
return reply_port->Write(req->num_bytes, req->data, req->num_caps, req->caps);
|
||||
}
|
||||
glcr::ErrorCode ReplyPortRecv(ZReplyPortRecvReq* req) {
|
||||
auto& proc = gScheduler->CurrentProcess();
|
||||
|
||||
auto reply_port_cap = proc.GetCapability(req->reply_port_cap);
|
||||
ValidateCapability<ReplyPort>(reply_port_cap, ZC_READ);
|
||||
auto reply_port = reply_port_cap->obj<ReplyPort>();
|
||||
|
||||
return reply_port->Read(req->num_bytes, req->data, req->num_caps, req->caps);
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue