summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Kernel/ACPI/ACPIStaticParser.cpp8
-rw-r--r--Kernel/ACPI/DMIDecoder.cpp8
-rw-r--r--Kernel/ACPI/MultiProcessorParser.cpp2
-rw-r--r--Kernel/Arch/i386/CPU.cpp16
-rw-r--r--Kernel/Devices/BXVGADevice.cpp2
-rw-r--r--Kernel/FileSystem/FIFO.cpp2
-rw-r--r--Kernel/Interrupts/APIC.cpp2
-rw-r--r--Kernel/PCI/MMIOAccess.cpp2
-rw-r--r--Kernel/Process.cpp2
-rw-r--r--Kernel/VM/MemoryManager.cpp14
-rw-r--r--Kernel/VM/Region.cpp7
11 files changed, 32 insertions, 33 deletions
diff --git a/Kernel/ACPI/ACPIStaticParser.cpp b/Kernel/ACPI/ACPIStaticParser.cpp
index 5a3d378116..f2796f5e95 100644
--- a/Kernel/ACPI/ACPIStaticParser.cpp
+++ b/Kernel/ACPI/ACPIStaticParser.cpp
@@ -168,7 +168,7 @@ namespace ACPI {
if (m_xsdt_supported) {
volatile auto* xsdt = (volatile Structures::XSDT*)sdt;
- klog() << "ACPI: Using XSDT, Enumerating tables @ P " << String::format("%p", m_main_system_description_table.get());
+ klog() << "ACPI: Using XSDT, Enumerating tables @ " << m_main_system_description_table;
klog() << "ACPI: XSDT Revision " << revision << ", Total length - " << length;
#ifdef ACPI_DEBUG
dbg() << "ACPI: XSDT pointer @ V " << xsdt;
@@ -181,7 +181,7 @@ namespace ACPI {
}
} else {
volatile auto* rsdt = (volatile Structures::RSDT*)sdt;
- klog() << "ACPI: Using RSDT, Enumerating tables @ P " << String::format("%p", m_main_system_description_table.get());
+ klog() << "ACPI: Using RSDT, Enumerating tables @ " << m_main_system_description_table;
klog() << "ACPI: RSDT Revision " << revision << ", Total length - " << length;
#ifdef ACPI_DEBUG
dbg() << "ACPI: RSDT pointer @ V " << rsdt;
@@ -220,7 +220,7 @@ namespace ACPI {
, m_rsdp(StaticParsing::search_rsdp())
{
if (!m_rsdp.is_null()) {
- klog() << "ACPI: Using RSDP @ P " << String::format("%p", m_rsdp);
+ klog() << "ACPI: Using RSDP @ " << m_rsdp;
m_operable = true;
locate_static_data();
} else {
@@ -233,7 +233,7 @@ namespace ACPI {
: Parser(true)
, m_rsdp(rsdp)
{
- klog() << "ACPI: Using RSDP @ P " << String::format("%p", rsdp.get());
+ klog() << "ACPI: Using RSDP @ " << rsdp;
m_operable = true;
locate_static_data();
}
diff --git a/Kernel/ACPI/DMIDecoder.cpp b/Kernel/ACPI/DMIDecoder.cpp
index 6db8b73ef6..6dd461a1e1 100644
--- a/Kernel/ACPI/DMIDecoder.cpp
+++ b/Kernel/ACPI/DMIDecoder.cpp
@@ -62,7 +62,7 @@ void DMIDecoder::initialize_untrusted()
void DMIDecoder::set_64_bit_entry_initialization_values(PhysicalAddress entry)
{
- klog() << "DMIDecoder: SMBIOS 64bit Entry point @ P " << String::format("%p", m_entry64bit_point.get());
+ klog() << "DMIDecoder: SMBIOS 64bit Entry point @ " << m_entry64bit_point;
m_use_64bit_entry = true;
auto region = MM.allocate_kernel_region(entry.page_base(), PAGE_ROUND_UP(SMBIOS_SEARCH_AREA_SIZE), "DMI Decoder 64 bit Initialization", Region::Access::Read, false, false);
@@ -74,7 +74,7 @@ void DMIDecoder::set_64_bit_entry_initialization_values(PhysicalAddress entry)
void DMIDecoder::set_32_bit_entry_initialization_values(PhysicalAddress entry)
{
- klog() << "DMIDecoder: SMBIOS 32bit Entry point @ P " << String::format("%p", m_entry32bit_point.get());
+ klog() << "DMIDecoder: SMBIOS 32bit Entry point @ " << m_entry32bit_point;
m_use_64bit_entry = false;
auto region = MM.allocate_kernel_region(entry.page_base(), PAGE_ROUND_UP(SMBIOS_SEARCH_AREA_SIZE), "DMI Decoder 32 bit Initialization", Region::Access::Read, false, false);
@@ -101,7 +101,7 @@ void DMIDecoder::initialize_parser()
} else if (!m_entry32bit_point.is_null()) {
set_32_bit_entry_initialization_values(m_entry32bit_point);
}
- klog() << "DMIDecoder: Data table @ P " << String::format("%p", m_structure_table.get());
+ klog() << "DMIDecoder: Data table @ " << m_structure_table;
enumerate_smbios_tables();
}
@@ -264,7 +264,7 @@ u64 DMIDecoder::get_bios_characteristics()
auto* bios_info = (SMBIOS::BIOSInfo*)get_smbios_physical_table_by_type(0).as_ptr();
ASSERT(bios_info != nullptr);
- klog() << "DMIDecoder: BIOS info @ P " << String::format("%p", bios_info);
+ klog() << "DMIDecoder: BIOS info @ " << PhysicalAddress((uintptr_t)bios_info);
return bios_info->bios_characteristics;
}
diff --git a/Kernel/ACPI/MultiProcessorParser.cpp b/Kernel/ACPI/MultiProcessorParser.cpp
index a5d430704e..6e46ecbe04 100644
--- a/Kernel/ACPI/MultiProcessorParser.cpp
+++ b/Kernel/ACPI/MultiProcessorParser.cpp
@@ -48,7 +48,7 @@ MultiProcessorParser::MultiProcessorParser()
, m_operable((m_floating_pointer != (uintptr_t) nullptr))
{
if (m_floating_pointer != (uintptr_t) nullptr) {
- klog() << "MultiProcessor: Floating Pointer Structure @ P " << String::format("%p", m_floating_pointer);
+ klog() << "MultiProcessor: Floating Pointer Structure @ " << PhysicalAddress(m_floating_pointer);
parse_floating_pointer_data();
parse_configuration_table();
} else {
diff --git a/Kernel/Arch/i386/CPU.cpp b/Kernel/Arch/i386/CPU.cpp
index cfe1888f9a..d36ab4fecd 100644
--- a/Kernel/Arch/i386/CPU.cpp
+++ b/Kernel/Arch/i386/CPU.cpp
@@ -246,7 +246,7 @@ void page_fault_handler(RegisterState regs)
bool faulted_in_userspace = (regs.cs & 3) == 3;
if (faulted_in_userspace && !MM.validate_user_stack(*Process::current, VirtualAddress(regs.userspace_esp))) {
- dbg() << "Invalid stack pointer: " << String::format("%p", regs.userspace_esp);
+ dbg() << "Invalid stack pointer: " << VirtualAddress(regs.userspace_esp);
handle_crash(regs, "Bad stack on page fault", SIGSTKFLT);
ASSERT_NOT_REACHED();
}
@@ -271,19 +271,19 @@ void page_fault_handler(RegisterState regs)
u32 slab_alloc_scrub_pattern = explode_byte(SLAB_ALLOC_SCRUB_BYTE);
u32 slab_dealloc_scrub_pattern = explode_byte(SLAB_DEALLOC_SCRUB_BYTE);
if ((fault_address & 0xffff0000) == (malloc_scrub_pattern & 0xffff0000)) {
- klog() << "Note: Address " << String::format("%p", fault_address) << " looks like it may be uninitialized malloc() memory";
+ klog() << "Note: Address " << VirtualAddress(fault_address) << " looks like it may be uninitialized malloc() memory";
} else if ((fault_address & 0xffff0000) == (free_scrub_pattern & 0xffff0000)) {
- klog() << "Note: Address " << String::format("%p", fault_address) << " looks like it may be recently free()'d memory";
+ klog() << "Note: Address " << VirtualAddress(fault_address) << " looks like it may be recently free()'d memory";
} else if ((fault_address & 0xffff0000) == (kmalloc_scrub_pattern & 0xffff0000)) {
- klog() << "Note: Address " << String::format("%p", fault_address) << " looks like it may be uninitialized kmalloc() memory";
+ klog() << "Note: Address " << VirtualAddress(fault_address) << " looks like it may be uninitialized kmalloc() memory";
} else if ((fault_address & 0xffff0000) == (kfree_scrub_pattern & 0xffff0000)) {
- klog() << "Note: Address " << String::format("%p", fault_address) << " looks like it may be recently kfree()'d memory";
+ klog() << "Note: Address " << VirtualAddress(fault_address) << " looks like it may be recently kfree()'d memory";
} else if ((fault_address & 0xffff0000) == (slab_alloc_scrub_pattern & 0xffff0000)) {
- klog() << "Note: Address " << String::format("%p", fault_address) << " looks like it may be uninitialized slab_alloc() memory";
+ klog() << "Note: Address " << VirtualAddress(fault_address) << " looks like it may be uninitialized slab_alloc() memory";
} else if ((fault_address & 0xffff0000) == (slab_dealloc_scrub_pattern & 0xffff0000)) {
- klog() << "Note: Address " << String::format("%p", fault_address) << " looks like it may be recently slab_dealloc()'d memory";
+ klog() << "Note: Address " << VirtualAddress(fault_address) << " looks like it may be recently slab_dealloc()'d memory";
} else if (fault_address < 4096) {
- klog() << "Note: Address " << String::format("%p", fault_address) << " looks like a possible nullptr dereference";
+ klog() << "Note: Address " << VirtualAddress(fault_address) << " looks like a possible nullptr dereference";
}
handle_crash(regs, "Page Fault", SIGSEGV);
diff --git a/Kernel/Devices/BXVGADevice.cpp b/Kernel/Devices/BXVGADevice.cpp
index 5ace534de3..508f850412 100644
--- a/Kernel/Devices/BXVGADevice.cpp
+++ b/Kernel/Devices/BXVGADevice.cpp
@@ -160,7 +160,7 @@ u32 BXVGADevice::find_framebuffer_address()
PCI::enumerate_all([&framebuffer_address](const PCI::Address& address, PCI::ID id) {
if (id == bochs_vga_id || id == virtualbox_vga_id) {
framebuffer_address = PCI::get_BAR0(address) & 0xfffffff0;
- klog() << "BXVGA: framebuffer @ P " << String::format("%p", framebuffer_address);
+ klog() << "BXVGA: framebuffer @ " << PhysicalAddress(framebuffer_address);
}
});
return framebuffer_address;
diff --git a/Kernel/FileSystem/FIFO.cpp b/Kernel/FileSystem/FIFO.cpp
index e1ae8d59b4..ce0c477b11 100644
--- a/Kernel/FileSystem/FIFO.cpp
+++ b/Kernel/FileSystem/FIFO.cpp
@@ -136,7 +136,7 @@ ssize_t FIFO::write(FileDescription&, const u8* buffer, ssize_t size)
return -EPIPE;
}
#ifdef FIFO_DEBUG
- dbg() << "fifo: write(" << String::format("%p", buffer) << ", " << size << ")";
+ dbg() << "fifo: write(" << (const void*)buffer) << ", " << size << ")";
#endif
return m_buffer.write(buffer, size);
}
diff --git a/Kernel/Interrupts/APIC.cpp b/Kernel/Interrupts/APIC.cpp
index e08452f1a8..05eb0a95c3 100644
--- a/Kernel/Interrupts/APIC.cpp
+++ b/Kernel/Interrupts/APIC.cpp
@@ -167,7 +167,7 @@ namespace APIC {
return false;
PhysicalAddress apic_base = get_base();
- klog() << "Initializing APIC, base: P " << String::format("%p", apic_base);
+ klog() << "Initializing APIC, base: " << apic_base;
set_base(apic_base);
g_apic_base = apic_base.as_ptr();
diff --git a/Kernel/PCI/MMIOAccess.cpp b/Kernel/PCI/MMIOAccess.cpp
index bb7572d7b8..72217222de 100644
--- a/Kernel/PCI/MMIOAccess.cpp
+++ b/Kernel/PCI/MMIOAccess.cpp
@@ -86,7 +86,7 @@ PCI::MMIOAccess::MMIOAccess(PhysicalAddress p_mcfg)
u32 lower_addr = mcfg.descriptors[index].base_addr;
m_segments.set(index, new PCI::MMIOSegment(PhysicalAddress(lower_addr), start_bus, end_bus));
- klog() << "PCI: New PCI segment @ P " << String::format("%p", lower_addr) << ", PCI buses (" << start_bus << "-" << end_bus << ")";
+ klog() << "PCI: New PCI segment @ " << PhysicalAddress(lower_addr) << ", PCI buses (" << start_bus << "-" << end_bus << ")";
}
mcfg_region->unmap();
klog() << "PCI: MMIO segments - " << m_segments.size();
diff --git a/Kernel/Process.cpp b/Kernel/Process.cpp
index da398ec085..98e17eeca0 100644
--- a/Kernel/Process.cpp
+++ b/Kernel/Process.cpp
@@ -922,7 +922,7 @@ int Process::do_exec(NonnullRefPtr<FileDescription> main_program_description, Ve
// instead of just non-null. You could totally have a DSO with entry point of
// the beginning of the text segement.
if (!loader->entry().offset(totally_random_offset).get()) {
- klog() << "do_exec: Failure loading " << path.characters() << ", entry pointer is invalid! (" << String::format("%p", loader->entry().offset(totally_random_offset).get()) << ")";
+ klog() << "do_exec: Failure loading " << path.characters() << ", entry pointer is invalid! (" << loader->entry().offset(totally_random_offset) << ")";
return -ENOEXEC;
}
diff --git a/Kernel/VM/MemoryManager.cpp b/Kernel/VM/MemoryManager.cpp
index 88de838f16..10cdbfca85 100644
--- a/Kernel/VM/MemoryManager.cpp
+++ b/Kernel/VM/MemoryManager.cpp
@@ -210,11 +210,11 @@ PageTableEntry& MemoryManager::ensure_pte(PageDirectory& page_directory, Virtual
PageDirectoryEntry& pde = pd[page_directory_index];
if (!pde.is_present()) {
#ifdef MM_DEBUG
- dbg() << "MM: PDE " << page_directory_index << " not present (requested for V" << String::format("%p", vaddr.get()) << "), allocating";
+ dbg() << "MM: PDE " << page_directory_index << " not present (requested for " << vaddr << "), allocating";
#endif
auto page_table = allocate_user_physical_page(ShouldZeroFill::Yes);
#ifdef MM_DEBUG
- dbg() << "MM: PD K" << &page_directory << " (" << (&page_directory == m_kernel_page_directory ? "Kernel" : "User") << ") at P" << String::format("%p", page_directory.cr3()) << " allocated page table " << String::format("#%u", page_directory_index) << " (for V" << String::format("%p", vaddr.get()) << ") at P" << String::format("%p", page_table->paddr().get());
+ dbg() << "MM: PD K" << &page_directory << " (" << (&page_directory == m_kernel_page_directory ? "Kernel" : "User") << ") at " << PhysicalAddress(page_directory.cr3()) << " allocated page table #" << page_directory_index << " (for " << vaddr << ") at " << page_table->paddr();
#endif
pde.set_page_table_base(page_table->paddr().get());
pde.set_user_allowed(true);
@@ -290,11 +290,11 @@ PageFaultResponse MemoryManager::handle_page_fault(const PageFault& fault)
dump_kernel_regions();
}
#ifdef PAGE_FAULT_DEBUG
- dbg() << "MM: handle_page_fault(" << String::format("%w", fault.code()) << ") at V" << String::format("%p", fault.vaddr().get());
+ dbg() << "MM: handle_page_fault(" << String::format("%w", fault.code()) << ") at " << fault.vaddr();
#endif
auto* region = region_from_vaddr(fault.vaddr());
if (!region) {
- klog() << "NP(error) fault at invalid address V" << String::format("%p", fault.vaddr().get());
+ klog() << "NP(error) fault at invalid address " << fault.vaddr();
return PageFaultResponse::ShouldCrash;
}
@@ -416,7 +416,7 @@ RefPtr<PhysicalPage> MemoryManager::allocate_user_physical_page(ShouldZeroFill s
}
#ifdef MM_DEBUG
- dbg() << "MM: allocate_user_physical_page vending P" << String::format("%p", page->paddr().get());
+ dbg() << "MM: allocate_user_physical_page vending " << page->paddr();
#endif
if (should_zero_fill == ShouldZeroFill::Yes) {
@@ -468,7 +468,7 @@ RefPtr<PhysicalPage> MemoryManager::allocate_supervisor_physical_page()
}
#ifdef MM_DEBUG
- dbg() << "MM: allocate_supervisor_physical_page vending P" << String::format("%p", page->paddr().get());
+ dbg() << "MM: allocate_supervisor_physical_page vending " << page->paddr();
#endif
fast_u32_fill((u32*)page->paddr().offset(0xc0000000).as_ptr(), 0, PAGE_SIZE / sizeof(u32));
@@ -493,7 +493,7 @@ void MemoryManager::flush_entire_tlb()
void MemoryManager::flush_tlb(VirtualAddress vaddr)
{
#ifdef MM_DEBUG
- dbg() << "MM: Flush page V" << String::format("%p", vaddr.get());
+ dbg() << "MM: Flush page " << vaddr;
#endif
asm volatile("invlpg %0"
:
diff --git a/Kernel/VM/Region.cpp b/Kernel/VM/Region.cpp
index a64c66a7f9..be4597803d 100644
--- a/Kernel/VM/Region.cpp
+++ b/Kernel/VM/Region.cpp
@@ -252,7 +252,7 @@ void Region::unmap(ShouldDeallocateVirtualMemoryRange deallocate_range)
MM.flush_tlb(vaddr);
#ifdef MM_DEBUG
auto& physical_page = vmobject().physical_pages()[first_page_index() + i];
- dbg() << "MM: >> Unmapped V" << String::format("%p", vaddr.get()) << " => P" << String::format("%p", physical_page ? physical_page->paddr().get() : 0) << " <<";
+ dbg() << "MM: >> Unmapped " << vaddr << " => P" << String::format("%p", physical_page ? physical_page->paddr().get() : 0) << " <<";
#endif
}
if (deallocate_range == ShouldDeallocateVirtualMemoryRange::Yes)
@@ -358,8 +358,7 @@ PageFaultResponse Region::handle_zero_fault(size_t page_index_in_region)
}
#ifdef PAGE_FAULT_DEBUG
- dbg() << " >> ZERO P\n"
- << String::format("%p", physical_page->paddr().get());
+ dbg() << " >> ZERO " << physical_page->paddr();
#endif
vmobject_physical_page_entry = move(physical_page);
remap_page(page_index_in_region);
@@ -394,7 +393,7 @@ PageFaultResponse Region::handle_cow_fault(size_t page_index_in_region)
u8* dest_ptr = MM.quickmap_page(*physical_page);
const u8* src_ptr = vaddr().offset(page_index_in_region * PAGE_SIZE).as_ptr();
#ifdef PAGE_FAULT_DEBUG
- dbg() << " >> COW P" << String::format("%p", physical_page->paddr().get()) << " <- P" << String::format("%p", physical_page_to_copy->paddr().get());
+ dbg() << " >> COW " << physical_page->paddr() << " <- " << physical_page_to_copy->paddr();
#endif
copy_from_user(dest_ptr, src_ptr, PAGE_SIZE);
vmobject_physical_page_entry = move(physical_page);