[rtems commit] bsp/genmcf548x: Use bsp_interrupt_vector_enable()

Sebastian Huber sebh at rtems.org
Mon Dec 16 14:13:16 UTC 2013


Module:    rtems
Branch:    master
Commit:    6eb17335ed81e19a987f663a701e1d011ccebc96
Changeset: http://git.rtems.org/rtems/commit/?id=6eb17335ed81e19a987f663a701e1d011ccebc96

Author:    Sebastian Huber <sebastian.huber at embedded-brains.de>
Date:      Fri Dec  6 08:37:11 2013 +0100

bsp/genmcf548x: Use bsp_interrupt_vector_enable()

---

 c/src/lib/libbsp/m68k/genmcf548x/clock/clock.c     |   10 +++-----
 c/src/lib/libbsp/m68k/genmcf548x/console/console.c |   24 ++-----------------
 c/src/lib/libbsp/m68k/genmcf548x/network/network.c |    3 +-
 3 files changed, 9 insertions(+), 28 deletions(-)

diff --git a/c/src/lib/libbsp/m68k/genmcf548x/clock/clock.c b/c/src/lib/libbsp/m68k/genmcf548x/clock/clock.c
index eda0a9c..2c975f1 100644
--- a/c/src/lib/libbsp/m68k/genmcf548x/clock/clock.c
+++ b/c/src/lib/libbsp/m68k/genmcf548x/clock/clock.c
@@ -50,12 +50,13 @@
 
 #include <rtems.h>
 #include <bsp.h>
+#include <bsp/irq-generic.h>
 #include <mcf548x/mcf548x.h>
 
 /*
  * Use SLT 0
  */
-#define CLOCK_VECTOR (64+54)
+#define CLOCK_IRQ MCF548X_IRQ_SLT0
 
 /*
  * Periodic interval timer interrupt handler
@@ -70,7 +71,7 @@
  */
 #define Clock_driver_support_install_isr( _new, _old )                   \
     do {                                                                 \
-        _old = (rtems_isr_entry)set_vector(_new, CLOCK_VECTOR, 1);       \
+        _old = (rtems_isr_entry)set_vector(_new, CLOCK_IRQ + 64, 1);     \
     } while(0)
 
 /*
@@ -89,10 +90,7 @@
  */
 #define Clock_driver_support_initialize_hardware()			\
   do {									\
-    int level;								\
-    rtems_interrupt_disable( level );					\
-    MCF548X_INTC_IMRH &= ~(MCF548X_INTC_IMRH_INT_MASK54);		\
-    rtems_interrupt_enable( level );					\
+    bsp_interrupt_vector_enable(CLOCK_IRQ);				\
     MCF548X_SLT_SLTCNT0 = get_CPU_clock_speed()				\
       / 1000								\
       * rtems_configuration_get_microseconds_per_tick()			\
diff --git a/c/src/lib/libbsp/m68k/genmcf548x/console/console.c b/c/src/lib/libbsp/m68k/genmcf548x/console/console.c
index 3c8b28c..ba21922 100644
--- a/c/src/lib/libbsp/m68k/genmcf548x/console/console.c
+++ b/c/src/lib/libbsp/m68k/genmcf548x/console/console.c
@@ -56,6 +56,7 @@
 #include <rtems/termiostypes.h>
 #include <termios.h>
 #include <bsp.h>
+#include <bsp/irq-generic.h>
 #include <malloc.h>
 #include <rtems/mw_uid.h>
 
@@ -483,27 +484,8 @@ IntUartInitialize(void)
 		/* set uart default values */
 		IntUartSetAttributes(chan, NULL);
 
-        /* unmask interrupt */
-		rtems_interrupt_disable(level);
-        switch(chan) {
-        case 0:
-            MCF548X_INTC_IMRH &= ~(MCF548X_INTC_IMRH_INT_MASK35);
-            break;
-
-        case 1:
-            MCF548X_INTC_IMRH &= ~(MCF548X_INTC_IMRH_INT_MASK34);
-            break;
-
-        case 2:
-            MCF548X_INTC_IMRH &= ~(MCF548X_INTC_IMRH_INT_MASK33);
-            break;
-
-        case 3:
-            MCF548X_INTC_IMRH &= ~(MCF548X_INTC_IMRH_INT_MASK32);
-            break;
-        }
-		rtems_interrupt_enable(level);
-
+		/* unmask interrupt */
+		bsp_interrupt_vector_enable(MCF548X_IRQ_PSC(chan));
 	} /* of chan loop */
 
 
diff --git a/c/src/lib/libbsp/m68k/genmcf548x/network/network.c b/c/src/lib/libbsp/m68k/genmcf548x/network/network.c
index 8296f23..bd3692f 100644
--- a/c/src/lib/libbsp/m68k/genmcf548x/network/network.c
+++ b/c/src/lib/libbsp/m68k/genmcf548x/network/network.c
@@ -50,6 +50,7 @@
 #include <net/if_var.h>
 
 #include <bsp.h>
+#include <bsp/irq-generic.h>
 #include <mcf548x/mcf548x.h>
 #include <rtems/rtems_mii_ioctl.h>
 #include <errno.h>
@@ -1288,7 +1289,7 @@ static void mcf548x_fec_init(void *arg)
 	rtems_panic ("Can't attach MFC54xx FEX interrupt handler\n");
       }
 
-      MCF548X_INTC_IMRH &= ~(1 << (MCF548X_FEC_IRQ_VECTOR(chan) % 32));
+      bsp_interrupt_vector_enable(MCF548X_IRQ_FEC(chan));
 
       MCF548X_FEC_EIMR(chan) = FEC_INTR_MASK_USED;
       mcf548x_fec_rx_bd_init(sc);




More information about the vc mailing list