Subversion Repositories HelenOS

Compare Revisions

Ignore whitespace Rev 3122 → Rev 3123

/branches/tracing/kernel/arch/arm32/src/exception.c
42,6 → 42,7
#include <arch/mm/page_fault.h>
#include <print.h>
#include <syscall/syscall.h>
#include <udebug/udebug.h>
 
/** Offset used in calculation of exception handler's relative address.
*
291,6 → 292,30
istate->r3, istate->r4, istate->r5, istate->r6);
}
 
/** Data abort exception handler.
*
* Determines whether the exception was caused by a breakpoint
* instruction or a page fault.
*/
static void data_abort_exception(int exc_no, istate_t *istate)
{
uint32_t *instr_addr = (uint32_t *) istate->pc;
uint32_t opcode = *instr_addr;
 
if ((opcode & 0xfff000f0) == 0xe1200070) {
/* Bkpt */
if (istate_from_uspace(istate)) {
udebug_breakpoint_event(0);
} else {
panic("Unexpected BKPT instruction at 0x%x",
istate->pc);
}
} else {
/* Page fault */
data_abort(exc_no, istate);
}
}
 
/** Interrupt Exception handler.
*
* Determines the sources of interrupt and calls their handlers.
355,7 → 380,8
exc_register(EXC_IRQ, "interrupt", (iroutine) irq_exception);
exc_register(EXC_PREFETCH_ABORT, "prefetch abort",
(iroutine) prefetch_abort);
exc_register(EXC_DATA_ABORT, "data abort", (iroutine) data_abort);
exc_register(EXC_DATA_ABORT, "data abort",
(iroutine) data_abort_exception);
exc_register(EXC_SWI, "software interrupt", (iroutine) swi_exception);
}