kernel: write to all registered consoles with printk()

This commit is contained in:
2023-05-06 21:32:19 +01:00
parent f52ca2f1e2
commit 94ea756b31
3 changed files with 29 additions and 4 deletions

View File

@@ -29,11 +29,23 @@ kern_status_t console_unregister(struct console *con)
spin_lock_irqsave(&consoles_lock, &flags);
queue_delete(&consoles, &con->c_list);
spin_unlock_irqrestore(&consoles_lock, flags);
return KERN_OK;
}
struct queue *get_consoles(unsigned long *flags)
{
spin_lock_irqsave(&consoles_lock, flags);
return &consoles;
}
void put_consoles(struct queue *consoles, unsigned long flags)
{
(void)consoles;
spin_unlock_irqrestore(&consoles_lock, flags);
}
void console_write(struct console *con, const char *s, unsigned int len)
{
if (con->c_write) {