[Zion] Move to StrFormat for debug line.

This commit is contained in:
Drew Galbraith 2023-11-05 09:24:09 -08:00
parent 4af19d010f
commit 69aced2220
23 changed files with 142 additions and 89 deletions

View file

@ -74,7 +74,7 @@ bool AddressSpace::HandlePageFault(uint64_t vaddr) {
return false;
}
#if K_VMAS_DEBUG
dbgln("[VMAS] Mapping P(%m) at V(%m)", physical_addr, vaddr);
dbgln("[VMAS] Mapping P({x}) at V({x})", physical_addr, vaddr);
#endif
MapPage(cr3_, vaddr, physical_addr);
return true;

View file

@ -10,7 +10,7 @@ MemoryObject::MemoryObject(uint64_t size) : size_(size) {
if ((size & 0xFFF) != 0) {
size_ = (size & ~0xFFF) + 0x1000;
#if K_MEM_DEBUG
dbgln("MemoryObject: aligned %x to %x", size, size_);
dbgln("MemoryObject: aligned {x} to {x}", size, size_);
#endif
}
// FIXME: Do this lazily.
@ -30,7 +30,7 @@ uint64_t MemoryObject::PhysicalPageAtOffset(uint64_t offset) {
void MemoryObject::CopyBytesToObject(uint64_t source, uint64_t length) {
if (length > size_) {
panic("Copy overruns memory object: %x too large for %x", length, size_);
panic("Copy overruns memory object: {x} too large for {x}", length, size_);
}
uint64_t hhdm = boot::GetHigherHalfDirectMap();
uint64_t page_number = 0;
@ -61,7 +61,7 @@ uint64_t MemoryObject::PageNumberToPhysAddr(uint64_t page_num) {
if (*iter == 0) {
#if K_MEM_DEBUG
dbgln("Allocating page num %u for mem object", page_num);
dbgln("Allocating page num {} for mem object", page_num);
#endif
*iter = phys_mem::AllocatePage();
}

View file

@ -40,7 +40,7 @@ glcr::RefPtr<Thread> Process::CreateThread() {
glcr::RefPtr<Thread> Process::GetThread(uint64_t tid) {
MutexHolder lock(mutex_);
if (tid >= threads_.size()) {
panic("Bad thread access %u on process %u with %u threads.", tid, id_,
panic("Bad thread access {} on process {} with {} threads.", tid, id_,
threads_.size());
}
return threads_[tid];