diff options
| author | Bernard Xiong <[email protected]> | 2015-05-04 17:53:37 +0800 |
|---|---|---|
| committer | Bernard Xiong <[email protected]> | 2015-05-04 17:53:37 +0800 |
| commit | 0100e4f16f508cf5edd1bda8dbbf96bcfdbee9c2 (patch) | |
| tree | 7736e2a5883e11670690d47ae9fc75bc32373a60 /libcpu | |
| parent | 854d8866d36b6911dee2fbc77e95084b44471066 (diff) | |
| parent | ce08c83c1f7581130ea6bc263371508b5c5aa91e (diff) | |
Merge pull request #469 from ArdaFu/master
[bsp][asm9260t] Add new bsp for ASM9260T
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 } |
