[rtems commit] sparc: Remove BSP specifics from <pci/irq.h>

Sebastian Huber sebh at rtems.org
Thu Jan 4 06:20:28 UTC 2018


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

Author:    Sebastian Huber <sebastian.huber at embedded-brains.de>
Date:      Tue Jan  2 11:56:36 2018 +0100

sparc: Remove BSP specifics from <pci/irq.h>

Update #3254.
Update #3260.
Update #3269.

---

 c/src/lib/libbsp/sparc/erc32/include/bsp.h |  7 -------
 c/src/lib/libbsp/sparc/leon2/include/bsp.h |  7 -------
 c/src/lib/libbsp/sparc/leon3/include/bsp.h |  7 -------
 cpukit/libpci/pci/irq.h                    | 22 ++++++++++++++++------
 4 files changed, 16 insertions(+), 27 deletions(-)

diff --git a/c/src/lib/libbsp/sparc/erc32/include/bsp.h b/c/src/lib/libbsp/sparc/erc32/include/bsp.h
index ec2f723..71719f9 100644
--- a/c/src/lib/libbsp/sparc/erc32/include/bsp.h
+++ b/c/src/lib/libbsp/sparc/erc32/include/bsp.h
@@ -177,13 +177,6 @@ void rtems_bsp_delay(int usecs);
 void console_outbyte_polled(int  port, unsigned char ch);
 int console_inbyte_nonblocking(int port);
 
-/* BSP PCI Interrupt support - to avoid warnings by libpci */
-#define BSP_PCI_shared_interrupt_register    BSP_shared_interrupt_register
-#define BSP_PCI_shared_interrupt_unregister  BSP_shared_interrupt_unregister
-#define BSP_PCI_shared_interrupt_unmask      BSP_shared_interrupt_unmask
-#define BSP_PCI_shared_interrupt_mask        BSP_shared_interrupt_mask
-#define BSP_PCI_shared_interrupt_clear       BSP_shared_interrupt_clear
-
 #ifdef __cplusplus
 }
 #endif
diff --git a/c/src/lib/libbsp/sparc/leon2/include/bsp.h b/c/src/lib/libbsp/sparc/leon2/include/bsp.h
index 77d7d78..2028ba0 100644
--- a/c/src/lib/libbsp/sparc/leon2/include/bsp.h
+++ b/c/src/lib/libbsp/sparc/leon2/include/bsp.h
@@ -201,13 +201,6 @@ void rtems_bsp_delay(int usecs);
  */
 int cchip1_register(void);
 
-/* BSP PCI Interrupt support */
-#define BSP_PCI_shared_interrupt_register    BSP_shared_interrupt_register
-#define BSP_PCI_shared_interrupt_unregister  BSP_shared_interrupt_unregister
-#define BSP_PCI_shared_interrupt_unmask      BSP_shared_interrupt_unmask
-#define BSP_PCI_shared_interrupt_mask        BSP_shared_interrupt_mask
-#define BSP_PCI_shared_interrupt_clear       BSP_shared_interrupt_clear
-
 /* AT697 has PCI defined as big endian */
 #define BSP_PCI_BIG_ENDIAN
 
diff --git a/c/src/lib/libbsp/sparc/leon3/include/bsp.h b/c/src/lib/libbsp/sparc/leon3/include/bsp.h
index ef597cb..3fda4ed 100644
--- a/c/src/lib/libbsp/sparc/leon3/include/bsp.h
+++ b/c/src/lib/libbsp/sparc/leon3/include/bsp.h
@@ -233,13 +233,6 @@ extern const unsigned char LEON3_mp_irq;
 extern const unsigned char LEON3_irq_to_cpu[32];
 #endif
 
-/* BSP PCI Interrupt support */
-#define BSP_PCI_shared_interrupt_register    BSP_shared_interrupt_register
-#define BSP_PCI_shared_interrupt_unregister  BSP_shared_interrupt_unregister
-#define BSP_PCI_shared_interrupt_unmask      BSP_shared_interrupt_unmask
-#define BSP_PCI_shared_interrupt_mask        BSP_shared_interrupt_mask
-#define BSP_PCI_shared_interrupt_clear       BSP_shared_interrupt_clear
-
 /* Common driver build-time configurations. On small systems undefine
  * [DRIVER]_INFO_AVAIL to avoid info routines get dragged in. It is good
  * for debugging and printing information about the system, but makes the
diff --git a/cpukit/libpci/pci/irq.h b/cpukit/libpci/pci/irq.h
index 6c84977..7622201 100644
--- a/cpukit/libpci/pci/irq.h
+++ b/cpukit/libpci/pci/irq.h
@@ -14,10 +14,18 @@
 #ifndef __PCI_IRQ_H__
 #define __PCI_IRQ_H__
 
-#include <bsp.h>
 #include <rtems/irq-extension.h>
 #include <rtems/score/basedefs.h>
 
+/*
+ * FIXME: This should be available via the IRQ extensions API.
+ *
+ * https://devel.rtems.org/ticket/3269
+ */
+void BSP_shared_interrupt_clear(int irq);
+void BSP_shared_interrupt_unmask(int irq);
+void BSP_shared_interrupt_mask(int irq);
+
 /* PCI Handler (ISR) called when IRQ is generated by any of the PCI devices
  * connected to the same PCI IRQ Pin. This has been defined the same way as
  * rtems_interrupt_handler in order for BSPs to "direct-map" the register
@@ -43,7 +51,9 @@ extern int pci_dev_irq(pci_dev_t dev);
 RTEMS_INLINE_ROUTINE int pci_interrupt_register(int irq, const char *info,
 						pci_isr isr, void *arg)
 {
-	return BSP_PCI_shared_interrupt_register(irq, info, isr, arg);
+	return rtems_interrupt_handler_install(irq, info,
+					       RTEMS_INTERRUPT_SHARED, isr,
+					       arg);
 }
 
 /* Unregister previously registered shared PCI IRQ handler
@@ -56,7 +66,7 @@ RTEMS_INLINE_ROUTINE int pci_interrupt_register(int irq, const char *info,
 RTEMS_INLINE_ROUTINE int pci_interrupt_unregister(int irq, pci_isr isr,
 						  void *arg)
 {
-	return BSP_PCI_shared_interrupt_unregister(irq, isr, arg);
+	return rtems_interrupt_handler_remove(irq, isr, arg);
 }
 
 /* Enable shared PCI IRQ handler. This function will unmask the interrupt
@@ -72,7 +82,7 @@ RTEMS_INLINE_ROUTINE int pci_interrupt_unregister(int irq, pci_isr isr,
  */
 RTEMS_INLINE_ROUTINE void pci_interrupt_unmask(int irq)
 {
-	BSP_PCI_shared_interrupt_unmask(irq);
+	BSP_shared_interrupt_unmask(irq);
 }
 
 /* Disable shared PCI IRQ handler. This function will mask the interrupt
@@ -88,7 +98,7 @@ RTEMS_INLINE_ROUTINE void pci_interrupt_unmask(int irq)
  */
 RTEMS_INLINE_ROUTINE void pci_interrupt_mask(int irq)
 {
-	BSP_PCI_shared_interrupt_mask(irq);
+	BSP_shared_interrupt_mask(irq);
 }
 
 /* Acknowledge the interrupt controller by writing to the interrupt controller.
@@ -102,7 +112,7 @@ RTEMS_INLINE_ROUTINE void pci_interrupt_mask(int irq)
  */
 RTEMS_INLINE_ROUTINE void pci_interrupt_clear(int irq)
 {
-	BSP_PCI_shared_interrupt_clear(irq);
+	BSP_shared_interrupt_clear(irq);
 }
 
 #endif /* !__PCI_IRQ_H__ */



More information about the vc mailing list