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