[Mammoth] Move all callers of FromCapability to OwnedMemoryObject.

This commit is contained in:
Drew Galbraith 2023-11-19 20:33:15 -08:00
parent 337126cabb
commit 8e827a5dfb
24 changed files with 175 additions and 87 deletions

View file

@ -36,14 +36,6 @@ MappedMemoryRegion MappedMemoryRegion::Default(uint64_t size) {
return MappedMemoryRegion(vmmo_cap, 0, vaddr, size);
}
MappedMemoryRegion MappedMemoryRegion::FromCapability(z_cap_t vmmo_cap) {
uint64_t vaddr;
check(ZAddressSpaceMap(gSelfVmasCap, 0, vmmo_cap, &vaddr));
// FIXME: get the size here.
return MappedMemoryRegion(vmmo_cap, 0, vaddr, 0);
}
OwnedMemoryRegion::OwnedMemoryRegion(OwnedMemoryRegion&& other)
: OwnedMemoryRegion(other.vmmo_cap_, other.vaddr_, other.size_) {
other.vmmo_cap_ = 0;