1 // SPDX-License-Identifier: BSD-2-Clause 2 /* 3 * Copyright (c) 2014, STMicroelectronics International N.V. 4 */ 5 6 #include <assert.h> 7 #include <compiler.h> 8 #include <trace.h> 9 #include <kernel/panic.h> 10 11 /* assert log and break for the optee kernel */ 12 13 void __nostackcheck _assert_log(const char *expr __maybe_unused, 14 const char *file __maybe_unused, 15 const int line __maybe_unused, 16 const char *func __maybe_unused) 17 { 18 #if defined(CFG_TEE_CORE_DEBUG) 19 EMSG_RAW("assertion '%s' failed at %s:%d <%s>", 20 expr, file, line, func); 21 #else 22 EMSG_RAW("assertion failed"); 23 #endif 24 } 25 26 void __noreturn _assert_break(void) 27 { 28 panic(); 29 } 30