[Zion] Add the ability to pass capabilities via endpoint call.
This commit is contained in:
parent
5b781bb394
commit
b516087922
18 changed files with 218 additions and 131 deletions
|
|
@ -31,7 +31,7 @@ template <typename Req, typename Resp>
|
|||
glcr::ErrorOr<glcr::Pair<Resp, z_cap_t>> EndpointClient::CallEndpointGetCap(
|
||||
const Req& req) {
|
||||
uint64_t reply_port_cap;
|
||||
RET_ERR(ZEndpointSend(cap_, sizeof(Req), &req, &reply_port_cap));
|
||||
RET_ERR(ZEndpointSend(cap_, sizeof(Req), &req, 0, nullptr, &reply_port_cap));
|
||||
|
||||
Resp resp;
|
||||
z_cap_t cap = 0;
|
||||
|
|
@ -49,7 +49,7 @@ glcr::ErrorOr<glcr::Pair<Resp, z_cap_t>> EndpointClient::CallEndpointGetCap(
|
|||
template <typename Req, typename Resp>
|
||||
glcr::ErrorOr<Resp> EndpointClient::CallEndpoint(const Req& req) {
|
||||
uint64_t reply_port_cap;
|
||||
RET_ERR(ZEndpointSend(cap_, sizeof(Req), &req, &reply_port_cap));
|
||||
RET_ERR(ZEndpointSend(cap_, sizeof(Req), &req, 0, nullptr, &reply_port_cap));
|
||||
|
||||
Resp resp;
|
||||
uint64_t num_bytes = sizeof(Resp);
|
||||
|
|
|
|||
|
|
@ -22,8 +22,10 @@ void EndpointServer::ServerThread() {
|
|||
while (true) {
|
||||
uint64_t message_size = kBufferSize;
|
||||
uint64_t reply_port_cap = 0;
|
||||
glcr::ErrorCode err = ZEndpointRecv(endpoint_cap_, &message_size,
|
||||
recieve_buffer_, &reply_port_cap);
|
||||
uint64_t num_caps = 0;
|
||||
glcr::ErrorCode err =
|
||||
ZEndpointRecv(endpoint_cap_, &message_size, recieve_buffer_, &num_caps,
|
||||
nullptr, &reply_port_cap);
|
||||
if (err != glcr::OK) {
|
||||
dbgln("Error in receive: %x", err);
|
||||
continue;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue