[Mammoth] Add a helper method for duplicating memory capabilities.
This commit is contained in:
parent
8e827a5dfb
commit
deb2e708cd
3 changed files with 9 additions and 4 deletions
|
|
@ -72,3 +72,9 @@ OwnedMemoryRegion OwnedMemoryRegion::FromCapability(z_cap_t vmmo_cap) {
|
|||
// FIXME: get the size here.
|
||||
return OwnedMemoryRegion(vmmo_cap, vaddr, size);
|
||||
}
|
||||
|
||||
z_cap_t OwnedMemoryRegion::DuplicateCap() {
|
||||
z_cap_t cap;
|
||||
check(ZCapDuplicate(vmmo_cap_, kZionPerm_All, &cap));
|
||||
return cap;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue