Imre Kis | e6d7341 | 2021-10-18 14:01:47 +0200 | [diff] [blame] | 1 | // SPDX-License-Identifier: BSD-3-Clause |
| 2 | /* |
| 3 | * Copyright (c) 2021, Arm Limited and Contributors. All rights reserved. |
| 4 | */ |
| 5 | |
| 6 | #include <assert.h> |
| 7 | #include "compiler.h" |
| 8 | #include "trace.h" |
| 9 | |
| 10 | /* |
| 11 | * The generic trace function called on assert fail. |
| 12 | */ |
| 13 | void __noreturn __assert_func(const char *file, int line, const char *func, const char *failedexpr) |
| 14 | { |
| 15 | #if TRACE_LEVEL >= TRACE_LEVEL_ERROR |
| 16 | trace_printf(func, line, TRACE_LEVEL_ERROR, "assertion %s failed", failedexpr); |
| 17 | #endif /* TRACE_LEVEL */ |
| 18 | |
| 19 | while (1) |
| 20 | ; |
| 21 | } |