diff options
| author | Bernard Xiong <[email protected]> | 2015-05-04 20:45:02 +0800 |
|---|---|---|
| committer | Bernard Xiong <[email protected]> | 2015-05-04 20:45:02 +0800 |
| commit | 75d82a1b8ef9579272fb2d945d0387e14b7508da (patch) | |
| tree | 3a06e32fc244d9d56630d10c1a15c9beab50e507 /libcpu | |
| parent | 452432a15b410797b0fd7a7fd6667bcc98c8a6db (diff) | |
| parent | 8a39ed9115d13552a4e332d01b75181e6b2a3865 (diff) | |
Merge branch 'master' of https://coding.net/bernard/rt-thread
Diffstat (limited to 'libcpu')
| -rw-r--r-- | libcpu/arm/arm926/trap.c | 37 |
1 files changed, 14 insertions, 23 deletions
diff --git a/libcpu/arm/arm926/trap.c b/libcpu/arm/arm926/trap.c index 77816a2aa6..726f22a557 100644 --- a/libcpu/arm/arm926/trap.c +++ b/libcpu/arm/arm926/trap.c @@ -25,8 +25,9 @@ #include <rtthread.h> #include <rthw.h> -#include <interrupt.h> +#define INT_IRQ 0x00 +#define INT_FIQ 0x01 extern struct rt_thread *rt_current_thread; #ifdef RT_USING_FINSH @@ -171,24 +172,18 @@ void rt_hw_trap_resv(struct rt_hw_register *regs) rt_hw_cpu_shutdown(); } - - +extern struct rt_irq_desc irq_desc[]; +extern rt_uint32_t rt_hw_interrupt_get_active(rt_uint32_t fiq_irq); +extern void rt_hw_interrupt_ack(rt_uint32_t fiq_irq, rt_uint32_t id); + void rt_hw_trap_irq() { rt_isr_handler_t isr_func; - rt_uint32_t irqstat; rt_uint32_t irq; void *param; - extern struct rt_irq_desc irq_desc[]; /* get irq number */ - irqstat = rt_hw_interrupt_get_active(INT_IRQ, &irq); - if (irqstat == 0) - { - rt_kprintf("No interrupt occur\n"); - rt_hw_interrupt_ack(INT_IRQ); - return; - } + irq = rt_hw_interrupt_get_active(INT_IRQ); /* get interrupt service routine */ isr_func = irq_desc[irq].handler; @@ -197,26 +192,20 @@ void rt_hw_trap_irq() /* turn to interrupt service routine */ isr_func(irq, param); - rt_hw_interrupt_ack(INT_IRQ); + rt_hw_interrupt_ack(INT_IRQ, irq); +#ifdef RT_USING_INTERRUPT_INFO irq_desc[irq].counter ++; +#endif } void rt_hw_trap_fiq() { rt_isr_handler_t isr_func; - rt_uint32_t irqstat; rt_uint32_t irq; void *param; - extern struct rt_irq_desc irq_desc[]; /* get irq number */ - irqstat = rt_hw_interrupt_get_active(INT_FIQ, &irq); - if (irqstat == 0) - { - rt_kprintf("No interrupt occur\n"); - rt_hw_interrupt_ack(INT_FIQ); - return; - } + irq = rt_hw_interrupt_get_active(INT_FIQ); /* get interrupt service routine */ isr_func = irq_desc[irq].handler; @@ -225,6 +214,8 @@ void rt_hw_trap_fiq() /* turn to interrupt service routine */ isr_func(irq, param); - rt_hw_interrupt_ack(INT_FIQ); + rt_hw_interrupt_ack(INT_FIQ, irq); +#ifdef RT_USING_INTERRUPT_INFO irq_desc[irq].counter ++; +#endif } |
