blob: 5220ad8f44f91440efb16a34228173608f797c82 [file] [log] [blame]
Harry Liebel0f702c62013-12-17 18:19:04 +00001/*
Antonio Nino Diaz0b326282017-02-16 16:17:19 +00002 * Copyright (c) 2013-2017, ARM Limited and Contributors. All rights reserved.
Harry Liebel0f702c62013-12-17 18:19:04 +00003 *
dp-arm82cb2c12017-05-03 09:38:09 +01004 * SPDX-License-Identifier: BSD-3-Clause
Harry Liebel0f702c62013-12-17 18:19:04 +00005 */
6
Antonio Nino Diaz0b326282017-02-16 16:17:19 +00007#include <console.h>
Soby Mathewb79af932014-06-12 17:23:58 +01008#include <debug.h>
Antonio Nino Diaz0b326282017-02-16 16:17:19 +00009#include <platform.h>
Harry Liebel0f702c62013-12-17 18:19:04 +000010
Antonio Nino Diazcc8b5632017-04-18 15:16:05 +010011void __assert(const char *function, const char *file, unsigned int line,
Harry Liebel0f702c62013-12-17 18:19:04 +000012 const char *assertion)
13{
Antonio Nino Diazcc8b5632017-04-18 15:16:05 +010014#if LOG_LEVEL >= LOG_LEVEL_INFO
15 /*
16 * Only print the output if LOG_LEVEL is higher or equal to
17 * LOG_LEVEL_INFO, which is the default value for builds with DEBUG=1.
18 */
Dan Handley6ad2e462014-07-29 17:14:00 +010019 tf_printf("ASSERT: %s <%d> : %s\n", function, line, assertion);
Antonio Nino Diaz0b326282017-02-16 16:17:19 +000020
21 console_flush();
Antonio Nino Diazcc8b5632017-04-18 15:16:05 +010022#endif
Antonio Nino Diaz0b326282017-02-16 16:17:19 +000023
Antonio Nino Diaz1e09ff92017-02-16 16:49:18 +000024 plat_panic_handler();
Harry Liebel0f702c62013-12-17 18:19:04 +000025}