[PATCH] bsp/csb336: mc9328mxl correct AITC access in bsp_interrupt_dispatch.

Pavel Pisa ppisa4lists at pikron.com
Thu Jul 25 08:34:50 UTC 2013


From: Pavel Pisa <ppisa at pikron.com>

The original version is missing void and result is that (*x >> 16) is
optimized to ldh rX,[rY]. But it is not allowed/supported to access
bus/address range used by AITC by other than 32 bit wide accesses
and 16-bit access results in the data abort exception.
The corrected version works on real hardware and is even
more readable.

Signed-off-by: Pavel Pisa <ppisa at pikron.com>
---
 c/src/lib/libcpu/arm/mc9328mxl/irq/irq.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/c/src/lib/libcpu/arm/mc9328mxl/irq/irq.c b/c/src/lib/libcpu/arm/mc9328mxl/irq/irq.c
index 447dedf..7c58a89 100644
--- a/c/src/lib/libcpu/arm/mc9328mxl/irq/irq.c
+++ b/c/src/lib/libcpu/arm/mc9328mxl/irq/irq.c
@@ -20,7 +20,8 @@
 
 void bsp_interrupt_dispatch(void)
 {
-  rtems_vector_number vector = *((uint32_t *) 0x00223040) >> 16;
+
+  rtems_vector_number vector = MC9328MXL_AITC_NIVECSR >> 16;
 
   bsp_interrupt_handler_dispatch(vector);
 }
-- 
1.7.10.4




More information about the devel mailing list