blob: 5a2d42876b16642a712e542f1014d8ac337f9fb3 [file] [log] [blame]
Imre Kise6d73412021-10-18 14:01:47 +02001// 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 */
13void __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}