Browse Source

Kernel: Convert klog() => AK::Format in a handful of places

Andreas Kling 4 năm trước cách đây
mục cha
commit
73e06a1983

+ 1 - 1
Kernel/ACPI/DynamicParser.cpp

@@ -34,7 +34,7 @@ UNMAP_AFTER_INIT DynamicParser::DynamicParser(PhysicalAddress rsdp)
     : IRQHandler(9)
     , Parser(rsdp)
 {
-    klog() << "ACPI: Dynamic Parsing Enabled, Can parse AML";
+    dmesgln("ACPI: Dynamic Parsing Enabled, Can parse AML");
 }
 
 void DynamicParser::handle_irq(const RegisterState&)

+ 1 - 1
Kernel/FileSystem/ProcFS.cpp

@@ -1521,7 +1521,7 @@ ssize_t ProcFSInode::write_bytes(off_t offset, ssize_t size, const UserOrKernelB
     VERIFY(offset == 0);
     ssize_t nwritten = write_callback(identifier(), buffer, (size_t)size);
     if (nwritten < 0)
-        klog() << "ProcFS: Writing " << size << " bytes failed: " << nwritten;
+        dbgln("ProcFS: Writing {} bytes failed: {}", size, nwritten);
     return nwritten;
 }
 

+ 9 - 9
Kernel/Interrupts/PIC.cpp

@@ -42,17 +42,17 @@ namespace Kernel {
 #define PIC1_CTL 0xA0
 #define PIC1_CMD 0xA1
 
-#define ICW1_ICW4 0x01      /* ICW4 (not) needed */
-#define ICW1_SINGLE 0x02    /* Single (cascade) mode */
+#define ICW1_ICW4 0x01 /* ICW4 (not) needed */
+#define ICW1_SINGLE 0x02 /* Single (cascade) mode */
 #define ICW1_INTERVAL4 0x04 /* Call address interval 4 (8) */
-#define ICW1_LEVEL 0x08     /* Level triggered (edge) mode */
-#define ICW1_INIT 0x10      /* Initialization - required! */
+#define ICW1_LEVEL 0x08 /* Level triggered (edge) mode */
+#define ICW1_INIT 0x10 /* Initialization - required! */
 
-#define ICW4_8086 0x01       /* 8086/88 (MCS-80/85) mode */
-#define ICW4_AUTO 0x02       /* Auto (normal) EOI */
-#define ICW4_BUF_SLAVE 0x08  /* Buffered mode/slave */
+#define ICW4_8086 0x01 /* 8086/88 (MCS-80/85) mode */
+#define ICW4_AUTO 0x02 /* Auto (normal) EOI */
+#define ICW4_BUF_SLAVE 0x08 /* Buffered mode/slave */
 #define ICW4_BUF_MASTER 0x0C /* Buffered mode/master */
-#define ICW4_SFNM 0x10       /* Special fully nested (not) */
+#define ICW4_SFNM 0x10 /* Special fully nested (not) */
 
 bool inline static is_all_masked(u16 reg)
 {
@@ -226,7 +226,7 @@ UNMAP_AFTER_INIT void PIC::initialize()
     // ...except IRQ2, since that's needed for the master to let through slave interrupts.
     enable_vector(2);
 
-    klog() << "PIC(i8259): cascading mode, vectors 0x" << String::format("%x", IRQ_VECTOR_BASE) << "-0x" << String::format("%x", IRQ_VECTOR_BASE + 0xf);
+    dmesgln("PIC: Cascading mode, vectors {:#02x}-{:#02x}", IRQ_VECTOR_BASE, IRQ_VECTOR_BASE + 0xf);
 }
 
 u16 PIC::get_isr() const

+ 1 - 1
Kernel/Interrupts/SpuriousInterruptHandler.cpp

@@ -76,7 +76,7 @@ void SpuriousInterruptHandler::handle_interrupt(const RegisterState& state)
         m_real_handler->handle_interrupt(state);
         return;
     }
-    klog() << "Spurious Interrupt, vector " << interrupt_number();
+    dbgln("Spurious interrupt, vector {}", interrupt_number());
 }
 
 void SpuriousInterruptHandler::enable_interrupt_vector()

+ 1 - 1
Kernel/KSyms.cpp

@@ -83,7 +83,7 @@ UNMAP_AFTER_INIT static void load_kernel_sybols_from_data(const KBuffer& buffer)
     s_symbols = static_cast<KernelSymbol*>(kmalloc_eternal(sizeof(KernelSymbol) * s_symbol_count));
     ++bufptr; // skip newline
 
-    klog() << "Loading kernel symbol table...";
+    dmesgln("Loading kernel symbol table...");
 
     size_t current_symbol_index = 0;
 

+ 1 - 1
Kernel/RTC.cpp

@@ -100,7 +100,7 @@ time_t now()
     unsigned year, month, day, hour, minute, second;
     read_registers(year, month, day, hour, minute, second);
 
-    klog() << "RTC: Year: " << year << ", month: " << month << ", day: " << day << ", hour: " << hour << ", minute: " << minute << ", second: " << second;
+    dmesgln("RTC: Year: {}, month: {}, day: {}, hour: {}, minute: {}, second: {}", year, month, day, hour, minute, second);
 
     time_t days_since_epoch = years_to_days_since_epoch(year) + day_of_year(year, month, day);
     return ((days_since_epoch * 24 + hour) * 60 + minute) * 60 + second;

+ 0 - 1
Kernel/Syscall.cpp

@@ -81,7 +81,6 @@ static KResultOr<FlatPtr> handle(RegisterState&, FlatPtr function, FlatPtr arg1,
 UNMAP_AFTER_INIT void initialize()
 {
     register_user_callable_interrupt_handler(syscall_vector, syscall_asm_entry);
-    klog() << "Syscall: int 0x82 handler installed";
 }
 
 #pragma GCC diagnostic ignored "-Wcast-function-type"

+ 1 - 1
Kernel/Syscalls/kill.cpp

@@ -35,7 +35,7 @@ KResult Process::do_kill(Process& process, int signal)
     if (!is_superuser() && euid() != process.uid() && uid() != process.uid())
         return EPERM;
     if (process.is_kernel_process() && signal == SIGKILL) {
-        klog() << "attempted to send SIGKILL to kernel process " << process.name().characters() << "(" << process.pid().value() << ")";
+        dbgln("Aattempted to send SIGKILL to kernel process {} ({})", process.name(), process.pid());
         return EPERM;
     }
     if (signal != 0)

+ 1 - 1
Kernel/Time/PIT.cpp

@@ -53,7 +53,7 @@ PIT::PIT(Function<void(const RegisterState&)> callback)
 {
     IO::out8(PIT_CTL, TIMER0_SELECT | WRITE_WORD | MODE_SQUARE_WAVE);
 
-    klog() << "PIT: " << OPTIMAL_TICKS_PER_SECOND_RATE << " Hz, square wave (" << String::formatted("{:x}", BASE_FREQUENCY / OPTIMAL_TICKS_PER_SECOND_RATE) << ")";
+    dmesgln("PIT: {} Hz, square wave ({:#08x})", OPTIMAL_TICKS_PER_SECOND_RATE, BASE_FREQUENCY / OPTIMAL_TICKS_PER_SECOND_RATE);
     reset_to_default_ticks_per_second();
     enable_irq();
 }