blob: 5220ad8f44f91440efb16a34228173608f797c82 [file] [log] [blame]
Harry Liebel0f702c62013-12-17 18:19:04 +00001/*
Antonio Nino Diaze3962d02017-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-armfa3cf0b2017-05-03 09:38:09 +01004 * SPDX-License-Identifier: BSD-3-Clause
Harry Liebel0f702c62013-12-17 18:19:04 +00005 */
6
Antonio Nino Diaze3962d02017-02-16 16:17:19 +00007#include <console.h>
Soby Mathewafe7e2f2014-06-12 17:23:58 +01008#include <debug.h>
Antonio Nino Diaze3962d02017-02-16 16:17:19 +00009#include <platform.h>
Harry Liebel0f702c62013-12-17 18:19:04 +000010
Antonio Nino Diaz808c2292017-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 Diaz808c2292017-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 Handley91b624e2014-07-29 17:14:00 +010019 tf_printf("ASSERT: %s <%d> : %s\n", function, line, assertion);
Antonio Nino Diaze3962d02017-02-16 16:17:19 +000020
21 console_flush();
Antonio Nino Diaz808c2292017-04-18 15:16:05 +010022#endif
Antonio Nino Diaze3962d02017-02-16 16:17:19 +000023
Antonio Nino Diaze98fa3a2017-02-16 16:49:18 +000024 plat_panic_handler();
Harry Liebel0f702c62013-12-17 18:19:04 +000025}