seL4/src/assert.c
Adrian Danis 0abc720277 s/DEBUG/CONFIG_DEBUG_BUILD/
DEBUG definition is not supposed to be used in the kernel, rather CONFIG_DEBUG_BUILD,
which can be toggled separately to user notion of DEBUG
2017-04-06 10:43:24 +10:00

47 lines
910 B
C

/*
* Copyright 2014, General Dynamics C4 Systems
*
* This software may be distributed and modified according to the terms of
* the GNU General Public License version 2. Note that NO WARRANTY is provided.
* See "LICENSE_GPLv2.txt" for details.
*
* @TAG(GD_GPL)
*/
#include <assert.h>
#include <machine/io.h>
#ifdef CONFIG_DEBUG_BUILD
void _fail(
const char* s,
const char* file,
unsigned int line,
const char* function)
{
printf(
"seL4 called fail at %s:%u in function %s, saying \"%s\"\n",
file,
line,
function,
s
);
halt();
}
void _assert_fail(
const char* assertion,
const char* file,
unsigned int line,
const char* function)
{
printf("seL4 failed assertion '%s' at %s:%u in function %s\n",
assertion,
file,
line,
function
);
halt();
}
#endif