[zion] Move port calls to new syscall process.
This commit is contained in:
parent
77bb3acfb4
commit
bd431b94ce
11 changed files with 118 additions and 175 deletions
|
|
@ -19,73 +19,6 @@ z_err_t SysCall1(uint64_t number, const void* first) {
|
|||
return SysCall2(number, first, 0);
|
||||
}
|
||||
|
||||
z_err_t ZPortCreate(z_cap_t* port_cap) {
|
||||
ZPortCreateResp resp;
|
||||
z_err_t ret = SysCall2(Z_PORT_CREATE, 0, &resp);
|
||||
*port_cap = resp.port_cap;
|
||||
return ret;
|
||||
}
|
||||
|
||||
z_err_t ZPortSend(z_cap_t port_cap, uint64_t num_bytes, const void* data,
|
||||
uint64_t num_caps, z_cap_t* caps) {
|
||||
ZPortSendReq req{.port_cap = port_cap,
|
||||
.message = {
|
||||
.num_bytes = num_bytes,
|
||||
.data = const_cast<void*>(data),
|
||||
.num_caps = num_caps,
|
||||
.caps = caps,
|
||||
}};
|
||||
return SysCall1(Z_PORT_SEND, &req);
|
||||
}
|
||||
|
||||
z_err_t ZPortRecv(z_cap_t port_cap, uint64_t num_bytes, void* data,
|
||||
uint64_t num_caps, z_cap_t* caps, uint64_t* actual_bytes,
|
||||
uint64_t* actual_caps) {
|
||||
ZPortRecvReq req{
|
||||
.port_cap = port_cap,
|
||||
.message =
|
||||
{
|
||||
.num_bytes = num_bytes,
|
||||
.data = data,
|
||||
.num_caps = num_caps,
|
||||
.caps = caps,
|
||||
},
|
||||
};
|
||||
z_err_t ret = SysCall1(Z_PORT_RECV, &req);
|
||||
*actual_bytes = req.message.num_bytes;
|
||||
*actual_caps = req.message.num_caps;
|
||||
return ret;
|
||||
}
|
||||
|
||||
z_err_t ZPortPoll(z_cap_t port_cap, uint64_t num_bytes, void* data,
|
||||
uint64_t num_caps, z_cap_t* caps, uint64_t* actual_bytes,
|
||||
uint64_t* actual_caps) {
|
||||
ZPortRecvReq req{
|
||||
.port_cap = port_cap,
|
||||
.message =
|
||||
{
|
||||
.num_bytes = num_bytes,
|
||||
.data = data,
|
||||
.num_caps = num_caps,
|
||||
.caps = caps,
|
||||
},
|
||||
};
|
||||
z_err_t ret = SysCall1(Z_PORT_POLL, &req);
|
||||
*actual_bytes = req.message.num_bytes;
|
||||
*actual_caps = req.message.num_caps;
|
||||
return ret;
|
||||
}
|
||||
|
||||
z_err_t ZIrqRegister(uint64_t irq_num, z_cap_t* port_cap) {
|
||||
ZIrqRegisterReq req{
|
||||
.irq_num = irq_num,
|
||||
};
|
||||
ZIrqRegisterResp resp;
|
||||
z_err_t ret = SysCall2(Z_IRQ_REGISTER, &req, &resp);
|
||||
*port_cap = resp.port_cap;
|
||||
return ret;
|
||||
}
|
||||
|
||||
z_err_t ZCapDuplicate(z_cap_t cap_in, z_cap_t* cap_out) {
|
||||
ZCapDuplicateReq req{
|
||||
.cap = cap_in,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue