1 /*
2 * Copyright 2014, General Dynamics C4 Systems
3 *
4 * SPDX-License-Identifier: GPL-2.0-only
5 */
6
7 #include <assert.h>
8 #include <machine/io.h>
9
10 #ifdef CONFIG_DEBUG_BUILD
11
_fail(const char * s,const char * file,unsigned int line,const char * function)12 void _fail(
13 const char *s,
14 const char *file,
15 unsigned int line,
16 const char *function)
17 {
18 printf(
19 "seL4 called fail at %s:%u in function %s, saying \"%s\"\n",
20 file,
21 line,
22 function,
23 s
24 );
25 halt();
26 }
27
_assert_fail(const char * assertion,const char * file,unsigned int line,const char * function)28 void _assert_fail(
29 const char *assertion,
30 const char *file,
31 unsigned int line,
32 const char *function)
33 {
34 printf("seL4 failed assertion '%s' at %s:%u in function %s\n",
35 assertion,
36 file,
37 line,
38 function
39 );
40 halt();
41 }
42
43 #endif
44