diff --git a/arch/x86/pagetables.c b/arch/x86/pagetables.c index f388c1a4..7f25f886 100644 --- a/arch/x86/pagetables.c +++ b/arch/x86/pagetables.c @@ -216,10 +216,10 @@ static inline void pgentry_fixup_flags(pgentry_t *entry, unsigned long flags) { if (unlikely(*entry != entry_new)) { char flags_str_old[16]; char flags_str_new[16]; - printk("WARNING: Already-present PTE protection flags conflicts with our.\n" - " Updating present flags: %s -> %s\n", - dump_pte_flags(flags_str_old, 16, (pte_t) *entry), - dump_pte_flags(flags_str_new, 16, (pte_t) entry_new)); + warning("Already-present PTE protection flags conflict with our.\n" + " Updating present flags: %s -> %s", + dump_pte_flags(flags_str_old, 16, (pte_t) *entry), + dump_pte_flags(flags_str_new, 16, (pte_t) entry_new)); *entry = entry_new; barrier(); flush_tlb(); diff --git a/arch/x86/traps.c b/arch/x86/traps.c index 30b3e6d1..7750d6f7 100644 --- a/arch/x86/traps.c +++ b/arch/x86/traps.c @@ -325,7 +325,7 @@ void do_exception(cpu_regs_t *regs) { /* Handle user tasks' exceptions */ if (enter_from_usermode(regs->exc.cs)) { - printk("Task exception: %s\n", panic_str); + warning("Task exception: %s", panic_str); terminate_user_task(); } diff --git a/common/cmdline.c b/common/cmdline.c index f4e02d8c..e510056e 100644 --- a/common/cmdline.c +++ b/common/cmdline.c @@ -117,9 +117,9 @@ void __text_init cmdline_parse(const char *cmdline) { strncpy(param->var, optval, param->varlen); if (strlen(optval) >= param->varlen) { ((char *) param->var)[param->varlen - 1] = '\0'; - printk("WARNING: The commandline parameter value for %s does not fit " - "into the preallocated buffer (size %lu >= %u)\n", - param->name, strlen(optval), param->varlen); + warning("The commandline parameter value for %s does not fit " + "into the preallocated buffer (size %lu >= %u)", + param->name, strlen(optval), param->varlen); } break; case ULONG: diff --git a/common/kernel.c b/common/kernel.c index 873a1aa5..557c5541 100644 --- a/common/kernel.c +++ b/common/kernel.c @@ -37,7 +37,7 @@ #endif void reboot(void) { - printk("Rebooting...\n"); + warning("Rebooting..."); io_delay(); #ifdef KTF_ACPICA diff --git a/common/pci.c b/common/pci.c index 4241262b..62319736 100644 --- a/common/pci.c +++ b/common/pci.c @@ -119,14 +119,14 @@ static void probe_pci(void) { const uint32_t vendor_reg = pci_cfg_read(bus, dev, func, PCI_REG_VENDOR); if (!PCI_DEV_EXISTS(vendor_reg)) { - printk("pci: non-existent host bridge @ 00.0.0\n"); + warning("pci: non-existent host bridge @ 00.0.0"); return; } class_reg = pci_cfg_read(bus, dev, func, PCI_REG_CLASS); if (PCI_CLASS(class_reg) != PCI_CLASS_BRIDGE && PCI_SUBCLASS(class_reg) != PCI_SUBCLASS_HOST_BRIDGE) { - printk("pci: expected host bridge class code @ 00.0.0\n"); + warning("pci: expected host bridge class code @ 00.0.0"); return; } diff --git a/common/sched.c b/common/sched.c index 66060bf2..485ba0c3 100644 --- a/common/sched.c +++ b/common/sched.c @@ -175,7 +175,7 @@ int schedule_task(task_t *task, cpu_t *cpu) { ASSERT(task); if (!cpu) { - printk("Unable to schedule task: %s. CPU does not exist.", task->name); + warning("Unable to schedule task: %s. CPU does not exist.", task->name); return -EEXIST; } diff --git a/common/setup.c b/common/setup.c index 5b06aa30..1cd2d060 100644 --- a/common/setup.c +++ b/common/setup.c @@ -178,9 +178,10 @@ void __text_init init_timers(cpu_t *cpu) { if (opt_apic_timer) { if (hpet_initialized || opt_pit) /* Needed for APIC timer calibration */ init_apic_timer(); - else - printk("CPU%u: Unable to initialize APIC timer - no calibration timers!\n", - cpu->id); + else { + warning("CPU%u: Unable to initialize APIC timer - no calibration timers!", + cpu->id); + } } } @@ -288,7 +289,7 @@ void __noreturn __text_init kernel_start(uint32_t multiboot_magic, unsigned long int ret = pfm_initialize(); if (ret != PFM_SUCCESS) - printk("Warning: PFM library initialization failed: %d\n", ret); + warning("PFM library initialization failed: %d", ret); #endif /* Jump from .text.init section to .text */ diff --git a/common/usermode.c b/common/usermode.c index af16f035..cadab6a5 100644 --- a/common/usermode.c +++ b/common/usermode.c @@ -71,7 +71,7 @@ long syscall_handler(long syscall_nr, long arg1, long arg2, long arg3, long arg4 } default: - printk("Unknown syscall: %lu\n", syscall_nr); + warning("Unknown syscall: %lu", syscall_nr); return -1; } } diff --git a/drivers/hpet.c b/drivers/hpet.c index 5e311c83..6333d15a 100644 --- a/drivers/hpet.c +++ b/drivers/hpet.c @@ -48,7 +48,7 @@ bool init_hpet(const cpu_t *cpu) { #endif if (!hpet) { - printk("HPET not initialized\n"); + warning("HPET not initialized"); return false; } diff --git a/drivers/keyboard.c b/drivers/keyboard.c index 8e6ddea0..f1bd9b46 100644 --- a/drivers/keyboard.c +++ b/drivers/keyboard.c @@ -123,7 +123,7 @@ void init_keyboard(const cpu_t *cpu) { /* Controller self test */ outb(KEYBOARD_PORT_CMD, KEYBOARD_CMD_SELF_TEST); if (inb(KEYBOARD_PORT_DATA) != KEYBOARD_RES_SELF_TEST) { - printk("Self test did not succeed\n"); + warning("Self test did not succeed"); return; } @@ -148,7 +148,7 @@ void init_keyboard(const cpu_t *cpu) { dprintk("Port1 available? %d - port2 available? %d\n", port1, port2); if (!port1 && !port2) { - printk("No available PS/2 working ports\n"); + warning("No available PS/2 working ports"); return; } diff --git a/smp/mptables.c b/smp/mptables.c index 65ac1bcd..70eafb0e 100644 --- a/smp/mptables.c +++ b/smp/mptables.c @@ -301,7 +301,7 @@ int init_mptables(void) { mpc_hdr_t *mpc_ptr; if (!mpf_ptr) { - printk("No MP Floating Structure Pointer found!\n"); + warning("No MP Floating Structure Pointer found!"); return -ENODEV; } @@ -309,7 +309,7 @@ int init_mptables(void) { dump_mpf(mpf_ptr); if (mpf_ptr->mpc_type > 0 || mpf_ptr->mpc_base == 0x0) { - printk("No MP Configuration Table present!\n"); + warning("No MP Configuration Table present!"); return -ENOENT; } diff --git a/tests/test.c b/tests/test.c index 90ac8d9f..c25e107e 100644 --- a/tests/test.c +++ b/tests/test.c @@ -51,7 +51,7 @@ static get_next_test_result_t get_next_test(test_fn **out_test_fn, char **out_na if (*out_name) { *out_test_fn = symbol_address(*out_name); if (!*out_test_fn) { - printk("Symbol for test %s not found\n", *out_name); + warning("Symbol for test %s not found", *out_name); return TESTS_ERROR; } return TESTS_FOUND;