[all] Add stub for new Endpoint kernel object

This commit is contained in:
Drew Galbraith 2023-06-21 21:26:24 -07:00
parent 1f7a15eed4
commit 69501bfe01
15 changed files with 144 additions and 38 deletions

View file

@ -0,0 +1,14 @@
#include "mammoth/endpoint_server.h"
glcr::ErrorOr<EndpointServer> EndpointServer::Create() {
uint64_t cap;
RET_ERR(ZEndpointCreate(&cap));
return EndpointServer(cap);
}
glcr::ErrorOr<EndpointClient> EndpointServer::CreateClient() {
uint64_t client_cap;
// FIXME: Restrict permissions to send-only here.
RET_ERR(ZCapDuplicate(endpoint_cap_, &client_cap));
return EndpointClient::AdoptEndpoint(client_cap);
}