logger fixes
This commit is contained in:
+8
-5
@@ -13,10 +13,17 @@ void console_write(const char* buf, size_t len) {
|
||||
spin_unlock(&console_lock);
|
||||
}
|
||||
|
||||
static void console_replay_write(void* ctx, const char* buf, size_t len) {
|
||||
struct console* con = ctx;
|
||||
con->write(con, buf, len);
|
||||
}
|
||||
|
||||
bool console_register(struct console* con) {
|
||||
if (!con->init(con))
|
||||
return false;
|
||||
|
||||
con->write(con, "\ec", 2);
|
||||
log_replay(console_replay_write, con);
|
||||
spin_lock(&console_lock);
|
||||
con->next = registered;
|
||||
registered = con;
|
||||
@@ -37,8 +44,4 @@ void console_unregister(struct console* con) {
|
||||
spin_unlock(&console_lock);
|
||||
}
|
||||
|
||||
[[__init]]
|
||||
static void console_stage_init(struct boot_info*) {
|
||||
kprintf("\ec");
|
||||
}
|
||||
INIT_TASK(console_stage, "core.console", console_stage_init);
|
||||
INIT_TASK(console_stage, "core.console");
|
||||
|
||||
Reference in New Issue
Block a user