summaryrefslogtreecommitdiffstats
path: root/payloads/libpayload/curses/keyboard.c
diff options
context:
space:
mode:
authorStefan Reinauer <stepan@coresystems.de>2008-09-26 18:36:26 +0000
committerStefan Reinauer <stepan@openbios.org>2008-09-26 18:36:26 +0000
commite75c3d85a35f0c42fef1621ca76eb085b6ae5a94 (patch)
tree3935deb54d4199d8a286ce877d7136802d7fbac6 /payloads/libpayload/curses/keyboard.c
parent96bcc53071bacc284df46093cfc3981b437cf035 (diff)
downloadcoreboot-e75c3d85a35f0c42fef1621ca76eb085b6ae5a94.tar.gz
coreboot-e75c3d85a35f0c42fef1621ca76eb085b6ae5a94.tar.bz2
coreboot-e75c3d85a35f0c42fef1621ca76eb085b6ae5a94.zip
* factor out serial hardware init
* add reverse color support for serial * add cursor enable/disable support for serial * fix tinycurses compilation if serial is disabled * add functions to query whether serial or vga console is enabled in tinycurses * initialize uninitialized COLOR_PAIRS variable * implement has_colors(), wredrawln() functions in curses Signed-off-by: Stefan Reinauer <stepan@coresystems.de> Acked-by: Jordan Crouse <jordan.crouse@amd.com> git-svn-id: svn://svn.coreboot.org/coreboot/trunk@3604 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
Diffstat (limited to 'payloads/libpayload/curses/keyboard.c')
-rw-r--r--payloads/libpayload/curses/keyboard.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/payloads/libpayload/curses/keyboard.c b/payloads/libpayload/curses/keyboard.c
index cfb7b769d72b..5fc54224a0f3 100644
--- a/payloads/libpayload/curses/keyboard.c
+++ b/payloads/libpayload/curses/keyboard.c
@@ -44,6 +44,7 @@ static int _halfdelay = 0;
/* ============== Serial ==================== */
+#ifdef CONFIG_SERIAL_CONSOLE
/* We treat serial like a vt100 terminal. For now we
do the cooking in here, but we should probably eventually
pass it to dedicated vt100 code */
@@ -135,6 +136,7 @@ static int cook_serial(unsigned char ch)
return ch;
}
}
+#endif
/* ================ Keyboard ================ */
@@ -215,8 +217,14 @@ void curses_enable_vga(int state)
else
curses_flags &= ~F_ENABLE_CONSOLE;
}
+
+int curses_vga_enabled(void)
+{
+ return (curses_flags & F_ENABLE_CONSOLE) != 0;
+}
#else
void curses_enable_vga(int state) { }
+int curses_vga_enabled(void) { return 0; }
#endif
#ifdef CONFIG_SERIAL_CONSOLE
@@ -227,7 +235,14 @@ void curses_enable_serial(int state)
else
curses_flags &= ~F_ENABLE_SERIAL;
}
+
+int curses_serial_enabled(void)
+{
+ return (curses_flags & F_ENABLE_SERIAL) != 0;
+}
+
#else
void curses_enable_serial(int state) { }
+int curses_serial_enabled(void) { return 0; }
#endif