[PATCH 2/2] bsps: Rework cache manager implementation
Sebastian Huber
sebastian.huber at embedded-brains.de
Mon Jan 29 14:39:17 UTC 2018
The previous cache manager support used a single souce file
(cache_manager.c) which included the an implementation header
(cache_.h). This required the use of specialized include paths to find
the right header file. Change this to include a generic implementation
header (cacheimpl.h) in specialized source files.
Use the following directories and files:
* bsps/shared/cache
* bsps/@RTEMS_CPU@/shared/cache
* bsps/@RTEMS_CPU@/@RTEMS_BSP_FAMILY/startup/cache.c
---
.../cache_.h => bsps/arm/shared/cache/cache-cp15.c | 7 +--
.../arm/shared/cache/cache-cp15.h | 2 -
.../arm/shared/cache/cache-l2c-310.c | 19 +------
.../cache_.h => bsps/arm/shared/cache/cache-v7m.c | 5 +-
.../libcpu/bfin => bsps/bfin/shared}/cache/cache.c | 39 ++++++++-----
.../libcpu/i386 => bsps/i386/shared/cache}/cache.c | 42 +++++++-------
.../cache_.h => bsps/m68k/genmcf548x/cache.c | 6 +-
.../m68k/shared/cache/cache-mcf5223x.c | 0
.../m68k/shared/cache/cache-mcf5225x.c | 0
.../m68k/shared/cache/cache-mcf5235.c | 0
.../m68k/shared/cache/cache-mcf5282.c | 32 ++++++-----
.../m68k/shared/cache/cache-mcf532x.c | 0
bsps/m68k/shared/cache/cache.c | 3 +
.../cache.c => bsps/m68k/shared/cache/cache.h | 33 +++++++++--
bsps/or1k/include/bsp/cache_.h | 43 --------------
.../lib/libcpu => bsps}/or1k/shared/cache/cache.c | 55 ++++++++++++------
.../cache_.h => bsps/powerpc/shared/cache/cache.c | 5 +-
.../shared/cache/cacheimpl.h | 1 -
bsps/shared/cache/nocache.c | 1 +
c/src/lib/libbsp/arm/altera-cyclone-v/Makefile.am | 6 +-
c/src/lib/libbsp/arm/atsam/Makefile.am | 4 +-
c/src/lib/libbsp/arm/beagle/Makefile.am | 6 +-
c/src/lib/libbsp/arm/csb336/Makefile.am | 7 +--
c/src/lib/libbsp/arm/csb337/Makefile.am | 7 +--
c/src/lib/libbsp/arm/edb7312/Makefile.am | 4 +-
c/src/lib/libbsp/arm/gdbarmsim/Makefile.am | 4 +-
c/src/lib/libbsp/arm/gumstix/Makefile.am | 4 +-
c/src/lib/libbsp/arm/imx/Makefile.am | 7 +--
c/src/lib/libbsp/arm/lm3s69xx/Makefile.am | 6 +-
c/src/lib/libbsp/arm/lpc176x/Makefile.am | 6 +-
c/src/lib/libbsp/arm/lpc24xx/Makefile.am | 6 +-
c/src/lib/libbsp/arm/lpc32xx/Makefile.am | 8 +--
c/src/lib/libbsp/arm/raspberrypi/Makefile.am | 5 +-
c/src/lib/libbsp/arm/realview-pbx-a9/Makefile.am | 7 +--
c/src/lib/libbsp/arm/rtl22xx/Makefile.am | 4 +-
c/src/lib/libbsp/arm/smdk2410/Makefile.am | 7 +--
c/src/lib/libbsp/arm/stm32f4/Makefile.am | 6 +-
c/src/lib/libbsp/arm/tms570/Makefile.am | 6 +-
c/src/lib/libbsp/arm/xilinx-zynq/Makefile.am | 7 +--
c/src/lib/libbsp/bfin/TLL6527M/Makefile.am | 2 +-
c/src/lib/libbsp/bfin/bf537Stamp/Makefile.am | 2 +-
c/src/lib/libbsp/bfin/eZKit533/Makefile.am | 2 +-
c/src/lib/libbsp/epiphany/epiphany_sim/Makefile.am | 4 +-
c/src/lib/libbsp/i386/pc386/Makefile.am | 5 +-
c/src/lib/libbsp/lm32/lm32_evr/Makefile.am | 4 +-
c/src/lib/libbsp/lm32/milkymist/Makefile.am | 4 +-
c/src/lib/libbsp/m32c/m32cbsp/Makefile.am | 4 +-
c/src/lib/libbsp/m68k/av5282/Makefile.am | 4 +-
c/src/lib/libbsp/m68k/csb360/Makefile.am | 4 +-
c/src/lib/libbsp/m68k/gen68340/Makefile.am | 3 +-
c/src/lib/libbsp/m68k/gen68360/Makefile.am | 3 +-
c/src/lib/libbsp/m68k/genmcf548x/Makefile.am | 4 +-
c/src/lib/libbsp/m68k/mcf5206elite/Makefile.am | 4 +-
c/src/lib/libbsp/m68k/mcf52235/Makefile.am | 4 +-
c/src/lib/libbsp/m68k/mcf5225x/Makefile.am | 4 +-
c/src/lib/libbsp/m68k/mcf5235/Makefile.am | 4 +-
c/src/lib/libbsp/m68k/mcf5329/Makefile.am | 6 +-
c/src/lib/libbsp/m68k/mrm332/Makefile.am | 3 +-
c/src/lib/libbsp/m68k/mvme147/Makefile.am | 3 +-
c/src/lib/libbsp/m68k/mvme147s/Makefile.am | 3 +-
c/src/lib/libbsp/m68k/mvme162/Makefile.am | 3 +-
c/src/lib/libbsp/m68k/mvme167/Makefile.am | 3 +-
c/src/lib/libbsp/m68k/uC5282/Makefile.am | 6 +-
c/src/lib/libbsp/mips/csb350/Makefile.am | 5 +-
c/src/lib/libbsp/mips/hurricane/Makefile.am | 5 +-
c/src/lib/libbsp/mips/jmr3904/Makefile.am | 5 +-
c/src/lib/libbsp/mips/malta/Makefile.am | 5 +-
c/src/lib/libbsp/mips/rbtx4925/Makefile.am | 5 +-
c/src/lib/libbsp/mips/rbtx4938/Makefile.am | 5 +-
c/src/lib/libbsp/moxie/moxiesim/Makefile.am | 4 +-
c/src/lib/libbsp/nios2/nios2_iss/Makefile.am | 2 +-
c/src/lib/libbsp/or1k/generic_or1k/Makefile.am | 2 +-
c/src/lib/libbsp/powerpc/beatnik/Makefile.am | 3 +-
c/src/lib/libbsp/powerpc/gen5200/Makefile.am | 3 +-
c/src/lib/libbsp/powerpc/gen83xx/Makefile.am | 11 ++--
c/src/lib/libbsp/powerpc/haleakala/Makefile.am | 3 +-
.../libbsp/powerpc/motorola_powerpc/Makefile.am | 3 +-
c/src/lib/libbsp/powerpc/mpc55xxevb/Makefile.am | 3 +-
c/src/lib/libbsp/powerpc/mpc8260ads/Makefile.am | 3 +-
c/src/lib/libbsp/powerpc/mvme3100/Makefile.am | 3 +-
c/src/lib/libbsp/powerpc/mvme5500/Makefile.am | 3 +-
c/src/lib/libbsp/powerpc/psim/Makefile.am | 3 +-
c/src/lib/libbsp/powerpc/qemuppc/Makefile.am | 3 +-
c/src/lib/libbsp/powerpc/qoriq/Makefile.am | 3 +-
c/src/lib/libbsp/powerpc/ss555/Makefile.am | 3 +-
c/src/lib/libbsp/powerpc/t32mppc/Makefile.am | 3 +-
c/src/lib/libbsp/powerpc/tqm8xx/Makefile.am | 3 +-
c/src/lib/libbsp/powerpc/virtex/Makefile.am | 3 +-
c/src/lib/libbsp/powerpc/virtex4/Makefile.am | 3 +-
c/src/lib/libbsp/powerpc/virtex5/Makefile.am | 3 +-
c/src/lib/libbsp/riscv/riscv_generic/Makefile.am | 4 +-
c/src/lib/libbsp/sh/gensh1/Makefile.am | 4 +-
c/src/lib/libbsp/sh/gensh2/Makefile.am | 4 +-
c/src/lib/libbsp/sh/gensh4/Makefile.am | 4 +-
c/src/lib/libbsp/sh/shsim/Makefile.am | 4 +-
c/src/lib/libbsp/shared/include/cache_.h | 1 -
c/src/lib/libbsp/sparc/erc32/Makefile.am | 3 +-
c/src/lib/libbsp/sparc/leon2/Makefile.am | 2 +-
.../sparc/leon2/startup/cache.c} | 11 +---
c/src/lib/libbsp/sparc/leon3/Makefile.am | 4 +-
.../leon3/{include/cache_.h => startup/cache.c} | 13 +----
c/src/lib/libbsp/sparc64/niagara/Makefile.am | 3 +-
c/src/lib/libbsp/sparc64/usiii/Makefile.am | 2 +-
c/src/lib/libbsp/v850/gdbv850sim/Makefile.am | 4 +-
c/src/lib/libcpu/arm/shared/include/cache_.h | 58 -------------------
c/src/lib/libcpu/bfin/Makefile.am | 6 --
c/src/lib/libcpu/bfin/cache/cache_.h | 21 -------
c/src/lib/libcpu/i386/Makefile.am | 6 --
c/src/lib/libcpu/i386/cache_.h | 15 -----
c/src/lib/libcpu/lm32/shared/cache/cache_.h | 11 ----
c/src/lib/libcpu/m68k/Makefile.am | 55 ------------------
c/src/lib/libcpu/m68k/shared/cache/cache_.h | 40 -------------
c/src/lib/libcpu/mips/shared/cache/cache.c | 8 ---
c/src/lib/libcpu/mips/shared/cache/cache_.h | 13 -----
c/src/lib/libcpu/nios2/Makefile.am | 8 ---
c/src/lib/libcpu/nios2/shared/cache/cache_.h | 34 -----------
c/src/lib/libcpu/or1k/shared/cache/cache_.h | 18 ------
c/src/lib/libcpu/powerpc/Makefile.am | 8 ---
c/src/lib/libcpu/shared/include/cache.h | 40 -------------
c/src/lib/libcpu/shared/src/no_cache.c | 65 ----------------------
c/src/lib/libcpu/sparc/Makefile.am | 10 ----
c/src/lib/libcpu/sparc/configure.ac | 3 -
c/src/lib/libcpu/sparc64/Makefile.am | 12 ----
c/src/lib/libcpu/sparc64/shared/cache/cache.c | 34 -----------
c/src/lib/libcpu/sparc64/shared/cache/cache_.h | 24 --------
125 files changed, 278 insertions(+), 872 deletions(-)
rename c/src/lib/libbsp/arm/shared/armv467ar-basic-cache/cache_.h => bsps/arm/shared/cache/cache-cp15.c (95%)
rename c/src/lib/libbsp/arm/shared/include/arm-cache-l1.h => bsps/arm/shared/cache/cache-cp15.h (99%)
rename c/src/lib/libbsp/arm/shared/arm-l2c-310/cache_.h => bsps/arm/shared/cache/cache-l2c-310.c (99%)
rename c/src/lib/libbsp/arm/shared/armv7m/include/cache_.h => bsps/arm/shared/cache/cache-v7m.c (96%)
rename {c/src/lib/libcpu/bfin => bsps/bfin/shared}/cache/cache.c (74%)
rename {c/src/lib/libcpu/i386 => bsps/i386/shared/cache}/cache.c (53%)
rename c/src/lib/libbsp/m68k/genmcf548x/include/cache_.h => bsps/m68k/genmcf548x/cache.c (95%)
rename c/src/lib/libcpu/m68k/mcf5223x/cache/cachepd.c => bsps/m68k/shared/cache/cache-mcf5223x.c (100%)
rename c/src/lib/libcpu/m68k/mcf5225x/cache/cachepd.c => bsps/m68k/shared/cache/cache-mcf5225x.c (100%)
rename c/src/lib/libcpu/m68k/mcf5235/cache/cachepd.c => bsps/m68k/shared/cache/cache-mcf5235.c (100%)
rename c/src/lib/libcpu/m68k/mcf5282/cache/cachepd.c => bsps/m68k/shared/cache/cache-mcf5282.c (73%)
rename c/src/lib/libcpu/m68k/mcf532x/cache/cachepd.c => bsps/m68k/shared/cache/cache-mcf532x.c (100%)
create mode 100644 bsps/m68k/shared/cache/cache.c
rename c/src/lib/libcpu/m68k/shared/cache/cache.c => bsps/m68k/shared/cache/cache.h (82%)
delete mode 100644 bsps/or1k/include/bsp/cache_.h
rename {c/src/lib/libcpu => bsps}/or1k/shared/cache/cache.c (83%)
rename c/src/lib/libcpu/powerpc/shared/src/cache_.h => bsps/powerpc/shared/cache/cache.c (98%)
rename c/src/lib/libcpu/shared/src/cache_manager.c => bsps/shared/cache/cacheimpl.h (99%)
create mode 100644 bsps/shared/cache/nocache.c
delete mode 100644 c/src/lib/libbsp/shared/include/cache_.h
rename c/src/lib/{libcpu/sparc/cache/cache_.h => libbsp/sparc/leon2/startup/cache.c} (82%)
rename c/src/lib/libbsp/sparc/leon3/{include/cache_.h => startup/cache.c} (95%)
delete mode 100644 c/src/lib/libcpu/arm/shared/include/cache_.h
delete mode 100644 c/src/lib/libcpu/bfin/cache/cache_.h
delete mode 100644 c/src/lib/libcpu/i386/cache_.h
delete mode 100644 c/src/lib/libcpu/lm32/shared/cache/cache_.h
delete mode 100644 c/src/lib/libcpu/m68k/shared/cache/cache_.h
delete mode 100644 c/src/lib/libcpu/mips/shared/cache/cache.c
delete mode 100644 c/src/lib/libcpu/mips/shared/cache/cache_.h
delete mode 100644 c/src/lib/libcpu/nios2/shared/cache/cache_.h
delete mode 100644 c/src/lib/libcpu/or1k/shared/cache/cache_.h
delete mode 100644 c/src/lib/libcpu/shared/include/cache.h
delete mode 100644 c/src/lib/libcpu/shared/src/no_cache.c
delete mode 100644 c/src/lib/libcpu/sparc64/shared/cache/cache.c
delete mode 100644 c/src/lib/libcpu/sparc64/shared/cache/cache_.h
diff --git a/c/src/lib/libbsp/arm/shared/armv467ar-basic-cache/cache_.h b/bsps/arm/shared/cache/cache-cp15.c
similarity index 95%
rename from c/src/lib/libbsp/arm/shared/armv467ar-basic-cache/cache_.h
rename to bsps/arm/shared/cache/cache-cp15.c
index 2ff1ae1f03..17de99eaec 100644
--- a/c/src/lib/libbsp/arm/shared/armv467ar-basic-cache/cache_.h
+++ b/bsps/arm/shared/cache/cache-cp15.c
@@ -20,11 +20,8 @@
* http://www.rtems.org/license/LICENSE.
*/
-#ifndef LIBBSP_ARM_ARMV467AR_BASIC_CACHE_H
-#define LIBBSP_ARM_ARMV467AR_BASIC_CACHE_H
-
#include <libcpu/arm-cp15.h>
-#include "../include/arm-cache-l1.h"
+#include "cache-cp15.h"
#define CPU_DATA_CACHE_ALIGNMENT 32
#define CPU_INSTRUCTION_CACHE_ALIGNMENT 32
@@ -184,4 +181,4 @@ static inline void _CPU_cache_disable_instruction(void)
rtems_interrupt_local_enable(level);
}
-#endif /* LIBBSP_ARM_ARMV467AR_BASIC_CACHE_H */
+#include "../../shared/cache/cacheimpl.h"
diff --git a/c/src/lib/libbsp/arm/shared/include/arm-cache-l1.h b/bsps/arm/shared/cache/cache-cp15.h
similarity index 99%
rename from c/src/lib/libbsp/arm/shared/include/arm-cache-l1.h
rename to bsps/arm/shared/cache/cache-cp15.h
index 9caa2685bc..ff01384f4b 100644
--- a/c/src/lib/libbsp/arm/shared/include/arm-cache-l1.h
+++ b/bsps/arm/shared/cache/cache-cp15.h
@@ -1,6 +1,4 @@
/**
- * @file arm-cache-l1.h
- *
* @ingroup arm_shared
*
* @brief Level 1 Cache definitions and functions.
diff --git a/c/src/lib/libbsp/arm/shared/arm-l2c-310/cache_.h b/bsps/arm/shared/cache/cache-l2c-310.c
similarity index 99%
rename from c/src/lib/libbsp/arm/shared/arm-l2c-310/cache_.h
rename to bsps/arm/shared/cache/cache-l2c-310.c
index 81b34a62fa..6869d205a8 100644
--- a/c/src/lib/libbsp/arm/shared/arm-l2c-310/cache_.h
+++ b/bsps/arm/shared/cache/cache-l2c-310.c
@@ -1,6 +1,4 @@
/**
- * @file cache_.h
- *
* @ingroup L2C-310_cache
*
* @brief Cache definitions and functions.
@@ -53,9 +51,6 @@
* ------------------ SLAC Software Notices, Set 4 OTT.002a, 2004 FEB 03
*/
-#ifndef LIBBSP_ARM_SHARED_L2C_310_CACHE_H
-#define LIBBSP_ARM_SHARED_L2C_310_CACHE_H
-
#include <assert.h>
#include <bsp.h>
#include <bsp/fatal.h>
@@ -63,11 +58,8 @@
#include <rtems/rtems/intr.h>
#include <bsp/arm-release-id.h>
#include <bsp/arm-errata.h>
-#include "../include/arm-cache-l1.h"
-#ifdef __cplusplus
-extern "C" {
-#endif /* __cplusplus */
+#include "cache-cp15.h"
/* These two defines also ensure that the rtems_cache_* functions have bodies */
#define CPU_DATA_CACHE_ALIGNMENT ARM_CACHE_L1_CPU_DATA_ALIGNMENT
@@ -1338,11 +1330,4 @@ _CPU_cache_get_instruction_cache_size( const uint32_t level )
return size;
}
-
-/** @} */
-
-#ifdef __cplusplus
-}
-#endif /* __cplusplus */
-
-#endif /* LIBBSP_ARM_SHARED_L2C_310_CACHE_H */
+#include "../../shared/cache/cacheimpl.h"
diff --git a/c/src/lib/libbsp/arm/shared/armv7m/include/cache_.h b/bsps/arm/shared/cache/cache-v7m.c
similarity index 96%
rename from c/src/lib/libbsp/arm/shared/armv7m/include/cache_.h
rename to bsps/arm/shared/cache/cache-v7m.c
index ef94c11734..a73112f12a 100644
--- a/c/src/lib/libbsp/arm/shared/armv7m/include/cache_.h
+++ b/bsps/arm/shared/cache/cache-v7m.c
@@ -12,9 +12,6 @@
* http://www.rtems.org/license/LICENSE.
*/
-#ifndef LIBBSP_ARM_ARMV7M_CACHE__H
-#define LIBBSP_ARM_ARMV7M_CACHE__H
-
#include <rtems.h>
#include <chip.h>
@@ -141,4 +138,4 @@ static inline void _CPU_cache_disable_instruction(void)
rtems_interrupt_enable(level);
}
-#endif /* LIBBSP_ARM_ARMV7M_CACHE__H */
+#include "../../shared/cache/cacheimpl.h"
diff --git a/c/src/lib/libcpu/bfin/cache/cache.c b/bsps/bfin/shared/cache/cache.c
similarity index 74%
rename from c/src/lib/libcpu/bfin/cache/cache.c
rename to bsps/bfin/shared/cache/cache.c
index cc60904f8c..6e1ed4cf4f 100644
--- a/c/src/lib/libcpu/bfin/cache/cache.c
+++ b/bsps/bfin/shared/cache/cache.c
@@ -12,8 +12,16 @@
#include <rtems.h>
#include <bsp.h>
#include <libcpu/memoryRegs.h>
-#include "cache_.h"
+#define CPU_DATA_CACHE_ALIGNMENT 32
+#define CPU_INSTRUCTION_CACHE_ALIGNMENT 32
+
+#ifdef BSP_DATA_CACHE_CONFIG
+#define LIBCPU_DATA_CACHE_CONFIG BSP_DATA_CACHE_CONFIG
+#else
+/* use 16K of each SRAM bank */
+#define LIBCPU_DATA_CACHE_CONFIG (3 << DMEM_CONTROL_DMC_SHIFT)
+#endif
/* There are many syncs in the following code because they should be
harmless except for wasting time, and this is easier than figuring out
@@ -21,7 +29,7 @@
buffers and queued reads. Many of them are likely unnecessary. */
-void _CPU_cache_flush_1_data_line(const void *d_addr) {
+static void _CPU_cache_flush_1_data_line(const void *d_addr) {
__asm__ __volatile__ ("ssync; flush [%0]; ssync" :: "a" (d_addr));
}
@@ -32,26 +40,26 @@ void _CPU_cache_flush_1_data_line(const void *d_addr) {
okay since with a pure invalidate method the caller would have no
way to insure the dirty line hadn't been written out anyway prior
to the invalidate. */
-void _CPU_cache_invalidate_1_data_line(const void *d_addr) {
+static void _CPU_cache_invalidate_1_data_line(const void *d_addr) {
__asm__ __volatile__ ("ssync; flushinv [%0]; ssync" :: "a" (d_addr));
}
-void _CPU_cache_freeze_data(void) {
+static void _CPU_cache_freeze_data(void) {
}
-void _CPU_cache_unfreeze_data(void) {
+static void _CPU_cache_unfreeze_data(void) {
}
-void _CPU_cache_invalidate_1_instruction_line(const void *d_addr) {
+static void _CPU_cache_invalidate_1_instruction_line(const void *d_addr) {
__asm__ __volatile__ ("ssync; iflush [%0]; ssync" :: "a" (d_addr));
}
-void _CPU_cache_freeze_instruction(void) {
+static void _CPU_cache_freeze_instruction(void) {
}
-void _CPU_cache_unfreeze_instruction(void) {
+static void _CPU_cache_unfreeze_instruction(void) {
}
/* incredibly inefficient... It would be better to make use of the
@@ -59,7 +67,7 @@ void _CPU_cache_unfreeze_instruction(void) {
cache line and flush just those. However the documentation I've
seen on those is a bit sketchy, and I sure wouldn't want to get it
wrong. */
-void _CPU_cache_flush_entire_data(void) {
+static void _CPU_cache_flush_entire_data(void) {
uint32_t i;
i = 0;
@@ -71,7 +79,7 @@ void _CPU_cache_flush_entire_data(void) {
__asm__ __volatile__ ("ssync");
}
-void _CPU_cache_invalidate_entire_data(void) {
+static void _CPU_cache_invalidate_entire_data(void) {
uint32_t dmemControl;
__asm__ __volatile__ ("ssync");
@@ -83,21 +91,21 @@ void _CPU_cache_invalidate_entire_data(void) {
/* this does not actually enable data cache unless CPLBs are also enabled.
LIBCPU_DATA_CACHE_CONFIG contains the DMEM_CONTROL_DMC bits to set. */
-void _CPU_cache_enable_data(void) {
+static void _CPU_cache_enable_data(void) {
__asm__ __volatile__ ("ssync");
*(uint32_t volatile *) DMEM_CONTROL |= LIBCPU_DATA_CACHE_CONFIG;
__asm__ __volatile__ ("ssync");
}
-void _CPU_cache_disable_data(void) {
+static void _CPU_cache_disable_data(void) {
__asm__ __volatile__ ("ssync");
*(uint32_t volatile *) DMEM_CONTROL &= ~DMEM_CONTROL_DMC_MASK;
__asm__ __volatile__ ("ssync");
}
-void _CPU_cache_invalidate_entire_instruction(void) {
+static void _CPU_cache_invalidate_entire_instruction(void) {
uint32_t imemControl;
__asm__ __volatile__ ("ssync");
@@ -109,17 +117,18 @@ void _CPU_cache_invalidate_entire_instruction(void) {
/* this only actually enables the instruction cache if the CPLBs are also
enabled. */
-void _CPU_cache_enable_instruction(void) {
+static void _CPU_cache_enable_instruction(void) {
__asm__ __volatile__ ("ssync");
*(uint32_t volatile *) IMEM_CONTROL |= IMEM_CONTROL_IMC;
__asm__ __volatile__ ("ssync");
}
-void _CPU_cache_disable_instruction(void) {
+static void _CPU_cache_disable_instruction(void) {
__asm__ __volatile__ ("ssync");
*(uint32_t volatile *) IMEM_CONTROL &= ~IMEM_CONTROL_IMC;
__asm__ __volatile__ ("ssync");
}
+#include "../../shared/cache/cacheimpl.h"
diff --git a/c/src/lib/libcpu/i386/cache.c b/bsps/i386/shared/cache/cache.c
similarity index 53%
rename from c/src/lib/libcpu/i386/cache.c
rename to bsps/i386/shared/cache/cache.c
index da31a38bee..64f4ee92ce 100644
--- a/c/src/lib/libcpu/i386/cache.c
+++ b/bsps/i386/shared/cache/cache.c
@@ -3,11 +3,14 @@
*/
#include <rtems.h>
-#include "cache_.h"
#include <rtems/score/cpu.h>
#include <libcpu/page.h>
-void _CPU_disable_cache(void)
+#define I386_CACHE_ALIGNMENT 16
+#define CPU_DATA_CACHE_ALIGNMENT I386_CACHE_ALIGNMENT
+#define CPU_INSTRUCTION_CACHE_ALIGNEMNT I386_CACHE_ALIGNMENT
+
+static void _CPU_disable_cache(void)
{
unsigned int regCr0;
@@ -22,7 +25,7 @@ void _CPU_disable_cache(void)
* Enable the entire cache
*/
-void _CPU_enable_cache(void)
+static void _CPU_enable_cache(void)
{
unsigned int regCr0;
@@ -44,45 +47,46 @@ void _CPU_enable_cache(void)
*/
#if defined(I386_CACHE_ALIGNMENT)
-void _CPU_cache_flush_1_data_line(const void *d_addr) {}
-void _CPU_cache_invalidate_1_data_line(const void *d_addr) {}
-void _CPU_cache_freeze_data(void) {}
-void _CPU_cache_unfreeze_data(void) {}
-void _CPU_cache_invalidate_1_instruction_line ( const void *d_addr ) {}
-void _CPU_cache_freeze_instruction(void) {}
-void _CPU_cache_unfreeze_instruction(void) {}
-
-void _CPU_cache_flush_entire_data(void)
+static void _CPU_cache_flush_1_data_line(const void *d_addr) {}
+static void _CPU_cache_invalidate_1_data_line(const void *d_addr) {}
+static void _CPU_cache_freeze_data(void) {}
+static void _CPU_cache_unfreeze_data(void) {}
+static void _CPU_cache_invalidate_1_instruction_line ( const void *d_addr ) {}
+static void _CPU_cache_freeze_instruction(void) {}
+static void _CPU_cache_unfreeze_instruction(void) {}
+
+static void _CPU_cache_flush_entire_data(void)
{
__asm__ volatile ("wbinvd");
}
-void _CPU_cache_invalidate_entire_data(void)
+static void _CPU_cache_invalidate_entire_data(void)
{
__asm__ volatile ("invd");
}
-void _CPU_cache_enable_data(void)
+static void _CPU_cache_enable_data(void)
{
_CPU_enable_cache();
}
-void _CPU_cache_disable_data(void)
+static void _CPU_cache_disable_data(void)
{
_CPU_disable_cache();
}
-void _CPU_cache_invalidate_entire_instruction(void)
+static void _CPU_cache_invalidate_entire_instruction(void)
{
__asm__ volatile ("invd");
}
-void _CPU_cache_enable_instruction(void)
+static void _CPU_cache_enable_instruction(void)
{
_CPU_enable_cache();
}
-void _CPU_cache_disable_instruction( void )
+static void _CPU_cache_disable_instruction( void )
{
_CPU_disable_cache();
}
-#endif
+
+#include "../../../shared/cache/cacheimpl.h"
diff --git a/c/src/lib/libbsp/m68k/genmcf548x/include/cache_.h b/bsps/m68k/genmcf548x/cache.c
similarity index 95%
rename from c/src/lib/libbsp/m68k/genmcf548x/include/cache_.h
rename to bsps/m68k/genmcf548x/cache.c
index 7d597c806c..18aa929b3d 100644
--- a/c/src/lib/libbsp/m68k/genmcf548x/include/cache_.h
+++ b/bsps/m68k/genmcf548x/cache.c
@@ -12,10 +12,6 @@
* http://www.rtems.org/license/LICENSE.
*/
-
-#ifndef LIBBSP_M68K_GENMCF548X_CACHE_H
-#define LIBBSP_M68K_GENMCF548X_CACHE_H
-
#include <bsp.h>
#define CPU_DATA_CACHE_ALIGNMENT 16
@@ -114,4 +110,4 @@ static inline void _CPU_cache_flush_entire_data( void)
}
}
-#endif /* LIBBSP_M68K_GENMCF548X_CACHE_H */
+#include "../../../shared/cache/cacheimpl.h"
diff --git a/c/src/lib/libcpu/m68k/mcf5223x/cache/cachepd.c b/bsps/m68k/shared/cache/cache-mcf5223x.c
similarity index 100%
rename from c/src/lib/libcpu/m68k/mcf5223x/cache/cachepd.c
rename to bsps/m68k/shared/cache/cache-mcf5223x.c
diff --git a/c/src/lib/libcpu/m68k/mcf5225x/cache/cachepd.c b/bsps/m68k/shared/cache/cache-mcf5225x.c
similarity index 100%
rename from c/src/lib/libcpu/m68k/mcf5225x/cache/cachepd.c
rename to bsps/m68k/shared/cache/cache-mcf5225x.c
diff --git a/c/src/lib/libcpu/m68k/mcf5235/cache/cachepd.c b/bsps/m68k/shared/cache/cache-mcf5235.c
similarity index 100%
rename from c/src/lib/libcpu/m68k/mcf5235/cache/cachepd.c
rename to bsps/m68k/shared/cache/cache-mcf5235.c
diff --git a/c/src/lib/libcpu/m68k/mcf5282/cache/cachepd.c b/bsps/m68k/shared/cache/cache-mcf5282.c
similarity index 73%
rename from c/src/lib/libcpu/m68k/mcf5282/cache/cachepd.c
rename to bsps/m68k/shared/cache/cache-mcf5282.c
index e59f213236..259572432a 100644
--- a/c/src/lib/libcpu/m68k/mcf5282/cache/cachepd.c
+++ b/bsps/m68k/shared/cache/cache-mcf5282.c
@@ -6,7 +6,7 @@
#include <rtems.h>
#include <mcf5282/mcf5282.h> /* internal MCF5282 modules */
-#include "cache_.h"
+#include "cache.h"
/*
* CPU-space access
@@ -40,18 +40,18 @@ void mcf5xxx_initialize_cacr(uint32_t cacr)
/*
* Cannot be frozen
*/
-void _CPU_cache_freeze_data(void) {}
-void _CPU_cache_unfreeze_data(void) {}
-void _CPU_cache_freeze_instruction(void) {}
-void _CPU_cache_unfreeze_instruction(void) {}
+static void _CPU_cache_freeze_data(void) {}
+static void _CPU_cache_unfreeze_data(void) {}
+static void _CPU_cache_freeze_instruction(void) {}
+static void _CPU_cache_unfreeze_instruction(void) {}
/*
* Write-through data cache -- flushes are unnecessary
*/
-void _CPU_cache_flush_1_data_line(const void *d_addr) {}
-void _CPU_cache_flush_entire_data(void) {}
+static void _CPU_cache_flush_1_data_line(const void *d_addr) {}
+static void _CPU_cache_flush_entire_data(void) {}
-void _CPU_cache_enable_instruction(void)
+static void _CPU_cache_enable_instruction(void)
{
rtems_interrupt_level level;
@@ -62,7 +62,7 @@ void _CPU_cache_enable_instruction(void)
rtems_interrupt_enable(level);
}
-void _CPU_cache_disable_instruction(void)
+static void _CPU_cache_disable_instruction(void)
{
rtems_interrupt_level level;
@@ -72,13 +72,13 @@ void _CPU_cache_disable_instruction(void)
rtems_interrupt_enable(level);
}
-void _CPU_cache_invalidate_entire_instruction(void)
+static void _CPU_cache_invalidate_entire_instruction(void)
{
m68k_set_cacr(cacr_mode | MCF5XXX_CACR_CINV | MCF5XXX_CACR_INVI);
NOP;
}
-void _CPU_cache_invalidate_1_instruction_line(const void *addr)
+static void _CPU_cache_invalidate_1_instruction_line(const void *addr)
{
/*
* Top half of cache is I-space
@@ -87,7 +87,7 @@ void _CPU_cache_invalidate_1_instruction_line(const void *addr)
__asm__ volatile ("cpushl %%bc,(%0)" :: "a" (addr));
}
-void _CPU_cache_enable_data(void)
+static void _CPU_cache_enable_data(void)
{
rtems_interrupt_level level;
@@ -97,7 +97,7 @@ void _CPU_cache_enable_data(void)
rtems_interrupt_enable(level);
}
-void _CPU_cache_disable_data(void)
+static void _CPU_cache_disable_data(void)
{
rtems_interrupt_level level;
@@ -107,12 +107,12 @@ void _CPU_cache_disable_data(void)
rtems_interrupt_enable(level);
}
-void _CPU_cache_invalidate_entire_data(void)
+static void _CPU_cache_invalidate_entire_data(void)
{
m68k_set_cacr(cacr_mode | MCF5XXX_CACR_CINV | MCF5XXX_CACR_INVD);
}
-void _CPU_cache_invalidate_1_data_line(const void *addr)
+static void _CPU_cache_invalidate_1_data_line(const void *addr)
{
/*
* Bottom half of cache is D-space
@@ -120,3 +120,5 @@ void _CPU_cache_invalidate_1_data_line(const void *addr)
addr = (void *)((int)addr & ~0x400);
__asm__ volatile ("cpushl %%bc,(%0)" :: "a" (addr));
}
+
+#include "../../../shared/cache/cacheimpl.h"
diff --git a/c/src/lib/libcpu/m68k/mcf532x/cache/cachepd.c b/bsps/m68k/shared/cache/cache-mcf532x.c
similarity index 100%
rename from c/src/lib/libcpu/m68k/mcf532x/cache/cachepd.c
rename to bsps/m68k/shared/cache/cache-mcf532x.c
diff --git a/bsps/m68k/shared/cache/cache.c b/bsps/m68k/shared/cache/cache.c
new file mode 100644
index 0000000000..3b5e87ef56
--- /dev/null
+++ b/bsps/m68k/shared/cache/cache.c
@@ -0,0 +1,3 @@
+#include <rtems.h>
+#include "cache.h"
+#include "../../../shared/cache/cacheimpl.h"
diff --git a/c/src/lib/libcpu/m68k/shared/cache/cache.c b/bsps/m68k/shared/cache/cache.h
similarity index 82%
rename from c/src/lib/libcpu/m68k/shared/cache/cache.c
rename to bsps/m68k/shared/cache/cache.h
index 5039ea59ed..2fa78b651d 100644
--- a/c/src/lib/libcpu/m68k/shared/cache/cache.c
+++ b/bsps/m68k/shared/cache/cache.h
@@ -1,9 +1,35 @@
/*
- * Cache Management Support Routines for the MC68040
+ * M68K Cache Manager Support
*/
-#include <rtems.h>
-#include "cache_.h"
+#if (defined(__mc68020__) && !defined(__mcpu32__))
+# define M68K_INSTRUCTION_CACHE_ALIGNMENT 16
+#elif defined(__mc68030__)
+# define M68K_INSTRUCTION_CACHE_ALIGNMENT 16
+# define M68K_DATA_CACHE_ALIGNMENT 16
+#elif ( defined(__mc68040__) || defined (__mc68060__) )
+# define M68K_INSTRUCTION_CACHE_ALIGNMENT 16
+# define M68K_DATA_CACHE_ALIGNMENT 16
+#elif ( defined(__mcf5200__) )
+# define M68K_INSTRUCTION_CACHE_ALIGNMENT 16
+# if ( defined(__mcf528x__) )
+# define M68K_DATA_CACHE_ALIGNMENT 16
+# endif
+#elif ( defined(__mcf5300__) )
+# define M68K_INSTRUCTION_CACHE_ALIGNMENT 16
+# define M68K_DATA_CACHE_ALIGNMENT 16
+#elif defined(__mcfv4e__)
+# define M68K_INSTRUCTION_CACHE_ALIGNMENT 16
+# define M68K_DATA_CACHE_ALIGNMENT 16
+#endif
+
+#if defined(M68K_DATA_CACHE_ALIGNMENT)
+#define CPU_DATA_CACHE_ALIGNMENT M68K_DATA_CACHE_ALIGNMENT
+#endif
+
+#if defined(M68K_INSTRUCTION_CACHE_ALIGNMENT)
+#define CPU_INSTRUCTION_CACHE_ALIGNMENT M68K_INSTRUCTION_CACHE_ALIGNMENT
+#endif
/*
* Since the cacr is common to all mc680x0, provide macros
@@ -187,4 +213,3 @@ void _CPU_cache_disable_instruction ( void )
_CPU_CACR_AND( 0xFFFF7FFF );
}
#endif
-/* end of file */
diff --git a/bsps/or1k/include/bsp/cache_.h b/bsps/or1k/include/bsp/cache_.h
deleted file mode 100644
index ed2053858e..0000000000
--- a/bsps/or1k/include/bsp/cache_.h
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- * COPYRIGHT (c) 2014 Hesham ALMatary <heshamelmatary at gmail.com>
- *
- * 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.
- */
-
-#ifndef LIBBSP_OR1K_SHARED_CACHE_H
-#define LIBBSP_OR1K_SHARED_CACHE_H
-
-#include <assert.h>
-#include <bsp.h>
-#include <rtems/rtems/intr.h>
-
-
-#ifdef __cplusplus
-extern "C" {
-#endif /* __cplusplus */
-
-/* These two defines also ensure that the rtems_cache_* functions have bodies */
-#define CPU_DATA_CACHE_ALIGNMENT 32
-#define CPU_INSTRUCTION_CACHE_ALIGNMENT 32
-
-#define CPU_CACHE_SUPPORT_PROVIDES_CACHE_SIZE_FUNCTIONS 1
-
-static inline size_t
-_CPU_cache_get_data_cache_size( const uint32_t level )
-{
- return (level == 0 || level == 1)? 8192 : 0;
-}
-
-static inline size_t
-_CPU_cache_get_instruction_cache_size( const uint32_t level )
-{
- return (level == 0 || level == 1)? 8192 : 0;
-}
-
-#ifdef __cplusplus
-}
-#endif /* __cplusplus */
-
-#endif /* LIBBSP_OR1K_SHARED_CACHE_H */
diff --git a/c/src/lib/libcpu/or1k/shared/cache/cache.c b/bsps/or1k/shared/cache/cache.c
similarity index 83%
rename from c/src/lib/libcpu/or1k/shared/cache/cache.c
rename to bsps/or1k/shared/cache/cache.c
index 898955f041..55fa54e62f 100644
--- a/c/src/lib/libcpu/or1k/shared/cache/cache.c
+++ b/bsps/or1k/shared/cache/cache.c
@@ -18,7 +18,24 @@
#include <rtems/score/interr.h>
#include <rtems/score/or1k-utility.h>
#include <rtems/score/percpu.h>
-#include "cache_.h"
+
+#define CPU_DATA_CACHE_ALIGNMENT 32
+#define CPU_INSTRUCTION_CACHE_ALIGNMENT 32
+
+#define CPU_CACHE_SUPPORT_PROVIDES_RANGE_FUNCTIONS 1
+#define CPU_CACHE_SUPPORT_PROVIDES_CACHE_SIZE_FUNCTIONS 1
+
+static inline size_t
+_CPU_cache_get_data_cache_size( const uint32_t level )
+{
+ return (level == 0 || level == 1)? 8192 : 0;
+}
+
+static inline size_t
+_CPU_cache_get_instruction_cache_size( const uint32_t level )
+{
+ return (level == 0 || level == 1)? 8192 : 0;
+}
static inline void _CPU_OR1K_Cache_data_block_prefetch(const void *d_addr)
{
@@ -79,7 +96,7 @@ static inline void _CPU_OR1K_Cache_instruction_block_lock
/* Implement RTEMS cache manager functions */
-void _CPU_cache_flush_1_data_line(const void *d_addr)
+static void _CPU_cache_flush_1_data_line(const void *d_addr)
{
ISR_Level level;
@@ -92,7 +109,7 @@ void _CPU_cache_flush_1_data_line(const void *d_addr)
_ISR_Local_enable(level);
}
-void _CPU_cache_invalidate_1_data_line(const void *d_addr)
+static void _CPU_cache_invalidate_1_data_line(const void *d_addr)
{
ISR_Level level;
@@ -103,17 +120,17 @@ void _CPU_cache_invalidate_1_data_line(const void *d_addr)
_ISR_Local_enable(level);
}
-void _CPU_cache_freeze_data(void)
+static void _CPU_cache_freeze_data(void)
{
/* Do nothing */
}
-void _CPU_cache_unfreeze_data(void)
+static void _CPU_cache_unfreeze_data(void)
{
/* Do nothing */
}
-void _CPU_cache_invalidate_1_instruction_line(const void *d_addr)
+static void _CPU_cache_invalidate_1_instruction_line(const void *d_addr)
{
ISR_Level level;
@@ -124,17 +141,17 @@ void _CPU_cache_invalidate_1_instruction_line(const void *d_addr)
_ISR_Local_enable(level);
}
-void _CPU_cache_freeze_instruction(void)
+static void _CPU_cache_freeze_instruction(void)
{
/* Do nothing */
}
-void _CPU_cache_unfreeze_instruction(void)
+static void _CPU_cache_unfreeze_instruction(void)
{
/* Do nothing */
}
-void _CPU_cache_flush_entire_data(void)
+static void _CPU_cache_flush_entire_data(void)
{
size_t addr;
ISR_Level level;
@@ -153,7 +170,7 @@ void _CPU_cache_flush_entire_data(void)
_ISR_Local_enable (level);
}
-void _CPU_cache_invalidate_entire_data(void)
+static void _CPU_cache_invalidate_entire_data(void)
{
size_t addr;
ISR_Level level;
@@ -172,7 +189,7 @@ void _CPU_cache_invalidate_entire_data(void)
_ISR_Local_enable (level);
}
-void _CPU_cache_invalidate_entire_instruction(void)
+static void _CPU_cache_invalidate_entire_instruction(void)
{
size_t addr;
ISR_Level level;
@@ -205,7 +222,7 @@ void _CPU_cache_invalidate_entire_instruction(void)
* cache line operation.
*/
-void _CPU_cache_flush_data_range(const void *d_addr, size_t n_bytes)
+static void _CPU_cache_flush_data_range(const void *d_addr, size_t n_bytes)
{
const void * final_address;
ISR_Level level;
@@ -242,7 +259,7 @@ void _CPU_cache_flush_data_range(const void *d_addr, size_t n_bytes)
_ISR_Local_enable (level);
}
-void _CPU_cache_invalidate_data_range(const void *d_addr, size_t n_bytes)
+static void _CPU_cache_invalidate_data_range(const void *d_addr, size_t n_bytes)
{
const void * final_address;
ISR_Level level;
@@ -279,7 +296,7 @@ void _CPU_cache_invalidate_data_range(const void *d_addr, size_t n_bytes)
_ISR_Local_enable (level);
}
-void _CPU_cache_invalidate_instruction_range(const void *i_addr, size_t n_bytes)
+static void _CPU_cache_invalidate_instruction_range(const void *i_addr, size_t n_bytes)
{
const void * final_address;
ISR_Level level;
@@ -316,7 +333,7 @@ void _CPU_cache_invalidate_instruction_range(const void *i_addr, size_t n_bytes)
_ISR_Local_enable (level);
}
-void _CPU_cache_enable_data(void)
+static void _CPU_cache_enable_data(void)
{
uint32_t sr;
ISR_Level level;
@@ -329,7 +346,7 @@ void _CPU_cache_enable_data(void)
_ISR_Local_enable(level);
}
-void _CPU_cache_disable_data(void)
+static void _CPU_cache_disable_data(void)
{
uint32_t sr;
ISR_Level level;
@@ -342,7 +359,7 @@ void _CPU_cache_disable_data(void)
_ISR_Local_enable(level);
}
-void _CPU_cache_enable_instruction(void)
+static void _CPU_cache_enable_instruction(void)
{
uint32_t sr;
ISR_Level level;
@@ -355,7 +372,7 @@ void _CPU_cache_enable_instruction(void)
_ISR_Local_enable(level);
}
-void _CPU_cache_disable_instruction(void)
+static void _CPU_cache_disable_instruction(void)
{
uint32_t sr;
ISR_Level level;
@@ -367,3 +384,5 @@ void _CPU_cache_disable_instruction(void)
_ISR_Local_enable(level);
}
+
+#include "../../../shared/cache/cacheimpl.h"
diff --git a/c/src/lib/libcpu/powerpc/shared/src/cache_.h b/bsps/powerpc/shared/cache/cache.c
similarity index 98%
rename from c/src/lib/libcpu/powerpc/shared/src/cache_.h
rename to bsps/powerpc/shared/cache/cache.c
index 17758947e0..902893b883 100644
--- a/c/src/lib/libcpu/powerpc/shared/src/cache_.h
+++ b/bsps/powerpc/shared/cache/cache.c
@@ -12,9 +12,6 @@
* Surrey Satellite Technology Limited (SSTL), 2001
*/
-#ifndef LIBCPU_POWERPC_CACHE_H
-#define LIBCPU_POWERPC_CACHE_H
-
#include <rtems.h>
#include <rtems/powerpc/powerpc.h>
#include <rtems/powerpc/registers.h>
@@ -319,4 +316,4 @@ static inline void _CPU_cache_invalidate_1_instruction_line(const void *addr)
__asm__ volatile ( "icbi 0,%0" :: "r" (addr) : "memory");
}
-#endif /* LIBCPU_POWERPC_CACHE_H */
+#include "../../../bsps/shared/cache/cacheimpl.h"
diff --git a/c/src/lib/libcpu/shared/src/cache_manager.c b/bsps/shared/cache/cacheimpl.h
similarity index 99%
rename from c/src/lib/libcpu/shared/src/cache_manager.c
rename to bsps/shared/cache/cacheimpl.h
index 3201c319b8..7e9f863337 100644
--- a/c/src/lib/libcpu/shared/src/cache_manager.c
+++ b/bsps/shared/cache/cacheimpl.h
@@ -40,7 +40,6 @@
*/
#include <rtems.h>
-#include "cache_.h"
#if CPU_DATA_CACHE_ALIGNMENT > CPU_CACHE_LINE_BYTES
#error "CPU_DATA_CACHE_ALIGNMENT is greater than CPU_CACHE_LINE_BYTES"
diff --git a/bsps/shared/cache/nocache.c b/bsps/shared/cache/nocache.c
new file mode 100644
index 0000000000..55aea24762
--- /dev/null
+++ b/bsps/shared/cache/nocache.c
@@ -0,0 +1 @@
+#include "cacheimpl.h"
diff --git a/c/src/lib/libbsp/arm/altera-cyclone-v/Makefile.am b/c/src/lib/libbsp/arm/altera-cyclone-v/Makefile.am
index cad2171586..fb63f94297 100644
--- a/c/src/lib/libbsp/arm/altera-cyclone-v/Makefile.am
+++ b/c/src/lib/libbsp/arm/altera-cyclone-v/Makefile.am
@@ -52,7 +52,6 @@ noinst_LIBRARIES = libbsp.a
libbsp_a_SOURCES =
libbsp_a_CPPFLAGS = $(AM_CPPFLAGS)
-libbsp_a_LIBADD =
# for the Altera hwlib
libbsp_a_CPPFLAGS += -I${srcdir}/hwlib/include
@@ -133,10 +132,7 @@ libbsp_a_SOURCES += ../../shared/tod.c
libbsp_a_SOURCES += rtc/rtc.c
# Cache
-libbsp_a_SOURCES += ../../../libcpu/shared/src/cache_manager.c
-libbsp_a_SOURCES += ../shared/include/arm-cache-l1.h
-libbsp_a_SOURCES += ../shared/arm-l2c-310/cache_.h
-libbsp_a_CPPFLAGS += -I$(srcdir)/../shared/arm-l2c-310
+libbsp_a_SOURCES += ../../../../../../bsps/arm/shared/cache/cache-l2c-310.c
###############################################################################
# Special Rules #
diff --git a/c/src/lib/libbsp/arm/atsam/Makefile.am b/c/src/lib/libbsp/arm/atsam/Makefile.am
index a41931ff78..10f34dab55 100644
--- a/c/src/lib/libbsp/arm/atsam/Makefile.am
+++ b/c/src/lib/libbsp/arm/atsam/Makefile.am
@@ -136,9 +136,7 @@ libbsp_a_SOURCES += clock/systick-freq.c
libbsp_a_SOURCES += ../../shared/timerstub.c
# Cache
-libbsp_a_SOURCES += ../../../libcpu/shared/src/cache_manager.c
-libbsp_a_SOURCES += ../shared/armv7m/include/cache_.h
-libbsp_a_CPPFLAGS += -I$(srcdir)/../shared/armv7m/include
+libbsp_a_SOURCES += ../../../../../../bsps/arm/shared/cache/cache-v7m.c
# Network
if HAS_NETWORKING
diff --git a/c/src/lib/libbsp/arm/beagle/Makefile.am b/c/src/lib/libbsp/arm/beagle/Makefile.am
index ae46cb391a..8251660bcb 100644
--- a/c/src/lib/libbsp/arm/beagle/Makefile.am
+++ b/c/src/lib/libbsp/arm/beagle/Makefile.am
@@ -36,7 +36,6 @@ dist_project_lib_DATA += startup/linkcmds.beagle
noinst_LIBRARIES = libbsp.a
libbsp_a_SOURCES =
-libbsp_a_CPPFLAGS = $(AM_CPPFLAGS)
libbsp_a_LIBADD =
# Shared
@@ -97,10 +96,7 @@ libbsp_a_SOURCES += clock.c
libbsp_a_SOURCES += ../../shared/clockdrv_shell.h
# Cache
-libbsp_a_SOURCES += ../../../libcpu/shared/src/cache_manager.c
-libbsp_a_SOURCES += ../shared/include/arm-cache-l1.h
-libbsp_a_SOURCES += ../shared/armv467ar-basic-cache/cache_.h
-libbsp_a_CPPFLAGS += -I$(srcdir)/../shared/armv467ar-basic-cache
+libbsp_a_SOURCES += ../../../../../../bsps/arm/shared/cache/cache-cp15.c
###############################################################################
# Special Rules #
diff --git a/c/src/lib/libbsp/arm/csb336/Makefile.am b/c/src/lib/libbsp/arm/csb336/Makefile.am
index 9ec214921c..8bc5a44f23 100644
--- a/c/src/lib/libbsp/arm/csb336/Makefile.am
+++ b/c/src/lib/libbsp/arm/csb336/Makefile.am
@@ -6,8 +6,6 @@ include $(top_srcdir)/../../bsp.am
dist_project_lib_DATA = startup/bsp_specs
-libbsp_a_CPPFLAGS = $(AM_CPPFLAGS)
-
DISTCLEANFILES = include/bspopts.h
noinst_PROGRAMS =
@@ -45,10 +43,7 @@ libbsp_a_SOURCES += ../../shared/src/irq-shell.c
libbsp_a_SOURCES += irq/irq.c
# Cache
-libbsp_a_SOURCES += ../../../libcpu/shared/src/cache_manager.c
-libbsp_a_SOURCES += ../shared/include/arm-cache-l1.h
-libbsp_a_SOURCES += ../shared/armv467ar-basic-cache/cache_.h
-libbsp_a_CPPFLAGS += -I$(srcdir)/../shared/armv467ar-basic-cache
+libbsp_a_SOURCES += ../../../../../../bsps/arm/shared/cache/cache-cp15.c
if HAS_NETWORKING
libbsp_a_SOURCES += network/lan91c11x.c
diff --git a/c/src/lib/libbsp/arm/csb337/Makefile.am b/c/src/lib/libbsp/arm/csb337/Makefile.am
index 1870f9fba9..69780d18a5 100644
--- a/c/src/lib/libbsp/arm/csb337/Makefile.am
+++ b/c/src/lib/libbsp/arm/csb337/Makefile.am
@@ -9,8 +9,6 @@ dist_project_lib_DATA = startup/bsp_specs
if ENABLE_LCD
endif
-libbsp_a_CPPFLAGS = $(AM_CPPFLAGS)
-
if ENABLE_UMON
endif
@@ -76,10 +74,7 @@ libbsp_a_SOURCES += ../../shared/umon/umoncons.c
endif
# Cache
-libbsp_a_SOURCES += ../../../libcpu/shared/src/cache_manager.c
-libbsp_a_SOURCES += ../shared/include/arm-cache-l1.h
-libbsp_a_SOURCES += ../shared/armv467ar-basic-cache/cache_.h
-libbsp_a_CPPFLAGS += -I$(srcdir)/../shared/armv467ar-basic-cache
+libbsp_a_SOURCES += ../../../../../../bsps/arm/shared/cache/cache-cp15.c
if HAS_NETWORKING
libbsp_a_SOURCES += network/network.c
diff --git a/c/src/lib/libbsp/arm/edb7312/Makefile.am b/c/src/lib/libbsp/arm/edb7312/Makefile.am
index bbf555a616..9ccca0b06d 100644
--- a/c/src/lib/libbsp/arm/edb7312/Makefile.am
+++ b/c/src/lib/libbsp/arm/edb7312/Makefile.am
@@ -50,9 +50,7 @@ libbsp_a_SOURCES += irq/irq.c
libbsp_a_SOURCES += irq/bsp_irq_asm.S
# Cache
-libbsp_a_SOURCES += ../../../libcpu/shared/src/cache_manager.c
-libbsp_a_SOURCES += ../../shared/include/cache_.h
-libbsp_a_CPPFLAGS = $(AM_CPPFLAGS) -I$(srcdir)/../../shared/include
+libbsp_a_SOURCES += ../../../../../../bsps/shared/cache/nocache.c
if HAS_NETWORKING
libbsp_a_SOURCES += network/network.c
diff --git a/c/src/lib/libbsp/arm/gdbarmsim/Makefile.am b/c/src/lib/libbsp/arm/gdbarmsim/Makefile.am
index 328792883e..62cbdccb8b 100644
--- a/c/src/lib/libbsp/arm/gdbarmsim/Makefile.am
+++ b/c/src/lib/libbsp/arm/gdbarmsim/Makefile.am
@@ -50,9 +50,7 @@ libbsp_a_SOURCES += ../../shared/src/irq-server.c
libbsp_a_SOURCES += ../../shared/src/irq-shell.c
# Cache
-libbsp_a_SOURCES += ../../../libcpu/shared/src/cache_manager.c
-libbsp_a_SOURCES += ../../shared/include/cache_.h
-libbsp_a_CPPFLAGS = $(AM_CPPFLAGS) -I$(srcdir)/../../shared/include
+libbsp_a_SOURCES += ../../../../../../bsps/shared/cache/nocache.c
#libbsp_a_LIBADD = ../../../libcpu/@RTEMS_CPU@/shared/arm920.rel \
# ../../../libcpu/@RTEMS_CPU@/@RTEMS_CPU_MODEL@/clock.rel \
diff --git a/c/src/lib/libbsp/arm/gumstix/Makefile.am b/c/src/lib/libbsp/arm/gumstix/Makefile.am
index 842c5c0f8c..cff8663382 100644
--- a/c/src/lib/libbsp/arm/gumstix/Makefile.am
+++ b/c/src/lib/libbsp/arm/gumstix/Makefile.am
@@ -46,9 +46,7 @@ libbsp_a_SOURCES += ../../shared/src/irq-shell.c
libbsp_a_SOURCES += irq/irq.c
# Cache
-libbsp_a_SOURCES += ../../../libcpu/shared/src/cache_manager.c
-libbsp_a_SOURCES += ../../shared/include/cache_.h
-libbsp_a_CPPFLAGS = $(AM_CPPFLAGS) -I$(srcdir)/../../shared/include
+libbsp_a_SOURCES += ../../../../../../bsps/shared/cache/nocache.c
if ON_SKYEYE
libbsp_a_SOURCES += fb/fb.c
diff --git a/c/src/lib/libbsp/arm/imx/Makefile.am b/c/src/lib/libbsp/arm/imx/Makefile.am
index bc2f6acf53..73c87f7503 100644
--- a/c/src/lib/libbsp/arm/imx/Makefile.am
+++ b/c/src/lib/libbsp/arm/imx/Makefile.am
@@ -29,8 +29,6 @@ dist_project_lib_DATA += startup/linkcmds.imx7
noinst_LIBRARIES = libbsp.a
libbsp_a_SOURCES =
-libbsp_a_CPPFLAGS = $(AM_CPPFLAGS)
-libbsp_a_LIBADD =
# Shared
libbsp_a_SOURCES += ../../shared/bootcard.c
@@ -76,10 +74,7 @@ libbsp_a_SOURCES += ../../shared/clockdrv_shell.h
libbsp_a_SOURCES += ../shared/arm-generic-timer-clock-config.c
# Cache
-libbsp_a_SOURCES += ../../../libcpu/shared/src/cache_manager.c
-libbsp_a_SOURCES += ../shared/include/arm-cache-l1.h
-libbsp_a_SOURCES += ../shared/armv467ar-basic-cache/cache_.h
-libbsp_a_CPPFLAGS += -I$(srcdir)/../shared/armv467ar-basic-cache
+libbsp_a_SOURCES += ../../../../../../bsps/arm/shared/cache/cache-cp15.c
# I2C
libbsp_a_SOURCES += i2c/imx-i2c.c
diff --git a/c/src/lib/libbsp/arm/lm3s69xx/Makefile.am b/c/src/lib/libbsp/arm/lm3s69xx/Makefile.am
index 3e5e0e1556..e5ba764f60 100644
--- a/c/src/lib/libbsp/arm/lm3s69xx/Makefile.am
+++ b/c/src/lib/libbsp/arm/lm3s69xx/Makefile.am
@@ -31,8 +31,6 @@ dist_project_lib_DATA += startup/linkcmds.lm3s6965_qemu
noinst_LIBRARIES = libbsp.a
libbsp_a_SOURCES =
-libbsp_a_CPPFLAGS = $(AM_CPPFLAGS)
-libbsp_a_LIBADD =
# Shared
libbsp_a_SOURCES += ../../shared/bootcard.c
@@ -81,9 +79,7 @@ libbsp_a_SOURCES += ../shared/armv7m/clock/armv7m-clock-config.c
libbsp_a_SOURCES += ../../shared/timerstub.c
# Cache
-libbsp_a_SOURCES += ../../../libcpu/shared/src/cache_manager.c
-libbsp_a_SOURCES += ../../../libcpu/arm/shared/cache/cache_.h
-libbsp_a_CPPFLAGS += -I$(srcdir)/../../../libcpu/arm/shared/include
+libbsp_a_SOURCES += ../../../../../../bsps/shared/cache/nocache.c
# SSI
libbsp_a_SOURCES += ssi/ssi.c
diff --git a/c/src/lib/libbsp/arm/lpc176x/Makefile.am b/c/src/lib/libbsp/arm/lpc176x/Makefile.am
index 634df1a609..4ac673a353 100644
--- a/c/src/lib/libbsp/arm/lpc176x/Makefile.am
+++ b/c/src/lib/libbsp/arm/lpc176x/Makefile.am
@@ -40,8 +40,6 @@ dist_project_lib_DATA += startup/linkcmds.lpc1768_mbed_ahb_ram_eth
noinst_LIBRARIES = libbsp.a
libbsp_a_SOURCES =
-libbsp_a_CPPFLAGS = $(AM_CPPFLAGS)
-libbsp_a_LIBADD =
# Shared
libbsp_a_SOURCES += ../../shared/bootcard.c
@@ -114,9 +112,7 @@ libbsp_a_SOURCES += misc/restart.c
libbsp_a_SOURCES += watchdog/watchdog.c
# Cache
-libbsp_a_SOURCES += ../../../libcpu/shared/src/cache_manager.c
-libbsp_a_SOURCES += ../../../libcpu/arm/shared/include/cache_.h
-libbsp_a_CPPFLAGS += -I$(srcdir)/../../../libcpu/arm/shared/include
+libbsp_a_SOURCES += ../../../../../../bsps/shared/cache/nocache.c
# Start hooks
libbsp_a_SOURCES += startup/bspstarthooks.c
diff --git a/c/src/lib/libbsp/arm/lpc24xx/Makefile.am b/c/src/lib/libbsp/arm/lpc24xx/Makefile.am
index d64806b62a..5e6f8f02c1 100644
--- a/c/src/lib/libbsp/arm/lpc24xx/Makefile.am
+++ b/c/src/lib/libbsp/arm/lpc24xx/Makefile.am
@@ -49,8 +49,6 @@ dist_project_lib_DATA += startup/linkcmds.lpc40xx_ea_rom_int
noinst_LIBRARIES = libbsp.a
libbsp_a_SOURCES =
-libbsp_a_CPPFLAGS = $(AM_CPPFLAGS)
-libbsp_a_LIBADD =
# Shared
libbsp_a_SOURCES += ../../shared/bootcard.c \
@@ -121,9 +119,7 @@ libbsp_a_SOURCES += ../shared/arm-pl111-fb.c
libbsp_a_SOURCES += startup/fb-config.c
# Cache
-libbsp_a_SOURCES += ../../../libcpu/shared/src/cache_manager.c
-libbsp_a_SOURCES += ../../../libcpu/arm/shared/include/cache_.h
-libbsp_a_CPPFLAGS += -I$(srcdir)/../../../libcpu/arm/shared/include
+libbsp_a_SOURCES += ../../../../../../bsps/shared/cache/nocache.c
# Start hooks
libbsp_a_SOURCES += startup/bspstarthooks.c
diff --git a/c/src/lib/libbsp/arm/lpc32xx/Makefile.am b/c/src/lib/libbsp/arm/lpc32xx/Makefile.am
index 08ff91eb91..7a6e8a80a1 100644
--- a/c/src/lib/libbsp/arm/lpc32xx/Makefile.am
+++ b/c/src/lib/libbsp/arm/lpc32xx/Makefile.am
@@ -40,8 +40,6 @@ dist_project_lib_DATA += startup/linkcmds.lpc32xx_mzx
noinst_LIBRARIES = libbsp.a
libbsp_a_SOURCES =
-libbsp_a_CPPFLAGS = $(AM_CPPFLAGS)
-libbsp_a_LIBADD =
# Shared
libbsp_a_SOURCES += ../../shared/bootcard.c
@@ -103,11 +101,7 @@ libbsp_a_SOURCES += misc/idle-thread.c
# I2C
# Cache
-libbsp_a_SOURCES += ../../../libcpu/shared/src/cache_manager.c
-libbsp_a_SOURCES += ../shared/include/arm-cache-l1.h
-libbsp_a_SOURCES += ../shared/armv467ar-basic-cache/cache_.h
-libbsp_a_CPPFLAGS += -I$(srcdir)/../shared/armv467ar-basic-cache
-
+libbsp_a_SOURCES += ../../../../../../bsps/arm/shared/cache/cache-cp15.c
# Start hooks
libbsp_a_SOURCES += startup/bspstarthooks.c
diff --git a/c/src/lib/libbsp/arm/raspberrypi/Makefile.am b/c/src/lib/libbsp/arm/raspberrypi/Makefile.am
index 1fbe34350c..32b05b7737 100644
--- a/c/src/lib/libbsp/arm/raspberrypi/Makefile.am
+++ b/c/src/lib/libbsp/arm/raspberrypi/Makefile.am
@@ -114,10 +114,7 @@ libbsp_a_SOURCES += i2c/i2c.c
libbsp_a_SOURCES += spi/spi.c
# Cache
-libbsp_a_SOURCES += ../../../libcpu/shared/src/cache_manager.c
-libbsp_a_SOURCES += ../shared/include/arm-cache-l1.h
-libbsp_a_SOURCES += ../shared/armv467ar-basic-cache/cache_.h
-libbsp_a_CPPFLAGS = $(AM_CPPFLAGS) -I$(srcdir)/../shared/armv467ar-basic-cache
+libbsp_a_SOURCES += ../../../../../../bsps/arm/shared/cache/cache-cp15.c
# Start hooks
libbsp_a_SOURCES += startup/bspstarthooks.c
diff --git a/c/src/lib/libbsp/arm/realview-pbx-a9/Makefile.am b/c/src/lib/libbsp/arm/realview-pbx-a9/Makefile.am
index 21365156bd..ee4581756d 100644
--- a/c/src/lib/libbsp/arm/realview-pbx-a9/Makefile.am
+++ b/c/src/lib/libbsp/arm/realview-pbx-a9/Makefile.am
@@ -37,8 +37,6 @@ dist_project_lib_DATA += startup/linkcmds.realview_pbx_a9_qemu_smp
noinst_LIBRARIES = libbsp.a
libbsp_a_SOURCES =
-libbsp_a_CPPFLAGS = $(AM_CPPFLAGS)
-libbsp_a_LIBADD =
# Shared
libbsp_a_SOURCES += ../../shared/bootcard.c
@@ -85,10 +83,7 @@ libbsp_a_SOURCES += ../../shared/clockdrv_shell.h
libbsp_a_SOURCES += ../shared/arm-a9mpcore-clock-config.c
# Cache
-libbsp_a_SOURCES += ../../../libcpu/shared/src/cache_manager.c
-libbsp_a_SOURCES += ../shared/include/arm-cache-l1.h
-libbsp_a_SOURCES += ../shared/armv467ar-basic-cache/cache_.h
-libbsp_a_CPPFLAGS += -I$(srcdir)/../shared/armv467ar-basic-cache
+libbsp_a_SOURCES += ../../../../../../bsps/arm/shared/cache/cache-cp15.c
# Start hooks
libbsp_a_SOURCES += startup/bspstarthooks.c
diff --git a/c/src/lib/libbsp/arm/rtl22xx/Makefile.am b/c/src/lib/libbsp/arm/rtl22xx/Makefile.am
index 33db14cf0b..b9e52c1ed0 100644
--- a/c/src/lib/libbsp/arm/rtl22xx/Makefile.am
+++ b/c/src/lib/libbsp/arm/rtl22xx/Makefile.am
@@ -49,9 +49,7 @@ libbsp_a_SOURCES += irq/irq.c
libbsp_a_SOURCES += console/uart.c
# Cache
-libbsp_a_SOURCES += ../../../libcpu/shared/src/cache_manager.c
-libbsp_a_SOURCES += ../../shared/include/cache_.h
-libbsp_a_CPPFLAGS = $(AM_CPPFLAGS) -I$(srcdir)/../../shared/include
+libbsp_a_SOURCES += ../../../../../../bsps/shared/cache/nocache.c
if HAS_NETWORKING
libbsp_a_SOURCES += network/network.c
diff --git a/c/src/lib/libbsp/arm/smdk2410/Makefile.am b/c/src/lib/libbsp/arm/smdk2410/Makefile.am
index 45a280c504..a0922bd77f 100644
--- a/c/src/lib/libbsp/arm/smdk2410/Makefile.am
+++ b/c/src/lib/libbsp/arm/smdk2410/Makefile.am
@@ -6,8 +6,6 @@ include $(top_srcdir)/../../bsp.am
dist_project_lib_DATA = startup/bsp_specs
-libbsp_a_CPPFLAGS = $(AM_CPPFLAGS)
-
DISTCLEANFILES = include/bspopts.h
EXTRA_DIST += start/start.S
@@ -58,10 +56,7 @@ libbsp_a_SOURCES += smc/smc.c
libbsp_a_SOURCES += smc/smc.h
# Cache
-libbsp_a_SOURCES += ../../../libcpu/shared/src/cache_manager.c
-libbsp_a_SOURCES += ../shared/include/arm-cache-l1.h
-libbsp_a_SOURCES += ../shared/armv467ar-basic-cache/cache_.h
-libbsp_a_CPPFLAGS += -I$(srcdir)/../shared/armv467ar-basic-cache
+libbsp_a_SOURCES += ../../../../../../bsps/arm/shared/cache/cache-cp15.c
libbsp_a_LIBADD = ../../../libcpu/@RTEMS_CPU@/shared/arm920.rel
diff --git a/c/src/lib/libbsp/arm/stm32f4/Makefile.am b/c/src/lib/libbsp/arm/stm32f4/Makefile.am
index 98abdc3415..9f7533ba5a 100644
--- a/c/src/lib/libbsp/arm/stm32f4/Makefile.am
+++ b/c/src/lib/libbsp/arm/stm32f4/Makefile.am
@@ -30,8 +30,6 @@ dist_project_lib_DATA += startup/linkcmds.stm32f4
noinst_LIBRARIES = libbsp.a
libbsp_a_SOURCES =
-libbsp_a_CPPFLAGS = $(AM_CPPFLAGS)
-libbsp_a_LIBADD =
# Shared
libbsp_a_SOURCES += ../../shared/bootcard.c
@@ -85,9 +83,7 @@ libbsp_a_SOURCES += ../shared/armv7m/clock/armv7m-clock-config.c
libbsp_a_SOURCES += ../../shared/timerstub.c
# Cache
-libbsp_a_SOURCES += ../../../libcpu/shared/src/cache_manager.c
-libbsp_a_SOURCES += ../../../libcpu/arm/shared/cache/cache_.h
-libbsp_a_CPPFLAGS += -I$(srcdir)/../../../libcpu/arm/shared/include
+libbsp_a_SOURCES += ../../../../../../bsps/shared/cache/nocache.c
###############################################################################
# Special Rules #
diff --git a/c/src/lib/libbsp/arm/tms570/Makefile.am b/c/src/lib/libbsp/arm/tms570/Makefile.am
index 1ad63447d7..b85e40278f 100644
--- a/c/src/lib/libbsp/arm/tms570/Makefile.am
+++ b/c/src/lib/libbsp/arm/tms570/Makefile.am
@@ -39,8 +39,6 @@ dist_project_lib_DATA += startup/linkcmds.tms570ls3137_hdk_with_loader
noinst_LIBRARIES = libbsp.a
libbsp_a_SOURCES =
-libbsp_a_CPPFLAGS = $(AM_CPPFLAGS)
-libbsp_a_LIBADD =
# Shared
libbsp_a_SOURCES += ../../shared/bootcard.c
@@ -96,9 +94,7 @@ libbsp_a_SOURCES += misc/cpucounterread.c
# Watchdog
# Cache
-libbsp_a_SOURCES += ../../../libcpu/shared/src/cache_manager.c
-libbsp_a_SOURCES += ../../../libcpu/arm/shared/include/cache_.h
-libbsp_a_CPPFLAGS += -I$(srcdir)/../../../libcpu/arm/shared/include
+libbsp_a_SOURCES += ../../../../../../bsps/shared/cache/nocache.c
if TMS570_USE_HWINIT_STARTUP
libbsp_a_SOURCES += hwinit/tms570_sys_core.S
diff --git a/c/src/lib/libbsp/arm/xilinx-zynq/Makefile.am b/c/src/lib/libbsp/arm/xilinx-zynq/Makefile.am
index 94f4e0f5ea..93952e4299 100644
--- a/c/src/lib/libbsp/arm/xilinx-zynq/Makefile.am
+++ b/c/src/lib/libbsp/arm/xilinx-zynq/Makefile.am
@@ -35,8 +35,6 @@ project_lib_DATA += linkcmds
noinst_LIBRARIES = libbsp.a
libbsp_a_SOURCES =
-libbsp_a_CPPFLAGS = $(AM_CPPFLAGS)
-libbsp_a_LIBADD =
# Shared
libbsp_a_SOURCES += ../../shared/bootcard.c
@@ -84,10 +82,7 @@ libbsp_a_SOURCES += ../shared/arm-a9mpcore-clock-config.c
libbsp_a_SOURCES += i2c/cadence-i2c.c
# Cache
-libbsp_a_SOURCES += ../../../libcpu/shared/src/cache_manager.c
-libbsp_a_SOURCES += ../shared/include/arm-cache-l1.h
-libbsp_a_SOURCES += ../shared/arm-l2c-310/cache_.h
-libbsp_a_CPPFLAGS += -I$(srcdir)/../shared/arm-l2c-310
+libbsp_a_SOURCES += ../../../../../../bsps/arm/shared/cache/cache-l2c-310.c
# Start hooks
libbsp_a_SOURCES += startup/bspstarthooks.c startup/bspstartmmu.c
diff --git a/c/src/lib/libbsp/bfin/TLL6527M/Makefile.am b/c/src/lib/libbsp/bfin/TLL6527M/Makefile.am
index 32cb3c02ee..aff2e31490 100644
--- a/c/src/lib/libbsp/bfin/TLL6527M/Makefile.am
+++ b/c/src/lib/libbsp/bfin/TLL6527M/Makefile.am
@@ -29,10 +29,10 @@ libbsp_a_SOURCES = \
libbsp_a_SOURCES += ../../shared/bspreset.c
libbsp_a_SOURCES += console/console.c
+libbsp_a_SOURCES += ../../../../../../bsps/bfin/shared/cache/cache.c
libbsp_a_LIBADD = ../../../libcpu/@RTEMS_CPU@/mmu.rel
libbsp_a_LIBADD += ../../../libcpu/@RTEMS_CPU@/@RTEMS_CPU_MODEL@/interrupt.rel
-libbsp_a_LIBADD += ../../../libcpu/@RTEMS_CPU@/cache.rel
libbsp_a_LIBADD += ../../../libcpu/@RTEMS_CPU@/uart.rel
libbsp_a_LIBADD += ../../../libcpu/@RTEMS_CPU@/clock.rel
libbsp_a_LIBADD += ../../../libcpu/@RTEMS_CPU@/rtc.rel
diff --git a/c/src/lib/libbsp/bfin/bf537Stamp/Makefile.am b/c/src/lib/libbsp/bfin/bf537Stamp/Makefile.am
index ffe4ff8a51..ddd320781c 100644
--- a/c/src/lib/libbsp/bfin/bf537Stamp/Makefile.am
+++ b/c/src/lib/libbsp/bfin/bf537Stamp/Makefile.am
@@ -30,6 +30,7 @@ libbsp_a_SOURCES += \
libbsp_a_SOURCES += ../../shared/bspreset.c
libbsp_a_SOURCES += console/console.c
+libbsp_a_SOURCES += ../../../../../../bsps/bfin/shared/cache/cache.c
if HAS_NETWORKING
libbsp_a_SOURCES += network/networkconfig.c
@@ -37,7 +38,6 @@ endif
libbsp_a_LIBADD = ../../../libcpu/@RTEMS_CPU@/mmu.rel
libbsp_a_LIBADD += ../../../libcpu/@RTEMS_CPU@/interrupt.rel
-libbsp_a_LIBADD += ../../../libcpu/@RTEMS_CPU@/cache.rel
libbsp_a_LIBADD += ../../../libcpu/@RTEMS_CPU@/uart.rel
libbsp_a_LIBADD += ../../../libcpu/@RTEMS_CPU@/clock.rel
libbsp_a_LIBADD += ../../../libcpu/@RTEMS_CPU@/rtc.rel
diff --git a/c/src/lib/libbsp/bfin/eZKit533/Makefile.am b/c/src/lib/libbsp/bfin/eZKit533/Makefile.am
index 9acbd1bf8e..57e698ab9e 100644
--- a/c/src/lib/libbsp/bfin/eZKit533/Makefile.am
+++ b/c/src/lib/libbsp/bfin/eZKit533/Makefile.am
@@ -30,10 +30,10 @@ libbsp_a_SOURCES += \
libbsp_a_SOURCES += ../../shared/bspreset.c
libbsp_a_SOURCES += console/console-io.c
+libbsp_a_SOURCES += ../../../../../../bsps/bfin/shared/cache/cache.c
libbsp_a_LIBADD = ../../../libcpu/@RTEMS_CPU@/mmu.rel
libbsp_a_LIBADD += ../../../libcpu/@RTEMS_CPU@/interrupt.rel
-libbsp_a_LIBADD += ../../../libcpu/@RTEMS_CPU@/cache.rel
libbsp_a_LIBADD += ../../../libcpu/@RTEMS_CPU@/uart.rel
libbsp_a_LIBADD += ../../../libcpu/@RTEMS_CPU@/clock.rel
libbsp_a_LIBADD += ../../../libcpu/@RTEMS_CPU@/rtc.rel
diff --git a/c/src/lib/libbsp/epiphany/epiphany_sim/Makefile.am b/c/src/lib/libbsp/epiphany/epiphany_sim/Makefile.am
index 3401b9a4d6..30cb3487ee 100644
--- a/c/src/lib/libbsp/epiphany/epiphany_sim/Makefile.am
+++ b/c/src/lib/libbsp/epiphany/epiphany_sim/Makefile.am
@@ -62,9 +62,7 @@ libbsp_a_SOURCES += ../../shared/src/irq-info.c
libbsp_a_SOURCES += irq/irq.c
# Cache
-libbsp_a_SOURCES += ../../../libcpu/shared/src/cache_manager.c
-libbsp_a_SOURCES += ../../shared/include/cache_.h
-libbsp_a_CPPFLAGS = $(AM_CPPFLAGS) -I$(srcdir)/../../shared/include
+libbsp_a_SOURCES += ../../../../../../bsps/shared/cache/nocache.c
# debugio
libbsp_a_SOURCES += console/console-io.c
diff --git a/c/src/lib/libbsp/i386/pc386/Makefile.am b/c/src/lib/libbsp/i386/pc386/Makefile.am
index 157d7a6017..0acce55c44 100644
--- a/c/src/lib/libbsp/i386/pc386/Makefile.am
+++ b/c/src/lib/libbsp/i386/pc386/Makefile.am
@@ -170,8 +170,9 @@ libbsp_a_SOURCES += ne2000/ne2000.c
libbsp_a_SOURCES += wd8003/wd8003.c
endif
-libbsp_a_LIBADD = ../../../libcpu/@RTEMS_CPU@/cache.rel
-libbsp_a_LIBADD += ../../../libcpu/@RTEMS_CPU@/page.rel
+libbsp_a_SOURCES += ../../../../../../bsps/i386/shared/cache/cache.c
+
+libbsp_a_LIBADD = ../../../libcpu/@RTEMS_CPU@/page.rel
libbsp_a_LIBADD += ../../../libcpu/@RTEMS_CPU@/score.rel
if HAS_SMP
diff --git a/c/src/lib/libbsp/lm32/lm32_evr/Makefile.am b/c/src/lib/libbsp/lm32/lm32_evr/Makefile.am
index 7f0cf77cad..1d9b605bdf 100644
--- a/c/src/lib/libbsp/lm32/lm32_evr/Makefile.am
+++ b/c/src/lib/libbsp/lm32/lm32_evr/Makefile.am
@@ -41,9 +41,7 @@ libbsp_a_SOURCES += ../../lm32/shared/console/uart.c
libbsp_a_SOURCES += ../../lm32/shared/timer/timer.c
# Cache
-libbsp_a_SOURCES += ../../../libcpu/shared/src/cache_manager.c
-libbsp_a_SOURCES += ../../shared/include/cache_.h
-libbsp_a_CPPFLAGS = $(AM_CPPFLAGS) -I$(srcdir)/../../shared/include
+libbsp_a_SOURCES += ../../../../../../bsps/shared/cache/nocache.c
if HAS_NETWORKING
libbsp_a_SOURCES += ../../lm32/shared/tsmac/tsmac.c
diff --git a/c/src/lib/libbsp/lm32/milkymist/Makefile.am b/c/src/lib/libbsp/lm32/milkymist/Makefile.am
index 79f6aa8fa6..25aee60e02 100644
--- a/c/src/lib/libbsp/lm32/milkymist/Makefile.am
+++ b/c/src/lib/libbsp/lm32/milkymist/Makefile.am
@@ -88,9 +88,7 @@ libbsp_a_SOURCES += ../../lm32/shared/milkymist_video/video.c
libbsp_a_SOURCES += ../../lm32/shared/milkymist_versions/versions.c
# Cache
-libbsp_a_SOURCES += ../../../libcpu/shared/src/cache_manager.c
-libbsp_a_SOURCES += ../../shared/include/cache_.h
-libbsp_a_CPPFLAGS = $(AM_CPPFLAGS) -I$(srcdir)/../../shared/include
+libbsp_a_SOURCES += ../../../../../../bsps/shared/cache/nocache.c
if HAS_NETWORKING
libbsp_a_SOURCES += ../../lm32/shared/milkymist_networking/network.c
diff --git a/c/src/lib/libbsp/m32c/m32cbsp/Makefile.am b/c/src/lib/libbsp/m32c/m32cbsp/Makefile.am
index a10f56cf47..4496cf6e56 100644
--- a/c/src/lib/libbsp/m32c/m32cbsp/Makefile.am
+++ b/c/src/lib/libbsp/m32c/m32cbsp/Makefile.am
@@ -34,9 +34,7 @@ libbsp_a_SOURCES = $(startup_SOURCES) $(clock_SOURCES) $(console_SOURCES) \
$(timer_SOURCES)
# Cache
-libbsp_a_SOURCES += ../../../libcpu/shared/src/cache_manager.c
-libbsp_a_SOURCES += ../../shared/include/cache_.h
-libbsp_a_CPPFLAGS = $(AM_CPPFLAGS) -I$(srcdir)/../../shared/include
+libbsp_a_SOURCES += ../../../../../../bsps/shared/cache/nocache.c
include $(top_srcdir)/../../../../automake/local.am
include $(srcdir)/../../../../../../bsps/m32c/m32cbsp/headers.am
diff --git a/c/src/lib/libbsp/m68k/av5282/Makefile.am b/c/src/lib/libbsp/m68k/av5282/Makefile.am
index d9842e1ca2..c41571aebd 100644
--- a/c/src/lib/libbsp/m68k/av5282/Makefile.am
+++ b/c/src/lib/libbsp/m68k/av5282/Makefile.am
@@ -40,9 +40,9 @@ if HAS_NETWORKING
libbsp_a_SOURCES += network/network.c
endif
+libbsp_a_SOURCES += ../../../../../../bsps/m68k/shared/cache/cache-mcf5282.c
+
libbsp_a_LIBADD = \
- ../../../libcpu/@RTEMS_CPU@/shared/cache.rel \
- ../../../libcpu/@RTEMS_CPU@/mcf5282/cachepd.rel \
../../../libcpu/@RTEMS_CPU@/shared/misc.rel
include $(top_srcdir)/../../../../automake/local.am
diff --git a/c/src/lib/libbsp/m68k/csb360/Makefile.am b/c/src/lib/libbsp/m68k/csb360/Makefile.am
index ce4afb155b..f4458825dd 100644
--- a/c/src/lib/libbsp/m68k/csb360/Makefile.am
+++ b/c/src/lib/libbsp/m68k/csb360/Makefile.am
@@ -34,9 +34,7 @@ libbsp_a_SOURCES += ../../shared/bspreset.c
libbsp_a_SOURCES += console/console-io.c ../../shared/console-polled.c
# Cache
-libbsp_a_SOURCES += ../../../libcpu/shared/src/cache_manager.c
-libbsp_a_SOURCES += ../../shared/include/cache_.h
-libbsp_a_CPPFLAGS = $(AM_CPPFLAGS) -I$(srcdir)/../../shared/include
+libbsp_a_SOURCES += ../../../../../../bsps/shared/cache/nocache.c
libbsp_a_LIBADD = \
../../../libcpu/@RTEMS_CPU@/shared/misc.rel \
diff --git a/c/src/lib/libbsp/m68k/gen68340/Makefile.am b/c/src/lib/libbsp/m68k/gen68340/Makefile.am
index bbb1f63c17..69467e1e78 100644
--- a/c/src/lib/libbsp/m68k/gen68340/Makefile.am
+++ b/c/src/lib/libbsp/m68k/gen68340/Makefile.am
@@ -37,8 +37,9 @@ libbsp_a_SOURCES += console/console.c console/m340uart.c \
# timer
libbsp_a_SOURCES += timer/timer.c
+libbsp_a_SOURCES += ../../../../../../bsps/m68k/shared/cache/cache.c
+
libbsp_a_LIBADD = \
- ../../../libcpu/@RTEMS_CPU@/shared/cache.rel \
../../../libcpu/@RTEMS_CPU@/shared/misc.rel
include $(top_srcdir)/../../../../automake/local.am
diff --git a/c/src/lib/libbsp/m68k/gen68360/Makefile.am b/c/src/lib/libbsp/m68k/gen68360/Makefile.am
index 1701c1b83d..daf6719451 100644
--- a/c/src/lib/libbsp/m68k/gen68360/Makefile.am
+++ b/c/src/lib/libbsp/m68k/gen68360/Makefile.am
@@ -42,8 +42,9 @@ if HAS_NETWORKING
libbsp_a_SOURCES += network/network.c
endif
+libbsp_a_SOURCES += ../../../../../../bsps/m68k/shared/cache/cache.c
+
libbsp_a_LIBADD = \
- ../../../libcpu/@RTEMS_CPU@/shared/cache.rel \
../../../libcpu/@RTEMS_CPU@/shared/misc.rel
if HAS_FPSP
libbsp_a_LIBADD += ../../../libcpu/@RTEMS_CPU@/@RTEMS_CPU_MODEL@/fpsp.rel
diff --git a/c/src/lib/libbsp/m68k/genmcf548x/Makefile.am b/c/src/lib/libbsp/m68k/genmcf548x/Makefile.am
index fba06369c9..d7389e73d1 100644
--- a/c/src/lib/libbsp/m68k/genmcf548x/Makefile.am
+++ b/c/src/lib/libbsp/m68k/genmcf548x/Makefile.am
@@ -49,9 +49,7 @@ libbsp_a_SOURCES += irq/irq.c
libbsp_a_SOURCES += irq/intc-icr-init-values.c
# Cache
-libbsp_a_SOURCES += ../../../libcpu/shared/src/cache_manager.c
-libbsp_a_SOURCES += ../include/cache_.h
-libbsp_a_CPPFLAGS += -I$(srcdir)/include
+libbsp_a_SOURCES += ../../../../../../bsps/m68k/genmcf548x/cache.c
if HAS_NETWORKING
libbsp_a_SOURCES += network/network.c
diff --git a/c/src/lib/libbsp/m68k/mcf5206elite/Makefile.am b/c/src/lib/libbsp/m68k/mcf5206elite/Makefile.am
index 7e0c38902b..2e0dbb7b6c 100644
--- a/c/src/lib/libbsp/m68k/mcf5206elite/Makefile.am
+++ b/c/src/lib/libbsp/m68k/mcf5206elite/Makefile.am
@@ -44,9 +44,7 @@ libbsp_a_SOURCES += tod/ds1307.c tod/todcfg.c ../../shared/tod.c
libbsp_a_SOURCES += nvram/nvram.c
# Cache
-libbsp_a_SOURCES += ../../../libcpu/shared/src/cache_manager.c
-libbsp_a_SOURCES += ../../shared/include/cache_.h
-libbsp_a_CPPFLAGS = $(AM_CPPFLAGS) -I$(srcdir)/../../shared/include
+libbsp_a_SOURCES += ../../../../../../bsps/shared/cache/nocache.c
libbsp_a_LIBADD = \
../../../libcpu/@RTEMS_CPU@/shared/misc.rel \
diff --git a/c/src/lib/libbsp/m68k/mcf52235/Makefile.am b/c/src/lib/libbsp/m68k/mcf52235/Makefile.am
index 5c51afeb58..95eb6e5950 100644
--- a/c/src/lib/libbsp/m68k/mcf52235/Makefile.am
+++ b/c/src/lib/libbsp/m68k/mcf52235/Makefile.am
@@ -38,9 +38,9 @@ libbsp_a_SOURCES += console/debugio.c
# timer
libbsp_a_SOURCES += timer/timer.c
+libbsp_a_SOURCES += ../../../../../../bsps/m68k/shared/cache/cache-mcf5223x.c
+
libbsp_a_LIBADD = \
- ../../../libcpu/@RTEMS_CPU@/shared/cache.rel \
- ../../../libcpu/@RTEMS_CPU@/mcf5223x/cachepd.rel \
../../../libcpu/@RTEMS_CPU@/shared/misc.rel
include $(top_srcdir)/../../../../automake/local.am
diff --git a/c/src/lib/libbsp/m68k/mcf5225x/Makefile.am b/c/src/lib/libbsp/m68k/mcf5225x/Makefile.am
index b33adc2ef0..8688f23965 100644
--- a/c/src/lib/libbsp/m68k/mcf5225x/Makefile.am
+++ b/c/src/lib/libbsp/m68k/mcf5225x/Makefile.am
@@ -33,9 +33,9 @@ libbsp_a_SOURCES += console/console.c
libbsp_a_SOURCES += console/debugio.c
libbsp_a_SOURCES += timer/timer.c
+libbsp_a_SOURCES += ../../../../../../bsps/m68k/shared/cache/cache-mcf5225x.c
+
libbsp_a_LIBADD = \
- ../../../libcpu/@RTEMS_CPU@/shared/cache.rel \
- ../../../libcpu/@RTEMS_CPU@/mcf5225x/cachepd.rel \
../../../libcpu/@RTEMS_CPU@/shared/misc.rel
include $(top_srcdir)/../../../../automake/local.am
diff --git a/c/src/lib/libbsp/m68k/mcf5235/Makefile.am b/c/src/lib/libbsp/m68k/mcf5235/Makefile.am
index adb474f65e..f673c1a688 100644
--- a/c/src/lib/libbsp/m68k/mcf5235/Makefile.am
+++ b/c/src/lib/libbsp/m68k/mcf5235/Makefile.am
@@ -42,9 +42,9 @@ if HAS_NETWORKING
libbsp_a_SOURCES += network/network.c
endif
+libbsp_a_SOURCES += ../../../../../../bsps/m68k/shared/cache/cache-mcf5235.c
+
libbsp_a_LIBADD = \
- ../../../libcpu/@RTEMS_CPU@/shared/cache.rel \
- ../../../libcpu/@RTEMS_CPU@/mcf5235/cachepd.rel \
../../../libcpu/@RTEMS_CPU@/shared/misc.rel
include $(top_srcdir)/../../../../automake/local.am
diff --git a/c/src/lib/libbsp/m68k/mcf5329/Makefile.am b/c/src/lib/libbsp/m68k/mcf5329/Makefile.am
index b844e949d6..a26f549f9a 100644
--- a/c/src/lib/libbsp/m68k/mcf5329/Makefile.am
+++ b/c/src/lib/libbsp/m68k/mcf5329/Makefile.am
@@ -41,10 +41,10 @@ if HAS_NETWORKING
libbsp_a_SOURCES += network/network.c
endif
+libbsp_a_SOURCES += ../../../../../../bsps/m68k/shared/cache/cache-mcf532x.c
+
libbsp_a_LIBADD = \
- ../../../libcpu/@RTEMS_CPU@/shared/cache.rel \
- ../../../libcpu/@RTEMS_CPU@/shared/misc.rel \
- ../../../libcpu/@RTEMS_CPU@/mcf532x/cachepd.rel
+ ../../../libcpu/@RTEMS_CPU@/shared/misc.rel
include $(top_srcdir)/../../../../automake/local.am
include $(srcdir)/../../../../../../bsps/m68k/mcf5329/headers.am
diff --git a/c/src/lib/libbsp/m68k/mrm332/Makefile.am b/c/src/lib/libbsp/m68k/mrm332/Makefile.am
index 0cd22f2c0d..7afb990c40 100644
--- a/c/src/lib/libbsp/m68k/mrm332/Makefile.am
+++ b/c/src/lib/libbsp/m68k/mrm332/Makefile.am
@@ -38,8 +38,9 @@ libbsp_a_SOURCES += spurious/spinit.c
# timer
libbsp_a_SOURCES += timer/timer.c
+libbsp_a_SOURCES += ../../../../../../bsps/m68k/shared/cache/cache.c
+
libbsp_a_LIBADD = \
- ../../../libcpu/@RTEMS_CPU@/shared/cache.rel \
../../../libcpu/@RTEMS_CPU@/shared/misc.rel
include $(top_srcdir)/../../../../automake/local.am
diff --git a/c/src/lib/libbsp/m68k/mvme147/Makefile.am b/c/src/lib/libbsp/m68k/mvme147/Makefile.am
index 6b1ec396dd..13b39c4442 100644
--- a/c/src/lib/libbsp/m68k/mvme147/Makefile.am
+++ b/c/src/lib/libbsp/m68k/mvme147/Makefile.am
@@ -37,8 +37,9 @@ libbsp_a_SOURCES += console/console.c ../../shared/dummy_printk_support.c
# timer
libbsp_a_SOURCES += timer/timer.c timer/timerisr.S
+libbsp_a_SOURCES += ../../../../../../bsps/m68k/shared/cache/cache.c
+
libbsp_a_LIBADD = \
- ../../../libcpu/@RTEMS_CPU@/shared/cache.rel \
../../../libcpu/@RTEMS_CPU@/shared/misc.rel
EXTRA_DIST += times
diff --git a/c/src/lib/libbsp/m68k/mvme147s/Makefile.am b/c/src/lib/libbsp/m68k/mvme147s/Makefile.am
index c4d5f5f89d..a0af237c7c 100644
--- a/c/src/lib/libbsp/m68k/mvme147s/Makefile.am
+++ b/c/src/lib/libbsp/m68k/mvme147s/Makefile.am
@@ -45,8 +45,9 @@ libbsp_a_SOURCES += shmsupp/addrconv.c shmsupp/getcfg.c shmsupp/lock.c \
shmsupp/mpisr.c
endif
+libbsp_a_SOURCES += ../../../../../../bsps/m68k/shared/cache/cache.c
+
libbsp_a_LIBADD = \
- ../../../libcpu/@RTEMS_CPU@/shared/cache.rel \
../../../libcpu/@RTEMS_CPU@/shared/misc.rel
EXTRA_DIST += times
diff --git a/c/src/lib/libbsp/m68k/mvme162/Makefile.am b/c/src/lib/libbsp/m68k/mvme162/Makefile.am
index c5e3b92f99..2c0031f61d 100644
--- a/c/src/lib/libbsp/m68k/mvme162/Makefile.am
+++ b/c/src/lib/libbsp/m68k/mvme162/Makefile.am
@@ -44,8 +44,9 @@ if HAS_NETWORKING
libbsp_a_SOURCES += ../mvme167/network/network.c
endif
+libbsp_a_SOURCES += ../../../../../../bsps/m68k/shared/cache/cache.c
+
libbsp_a_LIBADD = \
- ../../../libcpu/@RTEMS_CPU@/shared/cache.rel \
../../../libcpu/@RTEMS_CPU@/shared/misc.rel
if HAS_FPSP
libbsp_a_LIBADD += ../../../libcpu/@RTEMS_CPU@/@RTEMS_CPU_MODEL@/fpsp.rel
diff --git a/c/src/lib/libbsp/m68k/mvme167/Makefile.am b/c/src/lib/libbsp/m68k/mvme167/Makefile.am
index 84a227008a..8c8288cf04 100644
--- a/c/src/lib/libbsp/m68k/mvme167/Makefile.am
+++ b/c/src/lib/libbsp/m68k/mvme167/Makefile.am
@@ -41,8 +41,9 @@ if HAS_NETWORKING
libbsp_a_SOURCES += network/network.c
endif
+libbsp_a_SOURCES += ../../../../../../bsps/m68k/shared/cache/cache.c
+
libbsp_a_LIBADD = \
- ../../../libcpu/@RTEMS_CPU@/shared/cache.rel \
../../../libcpu/@RTEMS_CPU@/shared/misc.rel \
../../../libcpu/@RTEMS_CPU@/@RTEMS_CPU_MODEL@/fpsp.rel
diff --git a/c/src/lib/libbsp/m68k/uC5282/Makefile.am b/c/src/lib/libbsp/m68k/uC5282/Makefile.am
index 870ff61a20..e382fe46a9 100644
--- a/c/src/lib/libbsp/m68k/uC5282/Makefile.am
+++ b/c/src/lib/libbsp/m68k/uC5282/Makefile.am
@@ -39,9 +39,9 @@ if HAS_NETWORKING
libbsp_a_SOURCES += network/network.c
endif
-libbsp_a_LIBADD = ../../../libcpu/@RTEMS_CPU@/shared/cache.rel \
- ../../../libcpu/@RTEMS_CPU@/mcf5282/cachepd.rel \
- ../../../libcpu/@RTEMS_CPU@/shared/misc.rel
+libbsp_a_SOURCES += ../../../../../../bsps/m68k/shared/cache/cache-mcf5282.c
+
+libbsp_a_LIBADD = ../../../libcpu/@RTEMS_CPU@/shared/misc.rel
include $(top_srcdir)/../../../../automake/local.am
include $(srcdir)/../../../../../../bsps/m68k/uC5282/headers.am
diff --git a/c/src/lib/libbsp/mips/csb350/Makefile.am b/c/src/lib/libbsp/mips/csb350/Makefile.am
index aa58666dcf..69c709ce2e 100644
--- a/c/src/lib/libbsp/mips/csb350/Makefile.am
+++ b/c/src/lib/libbsp/mips/csb350/Makefile.am
@@ -53,8 +53,9 @@ if HAS_NETWORKING
libbsp_a_SOURCES += network/network.c
endif
-libbsp_a_LIBADD = ../../../libcpu/mips/shared/cache.rel
-libbsp_a_LIBADD += ../../../libcpu/mips/shared/interrupts.rel
+libbsp_a_SOURCES += ../../../../../../bsps/shared/cache/nocache.c
+
+libbsp_a_LIBADD = ../../../libcpu/mips/shared/interrupts.rel
include $(top_srcdir)/../../../../automake/local.am
include $(srcdir)/../../../../../../bsps/mips/csb350/headers.am
diff --git a/c/src/lib/libbsp/mips/hurricane/Makefile.am b/c/src/lib/libbsp/mips/hurricane/Makefile.am
index a634a84582..a65d2989c2 100644
--- a/c/src/lib/libbsp/mips/hurricane/Makefile.am
+++ b/c/src/lib/libbsp/mips/hurricane/Makefile.am
@@ -55,8 +55,9 @@ libbsp_a_SOURCES += ../shared/irq/irq.c
libbsp_a_SOURCES += irq/vectorisrs.c
libbsp_a_SOURCES += ../shared/irq/interruptmask.c
-libbsp_a_LIBADD = ../../../libcpu/@RTEMS_CPU@/shared/cache.rel
-libbsp_a_LIBADD += ../../../libcpu/@RTEMS_CPU@/shared/interrupts.rel
+libbsp_a_SOURCES += ../../../../../../bsps/shared/cache/nocache.c
+
+libbsp_a_LIBADD = ../../../libcpu/@RTEMS_CPU@/shared/interrupts.rel
libbsp_a_LIBADD += ../../../libcpu/@RTEMS_CPU@/rm52xx/timer.rel
include $(top_srcdir)/../../../../automake/local.am
diff --git a/c/src/lib/libbsp/mips/jmr3904/Makefile.am b/c/src/lib/libbsp/mips/jmr3904/Makefile.am
index 5d599cf64f..e67e58865f 100644
--- a/c/src/lib/libbsp/mips/jmr3904/Makefile.am
+++ b/c/src/lib/libbsp/mips/jmr3904/Makefile.am
@@ -47,8 +47,9 @@ libbsp_a_SOURCES += ../shared/irq/irq.c
libbsp_a_SOURCES += irq/vectorisrs.c
libbsp_a_SOURCES += ../shared/irq/interruptmask.c
-libbsp_a_LIBADD = ../../../libcpu/@RTEMS_CPU@/shared/cache.rel
-libbsp_a_LIBADD += ../../../libcpu/@RTEMS_CPU@/shared/interrupts.rel
+libbsp_a_SOURCES += ../../../../../../bsps/shared/cache/nocache.c
+
+libbsp_a_LIBADD = ../../../libcpu/@RTEMS_CPU@/shared/interrupts.rel
include $(top_srcdir)/../../../../automake/local.am
include $(srcdir)/../../../../../../bsps/mips/jmr3904/headers.am
diff --git a/c/src/lib/libbsp/mips/malta/Makefile.am b/c/src/lib/libbsp/mips/malta/Makefile.am
index 38b902cd0a..5349907003 100644
--- a/c/src/lib/libbsp/mips/malta/Makefile.am
+++ b/c/src/lib/libbsp/mips/malta/Makefile.am
@@ -54,8 +54,9 @@ libbsp_a_SOURCES += ../../shared/console_control.c
# timer
libbsp_a_SOURCES += ../../shared/timerstub.c
-libbsp_a_LIBADD = ../../../libcpu/@RTEMS_CPU@/shared/cache.rel
-libbsp_a_LIBADD += ../../../libcpu/@RTEMS_CPU@/shared/interrupts.rel
+libbsp_a_SOURCES += ../../../../../../bsps/shared/cache/nocache.c
+
+libbsp_a_LIBADD = ../../../libcpu/@RTEMS_CPU@/shared/interrupts.rel
# pci
libbsp_a_SOURCES += pci/pci.c
diff --git a/c/src/lib/libbsp/mips/rbtx4925/Makefile.am b/c/src/lib/libbsp/mips/rbtx4925/Makefile.am
index 3ea41e411a..74c8303492 100644
--- a/c/src/lib/libbsp/mips/rbtx4925/Makefile.am
+++ b/c/src/lib/libbsp/mips/rbtx4925/Makefile.am
@@ -55,8 +55,9 @@ libbsp_a_SOURCES += ../shared/irq/irq.c
libbsp_a_SOURCES += irq/vectorisrs.c
libbsp_a_SOURCES += ../shared/irq/interruptmask_TX49.c
-libbsp_a_LIBADD = ../../../libcpu/@RTEMS_CPU@/shared/cache.rel
-libbsp_a_LIBADD += ../../../libcpu/@RTEMS_CPU@/shared/interrupts.rel
+libbsp_a_SOURCES += ../../../../../../bsps/shared/cache/nocache.c
+
+libbsp_a_LIBADD = ../../../libcpu/@RTEMS_CPU@/shared/interrupts.rel
libbsp_a_LIBADD += ../../../libcpu/@RTEMS_CPU@/tx49/timer.rel
include $(top_srcdir)/../../../../automake/local.am
diff --git a/c/src/lib/libbsp/mips/rbtx4938/Makefile.am b/c/src/lib/libbsp/mips/rbtx4938/Makefile.am
index 3a8443a2ea..7d29c80d95 100644
--- a/c/src/lib/libbsp/mips/rbtx4938/Makefile.am
+++ b/c/src/lib/libbsp/mips/rbtx4938/Makefile.am
@@ -55,8 +55,9 @@ libbsp_a_SOURCES += ../shared/irq/irq.c
libbsp_a_SOURCES += irq/vectorisrs.c
libbsp_a_SOURCES += ../shared/irq/interruptmask_TX49.c
-libbsp_a_LIBADD = ../../../libcpu/@RTEMS_CPU@/shared/cache.rel
-libbsp_a_LIBADD += ../../../libcpu/@RTEMS_CPU@/shared/interrupts.rel
+libbsp_a_SOURCES += ../../../../../../bsps/shared/cache/nocache.c
+
+libbsp_a_LIBADD = ../../../libcpu/@RTEMS_CPU@/shared/interrupts.rel
libbsp_a_LIBADD += ../../../libcpu/@RTEMS_CPU@/tx49/timer.rel
include $(top_srcdir)/../../../../automake/local.am
diff --git a/c/src/lib/libbsp/moxie/moxiesim/Makefile.am b/c/src/lib/libbsp/moxie/moxiesim/Makefile.am
index 60d4678558..9eabcb181d 100644
--- a/c/src/lib/libbsp/moxie/moxiesim/Makefile.am
+++ b/c/src/lib/libbsp/moxie/moxiesim/Makefile.am
@@ -40,9 +40,7 @@ libbsp_a_SOURCES += ../../shared/console-polled.c console/console-io.c \
libbsp_a_SOURCES += ../../shared/timerstub.c
# Cache
-libbsp_a_SOURCES += ../../../libcpu/shared/src/cache_manager.c
-libbsp_a_SOURCES += ../../shared/include/cache_.h
-libbsp_a_CPPFLAGS = $(AM_CPPFLAGS) -I$(srcdir)/../../shared/include
+libbsp_a_SOURCES += ../../../../../../bsps/shared/cache/nocache.c
EXTRA_DIST += times
diff --git a/c/src/lib/libbsp/nios2/nios2_iss/Makefile.am b/c/src/lib/libbsp/nios2/nios2_iss/Makefile.am
index b3f66752a1..bb018369a8 100644
--- a/c/src/lib/libbsp/nios2/nios2_iss/Makefile.am
+++ b/c/src/lib/libbsp/nios2/nios2_iss/Makefile.am
@@ -44,7 +44,7 @@ libbsp_a_SOURCES += console/console.c ../../shared/console-polled.c
libbsp_a_SOURCES += timer/timer.c
# Cache
-libbsp_a_LIBADD = ../../../libcpu/@RTEMS_CPU@/shared/cache.rel
+libbsp_a_SOURCES += ../../../../../../bsps/shared/cache/nocache.c
include $(top_srcdir)/../../../../automake/local.am
include $(srcdir)/../../../../../../bsps/nios2/nios2_iss/headers.am
diff --git a/c/src/lib/libbsp/or1k/generic_or1k/Makefile.am b/c/src/lib/libbsp/or1k/generic_or1k/Makefile.am
index d5a4b74b33..da5c78a501 100644
--- a/c/src/lib/libbsp/or1k/generic_or1k/Makefile.am
+++ b/c/src/lib/libbsp/or1k/generic_or1k/Makefile.am
@@ -74,7 +74,7 @@ libbsp_a_SOURCES += ../../shared/src/irq-info.c
libbsp_a_SOURCES += irq/irq.c
# Cache
-libbsp_a_LIBADD += ../../../libcpu/@RTEMS_CPU@/shared/cache.rel
+libbsp_a_SOURCES += ../../../../../../bsps/or1k/shared/cache/cache.c
###############################################################################
# Special Rules #
diff --git a/c/src/lib/libbsp/powerpc/beatnik/Makefile.am b/c/src/lib/libbsp/powerpc/beatnik/Makefile.am
index c51965b9a8..dcb82d9917 100644
--- a/c/src/lib/libbsp/powerpc/beatnik/Makefile.am
+++ b/c/src/lib/libbsp/powerpc/beatnik/Makefile.am
@@ -163,8 +163,9 @@ endif
# tod
libbsp_a_SOURCES += ../../shared/tod.c tod/todcfg.c
+libbsp_a_SOURCES += ../../../../../../bsps/powerpc/shared/cache/cache.c
+
libbsp_a_LIBADD = ../../../libcpu/@RTEMS_CPU@/shared/cpuIdent.rel \
- ../../../libcpu/@RTEMS_CPU@/shared/cache.rel \
../../../libcpu/@RTEMS_CPU@/shared/stack.rel \
../../../libcpu/@RTEMS_CPU@/@exceptions@/rtems-cpu.rel \
../../../libcpu/@RTEMS_CPU@/@exceptions@/exc_bspsupport.rel \
diff --git a/c/src/lib/libbsp/powerpc/gen5200/Makefile.am b/c/src/lib/libbsp/powerpc/gen5200/Makefile.am
index a727020c0a..4a6b536e65 100644
--- a/c/src/lib/libbsp/powerpc/gen5200/Makefile.am
+++ b/c/src/lib/libbsp/powerpc/gen5200/Makefile.am
@@ -110,8 +110,9 @@ if HAS_NETWORKING
libbsp_a_SOURCES += network_5200/network.c
endif
+libbsp_a_SOURCES += ../../../../../../bsps/powerpc/shared/cache/cache.c
+
libbsp_a_LIBADD = ../../../libcpu/@RTEMS_CPU@/shared/cpuIdent.rel \
- ../../../libcpu/@RTEMS_CPU@/shared/cache.rel \
../../../libcpu/@RTEMS_CPU@/shared/stack.rel \
../../../libcpu/@RTEMS_CPU@/@exceptions@/rtems-cpu.rel \
../../../libcpu/@RTEMS_CPU@/@exceptions@/exc_bspsupport.rel \
diff --git a/c/src/lib/libbsp/powerpc/gen83xx/Makefile.am b/c/src/lib/libbsp/powerpc/gen83xx/Makefile.am
index e5d681153c..10f36ab04e 100644
--- a/c/src/lib/libbsp/powerpc/gen83xx/Makefile.am
+++ b/c/src/lib/libbsp/powerpc/gen83xx/Makefile.am
@@ -73,13 +73,9 @@ libbsp_a_SOURCES += i2c/i2c_init.c
# bsp_spi
libbsp_a_SOURCES += spi/spi_init.c
-if HAS_NETWORKING
-libbsp_a_SOURCES += network/network.c
-libbsp_a_LIBADD += ../../../libcpu/@RTEMS_CPU@/mpc83xx/tsec.rel
-endif
+libbsp_a_SOURCES += ../../../../../../bsps/powerpc/shared/cache/cache.c
libbsp_a_LIBADD = ../../../libcpu/@RTEMS_CPU@/shared/cpuIdent.rel \
- ../../../libcpu/@RTEMS_CPU@/shared/cache.rel \
../../../libcpu/@RTEMS_CPU@/@exceptions@/rtems-cpu.rel \
../../../libcpu/@RTEMS_CPU@/@exceptions@/exc_bspsupport.rel \
../../../libcpu/@RTEMS_CPU@/mpc6xx/mmu.rel \
@@ -88,6 +84,11 @@ libbsp_a_LIBADD = ../../../libcpu/@RTEMS_CPU@/shared/cpuIdent.rel \
../../../libcpu/@RTEMS_CPU@/mpc83xx/spi.rel \
../../../libcpu/@RTEMS_CPU@/mpc83xx/gtm.rel
+if HAS_NETWORKING
+libbsp_a_SOURCES += network/network.c
+libbsp_a_LIBADD += ../../../libcpu/@RTEMS_CPU@/mpc83xx/tsec.rel
+endif
+
EXTRA_DIST += README.mpc8349eamds
include $(top_srcdir)/../../../../automake/local.am
diff --git a/c/src/lib/libbsp/powerpc/haleakala/Makefile.am b/c/src/lib/libbsp/powerpc/haleakala/Makefile.am
index 022728651a..dcb66d0f72 100644
--- a/c/src/lib/libbsp/powerpc/haleakala/Makefile.am
+++ b/c/src/lib/libbsp/powerpc/haleakala/Makefile.am
@@ -42,10 +42,11 @@ if HAS_NETWORKING
libbsp_a_SOURCES += network/network.c
endif
+libbsp_a_SOURCES += ../../../../../../bsps/powerpc/shared/cache/cache.c
+
libbsp_a_LIBADD = ../../../libcpu/@RTEMS_CPU@/@exceptions@/rtems-cpu.rel \
../../../libcpu/@RTEMS_CPU@/@exceptions@/exc_bspsupport.rel \
../../../libcpu/@RTEMS_CPU@/@exceptions@/irq_bspsupport.rel \
- ../../../libcpu/@RTEMS_CPU@/shared/cache.rel \
../../../libcpu/@RTEMS_CPU@/shared/cpuIdent.rel \
../../../libcpu/@RTEMS_CPU@/ppc403/clock.rel \
../../../libcpu/@RTEMS_CPU@/ppc403/timer.rel
diff --git a/c/src/lib/libbsp/powerpc/motorola_powerpc/Makefile.am b/c/src/lib/libbsp/powerpc/motorola_powerpc/Makefile.am
index bbc0a8e8b6..1cf3671233 100644
--- a/c/src/lib/libbsp/powerpc/motorola_powerpc/Makefile.am
+++ b/c/src/lib/libbsp/powerpc/motorola_powerpc/Makefile.am
@@ -114,9 +114,10 @@ libbsp_a_SOURCES += ../../i386/pc386/ne2000/ne2000.c
endif
endif
+libbsp_a_SOURCES += ../../../../../../bsps/powerpc/shared/cache/cache.c
+
libbsp_a_LIBADD = \
polledIO.rel \
- ../../../libcpu/@RTEMS_CPU@/shared/cache.rel \
../../../libcpu/@RTEMS_CPU@/shared/cpuIdent.rel \
../../../libcpu/@RTEMS_CPU@/shared/stack.rel \
../../../libcpu/@RTEMS_CPU@/@exceptions@/rtems-cpu.rel \
diff --git a/c/src/lib/libbsp/powerpc/mpc55xxevb/Makefile.am b/c/src/lib/libbsp/powerpc/mpc55xxevb/Makefile.am
index 6cf6acc7e7..75a63170b5 100644
--- a/c/src/lib/libbsp/powerpc/mpc55xxevb/Makefile.am
+++ b/c/src/lib/libbsp/powerpc/mpc55xxevb/Makefile.am
@@ -106,8 +106,9 @@ endif
# BSP library
+libbsp_a_SOURCES += ../../../../../../bsps/powerpc/shared/cache/cache.c
+
libbsp_a_LIBADD = ../../../libcpu/@RTEMS_CPU@/shared/cpuIdent.rel \
- ../../../libcpu/@RTEMS_CPU@/shared/cache.rel \
../../../libcpu/@RTEMS_CPU@/shared/stack.rel \
../../../libcpu/@RTEMS_CPU@/@RTEMS_CPU_MODEL@/misc.rel \
../../../libcpu/@RTEMS_CPU@/@RTEMS_CPU_MODEL@/irq.rel \
diff --git a/c/src/lib/libbsp/powerpc/mpc8260ads/Makefile.am b/c/src/lib/libbsp/powerpc/mpc8260ads/Makefile.am
index 1f9d2f189d..5fc7755604 100644
--- a/c/src/lib/libbsp/powerpc/mpc8260ads/Makefile.am
+++ b/c/src/lib/libbsp/powerpc/mpc8260ads/Makefile.am
@@ -54,8 +54,9 @@ libbsp_a_SOURCES += network/if_hdlcsubr.c
libbsp_a_SOURCES += network/network.c
endif
+libbsp_a_SOURCES += ../../../../../../bsps/powerpc/shared/cache/cache.c
+
libbsp_a_LIBADD = ../../../libcpu/@RTEMS_CPU@/shared/cpuIdent.rel \
- ../../../libcpu/@RTEMS_CPU@/shared/cache.rel \
../../../libcpu/@RTEMS_CPU@/@exceptions@/rtems-cpu.rel \
../../../libcpu/@RTEMS_CPU@/@exceptions@/exc_bspsupport.rel \
../../../libcpu/@RTEMS_CPU@/mpc8260/console-generic.rel \
diff --git a/c/src/lib/libbsp/powerpc/mvme3100/Makefile.am b/c/src/lib/libbsp/powerpc/mvme3100/Makefile.am
index a9c1cea0f1..a684c75a47 100644
--- a/c/src/lib/libbsp/powerpc/mvme3100/Makefile.am
+++ b/c/src/lib/libbsp/powerpc/mvme3100/Makefile.am
@@ -105,8 +105,9 @@ network_rel_CPPFLAGS = $(AM_CPPFLAGS)
network_rel_LDFLAGS = $(RTEMS_RELLDFLAGS)
endif
+libbsp_a_SOURCES += ../../../../../../bsps/powerpc/shared/cache/cache.c
+
libbsp_a_LIBADD = ../../../libcpu/@RTEMS_CPU@/shared/cpuIdent.rel \
- ../../../libcpu/@RTEMS_CPU@/shared/cache.rel \
../../../libcpu/@RTEMS_CPU@/shared/stack.rel \
../../../libcpu/@RTEMS_CPU@/e500/clock.rel \
../../../libcpu/@RTEMS_CPU@/e500/timer.rel \
diff --git a/c/src/lib/libbsp/powerpc/mvme5500/Makefile.am b/c/src/lib/libbsp/powerpc/mvme5500/Makefile.am
index 4d7e0d4733..72a3f719e5 100644
--- a/c/src/lib/libbsp/powerpc/mvme5500/Makefile.am
+++ b/c/src/lib/libbsp/powerpc/mvme5500/Makefile.am
@@ -83,10 +83,11 @@ project_lib_DATA += mvme5500start.$(OBJEXT)
project_lib_DATA += linkcmds
dist_project_lib_DATA += ../shared/startup/linkcmds.share
+libbsp_a_SOURCES += ../../../../../../bsps/powerpc/shared/cache/cache.c
+
libbsp_a_LIBADD = \
../../../libcpu/@RTEMS_CPU@/shared/cpuIdent.rel \
../../../libcpu/@RTEMS_CPU@/shared/stack.rel \
- ../../../libcpu/@RTEMS_CPU@/shared/cache.rel \
../../../libcpu/@RTEMS_CPU@/@exceptions@/rtems-cpu.rel \
../../../libcpu/@RTEMS_CPU@/mpc6xx/clock.rel \
../../../libcpu/@RTEMS_CPU@/@exceptions@/exc_bspsupport.rel \
diff --git a/c/src/lib/libbsp/powerpc/psim/Makefile.am b/c/src/lib/libbsp/powerpc/psim/Makefile.am
index 61f78140c3..5206c63984 100644
--- a/c/src/lib/libbsp/powerpc/psim/Makefile.am
+++ b/c/src/lib/libbsp/powerpc/psim/Makefile.am
@@ -60,8 +60,9 @@ if HAS_NETWORKING
libbsp_a_SOURCES += network/if_sim.c
endif
+libbsp_a_SOURCES += ../../../../../../bsps/powerpc/shared/cache/cache.c
+
libbsp_a_LIBADD = ../../../libcpu/@RTEMS_CPU@/shared/cpuIdent.rel \
- ../../../libcpu/@RTEMS_CPU@/shared/cache.rel \
../../../libcpu/@RTEMS_CPU@/shared/stack.rel \
../../../libcpu/@RTEMS_CPU@/@exceptions@/rtems-cpu.rel \
../../../libcpu/@RTEMS_CPU@/mpc6xx/clock.rel \
diff --git a/c/src/lib/libbsp/powerpc/qemuppc/Makefile.am b/c/src/lib/libbsp/powerpc/qemuppc/Makefile.am
index 6d887f2d47..f1f46989fc 100644
--- a/c/src/lib/libbsp/powerpc/qemuppc/Makefile.am
+++ b/c/src/lib/libbsp/powerpc/qemuppc/Makefile.am
@@ -51,8 +51,9 @@ noinst_LIBRARIES = libbsp.a
libbsp_a_SOURCES = $(startup_SOURCES) $(clock_SOURCES) $(console_SOURCES) \
$(irq_SOURCES)
+libbsp_a_SOURCES += ../../../../../../bsps/powerpc/shared/cache/cache.c
+
libbsp_a_LIBADD = ../../../libcpu/@RTEMS_CPU@/shared/cpuIdent.rel \
- ../../../libcpu/@RTEMS_CPU@/shared/cache.rel \
../../../libcpu/@RTEMS_CPU@/shared/stack.rel \
../../../libcpu/@RTEMS_CPU@/@exceptions@/rtems-cpu.rel \
../../../libcpu/@RTEMS_CPU@/@exceptions@/exc_bspsupport.rel \
diff --git a/c/src/lib/libbsp/powerpc/qoriq/Makefile.am b/c/src/lib/libbsp/powerpc/qoriq/Makefile.am
index 6760cece35..0476f5df87 100644
--- a/c/src/lib/libbsp/powerpc/qoriq/Makefile.am
+++ b/c/src/lib/libbsp/powerpc/qoriq/Makefile.am
@@ -96,8 +96,9 @@ libbsp_a_SOURCES += shmsupp/lock.S \
shmsupp/intercom.c \
shmsupp/intercom-mpci.c
+libbsp_a_SOURCES += ../../../../../../bsps/powerpc/shared/cache/cache.c
+
libbsp_a_LIBADD = ../../../libcpu/@RTEMS_CPU@/shared/cpuIdent.rel \
- ../../../libcpu/@RTEMS_CPU@/shared/cache.rel \
../../../libcpu/@RTEMS_CPU@/@exceptions@/rtems-cpu.rel \
../../../libcpu/@RTEMS_CPU@/@exceptions@/exc_bspsupport.rel \
../../../libcpu/@RTEMS_CPU@/e500/mmu.rel
diff --git a/c/src/lib/libbsp/powerpc/ss555/Makefile.am b/c/src/lib/libbsp/powerpc/ss555/Makefile.am
index afa059e5a3..05de822a19 100644
--- a/c/src/lib/libbsp/powerpc/ss555/Makefile.am
+++ b/c/src/lib/libbsp/powerpc/ss555/Makefile.am
@@ -35,9 +35,10 @@ libbsp_a_SOURCES += ../../shared/bspreset.c
# tm27supp
libbsp_a_SOURCES += startup/tm27supp.c
+libbsp_a_SOURCES += ../../../../../../bsps/powerpc/shared/cache/cache.c
+
libbsp_a_LIBADD = \
../../../libcpu/@RTEMS_CPU@/shared/cpuIdent.rel \
- ../../../libcpu/@RTEMS_CPU@/shared/cache.rel \
../../../libcpu/@RTEMS_CPU@/@exceptions@/rtems-cpu.rel \
../../../libcpu/@RTEMS_CPU@/mpc5xx/clock.rel \
../../../libcpu/@RTEMS_CPU@/mpc5xx/console-generic.rel \
diff --git a/c/src/lib/libbsp/powerpc/t32mppc/Makefile.am b/c/src/lib/libbsp/powerpc/t32mppc/Makefile.am
index bb7b7875ad..4a54cbd9fa 100644
--- a/c/src/lib/libbsp/powerpc/t32mppc/Makefile.am
+++ b/c/src/lib/libbsp/powerpc/t32mppc/Makefile.am
@@ -64,8 +64,9 @@ libbsp_a_SOURCES += irq/irq.c
libbsp_a_SOURCES += ../../shared/console-termios.c
libbsp_a_SOURCES += console/console.c
+libbsp_a_SOURCES += ../../../../../../bsps/powerpc/shared/cache/cache.c
+
libbsp_a_LIBADD = ../../../libcpu/@RTEMS_CPU@/shared/cpuIdent.rel \
- ../../../libcpu/@RTEMS_CPU@/shared/cache.rel \
../../../libcpu/@RTEMS_CPU@/@exceptions@/rtems-cpu.rel \
../../../libcpu/@RTEMS_CPU@/@exceptions@/exc_bspsupport.rel
diff --git a/c/src/lib/libbsp/powerpc/tqm8xx/Makefile.am b/c/src/lib/libbsp/powerpc/tqm8xx/Makefile.am
index 9173d6b527..26946fa5c0 100644
--- a/c/src/lib/libbsp/powerpc/tqm8xx/Makefile.am
+++ b/c/src/lib/libbsp/powerpc/tqm8xx/Makefile.am
@@ -62,9 +62,10 @@ libbsp_a_SOURCES += network/network_fec.c
libbsp_a_SOURCES += network/network_scc.c
endif
+libbsp_a_SOURCES += ../../../../../../bsps/powerpc/shared/cache/cache.c
+
libbsp_a_LIBADD = \
../../../libcpu/@RTEMS_CPU@/shared/cpuIdent.rel \
- ../../../libcpu/@RTEMS_CPU@/shared/cache.rel \
../../../libcpu/@RTEMS_CPU@/@exceptions@/rtems-cpu.rel \
../../../libcpu/@RTEMS_CPU@/@exceptions@/exc_bspsupport.rel \
../../../libcpu/@RTEMS_CPU@/mpc8xx/console-generic.rel \
diff --git a/c/src/lib/libbsp/powerpc/virtex/Makefile.am b/c/src/lib/libbsp/powerpc/virtex/Makefile.am
index 0c0e1081e0..15b5dcc0cd 100644
--- a/c/src/lib/libbsp/powerpc/virtex/Makefile.am
+++ b/c/src/lib/libbsp/powerpc/virtex/Makefile.am
@@ -66,10 +66,11 @@ endif
libbsp_a_SOURCES += timer/timer-config.c
libbsp_a_LIBADD += ../../../libcpu/@RTEMS_CPU@/ppc403/timer.rel
+libbsp_a_SOURCES += ../../../../../../bsps/powerpc/shared/cache/cache.c
+
libbsp_a_LIBADD += \
../../../libcpu/@RTEMS_CPU@/@exceptions@/rtems-cpu.rel \
../../../libcpu/@RTEMS_CPU@/@exceptions@/exc_bspsupport.rel \
- ../../../libcpu/@RTEMS_CPU@/shared/cache.rel \
../../../libcpu/@RTEMS_CPU@/shared/cpuIdent.rel
include $(top_srcdir)/../../../../automake/local.am
diff --git a/c/src/lib/libbsp/powerpc/virtex4/Makefile.am b/c/src/lib/libbsp/powerpc/virtex4/Makefile.am
index c5a2a32632..4279e07bec 100644
--- a/c/src/lib/libbsp/powerpc/virtex4/Makefile.am
+++ b/c/src/lib/libbsp/powerpc/virtex4/Makefile.am
@@ -45,9 +45,10 @@ libbsp_a_SOURCES += irq/irq_init.c
# mmu
libbsp_a_SOURCES += mmu/mmu.c
+libbsp_a_SOURCES += ../../../../../../bsps/powerpc/shared/cache/cache.c
+
libbsp_a_LIBADD = ../../../libcpu/@RTEMS_CPU@/@exceptions@/rtems-cpu.rel \
../../../libcpu/@RTEMS_CPU@/@exceptions@/exc_bspsupport.rel \
- ../../../libcpu/@RTEMS_CPU@/shared/cache.rel \
../../../libcpu/@RTEMS_CPU@/shared/cpuIdent.rel \
../../../libcpu/@RTEMS_CPU@/ppc403/clock.rel \
../../../libcpu/@RTEMS_CPU@/ppc403/timer.rel
diff --git a/c/src/lib/libbsp/powerpc/virtex5/Makefile.am b/c/src/lib/libbsp/powerpc/virtex5/Makefile.am
index ffc9c7eaea..60ca33d5fd 100644
--- a/c/src/lib/libbsp/powerpc/virtex5/Makefile.am
+++ b/c/src/lib/libbsp/powerpc/virtex5/Makefile.am
@@ -47,9 +47,10 @@ libbsp_a_SOURCES += irq/irq_init.c
# mmu
libbsp_a_SOURCES += mmu/mmu.c
+libbsp_a_SOURCES += ../../../../../../bsps/powerpc/shared/cache/cache.c
+
libbsp_a_LIBADD = ../../../libcpu/@RTEMS_CPU@/@exceptions@/rtems-cpu.rel \
../../../libcpu/@RTEMS_CPU@/@exceptions@/exc_bspsupport.rel \
- ../../../libcpu/@RTEMS_CPU@/shared/cache.rel \
../../../libcpu/@RTEMS_CPU@/shared/cpuIdent.rel \
../../../libcpu/@RTEMS_CPU@/e500/clock.rel \
../../../libcpu/@RTEMS_CPU@/e500/timer.rel
diff --git a/c/src/lib/libbsp/riscv/riscv_generic/Makefile.am b/c/src/lib/libbsp/riscv/riscv_generic/Makefile.am
index 030cb473e7..744c9634d4 100644
--- a/c/src/lib/libbsp/riscv/riscv_generic/Makefile.am
+++ b/c/src/lib/libbsp/riscv/riscv_generic/Makefile.am
@@ -63,9 +63,7 @@ libbsp_a_SOURCES += ../../shared/src/irq-info.c
libbsp_a_SOURCES += irq/irq.c
# Cache
-libbsp_a_SOURCES += ../../../libcpu/shared/src/cache_manager.c
-libbsp_a_SOURCES += ../../shared/include/cache_.h
-libbsp_a_CPPFLAGS = $(AM_CPPFLAGS) -I$(srcdir)/../../shared/include
+libbsp_a_SOURCES += ../../../../../../bsps/shared/cache/nocache.c
# debugio
libbsp_a_SOURCES += console/console-io.c
diff --git a/c/src/lib/libbsp/sh/gensh1/Makefile.am b/c/src/lib/libbsp/sh/gensh1/Makefile.am
index f2e2993f18..f4e139eb3d 100644
--- a/c/src/lib/libbsp/sh/gensh1/Makefile.am
+++ b/c/src/lib/libbsp/sh/gensh1/Makefile.am
@@ -47,9 +47,7 @@ libbsp_a_SOURCES += console/sci.c
libbsp_a_SOURCES += ../../shared/dummy_printk_support.c
# Cache
-libbsp_a_SOURCES += ../../../libcpu/shared/src/cache_manager.c
-libbsp_a_SOURCES += ../../shared/include/cache_.h
-libbsp_a_CPPFLAGS = $(AM_CPPFLAGS) -I$(srcdir)/../../shared/include
+libbsp_a_SOURCES += ../../../../../../bsps/shared/cache/nocache.c
EXTRA_DIST += times
diff --git a/c/src/lib/libbsp/sh/gensh2/Makefile.am b/c/src/lib/libbsp/sh/gensh2/Makefile.am
index 131ee3f58c..4a9501e784 100644
--- a/c/src/lib/libbsp/sh/gensh2/Makefile.am
+++ b/c/src/lib/libbsp/sh/gensh2/Makefile.am
@@ -51,9 +51,7 @@ libbsp_a_SOURCES += console/sci_termios.c
libbsp_a_SOURCES += ../../shared/dummy_printk_support.c
# Cache
-libbsp_a_SOURCES += ../../../libcpu/shared/src/cache_manager.c
-libbsp_a_SOURCES += ../../shared/include/cache_.h
-libbsp_a_CPPFLAGS = $(AM_CPPFLAGS) -I$(srcdir)/../../shared/include
+libbsp_a_SOURCES += ../../../../../../bsps/shared/cache/nocache.c
include $(top_srcdir)/../../../../automake/local.am
include $(srcdir)/../../../../../../bsps/sh/gensh2/headers.am
diff --git a/c/src/lib/libbsp/sh/gensh4/Makefile.am b/c/src/lib/libbsp/sh/gensh4/Makefile.am
index 42539aa8cc..9fb0f6e272 100644
--- a/c/src/lib/libbsp/sh/gensh4/Makefile.am
+++ b/c/src/lib/libbsp/sh/gensh4/Makefile.am
@@ -38,9 +38,7 @@ libbsp_a_SOURCES += console/sh4uart.c
libbsp_a_SOURCES += hw_init/hw_init.c
# Cache
-libbsp_a_SOURCES += ../../../libcpu/shared/src/cache_manager.c
-libbsp_a_SOURCES += ../../shared/include/cache_.h
-libbsp_a_CPPFLAGS = $(AM_CPPFLAGS) -I$(srcdir)/../../shared/include
+libbsp_a_SOURCES += ../../../../../../bsps/shared/cache/nocache.c
EXTRA_DIST += times
diff --git a/c/src/lib/libbsp/sh/shsim/Makefile.am b/c/src/lib/libbsp/sh/shsim/Makefile.am
index 9cd43bac4a..3fe05b95af 100644
--- a/c/src/lib/libbsp/sh/shsim/Makefile.am
+++ b/c/src/lib/libbsp/sh/shsim/Makefile.am
@@ -47,9 +47,7 @@ libbsp_a_SOURCES += console/console-debugio.c
libbsp_a_SOURCES += ../../shared/timerstub.c
# Cache
-libbsp_a_SOURCES += ../../../libcpu/shared/src/cache_manager.c
-libbsp_a_SOURCES += ../../shared/include/cache_.h
-libbsp_a_CPPFLAGS = $(AM_CPPFLAGS) -I$(srcdir)/../../shared/include
+libbsp_a_SOURCES += ../../../../../../bsps/shared/cache/nocache.c
include $(top_srcdir)/../../../../automake/local.am
include $(srcdir)/../../../../../../bsps/sh/shsim/headers.am
diff --git a/c/src/lib/libbsp/shared/include/cache_.h b/c/src/lib/libbsp/shared/include/cache_.h
deleted file mode 100644
index 710cecca97..0000000000
--- a/c/src/lib/libbsp/shared/include/cache_.h
+++ /dev/null
@@ -1 +0,0 @@
-/* Empty */
diff --git a/c/src/lib/libbsp/sparc/erc32/Makefile.am b/c/src/lib/libbsp/sparc/erc32/Makefile.am
index cb7ee0a34e..52017ba0d6 100644
--- a/c/src/lib/libbsp/sparc/erc32/Makefile.am
+++ b/c/src/lib/libbsp/sparc/erc32/Makefile.am
@@ -76,9 +76,10 @@ if HAS_NETWORKING
libbsp_a_SOURCES += erc32sonic/erc32sonic.c
endif
+libbsp_a_SOURCES += ../../../../../../bsps/shared/cache/nocache.c
+
libbsp_a_LIBADD = \
../../../libcpu/@RTEMS_CPU@/access.rel \
- ../../../libcpu/@RTEMS_CPU@/cache.rel \
../../../libcpu/@RTEMS_CPU@/reg_win.rel \
../../../libcpu/@RTEMS_CPU@/syscall.rel
diff --git a/c/src/lib/libbsp/sparc/leon2/Makefile.am b/c/src/lib/libbsp/sparc/leon2/Makefile.am
index f7f2fd6937..d65abbc500 100644
--- a/c/src/lib/libbsp/sparc/leon2/Makefile.am
+++ b/c/src/lib/libbsp/sparc/leon2/Makefile.am
@@ -143,6 +143,7 @@ libbsp_a_SOURCES += ../../sparc/shared/analog/gradcdac.c
libbsp_a_SOURCES += ../../sparc/shared/mem/mctrl.c
# l2cache
libbsp_a_SOURCES += ../../sparc/shared/l2c/l2c.c
+libbsp_a_SOURCES += startup/cache.c
# griommu
libbsp_a_SOURCES += ../../sparc/shared/iommu/griommu.c
# timer
@@ -177,7 +178,6 @@ endif
libbsp_a_LIBADD = \
../../../libcpu/@RTEMS_CPU@/access.rel \
- ../../../libcpu/@RTEMS_CPU@/cache.rel \
../../../libcpu/@RTEMS_CPU@/reg_win.rel \
../../../libcpu/@RTEMS_CPU@/syscall.rel
diff --git a/c/src/lib/libcpu/sparc/cache/cache_.h b/c/src/lib/libbsp/sparc/leon2/startup/cache.c
similarity index 82%
rename from c/src/lib/libcpu/sparc/cache/cache_.h
rename to c/src/lib/libbsp/sparc/leon2/startup/cache.c
index 3d4ea69f8b..d38aa02f41 100644
--- a/c/src/lib/libcpu/sparc/cache/cache_.h
+++ b/c/src/lib/libbsp/sparc/leon2/startup/cache.c
@@ -2,9 +2,6 @@
* SPARC Cache Manager Support
*/
-#ifndef __SPARC_CACHE_h
-#define __SPARC_CACHE_h
-
/*
* CACHE MANAGER: The following functions are CPU-specific.
* They provide the basic implementation for the rtems_* cache
@@ -14,9 +11,6 @@
* FIXME: Some functions simply have not been implemented.
*/
-/* This define is set in a Makefile */
-#if defined(HAS_INSTRUCTION_CACHE)
-
#define CPU_INSTRUCTION_CACHE_ALIGNMENT 0
#define CPU_CACHE_SUPPORT_PROVIDES_RANGE_FUNCTIONS
@@ -52,7 +46,4 @@ static inline void _CPU_cache_disable_instruction ( void )
{
}
-#endif /* defined(HAS_INSTRUCTION_CACHE) */
-
-#endif
-/* end of include file */
+#include "../../../../../../bsps/shared/cache/cacheimpl.h"
diff --git a/c/src/lib/libbsp/sparc/leon3/Makefile.am b/c/src/lib/libbsp/sparc/leon3/Makefile.am
index 2f8480ae97..38eba20fe5 100644
--- a/c/src/lib/libbsp/sparc/leon3/Makefile.am
+++ b/c/src/lib/libbsp/sparc/leon3/Makefile.am
@@ -161,9 +161,7 @@ libbsp_a_SOURCES += ../../sparc/shared/iommu/griommu.c
libbsp_a_SOURCES += timer/timer.c
libbsp_a_SOURCES += timer/watchdog.c
# Cache
-libbsp_a_SOURCES += ../../../libcpu/shared/src/cache_manager.c
-libbsp_a_SOURCES += include/cache_.h
-libbsp_a_CPPFLAGS = $(AM_CPPFLAGS) -I$(srcdir)/include
+libbsp_a_SOURCES += startup/cache.c
# GR712
libbsp_a_SOURCES += ../../sparc/shared/ascs/grascs.c
diff --git a/c/src/lib/libbsp/sparc/leon3/include/cache_.h b/c/src/lib/libbsp/sparc/leon3/startup/cache.c
similarity index 95%
rename from c/src/lib/libbsp/sparc/leon3/include/cache_.h
rename to c/src/lib/libbsp/sparc/leon3/startup/cache.c
index ced5b6dd0a..52767cbceb 100644
--- a/c/src/lib/libbsp/sparc/leon3/include/cache_.h
+++ b/c/src/lib/libbsp/sparc/leon3/startup/cache.c
@@ -12,16 +12,9 @@
* http://www.rtems.org/license/LICENSE.
*/
-#ifndef LEON3_CACHE_H
-#define LEON3_CACHE_H
-
#include <amba.h>
#include <leon.h>
-#ifdef __cplusplus
-extern "C" {
-#endif
-
#define CPU_CACHE_SUPPORT_PROVIDES_RANGE_FUNCTIONS
#define CPU_CACHE_SUPPORT_PROVIDES_CACHE_SIZE_FUNCTIONS
@@ -195,8 +188,4 @@ static inline void _CPU_cache_disable_instruction(void)
/* TODO */
}
-#ifdef __cplusplus
-}
-#endif /* __cplusplus */
-
-#endif /* LEON3_CACHE_H */
+#include "../../../../../../bsps/shared/cache/cacheimpl.h"
diff --git a/c/src/lib/libbsp/sparc64/niagara/Makefile.am b/c/src/lib/libbsp/sparc64/niagara/Makefile.am
index 717dfdc638..8ae6d0ce61 100644
--- a/c/src/lib/libbsp/sparc64/niagara/Makefile.am
+++ b/c/src/lib/libbsp/sparc64/niagara/Makefile.am
@@ -50,9 +50,10 @@ noinst_LIBRARIES = libbsp.a
libbsp_a_SOURCES = $(startup_SOURCES) $(clock_SOURCES) $(console_SOURCES) \
$(timer_SOURCES)
+libbsp_a_SOURCES += ../../../../../../bsps/shared/cache/nocache.c
+
libbsp_a_LIBADD = \
../../../libcpu/@RTEMS_CPU@/shared/shared-score.rel \
- ../../../libcpu/@RTEMS_CPU@/shared/cache.rel \
../../../libcpu/@RTEMS_CPU@/shared/sparc64-syscall.rel
include $(top_srcdir)/../../../../automake/local.am
diff --git a/c/src/lib/libbsp/sparc64/usiii/Makefile.am b/c/src/lib/libbsp/sparc64/usiii/Makefile.am
index cf2828a015..aedeac340f 100644
--- a/c/src/lib/libbsp/sparc64/usiii/Makefile.am
+++ b/c/src/lib/libbsp/sparc64/usiii/Makefile.am
@@ -63,10 +63,10 @@ noinst_LIBRARIES = libbsp.a
libbsp_a_SOURCES = $(startup_SOURCES) $(mmu_SOURCES) $(clock_SOURCES) $(console_SOURCES) \
$(timer_SOURCES)
+libbsp_a_SOURCES += ../../../../../../bsps/shared/cache/nocache.c
libbsp_a_LIBADD = \
../../../libcpu/@RTEMS_CPU@/shared/shared-score.rel \
- ../../../libcpu/@RTEMS_CPU@/shared/cache.rel \
../../../libcpu/@RTEMS_CPU@/shared/sparc64-syscall.rel
include $(top_srcdir)/../../../../automake/local.am
diff --git a/c/src/lib/libbsp/v850/gdbv850sim/Makefile.am b/c/src/lib/libbsp/v850/gdbv850sim/Makefile.am
index 2f06d2ccd2..ec423e7795 100644
--- a/c/src/lib/libbsp/v850/gdbv850sim/Makefile.am
+++ b/c/src/lib/libbsp/v850/gdbv850sim/Makefile.am
@@ -38,9 +38,7 @@ libbsp_a_SOURCES += console/console-io.c
libbsp_a_SOURCES += ../../shared/timerstub.c
# Cache
-libbsp_a_SOURCES += ../../../libcpu/shared/src/cache_manager.c
-libbsp_a_SOURCES += ../../shared/include/cache_.h
-libbsp_a_CPPFLAGS = $(AM_CPPFLAGS) -I$(srcdir)/../../shared/include
+libbsp_a_SOURCES += ../../../../../../bsps/shared/cache/nocache.c
noinst_LIBRARIES = libbsp.a
diff --git a/c/src/lib/libcpu/arm/shared/include/cache_.h b/c/src/lib/libcpu/arm/shared/include/cache_.h
deleted file mode 100644
index 9db399edf7..0000000000
--- a/c/src/lib/libcpu/arm/shared/include/cache_.h
+++ /dev/null
@@ -1,58 +0,0 @@
-/**
- * @file
- *
- * @ingroup arm
- *
- * @brief ARM cache dummy include for chips without cache
- */
-
-/*
- * Copyright (c) 2009-2011 embedded brains GmbH. All rights reserved.
- *
- * embedded brains GmbH
- * Obere Lagerstr. 30
- * 82178 Puchheim
- * Germany
- * <rtems at embedded-brains.de>
- *
- * 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.
- */
-
-#ifndef LIBCPU_ARM_CACHE__H
-#define LIBCPU_ARM_CACHE__H
-
-/*
- * The ARM targets equipped by cache should include
- * which kind and implementation they support.
- * Next options are available
- *
- * c/src/lib/libbsp/arm/shared/armv467ar-basic-cache/cache_.h
- * basic ARM cache integrated on the CPU core directly
- * which requires only CP15 oparations
- *
- * c/src/lib/libbsp/arm/shared/arm-l2c-310/cache_.h
- * support for case where ARM L2C-310 cache controller
- * is used. It is accessible as mmaped peripheral.
- *
- * c/src/lib/libbsp/arm/shared/armv7m/include/cache_.h
- * Cortex-M specific cache support
- *
- * Cache support should be included in BSP Makefile.am
- *
- * Example how to include cache support
- *
- * # Cache
- * libbsp_a_SOURCES += ../../../libcpu/shared/src/cache_manager.c
- * libbsp_a_SOURCES += ../shared/include/arm-cache-l1.h
- * libbsp_a_SOURCES += ../shared/armv467ar-basic-cache/cache_.h
- * libbsp_a_CPPFLAGS += -I$(srcdir)/../shared/armv467ar-basic-cache
- */
-
-#if defined(__ARM_ARCH_5TEJ__) || defined(__ARM_ARCH_7A__)
-#warning ARM 5TEJ and ARMv7/Cortex-A cores include usually cache
-#warning change BSP to include appropriate cache implementation
-#endif
-
-#endif /* LIBCPU_ARM_CACHE__H */
diff --git a/c/src/lib/libcpu/bfin/Makefile.am b/c/src/lib/libcpu/bfin/Makefile.am
index 9b7ee0c26e..8d484480a9 100644
--- a/c/src/lib/libcpu/bfin/Makefile.am
+++ b/c/src/lib/libcpu/bfin/Makefile.am
@@ -22,12 +22,6 @@ endif
# endof bf52x
############
-noinst_PROGRAMS += cache.rel
-cache_rel_SOURCES = cache/cache.c \
- ../shared/src/cache_manager.c cache/cache_.h
-cache_rel_CPPFLAGS = $(AM_CPPFLAGS) -I$(srcdir)/cache
-cache_rel_LDFLAGS = $(RTEMS_RELLDFLAGS)
-
noinst_PROGRAMS += mmu.rel
mmu_rel_SOURCES = mmu/mmu.c
mmu_rel_CPPFLAGS = $(AM_CPPFLAGS)
diff --git a/c/src/lib/libcpu/bfin/cache/cache_.h b/c/src/lib/libcpu/bfin/cache/cache_.h
deleted file mode 100644
index f739976b51..0000000000
--- a/c/src/lib/libcpu/bfin/cache/cache_.h
+++ /dev/null
@@ -1,21 +0,0 @@
-/*
- * Blackfin Cache Manager Support
- */
-
-#ifndef _cache__h_
-#define _cache__h_
-
-#include "../../shared/include/cache.h"
-
-#define CPU_DATA_CACHE_ALIGNMENT 32
-#define CPU_INSTRUCTION_CACHE_ALIGNMENT 32
-
-#ifdef BSP_DATA_CACHE_CONFIG
-#define LIBCPU_DATA_CACHE_CONFIG BSP_DATA_CACHE_CONFIG
-#else
-/* use 16K of each SRAM bank */
-#define LIBCPU_DATA_CACHE_CONFIG (3 << DMEM_CONTROL_DMC_SHIFT)
-#endif
-
-#endif /* _cache__h_ */
-
diff --git a/c/src/lib/libcpu/i386/Makefile.am b/c/src/lib/libcpu/i386/Makefile.am
index 6f1e9fe3ec..ec7a4c4a48 100644
--- a/c/src/lib/libcpu/i386/Makefile.am
+++ b/c/src/lib/libcpu/i386/Makefile.am
@@ -4,12 +4,6 @@ noinst_PROGRAMS =
include $(top_srcdir)/../../../automake/compile.am
-noinst_PROGRAMS += cache.rel
-cache_rel_SOURCES = cache.c cache_.h \
- ../shared/src/cache_manager.c ../shared/include/cache.h
-cache_rel_CPPFLAGS = $(AM_CPPFLAGS)
-cache_rel_LDFLAGS = $(RTEMS_RELLDFLAGS)
-
noinst_PROGRAMS += score.rel
score_rel_SOURCES = displayCpu.c cpuModel.S cpuModel.h idtr.S cpu.h
score_rel_CPPFLAGS = $(AM_CPPFLAGS)
diff --git a/c/src/lib/libcpu/i386/cache_.h b/c/src/lib/libcpu/i386/cache_.h
deleted file mode 100644
index cefd39f3ad..0000000000
--- a/c/src/lib/libcpu/i386/cache_.h
+++ /dev/null
@@ -1,15 +0,0 @@
-/*
- * i386 Cache Manager Wrapper
- */
-
-#ifndef __i386_CACHE_h
-#define __i386_CACHE_h
-
-#define I386_CACHE_ALIGNMENT 16
-#define CPU_DATA_CACHE_ALIGNMENT I386_CACHE_ALIGNMENT
-#define CPU_INSTRUCTION_CACHE_ALIGNEMNT I386_CACHE_ALIGNMENT
-
-#include "../shared/include/cache.h"
-
-#endif
-/* end of include file */
diff --git a/c/src/lib/libcpu/lm32/shared/cache/cache_.h b/c/src/lib/libcpu/lm32/shared/cache/cache_.h
deleted file mode 100644
index 2a303b7db7..0000000000
--- a/c/src/lib/libcpu/lm32/shared/cache/cache_.h
+++ /dev/null
@@ -1,11 +0,0 @@
-/*
- * LM32 Cache Manager Support
- */
-
-#ifndef __LM32_CACHE_h
-#define __LM32_CACHE_h
-
-#include "../../../shared/include/cache.h"
-
-#endif
-/* end of include file */
diff --git a/c/src/lib/libcpu/m68k/Makefile.am b/c/src/lib/libcpu/m68k/Makefile.am
index 2800e421c4..ed07940257 100644
--- a/c/src/lib/libcpu/m68k/Makefile.am
+++ b/c/src/lib/libcpu/m68k/Makefile.am
@@ -6,13 +6,6 @@ noinst_PROGRAMS =
if shared
-noinst_PROGRAMS += shared/cache.rel
-shared_cache_rel_SOURCES = shared/cache/cache.c
-shared_cache_rel_SOURCES += shared/cache/cache_.h
-shared_cache_rel_SOURCES += ../shared/src/cache_manager.c
-shared_cache_rel_CPPFLAGS = $(AM_CPPFLAGS) -I$(srcdir)/shared/cache
-shared_cache_rel_LDFLAGS = $(RTEMS_RELLDFLAGS)
-
## shared/misc
# gcc doesn't recognize difference between the cpu32 and cpu32+ so we have to
@@ -92,46 +85,6 @@ mcf5206_timer_rel_CPPFLAGS = $(AM_CPPFLAGS)
mcf5206_timer_rel_LDFLAGS = $(RTEMS_RELLDFLAGS)
endif
-if mcf5223x
-## mcf5223x/include
-## mcf5223x/cache
-noinst_PROGRAMS += mcf5223x/cachepd.rel
-mcf5223x_cachepd_rel_SOURCES = mcf5223x/cache/cachepd.c
-mcf5223x_cachepd_rel_CPPFLAGS = $(AM_CPPFLAGS) -I$(srcdir)/shared/cache
-mcf5223x_cachepd_rel_LDFLAGS = $(RTEMS_RELLDFLAGS)
-endif
-
-if mcf5225x
-## mcf5225x/include
-# mcf5225x/cache
-noinst_PROGRAMS += mcf5225x/cachepd.rel
-mcf5225x_cachepd_rel_SOURCES = mcf5225x/cache/cachepd.c
-mcf5225x_cachepd_rel_CPPFLAGS = $(AM_CPPFLAGS) -I$(srcdir)/shared/cache
-mcf5225x_cachepd_rel_LDFLAGS = $(RTEMS_RELLDFLAGS)
-
-# Network
-if HAS_NETWORKING
-endif ## HAS_NETWORKING
-endif
-
-if mcf5235
-## mcf5235/include
-## mcf5235/cache
-noinst_PROGRAMS += mcf5235/cachepd.rel
-mcf5235_cachepd_rel_SOURCES = mcf5235/cache/cachepd.c
-mcf5235_cachepd_rel_CPPFLAGS = $(AM_CPPFLAGS) -I$(srcdir)/shared/cache
-mcf5235_cachepd_rel_LDFLAGS = $(RTEMS_RELLDFLAGS)
-endif
-
-if mcf532x
-## mcf532x/include
-## mcf532x/cache
-noinst_PROGRAMS += mcf532x/cachepd.rel
-mcf532x_cachepd_rel_SOURCES = mcf532x/cache/cachepd.c
-mcf532x_cachepd_rel_CPPFLAGS = $(AM_CPPFLAGS) -I$(srcdir)/shared/cache
-mcf532x_cachepd_rel_LDFLAGS = $(RTEMS_RELLDFLAGS)
-endif
-
if mcf5272
## mcf5272/include
## clock
@@ -147,14 +100,6 @@ mcf5272_timer_rel_CPPFLAGS = $(AM_CPPFLAGS)
mcf5272_timer_rel_LDFLAGS = $(RTEMS_RELLDFLAGS)
endif
-if mcf5282
-## mcf5282/include
-noinst_PROGRAMS += mcf5282/cachepd.rel
-mcf5282_cachepd_rel_SOURCES = mcf5282/cache/cachepd.c
-mcf5282_cachepd_rel_CPPFLAGS = $(AM_CPPFLAGS) -I$(srcdir)/shared/cache
-mcf5282_cachepd_rel_LDFLAGS = $(RTEMS_RELLDFLAGS)
-endif
-
if mcf548x
## mcf548x/include
## mcf548x/mcdma
diff --git a/c/src/lib/libcpu/m68k/shared/cache/cache_.h b/c/src/lib/libcpu/m68k/shared/cache/cache_.h
deleted file mode 100644
index af4bef638a..0000000000
--- a/c/src/lib/libcpu/m68k/shared/cache/cache_.h
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
- * M68K Cache Manager Support
- */
-
-#ifndef __M68K_CACHE_h
-#define __M68K_CACHE_h
-
-#if (defined(__mc68020__) && !defined(__mcpu32__))
-# define M68K_INSTRUCTION_CACHE_ALIGNMENT 16
-#elif defined(__mc68030__)
-# define M68K_INSTRUCTION_CACHE_ALIGNMENT 16
-# define M68K_DATA_CACHE_ALIGNMENT 16
-#elif ( defined(__mc68040__) || defined (__mc68060__) )
-# define M68K_INSTRUCTION_CACHE_ALIGNMENT 16
-# define M68K_DATA_CACHE_ALIGNMENT 16
-#elif ( defined(__mcf5200__) )
-# define M68K_INSTRUCTION_CACHE_ALIGNMENT 16
-# if ( defined(__mcf528x__) )
-# define M68K_DATA_CACHE_ALIGNMENT 16
-# endif
-#elif ( defined(__mcf5300__) )
-# define M68K_INSTRUCTION_CACHE_ALIGNMENT 16
-# define M68K_DATA_CACHE_ALIGNMENT 16
-#elif defined(__mcfv4e__)
-# define M68K_INSTRUCTION_CACHE_ALIGNMENT 16
-# define M68K_DATA_CACHE_ALIGNMENT 16
-#endif
-
-#if defined(M68K_DATA_CACHE_ALIGNMENT)
-#define CPU_DATA_CACHE_ALIGNMENT M68K_DATA_CACHE_ALIGNMENT
-#endif
-
-#if defined(M68K_INSTRUCTION_CACHE_ALIGNMENT)
-#define CPU_INSTRUCTION_CACHE_ALIGNMENT M68K_INSTRUCTION_CACHE_ALIGNMENT
-#endif
-
-#include "../../../shared/include/cache.h"
-
-#endif
-/* end of include file */
diff --git a/c/src/lib/libcpu/mips/shared/cache/cache.c b/c/src/lib/libcpu/mips/shared/cache/cache.c
deleted file mode 100644
index 384e7c8c19..0000000000
--- a/c/src/lib/libcpu/mips/shared/cache/cache.c
+++ /dev/null
@@ -1,8 +0,0 @@
-/*
- * Cache Management Support Routines for the MIPS
- */
-
-#include <rtems.h>
-#include "cache_.h"
-
-/* TBD */
diff --git a/c/src/lib/libcpu/mips/shared/cache/cache_.h b/c/src/lib/libcpu/mips/shared/cache/cache_.h
deleted file mode 100644
index a81c5a098a..0000000000
--- a/c/src/lib/libcpu/mips/shared/cache/cache_.h
+++ /dev/null
@@ -1,13 +0,0 @@
-/*
- * MIPS Cache Manager Support
- */
-
-#ifndef __MIPS_CACHE_h
-#define __MIPS_CACHE_h
-
-#include "../../../shared/include/cache.h"
-
-/* TBD */
-
-#endif
-/* end of include file */
diff --git a/c/src/lib/libcpu/nios2/Makefile.am b/c/src/lib/libcpu/nios2/Makefile.am
index 7641afb335..d5bfc578c3 100644
--- a/c/src/lib/libcpu/nios2/Makefile.am
+++ b/c/src/lib/libcpu/nios2/Makefile.am
@@ -7,14 +7,6 @@ DISTCLEANFILES =
noinst_PROGRAMS =
if shared
-
-## shared/cache
-noinst_PROGRAMS += shared/cache.rel
-shared_cache_rel_SOURCES = ../shared/src/no_cache.c shared/cache/cache_.h \
- ../shared/src/cache_manager.c
-shared_cache_rel_CPPFLAGS = $(AM_CPPFLAGS) -I$(srcdir)/shared/cache
-shared_cache_rel_LDFLAGS = $(RTEMS_RELLDFLAGS)
-
## shared/misc
noinst_PROGRAMS += shared/misc.rel
shared_misc_rel_SOURCES = shared/misc/memcpy.c
diff --git a/c/src/lib/libcpu/nios2/shared/cache/cache_.h b/c/src/lib/libcpu/nios2/shared/cache/cache_.h
deleted file mode 100644
index 1a83b8eb23..0000000000
--- a/c/src/lib/libcpu/nios2/shared/cache/cache_.h
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
- * M68K Cache Manager Support
- */
-
-#ifndef __M68K_CACHE_h
-#define __M68K_CACHE_h
-
-#if (defined(__mc68020__) && !defined(__mcpu32__))
-# define M68K_INSTRUCTION_CACHE_ALIGNMENT 16
-#elif defined(__mc68030__)
-# define M68K_INSTRUCTION_CACHE_ALIGNMENT 16
-# define M68K_DATA_CACHE_ALIGNMENT 16
-#elif ( defined(__mc68040__) || defined (__mc68060__) )
-# define M68K_INSTRUCTION_CACHE_ALIGNMENT 16
-# define M68K_DATA_CACHE_ALIGNMENT 16
-#elif ( defined(__mcf5200__) )
-# define M68K_INSTRUCTION_CACHE_ALIGNMENT 16
-# if ( defined(__mcf528x__) )
-# define M68K_DATA_CACHE_ALIGNMENT 16
-# endif
-#endif
-
-#if defined(M68K_DATA_CACHE_ALIGNMENT)
-#define CPU_DATA_CACHE_ALIGNMENT M68K_DATA_CACHE_ALIGNMENT
-#endif
-
-#if defined(M68K_INSTRUCTION_CACHE_ALIGNMENT)
-#define CPU_INSTRUCTION_CACHE_ALIGNMENT M68K_INSTRUCTION_CACHE_ALIGNMENT
-#endif
-
-#include "../../../shared/include/cache.h"
-
-#endif
-/* end of include file */
diff --git a/c/src/lib/libcpu/or1k/shared/cache/cache_.h b/c/src/lib/libcpu/or1k/shared/cache/cache_.h
deleted file mode 100644
index ea379580d5..0000000000
--- a/c/src/lib/libcpu/or1k/shared/cache/cache_.h
+++ /dev/null
@@ -1,18 +0,0 @@
-/*
- * or1k Cache Manager Support
- */
-
-#ifndef __OR1K_CACHE_H
-#define __OR1K_CACHE_H
-
-#include <bsp/cache_.h>
-#include "../../../shared/include/cache.h"
-
-#define CPU_CACHE_SUPPORT_PROVIDES_RANGE_FUNCTIONS 1
-
-void _CPU_cache_flush_data_range(const void *d_addr, size_t n_bytes);
-void _CPU_cache_invalidate_data_range(const void *d_addr, size_t n_bytes);
-void _CPU_cache_invalidate_instruction_range(const void *i_addr, size_t n_bytes);
-
-#endif
-/* end of include file */
diff --git a/c/src/lib/libcpu/powerpc/Makefile.am b/c/src/lib/libcpu/powerpc/Makefile.am
index 514c93db37..6cf77130f1 100644
--- a/c/src/lib/libcpu/powerpc/Makefile.am
+++ b/c/src/lib/libcpu/powerpc/Makefile.am
@@ -51,14 +51,6 @@ shared_cpuIdent_rel_SOURCES = shared/include/cpuIdent.c shared/include/cpuIdent.
shared_cpuIdent_rel_CPPFLAGS = $(AM_CPPFLAGS)
shared_cpuIdent_rel_LDFLAGS = $(RTEMS_RELLDFLAGS)
-# shared/cache
-noinst_PROGRAMS += shared/cache.rel
-shared_cache_rel_SOURCES = shared/src/cache_.h \
- ../shared/src/cache_manager.c \
- ../shared/include/cache.h
-shared_cache_rel_CPPFLAGS = $(AM_CPPFLAGS) -I$(srcdir)/shared/src
-shared_cache_rel_LDFLAGS = $(RTEMS_RELLDFLAGS)
-
# shared/stack
noinst_PROGRAMS += shared/stack.rel
shared_stack_rel_SOURCES = shared/src/stack.c shared/include/spr.h shared/src/stackTrace.h
diff --git a/c/src/lib/libcpu/shared/include/cache.h b/c/src/lib/libcpu/shared/include/cache.h
deleted file mode 100644
index 9220a20d28..0000000000
--- a/c/src/lib/libcpu/shared/include/cache.h
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
- * libcpu Cache Manager Support
- *
- * COPYRIGHT (c) 1989-1999.
- * On-Line Applications Research Corporation (OAR).
- *
- * 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.
- *
- * The functions declared in this file are implemented for
- * each processor in the cache.c file under libcpu/CPU/.
- * They provide the processor specific actions to take for
- * implementing most of the RTEMS Cache Manager directives,
- * and should only ever be called by these directives.
- *
- * The API for the RTEMS Cache Manager can be found in
- * c/src/exec/rtems/include/rtems/rtems/cache.h
- */
-
-#ifndef __LIBCPU_CACHE_h
-#define __LIBCPU_CACHE_h
-
-void _CPU_cache_flush_1_data_line(const void *d_addr);
-void _CPU_cache_invalidate_1_data_line(const void *d_addr);
-void _CPU_cache_freeze_data(void);
-void _CPU_cache_unfreeze_data(void);
-void _CPU_cache_invalidate_1_instruction_line(const void *d_addr);
-void _CPU_cache_freeze_instruction(void);
-void _CPU_cache_unfreeze_instruction(void);
-void _CPU_cache_flush_entire_data(void);
-void _CPU_cache_invalidate_entire_data(void);
-void _CPU_cache_enable_data(void);
-void _CPU_cache_disable_data(void);
-void _CPU_cache_invalidate_entire_instruction(void);
-void _CPU_cache_enable_instruction(void);
-void _CPU_cache_disable_instruction(void);
-
-#endif
-/* end of include file */
diff --git a/c/src/lib/libcpu/shared/src/no_cache.c b/c/src/lib/libcpu/shared/src/no_cache.c
deleted file mode 100644
index 3f869fcd60..0000000000
--- a/c/src/lib/libcpu/shared/src/no_cache.c
+++ /dev/null
@@ -1,65 +0,0 @@
-/*
- * STUB Cache Management Support Routines
- */
-
-#include <rtems.h>
-#include "cache_.h"
-
-/*
- * CACHE MANAGER: The following functions should be implemented
- * properly for each CPU if it has a cache. These provide the basic
- * implementation for the rtems_* cache management routines. If a given
- * function has no meaning for the CPU, then just let your implementation
- * do nothing.
- *
- * This is just a series of stubs.
- */
-
-void _CPU_cache_freeze_data ( void ) {}
-void _CPU_cache_unfreeze_data ( void ) {}
-void _CPU_cache_freeze_instruction ( void ) {}
-void _CPU_cache_unfreeze_instruction ( void ) {}
-
-void _CPU_cache_flush_1_data_line (
- const void * d_addr )
-{
-}
-
-void _CPU_cache_invalidate_1_data_line (
- const void * d_addr )
-{
-}
-
-void _CPU_cache_flush_entire_data ( void )
-{
-}
-
-void _CPU_cache_invalidate_entire_data ( void )
-{
-}
-
-void _CPU_cache_enable_data ( void )
-{
-}
-
-void _CPU_cache_disable_data ( void )
-{
-}
-
-void _CPU_cache_invalidate_1_instruction_line (
- const void * i_addr )
-{
-}
-
-void _CPU_cache_invalidate_entire_instruction ( void )
-{
-}
-
-void _CPU_cache_enable_instruction ( void )
-{
-}
-
-void _CPU_cache_disable_instruction ( void )
-{
-}
-/* end of file */
diff --git a/c/src/lib/libcpu/sparc/Makefile.am b/c/src/lib/libcpu/sparc/Makefile.am
index 4d957dac04..95e473d622 100644
--- a/c/src/lib/libcpu/sparc/Makefile.am
+++ b/c/src/lib/libcpu/sparc/Makefile.am
@@ -4,16 +4,6 @@ include $(top_srcdir)/../../../automake/compile.am
noinst_PROGRAMS =
-noinst_PROGRAMS += cache.rel
-cache_rel_SOURCES = cache/cache_.h \
- ../shared/src/cache_manager.c
-cache_rel_CPPFLAGS = $(AM_CPPFLAGS) -I$(srcdir)/cache
-cache_rel_LDFLAGS = $(RTEMS_RELLDFLAGS)
-
-if has_instruction_cache
-cache_rel_CPPFLAGS += -DHAS_INSTRUCTION_CACHE
-endif
-
noinst_PROGRAMS += syscall.rel
syscall_rel_SOURCES = syscall/syscall.S syscall/syscall.h
syscall_rel_CPPFLAGS = $(AM_CPPFLAGS)
diff --git a/c/src/lib/libcpu/sparc/configure.ac b/c/src/lib/libcpu/sparc/configure.ac
index 98b2ce8c4b..7107f971a9 100644
--- a/c/src/lib/libcpu/sparc/configure.ac
+++ b/c/src/lib/libcpu/sparc/configure.ac
@@ -21,9 +21,6 @@ AM_PROG_CC_C_O
RTEMS_CANONICALIZE_TOOLS
RTEMS_PROG_CCAS
-AM_CONDITIONAL(has_instruction_cache, test "$RTEMS_CPU_MODEL" = "leon1" \
-|| test "$RTEMS_CPU_MODEL" = "leon2" || test "$RTEMS_CPU_MODEL" = "leon3" )
-
RTEMS_AMPOLISH3
# Explicitly list all Makefiles here
diff --git a/c/src/lib/libcpu/sparc64/Makefile.am b/c/src/lib/libcpu/sparc64/Makefile.am
index 81d07d4617..d5883f5bd4 100644
--- a/c/src/lib/libcpu/sparc64/Makefile.am
+++ b/c/src/lib/libcpu/sparc64/Makefile.am
@@ -21,20 +21,8 @@ shared_sparc64_syscall_rel_SOURCES = shared/syscall/sparc64-syscall.S \
shared/syscall/sparc64-syscall.h
shared_sparc64_syscall_rel_CPPFLAGS = $(AM_CPPFLAGS)
shared_sparc64_syscall_rel_LDFLAGS = $(RTEMS_RELLDFLAGS)
-
-noinst_PROGRAMS += shared/cache.rel
-shared_cache_rel_SOURCES = shared/cache/cache.c shared/cache/cache_.h \
- ../shared/src/cache_manager.c
-shared_cache_rel_CPPFLAGS = $(AM_CPPFLAGS) -I$(srcdir)/shared/cache
-shared_cache_rel_LDFLAGS = $(RTEMS_RELLDFLAGS)
endif
-#if has_instruction_cache
-#cache_rel_CPPFLAGS += -DHAS_INSTRUCTION_CACHE
-#endif
-
-
-
### This is an example of how to define a separate score implementation.
## NOTE: Unlike other CPUs, we install into a subdirectory to avoid
## file name conflicts (See sh CPU for simexampleilar approach)
diff --git a/c/src/lib/libcpu/sparc64/shared/cache/cache.c b/c/src/lib/libcpu/sparc64/shared/cache/cache.c
deleted file mode 100644
index 63b6bb1cc6..0000000000
--- a/c/src/lib/libcpu/sparc64/shared/cache/cache.c
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
- * Cache Management Support Routines for the SPARC 64
- */
-
-#include <rtems.h>
-#include "cache_.h"
-
-
-#if defined(HAS_INSTRUCTION_CACHE)
-
-void _CPU_cache_invalidate_entire_instruction ( void )
-{
- __asm__ volatile ("flush");
-}
-
-/* XXX these need to be addressed */
-void _CPU_cache_freeze_instruction ( void )
-{
-}
-
-void _CPU_cache_unfreeze_instruction ( void )
-{
-}
-
-void _CPU_cache_enable_instruction ( void )
-{
-}
-
-void _CPU_cache_disable_instruction ( void )
-{
-}
-
-#endif
-/* end of file */
diff --git a/c/src/lib/libcpu/sparc64/shared/cache/cache_.h b/c/src/lib/libcpu/sparc64/shared/cache/cache_.h
deleted file mode 100644
index fc3600f380..0000000000
--- a/c/src/lib/libcpu/sparc64/shared/cache/cache_.h
+++ /dev/null
@@ -1,24 +0,0 @@
-/*
- * SPARC64 Cache Manager Support
- */
-
-#ifndef __SPARC_CACHE_h
-#define __SPARC_CACHE_h
-
-/*
- * CACHE MANAGER: The following functions are CPU-specific.
- * They provide the basic implementation for the rtems_* cache
- * management routines. If a given function has no meaning for the CPU,
- * it does nothing by default.
- *
- * FIXME: Some functions simply have not been implemented.
- */
-
-#if defined(HAS_INSTRUCTION_CACHE)
-#define CPU_INSTRUCTION_CACHE_ALIGNMENT 0
-#endif
-
-#include "../../../shared/include/cache.h"
-
-#endif
-/* end of include file */
--
2.12.3
More information about the devel
mailing list