summaryrefslogtreecommitdiff
path: root/Kernel
diff options
context:
space:
mode:
authorLiav A <liavalb@gmail.com>2020-02-24 19:03:18 +0200
committerAndreas Kling <kling@serenityos.org>2020-02-27 13:05:12 +0100
commitb41e2d25b4253075d6cd1244e4b01b7dbe55b7cc (patch)
treef6d263f1b25ff8d3de827ba09cd454bbf792d7bb /Kernel
parent9e520fd0d698acf10767a2e76ea2754990f7ffca (diff)
downloadserenity-b41e2d25b4253075d6cd1244e4b01b7dbe55b7cc.zip
CPU: Use dbg() instead of dbgprintf()
Diffstat (limited to 'Kernel')
-rw-r--r--Kernel/Arch/i386/CPU.cpp16
-rw-r--r--Kernel/Arch/i386/CPU.h2
2 files changed, 5 insertions, 13 deletions
diff --git a/Kernel/Arch/i386/CPU.cpp b/Kernel/Arch/i386/CPU.cpp
index 807a8f1e78..bc7e603d72 100644
--- a/Kernel/Arch/i386/CPU.cpp
+++ b/Kernel/Arch/i386/CPU.cpp
@@ -245,15 +245,7 @@ void page_fault_handler(RegisterState regs)
#ifdef PAGE_FAULT_DEBUG
u32 fault_page_directory = read_cr3();
- dbgprintf("%s(%u): ring%u %s page fault in PD=%x, %s%s V%08x\n",
- current ? Process::current->name().characters() : "(none)",
- current ? Process::current->pid() : 0,
- regs.cs & 3,
- regs.exception_code & 1 ? "PV" : "NP",
- fault_page_directory,
- regs.exception_code & 8 ? "reserved-bit " : "",
- regs.exception_code & 2 ? "write" : "read",
- fault_address);
+ dbg() << (current ? Process::current->name().characters() : "(none)") << "(" << (current ? Process::current->pid() : 0) << "): ring" << (regs.cs & 3) << " " << (regs.exception_code & 1 ? "PV" : "NP") << " page fault in PD=" << String::format("%x", fault_page_directory) << ", " << (regs.exception_code & 8 ? "reserved-bit " : "") << regs.exception_code & 2 ? "write" : "read" <<" V" << String::format("%08x", fault_address);
#endif
#ifdef PAGE_FAULT_DEBUG
@@ -262,7 +254,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))) {
- dbgprintf("Invalid stack pointer: %p\n", regs.userspace_esp);
+ dbg() << "Invalid stack pointer: " << String::format("%p", regs.userspace_esp);
handle_crash(regs, "Bad stack on page fault", SIGSTKFLT);
ASSERT_NOT_REACHED();
}
@@ -309,7 +301,7 @@ void page_fault_handler(RegisterState regs)
handle_crash(regs, "Page Fault", SIGSEGV);
} else if (response == PageFaultResponse::Continue) {
#ifdef PAGE_FAULT_DEBUG
- dbgprintf("Continuing after resolved page fault\n");
+ dbg() << "Continuing after resolved page fault";
#endif
} else {
ASSERT_NOT_REACHED();
@@ -674,7 +666,7 @@ void handle_interrupt(RegisterState regs)
s_interrupt_handler[irq]->increment_invoking_counter();
s_interrupt_handler[irq]->eoi();
} else {
- dbgprintf("No IRQ %d Handler installed!\n", irq);
+ dbg() << "No IRQ " << irq << " Handler installed!";
hang();
}
--g_in_irq;
diff --git a/Kernel/Arch/i386/CPU.h b/Kernel/Arch/i386/CPU.h
index 5c1708cd56..c9f59e3e40 100644
--- a/Kernel/Arch/i386/CPU.h
+++ b/Kernel/Arch/i386/CPU.h
@@ -526,7 +526,7 @@ public:
SplitQword end;
read_tsc(end.lsw, end.msw);
uint64_t diff = end.qw - m_start.qw;
- dbgprintf("Stopwatch(%s): %Q ticks\n", m_name, diff);
+ dbg() << "Stopwatch(" << m_name << "): " << diff << " ticks";
}
private: