3b77b723ca
PDCurses provides an alternative implementation of the curses library standard in addition to tinycurses. Where tinycurses is really tiny, PDCurses is more complete and provides virtually unlimited windows and the full API. The PDCurses code is brought in "vanilla", with all local changes residing in curses/pdcurses-backend/ In addition to a curses library, this change also provides libpanel (as part of the PDCurses code), and libform and libmenu which were derived from ncurses-5.9. As they rely on ncurses internals (and PDCurses is not ncurses), more changes were required for these libraries to work. The build system is extended to install the right set of header files depending on the selected curses implementation. Change-Id: I9e5b920f94b6510da01da2f656196a993170d1c5 Signed-off-by: Patrick Georgi <patrick.georgi@secunet.com> Reviewed-on: http://review.coreboot.org/106 Tested-by: build bot (Jenkins) Reviewed-by: Marc Jones <marcj303@gmail.com>
49 lines
899 B
C
49 lines
899 B
C
/* Public Domain Curses */
|
|
/* This file is BSD licensed, Copyright 2011 secunet AG */
|
|
|
|
#include "lppdc.h"
|
|
#include <libpayload.h>
|
|
|
|
int curses_flags = F_ENABLE_SERIAL | F_ENABLE_CONSOLE;
|
|
|
|
void PDC_beep(void)
|
|
{
|
|
PDC_LOG(("PDC_beep() - called\n"));
|
|
|
|
#ifdef CONFIG_SPEAKER
|
|
speaker_tone(1760, 500); /* 1760 == note A6 */
|
|
#endif
|
|
}
|
|
|
|
void PDC_napms(int ms)
|
|
{
|
|
PDC_LOG(("PDC_napms() - called: ms=%d\n", ms));
|
|
|
|
mdelay(ms);
|
|
}
|
|
|
|
const char *PDC_sysname(void)
|
|
{
|
|
return "LIBPAYLOAD";
|
|
}
|
|
|
|
void curses_enable_serial(int enable)
|
|
{
|
|
curses_flags = (curses_flags & ~F_ENABLE_SERIAL) | (enable * F_ENABLE_SERIAL);
|
|
}
|
|
|
|
void curses_enable_vga(int enable)
|
|
{
|
|
curses_flags = (curses_flags & ~F_ENABLE_CONSOLE) | (enable * F_ENABLE_CONSOLE);
|
|
}
|
|
|
|
int curses_serial_enabled()
|
|
{
|
|
return !!(curses_flags & F_ENABLE_SERIAL);
|
|
}
|
|
|
|
int curses_vga_enabled()
|
|
{
|
|
return !!(curses_flags & F_ENABLE_CONSOLE);
|
|
}
|
|
|