Add preprocessor directives to supress logs per file.

Makes the output much cleaner by default but allows for getting more
infor if debugging in the future.
This commit is contained in:
Drew Galbraith 2023-06-07 13:51:13 -07:00
parent add533071b
commit 53ff49b265
7 changed files with 52 additions and 5 deletions

View file

@ -3,6 +3,8 @@
#include "boot/boot_info.h"
#include "debug/debug.h"
#define K_PHYS_DEBUG 0
namespace phys_mem {
namespace {
@ -29,7 +31,9 @@ class PhysicalMemoryManager {
if (base == gBootstrap.init_page) {
base = gBootstrap.next_page;
uint64_t bootstrap_used = gBootstrap.next_page - gBootstrap.init_page;
#if K_PHYS_DEBUG
dbgln("[PMM] Taking over from bootstrap, used: %x", bootstrap_used);
#endif
size -= bootstrap_used;
}
AddMemoryRegion(base, size);
@ -109,7 +113,9 @@ uint64_t AllocatePage() {
panic("No Bootstrap Memory Manager");
}
#if K_PHYS_DEBUG
dbgln("[PMM] Boostrap Alloc!");
#endif
uint64_t page = gBootstrap.next_page;
if (page == gBootstrap.max_page) {