* add readline()
authorStefan Reinauer <stepan@coresystems.de>
Tue, 19 Aug 2008 17:47:18 +0000 (17:47 +0000)
committerStefan Reinauer <stepan@openbios.org>
Tue, 19 Aug 2008 17:47:18 +0000 (17:47 +0000)
* add fatal()

Signed-off-by: Stefan Reinauer <stepan@coresystems.de>
Signed-off-by: Patrick Georgi <patrick.georgi@coresystems.de>
Acked-by: Jordan Crouse <jordan.crouse@amd.com>
git-svn-id: svn://svn.coreboot.org/coreboot/trunk@3522 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1

payloads/libpayload/include/libpayload.h
payloads/libpayload/libc/Makefile.inc
payloads/libpayload/libc/lib.c

index 516bcc38ffc48dfb8fad5686d17e3a442447a0a0..b7f7fe0276d99be7e273153063f8d87507e2952b 100644 (file)
@@ -298,5 +298,10 @@ void delay(unsigned int n);
 /* i386/util.S */
 #define abort() halt()
 void halt(void) __attribute__ ((noreturn));
+void fatal(const char* msg) __attribute__ ((noreturn));
+
+/* libc/readline.c */
+char * readline(const char * prompt);
+int getline(char *buffer, int len)
 
 #endif
index bc82c9bc390e139da8ae09ec7762f4cd11e1aafe..a4cd1bce6f9897f7d7a3fab6cce8a17ee4488abd 100644 (file)
@@ -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
index e7eed68eb6cc485448c7cd251786b0fe56d15317..3f82acf3786f876b774e2195206873063cc758de 100644 (file)
@@ -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();
+}
+