[Zion] Add an argument to memory align a mapping.
This commit is contained in:
parent
c8931a01c8
commit
d44be91099
11 changed files with 30 additions and 22 deletions
|
|
@ -3,7 +3,9 @@
|
|||
#include <glacier/status/error.h>
|
||||
#include <zcall.h>
|
||||
|
||||
void dbgln(const glcr::String& string) { (void)ZDebug(string.cstr()); }
|
||||
void dbgln(glcr::StringView string) {
|
||||
(void)ZDebug(string.data(), string.size());
|
||||
}
|
||||
|
||||
void check(uint64_t code) {
|
||||
switch (code) {
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@
|
|||
#include <ztypes.h>
|
||||
|
||||
// TODO: Take StringView here instead.
|
||||
void dbgln(const glcr::String& string);
|
||||
void dbgln(glcr::StringView string);
|
||||
|
||||
template <typename... Args>
|
||||
void dbgln(const glcr::StringView& fmt, Args... args) {
|
||||
|
|
|
|||
|
|
@ -36,7 +36,7 @@ OwnedMemoryRegion::~OwnedMemoryRegion() {
|
|||
|
||||
OwnedMemoryRegion OwnedMemoryRegion::FromCapability(z_cap_t vmmo_cap) {
|
||||
uint64_t vaddr;
|
||||
check(ZAddressSpaceMap(gSelfVmasCap, 0, vmmo_cap, &vaddr));
|
||||
check(ZAddressSpaceMap(gSelfVmasCap, 0, vmmo_cap, 0, &vaddr));
|
||||
|
||||
uint64_t size;
|
||||
check(ZMemoryObjectInspect(vmmo_cap, &size));
|
||||
|
|
@ -50,7 +50,7 @@ OwnedMemoryRegion OwnedMemoryRegion::ContiguousPhysical(uint64_t size,
|
|||
check(ZMemoryObjectCreateContiguous(size, &vmmo_cap, paddr));
|
||||
|
||||
uint64_t vaddr;
|
||||
check(ZAddressSpaceMap(gSelfVmasCap, 0, vmmo_cap, &vaddr));
|
||||
check(ZAddressSpaceMap(gSelfVmasCap, 0, vmmo_cap, 0, &vaddr));
|
||||
|
||||
return OwnedMemoryRegion(vmmo_cap, vaddr, size);
|
||||
}
|
||||
|
|
@ -61,7 +61,7 @@ OwnedMemoryRegion OwnedMemoryRegion::DirectPhysical(uint64_t paddr,
|
|||
check(ZMemoryObjectCreatePhysical(paddr, size, &vmmo_cap));
|
||||
|
||||
uint64_t vaddr;
|
||||
check(ZAddressSpaceMap(gSelfVmasCap, 0, vmmo_cap, &vaddr));
|
||||
check(ZAddressSpaceMap(gSelfVmasCap, 0, vmmo_cap, 0, &vaddr));
|
||||
return OwnedMemoryRegion(vmmo_cap, vaddr, size);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue