* 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
This commit is contained in:
Stefan Reinauer
2008-09-26 18:36:26 +00:00
committed by Stefan Reinauer
parent 96bcc53071
commit e75c3d85a3
5 changed files with 141 additions and 34 deletions

View File

@ -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