Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion src/kernel/lowlevel.c
Original file line number Diff line number Diff line change
Expand Up @@ -608,6 +608,12 @@ static pmgr_reg_t *gPMGRreg = NULL;
static pmgr_map_t *gPMGRmap = NULL;
static pmgr_dev_t *gPMGRdev = NULL;

void crash_cmd() {
disable_interrupts();
((void (*)(void))0x41414141)();
panic("didn't crash?!");
}

void pmgr_init()
{
dt_node_t *pmgr = dt_get("/arm-io/pmgr");
Expand All @@ -620,7 +626,7 @@ void pmgr_init()
gPMGRBase = gIOBase + gPMGRreg[0].addr;
gWDTBase = gIOBase + dt_get_u64_prop("wdt", "reg");
command_register("reset", "resets the device", wdt_reset);
command_register("crash", "branches to an invalid address", (void*)0x41414141);
command_register("crash", "branches to an invalid address", crash_cmd);
}
void interrupt_init() {
gInterruptBase = dt_get_u32_prop("aic", "reg");
Expand Down