This patch removes most of the #ifdefs in libc/console.c, and
replaces it with two queues (input, output) where drivers (serial, keyboard, video, usb) can attach. The only things left with #ifdefs are initialization (at some point the drivers must get a chance to register) Signed-off-by: Patrick Georgi <patrick.georgi@coresystems.de> Acked-by: Jordan Crouse <jordan.crouse@amd.com> git-svn-id: svn://svn.coreboot.org/coreboot/trunk@3679 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
This commit is contained in:
@@ -326,6 +326,11 @@ int keyboard_add_reset_handler(void (*new_handler)(void))
|
||||
return 0;
|
||||
}
|
||||
|
||||
static struct console_input_driver cons = {
|
||||
.havekey = keyboard_havechar,
|
||||
.getchar = keyboard_getchar
|
||||
};
|
||||
|
||||
void keyboard_init(void)
|
||||
{
|
||||
u8 mode;
|
||||
@@ -350,5 +355,7 @@ void keyboard_init(void)
|
||||
|
||||
/* Write the new mode */
|
||||
keyboard_set_mode(mode);
|
||||
|
||||
console_add_input_driver(&cons);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user