coreboot-kgpe-d16/payloads/libpayload/curses/pdcurses-backend/pdcutil.c
Julius Werner eab2a29c8b payloads: Replace all IS_ENABLED(CONFIG_XXX) with CONFIG(XXX)
This patch is a raw application of

 find payloads/ -type f | \
   xargs sed -i -e 's/IS_ENABLED\s*(CONFIG_/CONFIG(/g'

Change-Id: I883b03b189f59b5d998a09a2596b0391a2d5cf33
Signed-off-by: Julius Werner <jwerner@chromium.org>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/31775
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Patrick Georgi <pgeorgi@google.com>
2019-03-07 17:15:30 +00:00

49 lines
927 B
C

/* Public Domain Curses */
/* This file is BSD licensed, Copyright 2011 secunet AG */
#include "lppdc.h"
#include <curses.h>
#include <libpayload.h>
int curses_flags = F_ENABLE_SERIAL | F_ENABLE_CONSOLE;
void PDC_beep(void)
{
PDC_LOG(("PDC_beep() - called\n"));
#if CONFIG(LP_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(void)
{
return !!(curses_flags & F_ENABLE_SERIAL);
}
int curses_vga_enabled(void)
{
return !!(curses_flags & F_ENABLE_CONSOLE);
}