[Zion] Add an argument to memory align a mapping.

This commit is contained in:
Drew Galbraith 2023-11-23 18:49:01 -08:00
parent c8931a01c8
commit d44be91099
11 changed files with 30 additions and 22 deletions

View file

@ -13,9 +13,9 @@ class NaiveAllocator {
uint64_t vmmo_cap;
uint64_t err = ZMemoryObjectCreate(kSize, &vmmo_cap);
if (err != 0) {
ZProcessExit(err);
(void)ZProcessExit(err);
}
err = ZAddressSpaceMap(gSelfVmasCap, 0, vmmo_cap, &next_addr_);
err = ZAddressSpaceMap(gSelfVmasCap, 0, vmmo_cap, 0, &next_addr_);
max_addr_ = next_addr_ + kSize;
}
@ -23,7 +23,7 @@ class NaiveAllocator {
uint64_t addr = next_addr_;
next_addr_ += size;
if (next_addr_ >= max_addr_) {
ZProcessExit(0xBEEF);
(void)ZProcessExit(0xBEEF);
return 0;
}
return reinterpret_cast<void*>(addr);