mirror of
https://github.com/RT-Thread/rt-thread.git
synced 2026-08-20 21:29:42 +08:00
code cleanup for interrupt description
This commit is contained in:
+234
-236
File diff suppressed because it is too large
Load Diff
@@ -159,13 +159,13 @@ void rt_hw_trap_irq()
|
||||
//at91_sys_write(AT91_AIC_EOICR, 0x55555555);
|
||||
|
||||
/* get interrupt service routine */
|
||||
isr_func = irq_desc[irq].isr_handle;
|
||||
isr_func = irq_desc[irq].handler;
|
||||
param = irq_desc[irq].param;
|
||||
|
||||
/* turn to interrupt service routine */
|
||||
isr_func(irq, param);
|
||||
at91_sys_write(AT91_AIC_EOICR, 0x55555555); //EIOCR must be write any value after interrupt, or else can't response next interrupt
|
||||
irq_desc[irq].interrupt_cnt++;
|
||||
irq_desc[irq].counter ++;
|
||||
}
|
||||
|
||||
void rt_hw_trap_fiq()
|
||||
|
||||
@@ -162,28 +162,28 @@ void rt_hw_cpu_shutdown(void)
|
||||
#if defined(__CC_ARM)
|
||||
__asm int __rt_ffs(int value)
|
||||
{
|
||||
CMP r0, #0x00
|
||||
BEQ exit
|
||||
RBIT r0, r0
|
||||
CLZ r0, r0
|
||||
ADDS r0, r0, #0x01
|
||||
CMP r0, #0x00
|
||||
BEQ exit
|
||||
RBIT r0, r0
|
||||
CLZ r0, r0
|
||||
ADDS r0, r0, #0x01
|
||||
|
||||
exit
|
||||
BX lr
|
||||
BX lr
|
||||
}
|
||||
#elif defined(__IAR_SYSTEMS_ICC__)
|
||||
int __rt_ffs(int value)
|
||||
{
|
||||
if (value == 0) return value;
|
||||
|
||||
__ASM("RBIT r0, r0");
|
||||
__ASM("CLZ r0, r0");
|
||||
__ASM("ADDS r0, r0, #0x01");
|
||||
if (value == 0) return value;
|
||||
|
||||
__ASM("RBIT r0, r0");
|
||||
__ASM("CLZ r0, r0");
|
||||
__ASM("ADDS r0, r0, #0x01");
|
||||
}
|
||||
#elif defined(__GNUC__)
|
||||
int __rt_ffs(int value)
|
||||
{
|
||||
return __builtin_ffs(value);
|
||||
return __builtin_ffs(value);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
Reference in New Issue
Block a user