summaryrefslogtreecommitdiff
path: root/framework
diff options
context:
space:
mode:
authorAntonio Nino Diaz <antonio.ninodiaz@arm.com>2017-04-19 14:02:46 +0100
committerAntonio Nino Diaz <antonio.ninodiaz@arm.com>2017-04-19 14:29:48 +0100
commit179312854c47a4c8e9fb2a94009eda15cb59262c (patch)
tree0ac7cf4d3ef83a9077dd3975bf2dbbed07990baf /framework
parent87cab8cfdf7a62a2c15de93791f5647ac1a7b406 (diff)
Use console_flush before CPU off
Make sure that all text is printed before trying to turn the last CPU off. Also, use console_flush in the panic functions. This is done in case the dead loop is replaced by any other kind of handler in the future. In that case, it is possible that the handler would reinitialize the console, which would clear its the buffer. Change-Id: If36b35f4d77f02afcbb06f4d71442a8a70569ef5 Signed-off-by: Antonio Nino Diaz <antonio.ninodiaz@arm.com>
Diffstat (limited to 'framework')
-rw-r--r--framework/debug.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/framework/debug.c b/framework/debug.c
index 0b9b8d8..eceb9b4 100644
--- a/framework/debug.c
+++ b/framework/debug.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2014, ARM Limited and Contributors. All rights reserved.
+ * Copyright (c) 2014-2017, ARM Limited and Contributors. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
@@ -28,6 +28,7 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
+#include <console.h>
#include <debug.h>
#include <tftf.h>
@@ -35,6 +36,9 @@
void __attribute__((__noreturn__)) do_panic(const char *file, int line)
{
printf("PANIC in file: %s line: %d\n", file, line);
+
+ console_flush();
+
while (1)
continue;
}
@@ -49,6 +53,9 @@ void __attribute__((__noreturn__)) do_bug_unreachable(const char *file, int line
void __attribute__((__noreturn__)) do_panic(void)
{
printf("PANIC\n");
+
+ console_flush();
+
while (1)
continue;
}