1 | /* |
---|
2 | * Interrupt handler Header file |
---|
3 | * |
---|
4 | * Copyright (c) 2004 by Jay Monkman <jtm@lopingdog.com> |
---|
5 | * |
---|
6 | * The license and distribution terms for this file may be |
---|
7 | * found in the file LICENSE in this distribution or at |
---|
8 | * |
---|
9 | * http://www.rtems.com/license/LICENSE. |
---|
10 | * |
---|
11 | * |
---|
12 | * $Id$ |
---|
13 | */ |
---|
14 | |
---|
15 | #ifndef __IRQ_H__ |
---|
16 | #define __IRQ_H__ |
---|
17 | |
---|
18 | #ifdef __cplusplus |
---|
19 | extern "C" { |
---|
20 | #endif |
---|
21 | |
---|
22 | #ifndef __asm__ |
---|
23 | |
---|
24 | /* |
---|
25 | * Include some preprocessor value also used by assember code |
---|
26 | */ |
---|
27 | |
---|
28 | #include <rtems.h> |
---|
29 | #include <at91rm9200.h> |
---|
30 | |
---|
31 | extern void default_int_handler(); |
---|
32 | /*********************************************************************** |
---|
33 | * Constants |
---|
34 | **********************************************************************/ |
---|
35 | /* possible interrupt sources on the AT91RM9200 */ |
---|
36 | #define AT91RM9200_INT_FIQ 0 |
---|
37 | #define AT91RM9200_INT_SYSIRQ 1 |
---|
38 | #define AT91RM9200_INT_PIOA 2 |
---|
39 | #define AT91RM9200_INT_PIOB 3 |
---|
40 | #define AT91RM9200_INT_PIOC 4 |
---|
41 | #define AT91RM9200_INT_PIOD 5 |
---|
42 | #define AT91RM9200_INT_US0 6 |
---|
43 | #define AT91RM9200_INT_US1 7 |
---|
44 | #define AT91RM9200_INT_US2 8 |
---|
45 | #define AT91RM9200_INT_US3 9 |
---|
46 | #define AT91RM9200_INT_MCI 10 |
---|
47 | #define AT91RM9200_INT_UDP 11 |
---|
48 | #define AT91RM9200_INT_TWI 12 |
---|
49 | #define AT91RM9200_INT_SPI 13 |
---|
50 | #define AT91RM9200_INT_SSC0 14 |
---|
51 | #define AT91RM9200_INT_SSC1 15 |
---|
52 | #define AT91RM9200_INT_SSC2 16 |
---|
53 | #define AT91RM9200_INT_TC0 17 |
---|
54 | #define AT91RM9200_INT_TC1 18 |
---|
55 | #define AT91RM9200_INT_TC2 19 |
---|
56 | #define AT91RM9200_INT_TC3 20 |
---|
57 | #define AT91RM9200_INT_TC4 21 |
---|
58 | #define AT91RM9200_INT_TC5 22 |
---|
59 | #define AT91RM9200_INT_UHP 23 |
---|
60 | #define AT91RM9200_INT_EMAC 24 |
---|
61 | #define AT91RM9200_INT_IRQ0 25 |
---|
62 | #define AT91RM9200_INT_IRQ1 26 |
---|
63 | #define AT91RM9200_INT_IRQ2 27 |
---|
64 | #define AT91RM9200_INT_IRQ3 28 |
---|
65 | #define AT91RM9200_INT_IRQ4 28 |
---|
66 | #define AT91RM9200_INT_IRQ5 30 |
---|
67 | #define AT91RM9200_INT_IRQ6 31 |
---|
68 | #define AT91RM9200_MAX_INT 32 |
---|
69 | |
---|
70 | /* vector table used by shared/irq_init.c */ |
---|
71 | /* we can treat the AT91RM9200 AIC_SVR_BASE as */ |
---|
72 | /* a vector table */ |
---|
73 | #define VECTOR_TABLE AIC_SVR_BASE |
---|
74 | |
---|
75 | typedef unsigned char rtems_irq_level; |
---|
76 | typedef unsigned char rtems_irq_trigger; |
---|
77 | |
---|
78 | struct __rtems_irq_connect_data__; /* forward declaratiuon */ |
---|
79 | typedef unsigned int rtems_irq_number; |
---|
80 | typedef void (*rtems_irq_hdl) (uint32_t vector); |
---|
81 | typedef void (*rtems_irq_enable) (const struct __rtems_irq_connect_data__*); |
---|
82 | typedef void (*rtems_irq_disable) (const struct __rtems_irq_connect_data__*); |
---|
83 | typedef int (*rtems_irq_is_enabled)(const struct __rtems_irq_connect_data__*); |
---|
84 | |
---|
85 | typedef struct __rtems_irq_connect_data__ { |
---|
86 | /* IRQ line */ |
---|
87 | rtems_irq_number name; |
---|
88 | |
---|
89 | /* Handler */ |
---|
90 | rtems_irq_hdl hdl; |
---|
91 | |
---|
92 | /* function for enabling interrupts at device level. */ |
---|
93 | rtems_irq_enable on; |
---|
94 | |
---|
95 | /* function for disabling interrupts at device level. */ |
---|
96 | rtems_irq_disable off; |
---|
97 | |
---|
98 | /* Function to test if interrupt is enabled */ |
---|
99 | rtems_irq_is_enabled isOn; |
---|
100 | |
---|
101 | /* priority level of interrupt */ |
---|
102 | rtems_irq_level irqLevel; |
---|
103 | |
---|
104 | /* Trigger method (rising/falling edge or high/low level) */ |
---|
105 | rtems_irq_trigger irqTrigger; |
---|
106 | } rtems_irq_connect_data; |
---|
107 | |
---|
108 | /* |
---|
109 | * function to initialize the interrupt for a specific BSP |
---|
110 | */ |
---|
111 | void BSP_rtems_irq_mngt_init(); |
---|
112 | |
---|
113 | |
---|
114 | /* |
---|
115 | * function to connect a particular irq handler. |
---|
116 | */ |
---|
117 | int BSP_install_rtems_irq_handler (const rtems_irq_connect_data*); |
---|
118 | |
---|
119 | /* |
---|
120 | * function to get the current RTEMS irq handler for ptr->name. |
---|
121 | */ |
---|
122 | int BSP_get_current_rtems_irq_handler (rtems_irq_connect_data* ptr); |
---|
123 | |
---|
124 | /* |
---|
125 | * function to disconnect the RTEMS irq handler for ptr->name. |
---|
126 | */ |
---|
127 | int BSP_remove_rtems_irq_handler (const rtems_irq_connect_data*); |
---|
128 | |
---|
129 | #endif /* __asm__ */ |
---|
130 | |
---|
131 | #ifdef __cplusplus |
---|
132 | } |
---|
133 | #endif |
---|
134 | |
---|
135 | #endif /* __IRQ_H__ */ |
---|