mirror of
https://github.com/justinian/jsix.git
synced 2025-12-10 00:14:32 -08:00
[kernel] Move the logger from kutil into kernel
Part one of a series of code moves. The kutil library is not very useful, as most of its code is kernel-specific. This was originally for testing purposes, but that can be achieved in other ways with the current build system. I find this mostly creates a strange division in the kernel code. Instead, I'm going to move everything kernel-specific to actually be in the kernel, and replace kutil with just 'util' for generic utility code I want to share. This commit: - Moves the logger into the kernel. - Updates the 'printf' library used from mpaland/printf to eyalroz/printf and moved it into the kernel, as it's only used by the logger in kutil. - Removes some other unused kutil headers from some files, to help future code rearrangement. Note that the (now redundant-seeming) log.cpp/h in kernel is currently still there - these files are more about log output than the logging system, and will get replaced once I add user-space log output.
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
#include <stdint.h>
|
||||
|
||||
#include "kernel_memory.h"
|
||||
#include "kutil/printf.h"
|
||||
#include "printf/printf.h"
|
||||
|
||||
#include "cpu.h"
|
||||
#include "device_manager.h"
|
||||
@@ -130,7 +130,7 @@ isr_handler(cpu_state *regs)
|
||||
break;
|
||||
|
||||
snprintf(message, sizeof(message),
|
||||
"Page fault: %016llx%s%s%s%s%s", cr2,
|
||||
"Page fault: %016lx%s%s%s%s%s", cr2,
|
||||
(regs->errorcode & 0x01) ? " present" : "",
|
||||
(regs->errorcode & 0x02) ? " write" : "",
|
||||
(regs->errorcode & 0x04) ? " user" : "",
|
||||
@@ -153,7 +153,7 @@ isr_handler(cpu_state *regs)
|
||||
return;
|
||||
|
||||
default:
|
||||
snprintf(message, sizeof(message), "Unknown interrupt 0x%x", regs->interrupt);
|
||||
snprintf(message, sizeof(message), "Unknown interrupt 0x%lx", regs->interrupt);
|
||||
kassert(false, message);
|
||||
}
|
||||
|
||||
@@ -170,7 +170,7 @@ irq_handler(cpu_state *regs)
|
||||
if (! device_manager::get().dispatch_irq(irq)) {
|
||||
char message[100];
|
||||
snprintf(message, sizeof(message),
|
||||
"Unknown IRQ: %d (vec 0x%x)", irq, regs->interrupt);
|
||||
"Unknown IRQ: %d (vec 0x%lx)", irq, regs->interrupt);
|
||||
kassert(false, message);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user