summaryrefslogtreecommitdiffstats
path: root/cpukit/include/pci/irq.h
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--cpukit/include/pci/irq.h52
1 files changed, 31 insertions, 21 deletions
diff --git a/cpukit/include/pci/irq.h b/cpukit/include/pci/irq.h
index b7c4a77aab..8617dd1680 100644
--- a/cpukit/include/pci/irq.h
+++ b/cpukit/include/pci/irq.h
@@ -1,3 +1,5 @@
+/* SPDX-License-Identifier: BSD-2-Clause */
+
/**
* @file
*
@@ -7,9 +9,26 @@
/*
* COPYRIGHT (c) 2010 Cobham Gaisler AB.
*
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.rtems.org/license/LICENSE.
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
*/
/* IRQ handling does not have so much with PCI to do, this library depends
@@ -19,18 +38,9 @@
#ifndef __PCI_IRQ_H__
#define __PCI_IRQ_H__
-#include <rtems/irq-extension.h>
+#include <rtems/rtems/intr.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
@@ -53,7 +63,7 @@ extern int pci_dev_irq(pci_dev_t dev);
* isr Function pointer to the ISR
* arg Second argument to function isr
*/
-RTEMS_INLINE_ROUTINE int pci_interrupt_register(int irq, const char *info,
+static inline int pci_interrupt_register(int irq, const char *info,
pci_isr isr, void *arg)
{
return rtems_interrupt_handler_install(irq, info,
@@ -68,7 +78,7 @@ RTEMS_INLINE_ROUTINE int pci_interrupt_register(int irq, const char *info,
* isr Function pointer to the ISR
* arg Second argument to function isr
*/
-RTEMS_INLINE_ROUTINE int pci_interrupt_unregister(int irq, pci_isr isr,
+static inline int pci_interrupt_unregister(int irq, pci_isr isr,
void *arg)
{
return rtems_interrupt_handler_remove(irq, isr, arg);
@@ -85,9 +95,9 @@ RTEMS_INLINE_ROUTINE int pci_interrupt_unregister(int irq, pci_isr isr,
* isr Function pointer to the ISR
* arg Second argument to function isr
*/
-RTEMS_INLINE_ROUTINE void pci_interrupt_unmask(int irq)
+static inline void pci_interrupt_unmask(int irq)
{
- BSP_shared_interrupt_unmask(irq);
+ (void)rtems_interrupt_vector_enable((rtems_vector_number)irq);
}
/* Disable shared PCI IRQ handler. This function will mask the interrupt
@@ -101,9 +111,9 @@ RTEMS_INLINE_ROUTINE void pci_interrupt_unmask(int irq)
* isr Function pointer to the ISR
* arg Second argument to function isr
*/
-RTEMS_INLINE_ROUTINE void pci_interrupt_mask(int irq)
+static inline void pci_interrupt_mask(int irq)
{
- BSP_shared_interrupt_mask(irq);
+ (void)rtems_interrupt_vector_disable((rtems_vector_number)irq);
}
/* Acknowledge the interrupt controller by writing to the interrupt controller.
@@ -115,9 +125,9 @@ RTEMS_INLINE_ROUTINE void pci_interrupt_mask(int irq)
* isr Function pointer to the ISR
* arg Second argument to function isr
*/
-RTEMS_INLINE_ROUTINE void pci_interrupt_clear(int irq)
+static inline void pci_interrupt_clear(int irq)
{
- BSP_shared_interrupt_clear(irq);
+ (void)rtems_interrupt_clear((rtems_vector_number)irq);
}
#endif /* !__PCI_IRQ_H__ */