From 0b32628eddfef95b51909816f625e6f37cd21cb8 Mon Sep 17 00:00:00 2001 From: Antonio Nino Diaz Date: Thu, 16 Feb 2017 16:17:19 +0000 Subject: Flush console where necessary Call console_flush() before execution either terminates or leaves an exception level. Fixes: ARM-software/tf-issues#123 Change-Id: I64eeb92effb039f76937ce89f877b68e355588e3 Signed-off-by: Antonio Nino Diaz --- lib/psci/psci_system_off.c | 7 ++++++- lib/stdlib/assert.c | 7 ++++++- 2 files changed, 12 insertions(+), 2 deletions(-) (limited to 'lib') diff --git a/lib/psci/psci_system_off.c b/lib/psci/psci_system_off.c index de9ec643..eb3e7fbc 100644 --- a/lib/psci/psci_system_off.c +++ b/lib/psci/psci_system_off.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2016, 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: @@ -31,6 +31,7 @@ #include #include #include +#include #include #include #include "psci_private.h" @@ -46,6 +47,8 @@ void psci_system_off(void) psci_spd_pm->svc_system_off(); } + console_flush(); + /* Call the platform specific hook */ psci_plat_pm_ops->system_off(); @@ -63,6 +66,8 @@ void psci_system_reset(void) psci_spd_pm->svc_system_reset(); } + console_flush(); + /* Call the platform specific hook */ psci_plat_pm_ops->system_reset(); diff --git a/lib/stdlib/assert.c b/lib/stdlib/assert.c index 90a1afe5..cb3f3550 100644 --- a/lib/stdlib/assert.c +++ b/lib/stdlib/assert.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013-2014, ARM Limited and Contributors. All rights reserved. + * Copyright (c) 2013-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,7 +28,9 @@ * POSSIBILITY OF SUCH DAMAGE. */ +#include #include +#include /* * This is a basic implementation. This could be improved. @@ -37,5 +39,8 @@ void __assert (const char *function, const char *file, unsigned int line, const char *assertion) { tf_printf("ASSERT: %s <%d> : %s\n", function, line, assertion); + + console_flush(); + while(1); } -- cgit v1.2.3 From 1e09ff93444943edcebfb167202f37a5e7913d92 Mon Sep 17 00:00:00 2001 From: Antonio Nino Diaz Date: Thu, 16 Feb 2017 16:49:18 +0000 Subject: Remove dead loops in assert() in C and ASM The desired behaviour is to call `plat_panic_handler()`, and to use `no_ret` to do so from ASM. Change-Id: I88b2feefa6e6c8f9bf057fd51ee0d2e9fb551e4f Signed-off-by: Antonio Nino Diaz --- lib/stdlib/assert.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib') diff --git a/lib/stdlib/assert.c b/lib/stdlib/assert.c index cb3f3550..3486e50b 100644 --- a/lib/stdlib/assert.c +++ b/lib/stdlib/assert.c @@ -42,5 +42,5 @@ void __assert (const char *function, const char *file, unsigned int line, console_flush(); - while(1); + plat_panic_handler(); } -- cgit v1.2.3