diff options
author | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2018-11-26 15:44:25 +0100 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2018-11-27 08:06:53 +0100 |
commit | a7267241a9ace0f8c1c1c9a9ee1721e04313aa91 (patch) | |
tree | 7d5a93f6339e164d19fbb6890af910e2d2101734 /bsps/sparc/shared/pci | |
parent | Add LICENSE.BSD-2-Clause (diff) | |
download | rtems-a7267241a9ace0f8c1c1c9a9ee1721e04313aa91.tar.bz2 |
bsps/sparc: Add and use <grlib_impl.h>
Reduce copy and paste.
Diffstat (limited to '')
-rw-r--r-- | bsps/sparc/shared/pci/gr_701.c | 11 | ||||
-rw-r--r-- | bsps/sparc/shared/pci/gr_cpci_gr740.c | 11 | ||||
-rw-r--r-- | bsps/sparc/shared/pci/gr_leon4_n2x.c | 11 | ||||
-rw-r--r-- | bsps/sparc/shared/pci/gr_rasta_adcdac.c | 11 | ||||
-rw-r--r-- | bsps/sparc/shared/pci/gr_rasta_io.c | 11 | ||||
-rw-r--r-- | bsps/sparc/shared/pci/gr_rasta_spw_router.c | 11 | ||||
-rw-r--r-- | bsps/sparc/shared/pci/gr_rasta_tmtc.c | 11 | ||||
-rw-r--r-- | bsps/sparc/shared/pci/gr_tmtc_1553.c | 11 | ||||
-rw-r--r-- | bsps/sparc/shared/pci/grpci2.c | 32 | ||||
-rw-r--r-- | bsps/sparc/shared/pci/grpci2dma.c | 34 |
10 files changed, 11 insertions, 143 deletions
diff --git a/bsps/sparc/shared/pci/gr_701.c b/bsps/sparc/shared/pci/gr_701.c index 2350e58b51..3e2109fbf5 100644 --- a/bsps/sparc/shared/pci/gr_701.c +++ b/bsps/sparc/shared/pci/gr_701.c @@ -23,7 +23,6 @@ #include <bsp.h> #include <rtems/bspIo.h> -#include <rtems/score/isrlock.h> /* spin-lock */ #include <pci.h> #include <pci/access.h> @@ -38,15 +37,7 @@ #include <bsp/gr_701.h> -/* map via rtems_interrupt_lock_* API: */ -#define SPIN_DECLARE(lock) RTEMS_INTERRUPT_LOCK_MEMBER(lock) -#define SPIN_INIT(lock, name) rtems_interrupt_lock_initialize(lock, name) -#define SPIN_LOCK(lock, level) rtems_interrupt_lock_acquire_isr(lock, &level) -#define SPIN_LOCK_IRQ(lock, level) rtems_interrupt_lock_acquire(lock, &level) -#define SPIN_UNLOCK(lock, level) rtems_interrupt_lock_release_isr(lock, &level) -#define SPIN_UNLOCK_IRQ(lock, level) rtems_interrupt_lock_release(lock, &level) -#define SPIN_IRQFLAGS(k) rtems_interrupt_lock_context k -#define SPIN_ISR_IRQFLAGS(k) SPIN_IRQFLAGS(k) +#include <grlib_impl.h> /* Offset from 0x80000000 (dual bus version) */ #define AHB1_BASE_ADDR 0x80000000 diff --git a/bsps/sparc/shared/pci/gr_cpci_gr740.c b/bsps/sparc/shared/pci/gr_cpci_gr740.c index 9b4fbfa3b2..dbb094744d 100644 --- a/bsps/sparc/shared/pci/gr_cpci_gr740.c +++ b/bsps/sparc/shared/pci/gr_cpci_gr740.c @@ -33,7 +33,6 @@ #include <bsp.h> #include <rtems/bspIo.h> -#include <rtems/score/isrlock.h> /* spin-lock */ #include <pci.h> #include <ambapp.h> @@ -46,15 +45,7 @@ #include <bsp/gr_cpci_gr740.h> -/* map via rtems_interrupt_lock_* API: */ -#define SPIN_DECLARE(lock) RTEMS_INTERRUPT_LOCK_MEMBER(lock) -#define SPIN_INIT(lock, name) rtems_interrupt_lock_initialize(lock, name) -#define SPIN_LOCK(lock, level) rtems_interrupt_lock_acquire_isr(lock, &level) -#define SPIN_LOCK_IRQ(lock, level) rtems_interrupt_lock_acquire(lock, &level) -#define SPIN_UNLOCK(lock, level) rtems_interrupt_lock_release_isr(lock, &level) -#define SPIN_UNLOCK_IRQ(lock, level) rtems_interrupt_lock_release(lock, &level) -#define SPIN_IRQFLAGS(k) rtems_interrupt_lock_context k -#define SPIN_ISR_IRQFLAGS(k) SPIN_IRQFLAGS(k) +#include <grlib_impl.h> /* Determines which PCI address the AHB masters on the GR740 board will * access when accessing the AHB to PCI window, it should be set so that the diff --git a/bsps/sparc/shared/pci/gr_leon4_n2x.c b/bsps/sparc/shared/pci/gr_leon4_n2x.c index c97c0b8cf5..76e2bb0b28 100644 --- a/bsps/sparc/shared/pci/gr_leon4_n2x.c +++ b/bsps/sparc/shared/pci/gr_leon4_n2x.c @@ -32,7 +32,6 @@ #include <bsp.h> #include <rtems/bspIo.h> -#include <rtems/score/isrlock.h> /* spin-lock */ #include <pci.h> #include <ambapp.h> @@ -45,15 +44,7 @@ #include <bsp/gr_leon4_n2x.h> -/* map via rtems_interrupt_lock_* API: */ -#define SPIN_DECLARE(lock) RTEMS_INTERRUPT_LOCK_MEMBER(lock) -#define SPIN_INIT(lock, name) rtems_interrupt_lock_initialize(lock, name) -#define SPIN_LOCK(lock, level) rtems_interrupt_lock_acquire_isr(lock, &level) -#define SPIN_LOCK_IRQ(lock, level) rtems_interrupt_lock_acquire(lock, &level) -#define SPIN_UNLOCK(lock, level) rtems_interrupt_lock_release_isr(lock, &level) -#define SPIN_UNLOCK_IRQ(lock, level) rtems_interrupt_lock_release(lock, &level) -#define SPIN_IRQFLAGS(k) rtems_interrupt_lock_context k -#define SPIN_ISR_IRQFLAGS(k) SPIN_IRQFLAGS(k) +#include <grlib_impl.h> /* Determines which PCI address the AHB masters on the LEON-N2X board will * access when accessing the AHB to PCI window, it should be set so that the diff --git a/bsps/sparc/shared/pci/gr_rasta_adcdac.c b/bsps/sparc/shared/pci/gr_rasta_adcdac.c index 4bd00730e1..8a58438287 100644 --- a/bsps/sparc/shared/pci/gr_rasta_adcdac.c +++ b/bsps/sparc/shared/pci/gr_rasta_adcdac.c @@ -23,7 +23,6 @@ #include <bsp.h> #include <rtems/bspIo.h> -#include <rtems/score/isrlock.h> /* spin-lock */ #include <pci.h> #include <ambapp.h> @@ -36,15 +35,7 @@ #include <bsp/gr_rasta_adcdac.h> -/* map via rtems_interrupt_lock_* API: */ -#define SPIN_DECLARE(lock) RTEMS_INTERRUPT_LOCK_MEMBER(lock) -#define SPIN_INIT(lock, name) rtems_interrupt_lock_initialize(lock, name) -#define SPIN_LOCK(lock, level) rtems_interrupt_lock_acquire_isr(lock, &level) -#define SPIN_LOCK_IRQ(lock, level) rtems_interrupt_lock_acquire(lock, &level) -#define SPIN_UNLOCK(lock, level) rtems_interrupt_lock_release_isr(lock, &level) -#define SPIN_UNLOCK_IRQ(lock, level) rtems_interrupt_lock_release(lock, &level) -#define SPIN_IRQFLAGS(k) rtems_interrupt_lock_context k -#define SPIN_ISR_IRQFLAGS(k) SPIN_IRQFLAGS(k) +#include <grlib_impl.h> /*#define DEBUG 1*/ diff --git a/bsps/sparc/shared/pci/gr_rasta_io.c b/bsps/sparc/shared/pci/gr_rasta_io.c index 02c8b5b572..78f6eefa20 100644 --- a/bsps/sparc/shared/pci/gr_rasta_io.c +++ b/bsps/sparc/shared/pci/gr_rasta_io.c @@ -23,7 +23,6 @@ #include <bsp.h> #include <rtems/bspIo.h> -#include <rtems/score/isrlock.h> /* spin-lock */ #include <pci.h> #include <ambapp.h> @@ -36,15 +35,7 @@ #include <bsp/gr_rasta_io.h> -/* map via rtems_interrupt_lock_* API: */ -#define SPIN_DECLARE(lock) RTEMS_INTERRUPT_LOCK_MEMBER(lock) -#define SPIN_INIT(lock, name) rtems_interrupt_lock_initialize(lock, name) -#define SPIN_LOCK(lock, level) rtems_interrupt_lock_acquire_isr(lock, &level) -#define SPIN_LOCK_IRQ(lock, level) rtems_interrupt_lock_acquire(lock, &level) -#define SPIN_UNLOCK(lock, level) rtems_interrupt_lock_release_isr(lock, &level) -#define SPIN_UNLOCK_IRQ(lock, level) rtems_interrupt_lock_release(lock, &level) -#define SPIN_IRQFLAGS(k) rtems_interrupt_lock_context k -#define SPIN_ISR_IRQFLAGS(k) SPIN_IRQFLAGS(k) +#include <grlib_impl.h> /* Determines which PCI address the AHB masters will access, it should be * set so that the masters can access the CPU RAM. Default is base of CPU RAM, diff --git a/bsps/sparc/shared/pci/gr_rasta_spw_router.c b/bsps/sparc/shared/pci/gr_rasta_spw_router.c index 194d0a9b99..dede9a8190 100644 --- a/bsps/sparc/shared/pci/gr_rasta_spw_router.c +++ b/bsps/sparc/shared/pci/gr_rasta_spw_router.c @@ -21,7 +21,6 @@ #include <bsp.h> #include <rtems/bspIo.h> -#include <rtems/score/isrlock.h> /* spin-lock */ #include <pci.h> #include <ambapp.h> @@ -33,15 +32,7 @@ #include <bsp/genirq.h> #include <bsp/gr_rasta_spw_router.h> -/* map via rtems_interrupt_lock_* API: */ -#define SPIN_DECLARE(lock) RTEMS_INTERRUPT_LOCK_MEMBER(lock) -#define SPIN_INIT(lock, name) rtems_interrupt_lock_initialize(lock, name) -#define SPIN_LOCK(lock, level) rtems_interrupt_lock_acquire_isr(lock, &level) -#define SPIN_LOCK_IRQ(lock, level) rtems_interrupt_lock_acquire(lock, &level) -#define SPIN_UNLOCK(lock, level) rtems_interrupt_lock_release_isr(lock, &level) -#define SPIN_UNLOCK_IRQ(lock, level) rtems_interrupt_lock_release(lock, &level) -#define SPIN_IRQFLAGS(k) rtems_interrupt_lock_context k -#define SPIN_ISR_IRQFLAGS(k) SPIN_IRQFLAGS(k) +#include <grlib_impl.h> /* Determines which PCI address the AHB masters will access, it should be * set so that the masters can access the CPU RAM. Default is base of CPU RAM, diff --git a/bsps/sparc/shared/pci/gr_rasta_tmtc.c b/bsps/sparc/shared/pci/gr_rasta_tmtc.c index 7f49d1de1d..f615958c84 100644 --- a/bsps/sparc/shared/pci/gr_rasta_tmtc.c +++ b/bsps/sparc/shared/pci/gr_rasta_tmtc.c @@ -23,7 +23,6 @@ #include <bsp.h> #include <rtems/bspIo.h> -#include <rtems/score/isrlock.h> /* spin-lock */ #include <pci.h> #include <ambapp.h> @@ -36,15 +35,7 @@ #include <bsp/gr_rasta_tmtc.h> -/* map via rtems_interrupt_lock_* API: */ -#define SPIN_DECLARE(lock) RTEMS_INTERRUPT_LOCK_MEMBER(lock) -#define SPIN_INIT(lock, name) rtems_interrupt_lock_initialize(lock, name) -#define SPIN_LOCK(lock, level) rtems_interrupt_lock_acquire_isr(lock, &level) -#define SPIN_LOCK_IRQ(lock, level) rtems_interrupt_lock_acquire(lock, &level) -#define SPIN_UNLOCK(lock, level) rtems_interrupt_lock_release_isr(lock, &level) -#define SPIN_UNLOCK_IRQ(lock, level) rtems_interrupt_lock_release(lock, &level) -#define SPIN_IRQFLAGS(k) rtems_interrupt_lock_context k -#define SPIN_ISR_IRQFLAGS(k) SPIN_IRQFLAGS(k) +#include <grlib_impl.h> /* Determines which PCI address the AHB masters will access, it should be * set so that the masters can access the CPU RAM. Default is base of CPU RAM, diff --git a/bsps/sparc/shared/pci/gr_tmtc_1553.c b/bsps/sparc/shared/pci/gr_tmtc_1553.c index 4bbdaffb84..f68188bc9e 100644 --- a/bsps/sparc/shared/pci/gr_tmtc_1553.c +++ b/bsps/sparc/shared/pci/gr_tmtc_1553.c @@ -23,7 +23,6 @@ #include <bsp.h> #include <rtems/bspIo.h> -#include <rtems/score/isrlock.h> /* spin-lock */ #include <pci.h> #include <pci/access.h> @@ -37,15 +36,7 @@ #include <bsp/gr_tmtc_1553.h> -/* map via rtems_interrupt_lock_* API: */ -#define SPIN_DECLARE(lock) RTEMS_INTERRUPT_LOCK_MEMBER(lock) -#define SPIN_INIT(lock, name) rtems_interrupt_lock_initialize(lock, name) -#define SPIN_LOCK(lock, level) rtems_interrupt_lock_acquire_isr(lock, &level) -#define SPIN_LOCK_IRQ(lock, level) rtems_interrupt_lock_acquire(lock, &level) -#define SPIN_UNLOCK(lock, level) rtems_interrupt_lock_release_isr(lock, &level) -#define SPIN_UNLOCK_IRQ(lock, level) rtems_interrupt_lock_release(lock, &level) -#define SPIN_IRQFLAGS(k) rtems_interrupt_lock_context k -#define SPIN_ISR_IRQFLAGS(k) SPIN_IRQFLAGS(k) +#include <grlib_impl.h> /*#define DEBUG 1 */ diff --git a/bsps/sparc/shared/pci/grpci2.c b/bsps/sparc/shared/pci/grpci2.c index 69aa938d97..9bb479c110 100644 --- a/bsps/sparc/shared/pci/grpci2.c +++ b/bsps/sparc/shared/pci/grpci2.c @@ -43,37 +43,7 @@ #include <drvmgr/pci_bus.h> #include <bsp/grpci2.h> -/* Use interrupt lock privmitives compatible with SMP defined in - * RTEMS 4.11.99 and higher. - */ -#if (((__RTEMS_MAJOR__ << 16) | (__RTEMS_MINOR__ << 8) | __RTEMS_REVISION__) >= 0x040b63) - -/* map via rtems_interrupt_lock_* API: */ -#define SPIN_DECLARE(lock) RTEMS_INTERRUPT_LOCK_MEMBER(lock) -#define SPIN_INIT(lock, name) rtems_interrupt_lock_initialize(lock, name) -#define SPIN_LOCK(lock, level) rtems_interrupt_lock_acquire_isr(lock, &level) -#define SPIN_LOCK_IRQ(lock, level) rtems_interrupt_lock_acquire(lock, &level) -#define SPIN_UNLOCK(lock, level) rtems_interrupt_lock_release_isr(lock, &level) -#define SPIN_UNLOCK_IRQ(lock, level) rtems_interrupt_lock_release(lock, &level) -#define SPIN_IRQFLAGS(k) rtems_interrupt_lock_context k -#define SPIN_ISR_IRQFLAGS(k) SPIN_IRQFLAGS(k) - -#else - -/* maintain single-core compatibility with older versions of RTEMS: */ -#define SPIN_DECLARE(name) -#define SPIN_INIT(lock, name) -#define SPIN_LOCK(lock, level) -#define SPIN_LOCK_IRQ(lock, level) rtems_interrupt_disable(level) -#define SPIN_UNLOCK(lock, level) -#define SPIN_UNLOCK_IRQ(lock, level) rtems_interrupt_enable(level) -#define SPIN_IRQFLAGS(k) rtems_interrupt_level k -#define SPIN_ISR_IRQFLAGS(k) - -#ifdef RTEMS_SMP -#error SMP mode not compatible with these interrupt lock primitives -#endif -#endif +#include <grlib_impl.h> /* If defined to 1 - byte twisting is enabled by default */ #define DEFAULT_BT_ENABLED 0 diff --git a/bsps/sparc/shared/pci/grpci2dma.c b/bsps/sparc/shared/pci/grpci2dma.c index d5f1f9942f..92c2038de0 100644 --- a/bsps/sparc/shared/pci/grpci2dma.c +++ b/bsps/sparc/shared/pci/grpci2dma.c @@ -18,40 +18,10 @@ #include <bsp.h> #include <bsp/grpci2dma.h> +#include <grlib_impl.h> + /* This driver has been prepared for SMP operation */ -/* Use interrupt lock privmitives compatible with SMP defined in - * RTEMS 4.11.99 and higher. - */ -#if (((__RTEMS_MAJOR__ << 16) | (__RTEMS_MINOR__ << 8) | __RTEMS_REVISION__) >= 0x040b63) - -/* map via rtems_interrupt_lock_* API: */ -#define SPIN_DECLARE(lock) RTEMS_INTERRUPT_LOCK_MEMBER(lock) -#define SPIN_INIT(lock, name) rtems_interrupt_lock_initialize(lock, name) -#define SPIN_LOCK(lock, level) rtems_interrupt_lock_acquire_isr(lock, &level) -#define SPIN_LOCK_IRQ(lock, level) rtems_interrupt_lock_acquire(lock, &level) -#define SPIN_UNLOCK(lock, level) rtems_interrupt_lock_release_isr(lock, &level) -#define SPIN_UNLOCK_IRQ(lock, level) rtems_interrupt_lock_release(lock, &level) -#define SPIN_IRQFLAGS(k) rtems_interrupt_lock_context k -#define SPIN_ISR_IRQFLAGS(k) SPIN_IRQFLAGS(k) - -#else - -/* maintain single-core compatibility with older versions of RTEMS: */ -#define SPIN_DECLARE(name) -#define SPIN_INIT(lock, name) -#define SPIN_LOCK(lock, level) -#define SPIN_LOCK_IRQ(lock, level) rtems_interrupt_disable(level) -#define SPIN_UNLOCK(lock, level) -#define SPIN_UNLOCK_IRQ(lock, level) rtems_interrupt_enable(level) -#define SPIN_IRQFLAGS(k) rtems_interrupt_level k -#define SPIN_ISR_IRQFLAGS(k) - -#ifdef RTEMS_SMP -#error SMP mode not compatible with these interrupt lock primitives -#endif - -#endif /*#define STATIC*/ #define STATIC static |