assert.c 585 Bytes
Newer Older
1
/*
2
 * Copyright (c) 2013-2017, ARM Limited and Contributors. All rights reserved.
3
 *
dp-arm's avatar
dp-arm committed
4
 * SPDX-License-Identifier: BSD-3-Clause
5
6
 */

7
#include <console.h>
8
#include <debug.h>
9
#include <platform.h>
10

11
void __assert(const char *function, const char *file, unsigned int line,
12
13
		const char *assertion)
{
14
15
16
17
18
#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.
	 */
Dan Handley's avatar
Dan Handley committed
19
	tf_printf("ASSERT: %s <%d> : %s\n", function, line, assertion);
20
21

	console_flush();
22
#endif
23

24
	plat_panic_handler();
25
}