diff options
author | Sahan Fernando <sahan.h.fernando@gmail.com> | 2021-01-12 00:30:22 +1100 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2021-01-11 21:06:32 +0100 |
commit | 099b83fd286dddcc5cf0c766241dd2b1a3098796 (patch) | |
tree | ddd4e749b9e6b977d93f39f0e2ad4b2ca4e0161a /Kernel/VM/MemoryManager.cpp | |
parent | 009c753a12d646617be9a6fec9e99cc1e500d5b5 (diff) | |
download | serenity-099b83fd286dddcc5cf0c766241dd2b1a3098796.zip |
Everywhere: Fix incorrect uses of String::format and StringBuilder::appendf
These changes are arbitrarily divided into multiple commits to make it
easier to find potentially introduced bugs with git bisect.
Diffstat (limited to 'Kernel/VM/MemoryManager.cpp')
-rw-r--r-- | Kernel/VM/MemoryManager.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/Kernel/VM/MemoryManager.cpp b/Kernel/VM/MemoryManager.cpp index c33c59f647..f7d7298dbd 100644 --- a/Kernel/VM/MemoryManager.cpp +++ b/Kernel/VM/MemoryManager.cpp @@ -132,7 +132,7 @@ void MemoryManager::parse_memory_map() auto* mmap = (multiboot_memory_map_t*)(low_physical_to_virtual(multiboot_info_ptr->mmap_addr)); for (; (unsigned long)mmap < (low_physical_to_virtual(multiboot_info_ptr->mmap_addr)) + (multiboot_info_ptr->mmap_length); mmap = (multiboot_memory_map_t*)((unsigned long)mmap + mmap->size + sizeof(mmap->size))) { - klog() << "MM: Multiboot mmap: base_addr = " << String::format("0x%08x", mmap->addr) << ", length = " << String::format("0x%08x", mmap->len) << ", type = 0x" << String::format("%x", mmap->type); + klog() << "MM: Multiboot mmap: base_addr = " << String::format("0x%08llx", mmap->addr) << ", length = " << String::format("0x%08llx", mmap->len) << ", type = 0x" << String::format("%x", mmap->type); if (mmap->type != MULTIBOOT_MEMORY_AVAILABLE) continue; @@ -145,7 +145,7 @@ void MemoryManager::parse_memory_map() auto diff = (FlatPtr)mmap->addr % PAGE_SIZE; if (diff != 0) { - klog() << "MM: got an unaligned region base from the bootloader; correcting " << String::format("%p", mmap->addr) << " by " << diff << " bytes"; + klog() << "MM: got an unaligned region base from the bootloader; correcting " << String::format("%p", (void*)mmap->addr) << " by " << diff << " bytes"; diff = PAGE_SIZE - diff; mmap->addr += diff; mmap->len -= diff; @@ -883,7 +883,7 @@ void MemoryManager::dump_kernel_regions() klog() << "BEGIN END SIZE ACCESS NAME"; ScopedSpinLock lock(s_mm_lock); for (auto& region : MM.m_kernel_regions) { - klog() << String::format("%08x", region.vaddr().get()) << " -- " << String::format("%08x", region.vaddr().offset(region.size() - 1).get()) << " " << String::format("%08x", region.size()) << " " << (region.is_readable() ? 'R' : ' ') << (region.is_writable() ? 'W' : ' ') << (region.is_executable() ? 'X' : ' ') << (region.is_shared() ? 'S' : ' ') << (region.is_stack() ? 'T' : ' ') << (region.vmobject().is_anonymous() ? 'A' : ' ') << " " << region.name().characters(); + klog() << String::format("%08x", region.vaddr().get()) << " -- " << String::format("%08x", region.vaddr().offset(region.size() - 1).get()) << " " << String::format("%08zx", region.size()) << " " << (region.is_readable() ? 'R' : ' ') << (region.is_writable() ? 'W' : ' ') << (region.is_executable() ? 'X' : ' ') << (region.is_shared() ? 'S' : ' ') << (region.is_stack() ? 'T' : ' ') << (region.vmobject().is_anonymous() ? 'A' : ' ') << " " << region.name().characters(); } } |