From 6e51ceeb2b5eb585fcb244d50b90eb16e97b0fba Mon Sep 17 00:00:00 2001 From: Stefan Reinauer Date: Tue, 19 Aug 2008 17:47:18 +0000 Subject: * add readline() * add fatal() Signed-off-by: Stefan Reinauer Signed-off-by: Patrick Georgi Acked-by: Jordan Crouse git-svn-id: svn://svn.coreboot.org/coreboot/trunk@3522 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1 --- payloads/libpayload/libc/Makefile.inc | 1 + payloads/libpayload/libc/lib.c | 12 ++++++++++++ 2 files changed, 13 insertions(+) (limited to 'payloads/libpayload/libc') diff --git a/payloads/libpayload/libc/Makefile.inc b/payloads/libpayload/libc/Makefile.inc index bc82c9bc39..a4cd1bce6f 100644 --- a/payloads/libpayload/libc/Makefile.inc +++ b/payloads/libpayload/libc/Makefile.inc @@ -31,3 +31,4 @@ TARGETS-$(CONFIG_LIBC) += libc/malloc.o libc/printf.o libc/console.o libc/string.o TARGETS-$(CONFIG_LIBC) += libc/memory.o libc/ctype.o libc/ipchecksum.o libc/lib.o TARGETS-$(CONFIG_LIBC) += libc/rand.o libc/time.o libc/lar.o libc/exec.o +TARGETS-$(CONFIG_LIBC) += libc/readline.o diff --git a/payloads/libpayload/libc/lib.c b/payloads/libpayload/libc/lib.c index e7eed68eb6..3f82acf378 100644 --- a/payloads/libpayload/libc/lib.c +++ b/payloads/libpayload/libc/lib.c @@ -101,3 +101,15 @@ u8 hex2bin(u8 h) ('A' <= h && h <= 'F') ? (h - 'A' + 10) : \ ('a' <= h && h <= 'f') ? (h - 'a' + 10) : 0); } + +/** + * Enters HALT state, after printing msg + * + * @param msg message to print + */ +void fatal(const char *msg) +{ + printf("%s",msg); + halt(); +} + -- cgit v1.2.3