1 | /** |
---|
2 | * @file irq_init.c |
---|
3 | * |
---|
4 | * This file contains the implementation of rtems initialization |
---|
5 | * related to interrupt handling. |
---|
6 | */ |
---|
7 | /* |
---|
8 | * RTEMS GBA BSP |
---|
9 | * |
---|
10 | * CopyRight (C) 2000 Canon Research Centre France SA. |
---|
11 | * Emmanuel Raguet, mailto:raguet@crf.canon.fr |
---|
12 | * |
---|
13 | * Copyright (c) 2004 Markku Puro <markku.puro@kopteri.net> |
---|
14 | * |
---|
15 | * The license and distribution terms for this file may be |
---|
16 | * found in found in the file LICENSE in this distribution or at |
---|
17 | * http://www.rtems.com/license/LICENSE. |
---|
18 | * |
---|
19 | * $Id$ |
---|
20 | */ |
---|
21 | #include <stdint.h> |
---|
22 | #include <bsp.h> |
---|
23 | #include <irq.h> |
---|
24 | #include <rtems/bspIo.h> |
---|
25 | |
---|
26 | /** default int vector */ |
---|
27 | extern void _ISR_Handler(void); |
---|
28 | |
---|
29 | /** max number of vectors, defined in linkcmds */ |
---|
30 | extern void _irq_max_vector; |
---|
31 | |
---|
32 | /** |
---|
33 | * @brief default_int_handler BSP routine is default int_handler |
---|
34 | * |
---|
35 | * @param None |
---|
36 | * @return None |
---|
37 | */ |
---|
38 | void default_int_handler(void) |
---|
39 | { |
---|
40 | printk("raw_idt_notify has been called \n"); |
---|
41 | } |
---|
42 | |
---|
43 | /** |
---|
44 | * @brief rtems_irq_mngt_init BSP routine initialize rtems_irq_mngt |
---|
45 | * |
---|
46 | * @param None |
---|
47 | * @return None |
---|
48 | */ |
---|
49 | void rtems_irq_mngt_init(void) |
---|
50 | { |
---|
51 | int i; |
---|
52 | uint32_t *vectorTable; |
---|
53 | rtems_interrupt_level level; |
---|
54 | |
---|
55 | vectorTable = (uint32_t *)VECTOR_TABLE; |
---|
56 | |
---|
57 | rtems_interrupt_disable(level); |
---|
58 | |
---|
59 | /* @todo Can't use exception vectors in GBA because they are already in GBA ROM BIOS */ |
---|
60 | /* First, connect the ISR_Handler for IRQ and FIQ interrupts */ |
---|
61 | /*_CPU_ISR_install_vector(ARM_EXCEPTION_IRQ, _ISR_Handler, NULL);*/ |
---|
62 | /*_CPU_ISR_install_vector(ARM_EXCEPTION_FIQ, _ISR_Handler, NULL);*/ |
---|
63 | |
---|
64 | /* Initialize the vector table contents with default handler */ |
---|
65 | for (i=0 ; i < (uint32_t)&_irq_max_vector ; i++) { |
---|
66 | *(vectorTable + i) = (uint32_t)(default_int_handler); |
---|
67 | } |
---|
68 | /* Initialize the INT at the BSP level */ |
---|
69 | BSP_rtems_irq_mngt_init(); |
---|
70 | } |
---|
71 | |
---|