[PATCH v4 5/8] grlib: use rtems_interrupt_handler_install() for all interrupt handlers

Jiri Gaisler jiri at gaisler.se
Mon Jan 21 15:49:46 UTC 2019


---
 bsps/shared/grlib/ascs/grascs.c             | 7 +++++--
 bsps/shared/grlib/can/satcan.c              | 6 ++++--
 bsps/shared/grlib/drvmgr/ambapp_bus_grlib.c | 7 ++++---
 bsps/shared/grlib/slink/grslink.c           | 7 +++++--
 4 files changed, 18 insertions(+), 9 deletions(-)

diff --git a/bsps/shared/grlib/ascs/grascs.c b/bsps/shared/grlib/ascs/grascs.c
index 8d3d1b4285..79acb8a3c6 100644
--- a/bsps/shared/grlib/ascs/grascs.c
+++ b/bsps/shared/grlib/ascs/grascs.c
@@ -13,6 +13,7 @@
 #include <grlib/ambapp.h>
 #include <grlib/grascs.h>
 
+#include <grlib/grlib.h>
 #include <grlib/grlib_impl.h>
 
 #ifndef GAISLER_ASCS
@@ -129,7 +130,7 @@ static int ASCS_get_sysfreq(void) {
                 appropriate bits in the core's STS register and releases
 		the associated semaphore
 */
-static rtems_isr ASCS_irqhandler(rtems_vector_number v) {
+static rtems_isr ASCS_irqhandler(void *v) {
 
   if(cfg->regs->sts & GRASCS_STS_TCDONE) {
     /* Clear TC done bit */
@@ -270,7 +271,9 @@ int ASCS_init(void) {
     GRASCS_CMD_TCDONE | GRASCS_CMD_TMDONE;
 
   /* Register interrupt routine */
-  set_vector(ASCS_irqhandler,irq+0x10,2);
+  rtems_interrupt_handler_install(irq, "grascs",
+		  RTEMS_INTERRUPT_SHARED,
+		  ASCS_irqhandler, NULL);
   
   return 0;
 
diff --git a/bsps/shared/grlib/can/satcan.c b/bsps/shared/grlib/can/satcan.c
index c6d58aaed4..ff54128332 100644
--- a/bsps/shared/grlib/can/satcan.c
+++ b/bsps/shared/grlib/can/satcan.c
@@ -152,7 +152,7 @@ static void almalloc(unsigned char **alptr, void **ptr, int sz)
   *alptr = (unsigned char *) (((int)*ptr+sz) & ~(sz-1));
 }
 
-static rtems_isr satcan_interrupt_handler(rtems_vector_number v)
+static rtems_isr satcan_interrupt_handler(void *v)
 {
 	unsigned int irq;
 	unsigned int fifo;
@@ -665,7 +665,9 @@ static rtems_device_driver satcan_initialize(rtems_device_major_number major, rt
 	priv->dmamode = SATCAN_DMA_MODE_SYSTEM;
 
 	/* Register interrupt handler */
-	set_vector(satcan_interrupt_handler, d.irq+0x10, 2);
+	rtems_interrupt_handler_install(d.irq, "satcan",
+			RTEMS_INTERRUPT_SHARED,
+			satcan_interrupt_handler, NULL);
 
 	return RTEMS_SUCCESSFUL;
 }
diff --git a/bsps/shared/grlib/drvmgr/ambapp_bus_grlib.c b/bsps/shared/grlib/drvmgr/ambapp_bus_grlib.c
index 5eb51d0944..fbbe5fa9bb 100644
--- a/bsps/shared/grlib/drvmgr/ambapp_bus_grlib.c
+++ b/bsps/shared/grlib/drvmgr/ambapp_bus_grlib.c
@@ -18,7 +18,7 @@
 #include <libcpu/access.h>
 
 #include <grlib/ambapp_bus.h>
-#include <drvmgr/ambapp_bus_grlib.h>
+#include <grlib/ambapp_bus_grlib.h>
 #include <grlib/genirq.h>
 
 #include <bsp.h>
@@ -188,7 +188,8 @@ static int ambapp_grlib_int_register
 	void *arg
 	)
 {
-	return BSP_shared_interrupt_register(irq, info, isr, arg);
+	return rtems_interrupt_handler_install(irq, info,
+			RTEMS_INTERRUPT_SHARED, isr, arg);
 }
 
 static int ambapp_grlib_int_unregister
@@ -199,7 +200,7 @@ static int ambapp_grlib_int_unregister
 	void *arg
 	)
 {
-	return BSP_shared_interrupt_unregister(irq, isr, arg);
+	return rtems_interrupt_handler_remove(irq, isr, arg);
 }
 
 static int ambapp_grlib_int_clear
diff --git a/bsps/shared/grlib/slink/grslink.c b/bsps/shared/grlib/slink/grslink.c
index fa6f205915..bf21649aa6 100644
--- a/bsps/shared/grlib/slink/grslink.c
+++ b/bsps/shared/grlib/slink/grslink.c
@@ -26,6 +26,7 @@
 #include <grlib/grslink.h>
 #include <grlib/ambapp.h>
 
+#include <grlib/grlib.h>
 #include <grlib/grlib_impl.h>
 
 #ifndef GAISLER_SLINK
@@ -235,7 +236,7 @@ static int SLINK_getsysfreq(void)
  * variable. SLAVE-WORD-SEND transfers are placed in the IO card's receive
  * queue.
  */
-static rtems_isr SLINK_interrupt_handler(rtems_vector_number v)
+static rtems_isr SLINK_interrupt_handler(void *v)
 {
 	unsigned int sts;
 	unsigned int wrd;
@@ -406,7 +407,9 @@ int SLINK_init(unsigned int nullwrd, int parity, int qsize,
 	cfg->slink_seq_change = sequence_callback;
 
 	/* Set-up IRQ handling */
-	set_vector(SLINK_interrupt_handler,irq+0x10,2);
+	rtems_interrupt_handler_install(irq, "slink",
+			RTEMS_INTERRUPT_SHARED,
+			SLINK_interrupt_handler, NULL);
 	
 	return 0;
 
-- 
2.17.1




More information about the devel mailing list