aboutsummaryrefslogtreecommitdiffstats
path: root/core/kaboom.c
blob: 0b025dd080ed800905d09ab1e0fd9a9fa124d38a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
/*
 * kaboom.c
 */

#include "core.h"

#ifdef CORE_DEBUG

#include <dprintf.h>

__noreturn __bad_SEG(const volatile void *p)
{
    dprintf("SEG() passed an invalid pointer: %p\n", p);
    kaboom();
}

#endif

#undef kaboom

__export __noreturn _kaboom(void)
{
    extern void kaboom(void);
    call16(kaboom, &zero_regs, NULL);
    /* Do this if kaboom somehow returns... */
    for (;;)
	asm volatile("hlt");
}