diff packages/hal/arm/arch/current/src/vectors.S @ 1334:8758da1a0278

2003-10-23 Thomas Koeller <thomas.koeller@baslerweb.com> * src/vectors.S: Acknowlege spurious interrupts.
author nickg
date Tue, 28 Oct 2003 18:08:06 +0000
parents 1750695510ac
children a10cfd6a2ddc
line wrap: on
line diff
--- a/packages/hal/arm/arch/current/src/vectors.S
+++ b/packages/hal/arm/arch/current/src/vectors.S
@@ -80,6 +80,21 @@
         .thumb_func                             ;\
  _l_:
 
+// Call thumb function from ARM mode, return to ARM
+// mode afterwards
+#define THUMB_CALL(_r_, _l_, _f_)                \
+        ldr     _r_,=_f_+1                      ;\
+        mov     lr,pc                           ;\
+        bx      _r_                             ;\
+        .pool                                   ;\
+        .code   16                              ;\
+        .thumb_func                             ;\
+        ldr     _r_,=_l_  ## f                  ;\
+        bx      _r_                             ;\
+        .pool                                   ;\
+        .code   32                              ;\
+ _l_:
+
 // Switch to ARM mode
 #define ARM_MODE(_r_, _l_)                       \
         ldr     _r_,=_l_ ## f                   ;\
@@ -104,6 +119,10 @@
 // Switch to thumb mode
 #define THUMB_MODE(_r_, _l_)
 
+// Call ARM function
+#define THUMB_CALL(_r_, _l_, _f_) \
+        bl      _f_
+
 // Switch to ARM mode
 #define ARM_MODE(_r_, _l_)
 
@@ -872,15 +891,13 @@ 10:
 
         cmp     r0,#CYGNUM_HAL_INTERRUPT_NONE   // spurious interrupt
         bne     10f
-#ifndef CYGIMP_HAL_COMMON_INTERRUPTS_IGNORE_SPURIOUS
+
+#ifdef  CYGIMP_HAL_COMMON_INTERRUPTS_IGNORE_SPURIOUS
+        // Acknowledge the interrupt
+        THUMB_CALL(r1,12,hal_interrupt_acknowledge)
+#else
         mov     r0,v6                   // register frame
-# ifdef __thumb__
-        ldr     r1,=hal_spurious_IRQ
-        mov     lr,pc
-        bx      r1
-# else
-        bl      hal_spurious_IRQ
-# endif
+        THUMB_CALL(r1,12,hal_spurious_IRQ)
 #endif // CYGIMP_HAL_COMMON_INTERRUPTS_IGNORE_SPURIOUS
         b       spurious_IRQ