Subversion Repositories HelenOS

Rev

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

Rev 2306 Rev 2326
Line 32... Line 32...
32
/** @file
32
/** @file
33
    @brief  Exception handlers and exception initialization routines.
33
    @brief  Exception handlers and exception initialization routines.
34
 */
34
 */
35
 
35
 
36
#include <arch/exception.h>
36
#include <arch/exception.h>
37
#include <arch/debug_print/print.h>
37
#include <arch/debug/print.h>
38
#include <arch/memstr.h>
38
#include <arch/memstr.h>
39
#include <arch/regutils.h>
39
#include <arch/regutils.h>
40
#include <interrupt.h>
40
#include <interrupt.h>
41
#include <arch/machine.h>
41
#include <arch/machine.h>
42
#include <arch/mm/page_fault.h>
42
#include <arch/mm/page_fault.h>
Line 305... Line 305...
305
   
305
   
306
    asm volatile( "mcr p15, 0, %0, c1, c1" : : "r" (control_reg));
306
    asm volatile( "mcr p15, 0, %0, c1, c1" : : "r" (control_reg));
307
}
307
}
308
#endif
308
#endif
309
 
309
 
-
 
310
 
310
/** Initializes exception handling.
311
/** Initializes exception handling.
311
 *
312
 *
312
 * Installs low-level exception handlers and then registers
313
 * Installs low-level exception handlers and then registers
313
 * exceptions and their handlers to kernel exception dispatcher.
314
 * exceptions and their handlers to kernel exception dispatcher.
314
 */
315
 */
Line 324... Line 325...
324
    exc_register(EXC_DATA_ABORT, "data abort", (iroutine) data_abort);
325
    exc_register(EXC_DATA_ABORT, "data abort", (iroutine) data_abort);
325
    exc_register(EXC_SWI, "software interrupt", (iroutine) swi_exception);
326
    exc_register(EXC_SWI, "software interrupt", (iroutine) swi_exception);
326
    /* TODO add next */
327
    /* TODO add next */
327
}
328
}
328
 
329
 
-
 
330
 
329
/** Sets stack pointers in all supported exception modes.
331
/** Sets stack pointers in all supported exception modes.
330
 *
-
 
331
 * @param stack_ptr stack pointer
-
 
332
 */
332
 */
333
void setup_exception_stacks()
333
void setup_exception_stacks()
334
{
334
{
335
        /* switch to particular mode and set "r13" there */
335
        /* switch to particular mode and set "r13" there */
336
 
336
 
Line 351... Line 351...
351
        /* TODO if you want to test other exceptions than IRQ,
351
        /* TODO if you want to test other exceptions than IRQ,
352
        make stack analogous to irq_stack (in start.S),
352
        make stack analogous to irq_stack (in start.S),
353
        and then set stack pointer here */
353
        and then set stack pointer here */
354
 
354
 
355
        current_status_reg_control_write(cspr);
355
        current_status_reg_control_write(cspr);
356
 
-
 
357
}
356
}
358
 
357
 
359
 
358
 
-
 
359
/** Prints #istate_t structure content.
-
 
360
 *
-
 
361
 * @param istate Structure to be printed.
-
 
362
 */
360
void print_istate(istate_t *istate)
363
void print_istate(istate_t *istate)
361
{
364
{
362
    dprintf("istate dump:\n");
365
    dprintf("istate dump:\n");
363
 
366
 
364
    dprintf(" r0: %x    r1: %x    r2: %x    r3: %x\n",
367
    dprintf(" r0: %x    r1: %x    r2: %x    r3: %x\n",