diff options
author | Andreas Kling <kling@serenityos.org> | 2021-03-09 22:44:04 +0100 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2021-03-09 22:44:04 +0100 |
commit | b007bc07b7b7d4ee54f424b63874d7e628e7b6a3 (patch) | |
tree | 2a0e9a6118c18240ee358337aec4d7ebafc854c1 /Kernel/VM/MemoryManager.cpp | |
parent | 232738fb7adfdab6f2f74e02f1aa0ad394f3e8bd (diff) | |
download | serenity-b007bc07b7b7d4ee54f424b63874d7e628e7b6a3.zip |
Kernel: Convert klog() => dmesgln() in MemoryManager
Diffstat (limited to 'Kernel/VM/MemoryManager.cpp')
-rw-r--r-- | Kernel/VM/MemoryManager.cpp | 15 |
1 files changed, 4 insertions, 11 deletions
diff --git a/Kernel/VM/MemoryManager.cpp b/Kernel/VM/MemoryManager.cpp index d4079a09e0..0e7f49c4bc 100644 --- a/Kernel/VM/MemoryManager.cpp +++ b/Kernel/VM/MemoryManager.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2020, Andreas Kling <kling@serenityos.org> + * Copyright (c) 2018-2021, Andreas Kling <kling@serenityos.org> * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -66,11 +66,6 @@ namespace Kernel { static MemoryManager* s_the; RecursiveSpinLock s_mm_lock; -const LogStream& operator<<(const LogStream& stream, const UsedMemoryRange& value) -{ - return stream << UserMemoryRangeTypeNames[static_cast<int>(value.type)] << " range @ " << value.start << " - " << value.end; -} - MemoryManager& MM { return *s_the; @@ -217,7 +212,7 @@ UNMAP_AFTER_INIT void MemoryManager::parse_memory_map() auto* mmap_end = reinterpret_cast<multiboot_memory_map_t*>(low_physical_to_virtual(multiboot_info_ptr->mmap_addr) + multiboot_info_ptr->mmap_length); for (auto& used_range : m_used_memory_ranges) { - klog() << "MM: " << used_range; + dmesgln("MM: {} range @ {} - {}", UserMemoryRangeTypeNames[static_cast<int>(used_range.type)], used_range.start, used_range.end); } for (auto* mmap = mmap_begin; mmap < mmap_end; mmap++) { @@ -239,7 +234,7 @@ UNMAP_AFTER_INIT void MemoryManager::parse_memory_map() m_physical_memory_ranges.append(PhysicalMemoryRange { PhysicalMemoryRangeType::ACPI_NVS, start_address, length }); break; case (MULTIBOOT_MEMORY_BADRAM): - klog() << "MM: Warning, detected bad memory range!"; + dmesgln("MM: Warning, detected bad memory range!"); m_physical_memory_ranges.append(PhysicalMemoryRange { PhysicalMemoryRangeType::BadMemory, start_address, length }); break; default: @@ -477,9 +472,7 @@ PageFaultResponse MemoryManager::handle_page_fault(const PageFault& fault) dump_kernel_regions(); return PageFaultResponse::ShouldCrash; } -#if PAGE_FAULT_DEBUG - dbgln("MM: CPU[{}] handle_page_fault({:#04x}) at {}", Processor::id(), fault.code(), fault.vaddr()); -#endif + dbgln_if(PAGE_FAULT_DEBUG, "MM: CPU[{}] handle_page_fault({:#04x}) at {}", Processor::id(), fault.code(), fault.vaddr()); auto* region = find_region_from_vaddr(fault.vaddr()); if (!region) { dmesgln("CPU[{}] NP(error) fault at invalid address {}", Processor::id(), fault.vaddr()); |