[Mammoth] Move most classes to the mmth namespace.

This commit is contained in:
Drew Galbraith 2023-11-22 14:59:41 -08:00
parent 5f8d577948
commit 8d730c67c1
42 changed files with 130 additions and 60 deletions

View file

@ -17,7 +17,7 @@ uint64_t gBootPciVmmoCap = 0;
uint64_t gBootFramebufferVmmoCap = 0;
z_err_t ParseInitPort(uint64_t init_port_cap) {
PortServer port = PortServer::AdoptCap(init_port_cap);
mmth::PortServer port = mmth::PortServer::AdoptCap(init_port_cap);
z_err_t ret;
uint64_t init_sig, init_cap;
while ((ret = port.PollForIntCap(&init_sig, &init_cap)) != glcr::EMPTY) {

View file

@ -5,6 +5,8 @@
#include "util/debug.h"
#include "util/init.h"
namespace mmth {
OwnedMemoryRegion::OwnedMemoryRegion(OwnedMemoryRegion&& other)
: OwnedMemoryRegion(other.vmmo_cap_, other.vaddr_, other.size_) {
other.vmmo_cap_ = 0;
@ -68,3 +70,5 @@ z_cap_t OwnedMemoryRegion::DuplicateCap() {
check(ZCapDuplicate(vmmo_cap_, kZionPerm_All, &cap));
return cap;
}
} // namespace mmth

View file

@ -3,6 +3,7 @@
#include <stdint.h>
#include <ztypes.h>
namespace mmth {
/*
* Memory Region class that unmaps its memory and releases its
* capability when it goes out of scope.
@ -41,3 +42,5 @@ class OwnedMemoryRegion {
// TODO: We may want to differentiate between VMMO size and mapped size?
uint64_t size_ = 0;
};
} // namespace mmth