X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;ds=sidebyside;f=kernel%2Fprintk.c;h=9b1f825bc570877355bd7a577cf2182cd30794e1;hb=9bf4aaab3e101692164d49b7ca357651eb691cb6;hp=3bf268b7fda9c03219b2dfd845f4a6c28518c7ba;hpb=db216c3d5e4c040e557a50f8f5d35d5c415e8c1c;p=linux-2.6.git diff --git a/kernel/printk.c b/kernel/printk.c index 3bf268b7f..9b1f825bc 100644 --- a/kernel/printk.c +++ b/kernel/printk.c @@ -687,6 +687,47 @@ void console_unblank(void) } EXPORT_SYMBOL(console_unblank); +/* + * Return the console tty driver structure and its associated index + */ +struct tty_driver *console_device(int *index) +{ + struct console *c; + struct tty_driver *driver = NULL; + + acquire_console_sem(); + for (c = console_drivers; c != NULL; c = c->next) { + if (!c->device) + continue; + driver = c->device(c, index); + if (driver) + break; + } + release_console_sem(); + return driver; +} + +/* + * Prevent further output on the passed console device so that (for example) + * serial drivers can disable console output before suspending a port, and can + * re-enable output afterwards. + */ +void console_stop(struct console *console) +{ + acquire_console_sem(); + console->flags &= ~CON_ENABLED; + release_console_sem(); +} +EXPORT_SYMBOL(console_stop); + +void console_start(struct console *console) +{ + acquire_console_sem(); + console->flags |= CON_ENABLED; + release_console_sem(); +} +EXPORT_SYMBOL(console_start); + /* * The console driver calls this routine during kernel initialization * to register the console printing procedure with printk() and to