summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRouven Czerwinski <r.czerwinski@pengutronix.de>2019-08-06 07:11:02 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2019-08-07 09:42:15 +0200
commit6ca22c92e949619395d0c186cdb78a37ec2c9201 (patch)
tree0d747a5c6c7ef4bb0bd9f23ac9684447768f1cc0
parent896acd4688b62a4d3f75f9e7e3c4f1ef6a6c4b63 (diff)
downloadbarebox-6ca22c92e949619395d0c186cdb78a37ec2c9201.tar.gz
pbl: support panic with log output
If panic is called with a string in the PBL, print the panic string before falling into the busy loop. Signed-off-by: Rouven Czerwinski <r.czerwinski@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
-rw-r--r--pbl/misc.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/pbl/misc.c b/pbl/misc.c
index 7e76120..201ae38 100644
--- a/pbl/misc.c
+++ b/pbl/misc.c
@@ -11,5 +11,10 @@ void __noreturn hang(void)
void __noreturn panic(const char *fmt, ...)
{
+ va_list args;
+
+ va_start(args, fmt);
+ printf(fmt, args);
+ va_end(args);
while(1);
}