[Mammoth] Add an owned memory capability that cleans itself up.

This commit is contained in:
Drew Galbraith 2023-11-19 17:54:28 -08:00
parent 7d48dd2b8b
commit 3e9923f227
5 changed files with 84 additions and 9 deletions

View file

@ -18,9 +18,9 @@ uint64_t main(uint64_t init_port_cap) {
Empty empty;
AhciInfo ahci;
RET_ERR(stub.GetAhciInfo(empty, ahci));
MappedMemoryRegion ahci_region =
MappedMemoryRegion::FromCapability(ahci.ahci_region());
ASSIGN_OR_RETURN(auto driver, AhciDriver::Init(ahci_region));
OwnedMemoryRegion ahci_region =
OwnedMemoryRegion::FromCapability(ahci.ahci_region());
ASSIGN_OR_RETURN(auto driver, AhciDriver::Init(glcr::Move(ahci_region)));
ASSIGN_OR_RETURN(glcr::UniquePtr<DenaliServer> server,
DenaliServer::Create(*driver));