From e54d55b9d935745c2aa3f07712b857af42506c0d Mon Sep 17 00:00:00 2001 From: Greg Watson Date: Sat, 13 Mar 2004 03:40:51 +0000 Subject: added rx support git-svn-id: svn://svn.coreboot.org/coreboot/trunk@1410 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1 --- src/console/console.c | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) (limited to 'src/console/console.c') diff --git a/src/console/console.c b/src/console/console.c index 5ec936d8ab..b97ee8e1d5 100644 --- a/src/console/console.c +++ b/src/console/console.c @@ -52,6 +52,31 @@ void console_tx_byte(unsigned char byte) __console_tx_byte(byte); } +unsigned char console_rx_byte(void) +{ + struct console_driver *driver; + if (!initialized) + return 0; + for(driver = console_drivers; driver < econsole_drivers; driver++) + if (driver->tst_byte) + break; + if (driver == econsole_drivers) + return 0; + while (!driver->tst_byte()); + return driver->rx_byte(); +} + +int console_tst_byte(void) +{ + struct console_driver *driver; + if (!initialized) + return 0; + for(driver = console_drivers; driver < econsole_drivers; driver++) + if (driver->tst_byte) + return driver->tst_byte(); + return 0; +} + /* * Write POST information */ -- cgit v1.2.3