aboutsummaryrefslogtreecommitdiff
path: root/core/utils.c
diff options
context:
space:
mode:
Diffstat (limited to 'core/utils.c')
-rw-r--r--core/utils.c26
1 files changed, 11 insertions, 15 deletions
diff --git a/core/utils.c b/core/utils.c
index 728cea4..8fd63fc 100644
--- a/core/utils.c
+++ b/core/utils.c
@@ -13,28 +13,24 @@
#include <cpu.h>
#include <stack.h>
-void __noreturn assert_fail(const char *msg)
-{
- /**
- * @fwts-label FailedAssert
- * @fwts-advice OPAL hit an assert(). During normal usage (even
- * testing) we should never hit an assert. There are other code
- * paths for controlled shutdown/panic in the event of catastrophic
- * errors.
- */
- prlog(PR_EMERG, "Assert fail: %s\n", msg);
- _abort(msg);
-}
-
-void __noreturn _abort(const char *msg)
+void __noreturn assert_fail(const char *msg, const char *file,
+ unsigned int line, const char *function)
{
static bool in_abort = false;
+ (void)function;
if (in_abort)
for (;;) ;
in_abort = true;
- prlog(PR_EMERG, "Aborting!\n");
+ /**
+ * @fwts-label FailedAssert2
+ * @fwts-advice OPAL hit an assert(). During normal usage (even
+ * testing) we should never hit an assert. There are other code
+ * paths for controlled shutdown/panic in the event of catastrophic
+ * errors.
+ */
+ prlog(PR_EMERG, "assert failed at %s:%u: %s\n", file, line, msg);
backtrace();
if (platform.terminate)