[Mammoth] Move all callers of FromCapability to OwnedMemoryObject.
This commit is contained in:
parent
337126cabb
commit
8e827a5dfb
24 changed files with 175 additions and 87 deletions
|
|
@ -9,7 +9,6 @@ class MappedMemoryRegion {
|
|||
static MappedMemoryRegion DirectPhysical(uint64_t phys_addr, uint64_t size);
|
||||
static MappedMemoryRegion ContiguousPhysical(uint64_t size);
|
||||
static MappedMemoryRegion Default(uint64_t size);
|
||||
static MappedMemoryRegion FromCapability(z_cap_t vmmo_cap);
|
||||
|
||||
MappedMemoryRegion() {}
|
||||
// TODO: Disallow copy before doing any cleanup here.
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue