Subversion Repositories HelenOS

Compare Revisions

Ignore whitespace Rev 3124 → Rev 3125

/branches/tracing/kernel/arch/arm32/src/exception.c
292,30 → 292,6
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.
380,8 → 356,7
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_exception);
exc_register(EXC_DATA_ABORT, "data abort", (iroutine) data_abort);
exc_register(EXC_SWI, "software interrupt", (iroutine) swi_exception);
}
 
/branches/tracing/kernel/arch/arm32/src/mm/page_fault.c
192,6 → 192,30
}
}
 
/** Check whether the abort was caused by a bkpt instruction.
*
* This must be called after (possibly) fetching the faulting page.
*
* TODO: When paging-out is implemented, make sure the page
* is still present when reading the instruction (we don't want
* to trigger another exception).
*/
static void bkpt_check(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);
}
}
}
 
/** Handles "prefetch abort" exception (instruction couldn't be executed).
*
* @param exc_no Exception number.
207,6 → 231,9
panic("page fault - prefetch_abort at address: %x\n",
istate->pc);
}
 
/* Now check if the abort was caused by a breakpoint instruction */
bkpt_check(istate);
}
 
/** @}