2013-12-17 18:19:04 +00:00
|
|
|
/*
|
2017-02-16 16:17:19 +00:00
|
|
|
* Copyright (c) 2013-2017, ARM Limited and Contributors. All rights reserved.
|
2013-12-17 18:19:04 +00:00
|
|
|
*
|
2017-05-03 09:38:09 +01:00
|
|
|
* SPDX-License-Identifier: BSD-3-Clause
|
2013-12-17 18:19:04 +00:00
|
|
|
*/
|
|
|
|
|
2017-02-16 16:17:19 +00:00
|
|
|
#include <console.h>
|
2014-06-12 17:23:58 +01:00
|
|
|
#include <debug.h>
|
2017-02-16 16:17:19 +00:00
|
|
|
#include <platform.h>
|
2013-12-17 18:19:04 +00:00
|
|
|
|
2017-04-18 15:16:05 +01:00
|
|
|
void __assert(const char *function, const char *file, unsigned int line,
|
2013-12-17 18:19:04 +00:00
|
|
|
const char *assertion)
|
|
|
|
{
|
2017-04-18 15:16:05 +01:00
|
|
|
#if LOG_LEVEL >= LOG_LEVEL_INFO
|
|
|
|
/*
|
|
|
|
* Only print the output if LOG_LEVEL is higher or equal to
|
|
|
|
* LOG_LEVEL_INFO, which is the default value for builds with DEBUG=1.
|
|
|
|
*/
|
2014-07-29 17:14:00 +01:00
|
|
|
tf_printf("ASSERT: %s <%d> : %s\n", function, line, assertion);
|
2017-02-16 16:17:19 +00:00
|
|
|
|
|
|
|
console_flush();
|
2017-04-18 15:16:05 +01:00
|
|
|
#endif
|
2017-02-16 16:17:19 +00:00
|
|
|
|
2017-02-16 16:49:18 +00:00
|
|
|
plat_panic_handler();
|
2013-12-17 18:19:04 +00:00
|
|
|
}
|