Harry Liebel | 0f702c6 | 2013-12-17 18:19:04 +0000 | [diff] [blame] | 1 | /* |
Antonio Nino Diaz | e3962d0 | 2017-02-16 16:17:19 +0000 | [diff] [blame] | 2 | * Copyright (c) 2013-2017, ARM Limited and Contributors. All rights reserved. |
Harry Liebel | 0f702c6 | 2013-12-17 18:19:04 +0000 | [diff] [blame] | 3 | * |
dp-arm | fa3cf0b | 2017-05-03 09:38:09 +0100 | [diff] [blame] | 4 | * SPDX-License-Identifier: BSD-3-Clause |
Harry Liebel | 0f702c6 | 2013-12-17 18:19:04 +0000 | [diff] [blame] | 5 | */ |
| 6 | |
Antonio Nino Diaz | e3962d0 | 2017-02-16 16:17:19 +0000 | [diff] [blame] | 7 | #include <console.h> |
Soby Mathew | afe7e2f | 2014-06-12 17:23:58 +0100 | [diff] [blame] | 8 | #include <debug.h> |
Antonio Nino Diaz | e3962d0 | 2017-02-16 16:17:19 +0000 | [diff] [blame] | 9 | #include <platform.h> |
Harry Liebel | 0f702c6 | 2013-12-17 18:19:04 +0000 | [diff] [blame] | 10 | |
Antonio Nino Diaz | 808c229 | 2017-04-18 15:16:05 +0100 | [diff] [blame] | 11 | void __assert(const char *function, const char *file, unsigned int line, |
Harry Liebel | 0f702c6 | 2013-12-17 18:19:04 +0000 | [diff] [blame] | 12 | const char *assertion) |
| 13 | { |
Antonio Nino Diaz | 808c229 | 2017-04-18 15:16:05 +0100 | [diff] [blame] | 14 | #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 Handley | 91b624e | 2014-07-29 17:14:00 +0100 | [diff] [blame] | 19 | tf_printf("ASSERT: %s <%d> : %s\n", function, line, assertion); |
Antonio Nino Diaz | e3962d0 | 2017-02-16 16:17:19 +0000 | [diff] [blame] | 20 | |
| 21 | console_flush(); |
Antonio Nino Diaz | 808c229 | 2017-04-18 15:16:05 +0100 | [diff] [blame] | 22 | #endif |
Antonio Nino Diaz | e3962d0 | 2017-02-16 16:17:19 +0000 | [diff] [blame] | 23 | |
Antonio Nino Diaz | e98fa3a | 2017-02-16 16:49:18 +0000 | [diff] [blame] | 24 | plat_panic_handler(); |
Harry Liebel | 0f702c6 | 2013-12-17 18:19:04 +0000 | [diff] [blame] | 25 | } |