/branches/dynload/kernel/generic/include/debug.h |
---|
57,7 → 57,7 |
#ifdef CONFIG_DEBUG |
# define ASSERT(expr) \ |
if (!(expr)) { \ |
panic("assertion failed (%s), caller=%p\n", #expr, CALLER); \ |
panic("Assertion failed (%s), caller=%p.", #expr, CALLER); \ |
} |
#else |
# define ASSERT(expr) |
/branches/dynload/kernel/generic/include/panic.h |
---|
37,11 → 37,11 |
#ifdef CONFIG_DEBUG |
# define panic(format, ...) \ |
panic_printf("Kernel panic in %s() at %s:%u: " format, __func__, \ |
__FILE__, __LINE__, ##__VA_ARGS__); |
panic_printf("Kernel panic in %s() at %s:%u: " format "\n", \ |
__func__, __FILE__, __LINE__, ##__VA_ARGS__); |
#else |
# define panic(format, ...) \ |
panic_printf("Kernel panic: " format, ##__VA_ARGS__); |
panic_printf("Kernel panic: " format "\n", ##__VA_ARGS__); |
#endif |
extern void panic_printf(char *fmt, ...) __attribute__((noreturn)); |
/branches/dynload/kernel/generic/include/interrupt.h |
---|
44,12 → 44,12 |
typedef void (* iroutine)(int n, istate_t *istate); |
#define fault_if_from_uspace(istate, cmd, ...) \ |
#define fault_if_from_uspace(istate, fmt, ...) \ |
{ \ |
if (istate_from_uspace(istate)) { \ |
task_t *task = TASK; \ |
printf("Task %" PRIu64 " killed due to an exception at %p.", task->taskid, istate_get_pc(istate)); \ |
printf(" " cmd, ##__VA_ARGS__); \ |
printf(" " fmt "\n", ##__VA_ARGS__); \ |
task_kill(task->taskid); \ |
thread_exit(); \ |
} \ |