mm: replace some printfs with debug_log
This commit is contained in:
+1
-1
@@ -14,7 +14,7 @@ int printf(const char* __restrict, ...);
|
||||
int putchar(int);
|
||||
int puts(const char*);
|
||||
|
||||
#define KATAU_DEBUG
|
||||
//#define KATAU_DEBUG
|
||||
|
||||
#ifdef KATAU_DEBUG
|
||||
#define debug_log printf
|
||||
|
||||
+1
-1
@@ -61,7 +61,7 @@ void* alloc_page() {
|
||||
if(page_num == 0)
|
||||
continue;
|
||||
|
||||
printf("allocating page %X\n", page_num * PAGE_SIZE);
|
||||
debug_log("allocating page %X\n", page_num * PAGE_SIZE);
|
||||
|
||||
page_bitmap[i] |= (1 << j); // Помечаем как занятый
|
||||
return (void*)(page_num * PAGE_SIZE);
|
||||
|
||||
+2
-2
@@ -174,7 +174,7 @@ void destroy_page_dir(uint32_t* page_dir_virt) {
|
||||
|
||||
// If the page table entry is present, free the physical page (frame) it points to
|
||||
if (pte & PAGE_PRESENT) {
|
||||
printf("freeing page %X\n", pte);
|
||||
debug_log("freeing page %X\n", pte);
|
||||
free_page((void*)(pte & ~0xFFF));
|
||||
}
|
||||
}
|
||||
@@ -187,6 +187,6 @@ void destroy_page_dir(uint32_t* page_dir_virt) {
|
||||
|
||||
// Finally, free the page directory itself.
|
||||
// We need its physical address to pass to the physical memory manager.
|
||||
printf("freeing PD page %X\n", virt_to_phys(page_dir_virt));
|
||||
debug_log("freeing PD page %X\n", virt_to_phys(page_dir_virt));
|
||||
free_page((void*)virt_to_phys(page_dir_virt));
|
||||
}
|
||||
Reference in New Issue
Block a user