Subversion Repositories HelenOS

Rev

Rev 3123 | Rev 3424 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 3123 Rev 3125
Line 290... Line 290...
290
{
290
{
291
    istate->r0 = syscall_handler(istate->r0, istate->r1, istate->r2,
291
    istate->r0 = syscall_handler(istate->r0, istate->r1, istate->r2,
292
        istate->r3, istate->r4, istate->r5, istate->r6);
292
        istate->r3, istate->r4, istate->r5, istate->r6);
293
}
293
}
294
 
294
 
295
/** Data abort exception handler.
-
 
296
 *
-
 
297
 * Determines whether the exception was caused by a breakpoint
-
 
298
 * instruction or a page fault.
-
 
299
 */
-
 
300
static void data_abort_exception(int exc_no, istate_t *istate)
-
 
301
{
-
 
302
    uint32_t *instr_addr = (uint32_t *) istate->pc;
-
 
303
    uint32_t opcode = *instr_addr;
-
 
304
 
-
 
305
    if ((opcode & 0xfff000f0) == 0xe1200070) {
-
 
306
        /* Bkpt */
-
 
307
        if (istate_from_uspace(istate)) {
-
 
308
            udebug_breakpoint_event(0);
-
 
309
        } else {
-
 
310
            panic("Unexpected BKPT instruction at 0x%x",
-
 
311
                istate->pc);
-
 
312
        }
-
 
313
    } else {
-
 
314
        /* Page fault */
-
 
315
        data_abort(exc_no, istate);
-
 
316
    }
-
 
317
}
-
 
318
 
-
 
319
/** Interrupt Exception handler.
295
/** Interrupt Exception handler.
320
 *
296
 *
321
 * Determines the sources of interrupt and calls their handlers.
297
 * Determines the sources of interrupt and calls their handlers.
322
 */
298
 */
323
static void irq_exception(int exc_no, istate_t *istate)
299
static void irq_exception(int exc_no, istate_t *istate)
Line 378... Line 354...
378
    install_exception_handlers();
354
    install_exception_handlers();
379
   
355
   
380
    exc_register(EXC_IRQ, "interrupt", (iroutine) irq_exception);
356
    exc_register(EXC_IRQ, "interrupt", (iroutine) irq_exception);
381
    exc_register(EXC_PREFETCH_ABORT, "prefetch abort",
357
    exc_register(EXC_PREFETCH_ABORT, "prefetch abort",
382
        (iroutine) prefetch_abort);
358
        (iroutine) prefetch_abort);
383
    exc_register(EXC_DATA_ABORT, "data abort",
359
    exc_register(EXC_DATA_ABORT, "data abort", (iroutine) data_abort);
384
        (iroutine) data_abort_exception);
-
 
385
    exc_register(EXC_SWI, "software interrupt", (iroutine) swi_exception);
360
    exc_register(EXC_SWI, "software interrupt", (iroutine) swi_exception);
386
}
361
}
387
 
362
 
388
/** Prints #istate_t structure content.
363
/** Prints #istate_t structure content.
389
 *
364
 *