39 #define INTBASE (0x80020000)
44 #define __INTERRUPT_union(x) \
76 __INTERRUPT_union(INTENABLE);
77 __INTERRUPT_union(INTTYPE);
81 __INTERRUPT_union(INTSRC);
82 __INTERRUPT_union(INTFRC);
83 __INTERRUPT_union(NIPEND);
84 __INTERRUPT_union(FIPEND);
86 #undef __INTERRUPT_union
88 static volatile struct ITC_struct *
const ITC = (
void *) (INTBASE);
94 #define INTCNTL_OFF (0x0)
95 #define INTENNUM_OFF (0x8)
96 #define INTDISNUM_OFF (0xC)
97 #define INTENABLE_OFF (0x10)
98 #define INTSRC_OFF (0x30)
99 #define INTFRC_OFF (0x34)
100 #define NIPEND_OFF (0x38)
102 static volatile uint32_t *
const INTCNTL = ((
volatile uint32_t *) (INTBASE + INTCNTL_OFF));
103 static volatile uint32_t *
const INTENNUM = ((
volatile uint32_t *) (INTBASE + INTENNUM_OFF));
104 static volatile uint32_t *
const INTDISNUM = ((
volatile uint32_t *) (INTBASE + INTDISNUM_OFF));
105 static volatile uint32_t *
const INTENABLE = ((
volatile uint32_t *) (INTBASE + INTENABLE_OFF));
106 static volatile uint32_t *
const INTSRC = ((
volatile uint32_t *) (INTBASE + INTSRC_OFF));
107 static volatile uint32_t *
const INTFRC = ((
volatile uint32_t *) (INTBASE + INTFRC_OFF));
108 static volatile uint32_t *
const NIPEND = ((
volatile uint32_t *) (INTBASE + NIPEND_OFF));
110 enum interrupt_nums {
124 #define global_irq_disable() (set_bit(*INTCNTL,20))
125 #define global_irq_enable() (clear_bit(*INTCNTL,20))
127 #define enable_irq(irq) (*INTENNUM = INT_NUM_##irq)
128 #define disable_irq(irq) (*INTDISNUM = INT_NUM_##irq)
130 #define safe_irq_disable(x) volatile uint32_t saved_irq; saved_irq = *INTENABLE; disable_irq(x)
131 #define irq_restore() *INTENABLE = saved_irq
142 #define __int_top() volatile uint32_t saved_intenable
143 #define __int_disable() saved_intenable = ITC->INTENABLE; ITC->INTENABLE = 0
144 #define __int_enable() ITC->INTENABLE = saved_intenable
145 #define disable_int(x) do { \
149 __int_enable(); } while(0)