Skip to content

Commit

Permalink
Kernel: Convert klog() => AK::Format in a handful of places
Browse files Browse the repository at this point in the history
  • Loading branch information
awesomekling committed Mar 12, 2021
1 parent ad2f95e commit 73e06a1
Show file tree
Hide file tree
Showing 9 changed files with 16 additions and 17 deletions.
2 changes: 1 addition & 1 deletion Kernel/ACPI/DynamicParser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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&)
Expand Down
2 changes: 1 addition & 1 deletion Kernel/FileSystem/ProcFS.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down
18 changes: 9 additions & 9 deletions Kernel/Interrupts/PIC.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion Kernel/Interrupts/SpuriousInterruptHandler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
2 changes: 1 addition & 1 deletion Kernel/KSyms.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
2 changes: 1 addition & 1 deletion Kernel/RTC.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
1 change: 0 additions & 1 deletion Kernel/Syscall.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion Kernel/Syscalls/kill.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion Kernel/Time/PIT.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
Expand Down

0 comments on commit 73e06a1

Please sign in to comment.