[denali] Get all caps from the init port.

This allows us to remove the bootstrap capabilities for good woo hoo!
This commit is contained in:
Drew Galbraith 2023-06-17 01:30:47 -07:00
parent 6e86ce67f0
commit 7dcbbd671e
11 changed files with 62 additions and 28 deletions

View file

@ -2,10 +2,6 @@
#include <stdint.h>
#include <zerrors.h>
extern uint64_t gSelfProcCap;
extern uint64_t gSelfVmasCap;
extern uint64_t gBootDenaliVmmoCap;
#include <zglobal.h>
z_err_t ParseInitPort(uint64_t init_port_cap);

View file

@ -1,6 +1,7 @@
#pragma once
#include <stdint.h>
#include <zcall.h>
#include <zerrors.h>
class Port {
@ -9,6 +10,15 @@ class Port {
z_err_t PollForIntCap(uint64_t* msg, uint64_t* cap);
template <typename T>
z_err_t WriteMessage(const T& obj, uint64_t cap);
private:
uint64_t port_cap_;
};
template <typename T>
z_err_t Port::WriteMessage(const T& obj, uint64_t cap) {
return ZPortSend(port_cap_, sizeof(obj),
reinterpret_cast<const uint8_t*>(&obj), 1, &cap);
}