[rtems commit] bsps: Rework cache manager implementation

Sebastian Huber sebh at rtems.org
Wed Jan 31 11:51:43 UTC 2018


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

Author:    Sebastian Huber <sebastian.huber at embedded-brains.de>
Date:      Sat Jan 27 14:37:51 2018 +0100

bsps: Rework cache manager implementation

The previous cache manager support used a single souce file
(cache_manager.c) which included 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/start/cache.c

Update #3285.

---

 .../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 | 37 ++++++------
 .../cache_.h => bsps/m68k/genmcf548x/start/cache.c |  6 +-
 bsps/m68k/shared/cache/cache-mcf5223x.c            | 38 +++++++++++++
 bsps/m68k/shared/cache/cache-mcf5225x.c            | 34 +++++++++++
 .../m68k/shared/cache/cache-mcf5235.c              | 32 ++++++-----
 .../m68k/shared/cache/cache-mcf5282.c              | 32 ++++++-----
 .../m68k/shared/cache/cache-mcf532x.c              | 32 ++++++-----
 bsps/m68k/shared/cache/cache.c                     |  3 +
 .../cache.c => bsps/m68k/shared/cache/cache.h      | 33 +++++++++--
 bsps/or1k/headers.am                               |  1 -
 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 +
 .../cache_.h => bsps/sparc/leon2/start/cache.c     | 11 +---
 .../cache_.h => bsps/sparc/leon3/start/cache.c     | 13 +----
 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 +-
 c/src/lib/libbsp/sparc/leon3/Makefile.am           |  5 +-
 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/Makefile.am                       |  2 -
 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/Makefile.am                  |  7 ---
 c/src/lib/libcpu/lm32/shared/cache/cache_.h        | 11 ----
 c/src/lib/libcpu/m68k/Makefile.am                  | 55 ------------------
 c/src/lib/libcpu/m68k/mcf5223x/cache/cachepd.c     | 36 ------------
 c/src/lib/libcpu/m68k/mcf5225x/cache/cachepd.c     | 32 -----------
 c/src/lib/libcpu/m68k/shared/cache/cache_.h        | 40 -------------
 c/src/lib/libcpu/mips/Makefile.am                  |  7 ---
 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/Makefile.am                  | 16 ------
 c/src/lib/libcpu/or1k/configure.ac                 | 33 -----------
 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 --------
 133 files changed, 383 insertions(+), 1033 deletions(-)

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 2ff1ae1..17de99e 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 9caa268..ff01384 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 81b34a6..6869d20 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 ef94c11..a73112f 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 cc60904..ea5061b 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 56%
rename from c/src/lib/libcpu/i386/cache.c
rename to bsps/i386/shared/cache/cache.c
index da31a38..df79094 100644
--- a/c/src/lib/libcpu/i386/cache.c
+++ b/bsps/i386/shared/cache/cache.c
@@ -3,10 +3,13 @@
  */
 
 #include <rtems.h>
-#include "cache_.h"
 #include <rtems/score/cpu.h>
 #include <libcpu/page.h>
 
+#define I386_CACHE_ALIGNMENT 16
+#define CPU_DATA_CACHE_ALIGNMENT I386_CACHE_ALIGNMENT
+#define CPU_INSTRUCTION_CACHE_ALIGNEMNT I386_CACHE_ALIGNMENT
+
 void _CPU_disable_cache(void)
 {
   unsigned int regCr0;
@@ -44,45 +47,47 @@ 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/start/cache.c
similarity index 95%
rename from c/src/lib/libbsp/m68k/genmcf548x/include/cache_.h
rename to bsps/m68k/genmcf548x/start/cache.c
index 7d597c8..18aa929 100644
--- a/c/src/lib/libbsp/m68k/genmcf548x/include/cache_.h
+++ b/bsps/m68k/genmcf548x/start/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/bsps/m68k/shared/cache/cache-mcf5223x.c b/bsps/m68k/shared/cache/cache-mcf5223x.c
new file mode 100644
index 0000000..60b2f7f
--- /dev/null
+++ b/bsps/m68k/shared/cache/cache-mcf5223x.c
@@ -0,0 +1,38 @@
+/*
+ *  COPYRIGHT (c) 1989-2008.
+ *  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.
+ */
+
+#include <rtems.h>
+#include <mcf5223x/mcf5223x.h>
+#include "cache.h"
+
+/*
+ * Cannot be frozen
+ */
+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
+ */
+static void _CPU_cache_flush_1_data_line(const void *d_addr) {}
+static void _CPU_cache_flush_entire_data(void) {}
+
+static void _CPU_cache_enable_instruction(void) {}
+static void _CPU_cache_disable_instruction(void) {}
+static void _CPU_cache_invalidate_entire_instruction(void) {}
+static void _CPU_cache_invalidate_1_instruction_line(const void *addr) {}
+
+static void _CPU_cache_enable_data(void) {}
+static void _CPU_cache_disable_data(void) {}
+static void _CPU_cache_invalidate_entire_data(void) {}
+static void _CPU_cache_invalidate_1_data_line(const void *addr) {}
+
+#include "../../../shared/cache/cacheimpl.h"
diff --git a/bsps/m68k/shared/cache/cache-mcf5225x.c b/bsps/m68k/shared/cache/cache-mcf5225x.c
new file mode 100644
index 0000000..10c867b
--- /dev/null
+++ b/bsps/m68k/shared/cache/cache-mcf5225x.c
@@ -0,0 +1,34 @@
+/**
+ *  @file
+ *
+ *  Cache Management Support Routines for the MCF5225x
+ */
+
+#include <rtems.h>
+#include "cache.h"
+
+/*
+ * Cannot be frozen
+ */
+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
+ */
+static void _CPU_cache_flush_1_data_line(const void *d_addr) {}
+static void _CPU_cache_flush_entire_data(void) {}
+
+static void _CPU_cache_enable_instruction(void) {}
+static void _CPU_cache_disable_instruction(void) {}
+static void _CPU_cache_invalidate_entire_instruction(void) {}
+static void _CPU_cache_invalidate_1_instruction_line(const void *addr) {}
+
+static void _CPU_cache_enable_data(void) {}
+static void _CPU_cache_disable_data(void) {}
+static void _CPU_cache_invalidate_entire_data(void) {}
+static void _CPU_cache_invalidate_1_data_line(const void *addr) {}
+
+#include "../../../shared/cache/cacheimpl.h"
diff --git a/c/src/lib/libcpu/m68k/mcf5235/cache/cachepd.c b/bsps/m68k/shared/cache/cache-mcf5235.c
similarity index 67%
rename from c/src/lib/libcpu/m68k/mcf5235/cache/cachepd.c
rename to bsps/m68k/shared/cache/cache-mcf5235.c
index 043908c..35390b0 100644
--- a/c/src/lib/libcpu/m68k/mcf5235/cache/cachepd.c
+++ b/bsps/m68k/shared/cache/cache-mcf5235.c
@@ -9,7 +9,7 @@
 
 #include <rtems.h>
 #include <mcf5235/mcf5235.h>
-#include "cache_.h"
+#include "cache.h"
 
 /*
  *  Default value for the cacr is set by the BSP
@@ -19,18 +19,18 @@ extern uint32_t cacr_mode;
 /*
  * 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;
 
@@ -40,7 +40,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;
 
@@ -50,12 +50,12 @@ 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);
 }
 
-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
@@ -64,7 +64,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;
 
@@ -74,7 +74,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;
 
@@ -84,12 +84,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
@@ -97,3 +97,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/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 e59f213..2595724 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 75%
rename from c/src/lib/libcpu/m68k/mcf532x/cache/cachepd.c
rename to bsps/m68k/shared/cache/cache-mcf532x.c
index 5a93ea9..0203afe 100644
--- a/c/src/lib/libcpu/m68k/mcf532x/cache/cachepd.c
+++ b/bsps/m68k/shared/cache/cache-mcf532x.c
@@ -6,7 +6,7 @@
 
 #include <rtems.h>
 #include <mcf532x/mcf532x.h>
-#include "cache_.h"
+#include "cache.h"
 
 #define m68k_set_cacr(_cacr) \
   __asm__ volatile ("movec %0,%%cacr" : : "d" (_cacr))
@@ -23,23 +23,23 @@ static uint32_t cacr_mode = MCF_CACR_ESB |
 /*
  * Cannot be frozen
  */
-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_freeze_instruction(void)
+static void _CPU_cache_freeze_instruction(void)
 {
 }
 
-void _CPU_cache_unfreeze_instruction(void)
+static void _CPU_cache_unfreeze_instruction(void)
 {
 }
 
-void _CPU_cache_flush_1_data_line(const void *d_addr)
+static void _CPU_cache_flush_1_data_line(const void *d_addr)
 {
   register unsigned long adr = (((unsigned long) d_addr >> 4) & 0xff) << 4;
 
@@ -52,7 +52,7 @@ void _CPU_cache_flush_1_data_line(const void *d_addr)
   __asm__ volatile ("cpushl %%bc,(%0)" :: "a" (adr));
 }
 
-void _CPU_cache_flush_entire_data(void)
+static void _CPU_cache_flush_entire_data(void)
 {
   register unsigned long set, adr;
 
@@ -68,7 +68,7 @@ void _CPU_cache_flush_entire_data(void)
   }
 }
 
-void _CPU_cache_enable_instruction(void)
+static void _CPU_cache_enable_instruction(void)
 {
   rtems_interrupt_level level;
 
@@ -81,7 +81,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;
 
@@ -94,12 +94,12 @@ 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 | MCF_CACR_CINVA);
 }
 
-void _CPU_cache_invalidate_1_instruction_line(const void *addr)
+static void _CPU_cache_invalidate_1_instruction_line(const void *addr)
 {
   register unsigned long adr = (((unsigned long) addr >> 4) & 0xff) << 4;
 
@@ -112,7 +112,7 @@ void _CPU_cache_invalidate_1_instruction_line(const void *addr)
   __asm__ volatile ("cpushl %%bc,(%0)" :: "a" (adr));
 }
 
-void _CPU_cache_enable_data(void)
+static void _CPU_cache_enable_data(void)
 {
   /*
    * The 532x has a unified data and instruction cache, so we call through
@@ -121,7 +121,7 @@ void _CPU_cache_enable_data(void)
   _CPU_cache_enable_instruction();
 }
 
-void _CPU_cache_disable_data(void)
+static void _CPU_cache_disable_data(void)
 {
   /*
    * The 532x has a unified data and instruction cache, so we call through
@@ -130,12 +130,14 @@ void _CPU_cache_disable_data(void)
   _CPU_cache_disable_instruction();
 }
 
-void _CPU_cache_invalidate_entire_data(void)
+static void _CPU_cache_invalidate_entire_data(void)
 {
   _CPU_cache_invalidate_entire_instruction();
 }
 
-void _CPU_cache_invalidate_1_data_line(const void *addr)
+static void _CPU_cache_invalidate_1_data_line(const void *addr)
 {
   _CPU_cache_invalidate_1_instruction_line(addr);
 }
+
+#include "../../../shared/cache/cacheimpl.h"
diff --git a/bsps/m68k/shared/cache/cache.c b/bsps/m68k/shared/cache/cache.c
new file mode 100644
index 0000000..3b5e87e
--- /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 5039ea5..2fa78b6 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/headers.am b/bsps/or1k/headers.am
index 7729a76..670c0c4 100644
--- a/bsps/or1k/headers.am
+++ b/bsps/or1k/headers.am
@@ -2,5 +2,4 @@
 
 include_bspdir = $(includedir)/bsp
 include_bsp_HEADERS =
-include_bsp_HEADERS += ../../../../../bsps/or1k/include/bsp/cache_.h
 include_bsp_HEADERS += ../../../../../bsps/or1k/include/bsp/linker-symbols.h
diff --git a/bsps/or1k/include/bsp/cache_.h b/bsps/or1k/include/bsp/cache_.h
deleted file mode 100644
index ed20538..0000000
--- 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 898955f..55fa54e 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 1775894..902893b 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 3201c31..7e9f863 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 0000000..55aea24
--- /dev/null
+++ b/bsps/shared/cache/nocache.c
@@ -0,0 +1 @@
+#include "cacheimpl.h"
diff --git a/c/src/lib/libcpu/sparc/cache/cache_.h b/bsps/sparc/leon2/start/cache.c
similarity index 82%
rename from c/src/lib/libcpu/sparc/cache/cache_.h
rename to bsps/sparc/leon2/start/cache.c
index 3d4ea69..5597bd8 100644
--- a/c/src/lib/libcpu/sparc/cache/cache_.h
+++ b/bsps/sparc/leon2/start/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,8 +11,7 @@
  * FIXME: Some functions simply have not been implemented.
  */
 
-/* This define is set in a Makefile */
-#if defined(HAS_INSTRUCTION_CACHE)
+#include <stddef.h>
 
 #define CPU_INSTRUCTION_CACHE_ALIGNMENT 0
 
@@ -52,7 +48,4 @@ static inline void _CPU_cache_disable_instruction (   void )
 {
 }
 
-#endif /* defined(HAS_INSTRUCTION_CACHE) */
-
-#endif
-/* end of include file */
+#include "../../../shared/cache/cacheimpl.h"
diff --git a/c/src/lib/libbsp/sparc/leon3/include/cache_.h b/bsps/sparc/leon3/start/cache.c
similarity index 95%
rename from c/src/lib/libbsp/sparc/leon3/include/cache_.h
rename to bsps/sparc/leon3/start/cache.c
index ced5b6d..fb210a1 100644
--- a/c/src/lib/libbsp/sparc/leon3/include/cache_.h
+++ b/bsps/sparc/leon3/start/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 "../../../shared/cache/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 cad2171..fb63f94 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 a41931f..10f34da 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 ae46cb3..8251660 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 9ec2149..8bc5a44 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 1870f9f..69780d1 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 bbf555a..9ccca0b 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 3287928..62cbdcc 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 842c5c0..cff8663 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 bc2f6ac..73c87f7 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 3e5e0e1..e5ba764 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 634df1a..4ac673a 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 d64806b..5e6f8f0 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 08ff91e..7a6e8a8 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 1fbe343..32b05b7 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 2136515..ee45817 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 33db14c..b9e52c1 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 45a280c..a0922bd 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 98abdc3..9f7533b 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 1ad6344..b85e402 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 94f4e0f..93952e4 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 32cb3c0..aff2e31 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 ffe4ff8..ddd3207 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 9acbd1b..57e698a 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 3401b9a..30cb348 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 157d7a6..0acce55 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 7f0cf77..1d9b605 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 79f6aa8..25aee60 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 a10f56c..4496cf6 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 d9842e1..c41571a 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 ce4afb1..f445882 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 bbb1f63..69467e1 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 1701c1b..daf6719 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 fba0636..111e6d2 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/start/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 7e0c389..2e0dbb7 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 5c51afe..95eb6e5 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 b33adc2..8688f23 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 adb474f..f673c1a 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 b844e94..a26f549 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 0cd22f2..7afb990 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 6b1ec39..13b39c4 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 c4d5f5f..a0af237 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 c5e3b92..2c0031f 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 84a2270..8c8288c 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 870ff61..e382fe4 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 aa58666..69c709c 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 a634a84..a65d298 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 5d599cf..e67e588 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 38b902c..5349907 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 3ea41e4..74c8303 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 3a8443a..7d29c80 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 60d4678..9eabcb1 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 b3f6675..bb01836 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 d5a4b74..da5c78a 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 c51965b..dcb82d9 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 a727020..4a6b536 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 e5d6811..10f36ab 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 0227286..dcb66d0 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 bbc0a8e..1cf3671 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 6cf6acc..75a6317 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 1f9d2f1..5fc7755 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 a9c1cea..a684c75 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 4d7e0d4..72a3f71 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 61f7814..5206c63 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 6d887f2..f1f4698 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 6760cec..0476f5d 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 afa059e..05de822 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 bb7b787..4a54cbd 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 9173d6b..26946fa 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 0c0e108..15b5dcc 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 c5a2a32..4279e07 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 ffc9c7e..60ca33d 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 030cb47..744c963 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 f2e2993..f4e139e 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 131ee3f..4a9501e 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 42539aa..9fb0f6e 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 9cd43ba..3fe05b9 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 710cecc..0000000
--- 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 cb7ee0a..52017ba 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 f7f2fd6..f2d7e56 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 += ../../../../../../bsps/sparc/leon2/start/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/libbsp/sparc/leon3/Makefile.am b/c/src/lib/libbsp/sparc/leon3/Makefile.am
index 2f8480a..614a5d5 100644
--- a/c/src/lib/libbsp/sparc/leon3/Makefile.am
+++ b/c/src/lib/libbsp/sparc/leon3/Makefile.am
@@ -155,15 +155,12 @@ 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 += ../../../../../../bsps/sparc/leon3/start/cache.c
 # griommu
 libbsp_a_SOURCES += ../../sparc/shared/iommu/griommu.c
 # timer
 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
 
 # GR712
 libbsp_a_SOURCES += ../../sparc/shared/ascs/grascs.c
diff --git a/c/src/lib/libbsp/sparc64/niagara/Makefile.am b/c/src/lib/libbsp/sparc64/niagara/Makefile.am
index 717dfdc..8ae6d0c 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 cf2828a..aedeac3 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 2f06d2c..ec423e7 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/Makefile.am b/c/src/lib/libcpu/Makefile.am
index 9cc2ece..693f50b 100644
--- a/c/src/lib/libcpu/Makefile.am
+++ b/c/src/lib/libcpu/Makefile.am
@@ -1,6 +1,4 @@
 EXTRA_DIST =
-EXTRA_DIST += shared/include/cache.h
-EXTRA_DIST += shared/src/cache_manager.c
 
 _SUBDIRS = @libcpu_cpu_subdir@
 DIST_SUBDIRS = @libcpu_cpu_subdir@
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 9db399e..0000000
--- 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 9b7ee0c..8d48448 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 f739976..0000000
--- 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 6f1e9fe..ec7a4c4 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 cefd39f..0000000
--- 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/Makefile.am b/c/src/lib/libcpu/lm32/Makefile.am
index 1e609ca..7c1ce06 100644
--- a/c/src/lib/libcpu/lm32/Makefile.am
+++ b/c/src/lib/libcpu/lm32/Makefile.am
@@ -7,13 +7,6 @@ DISTCLEANFILES =
 noinst_PROGRAMS =
 
 if shared
-
-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/lm32/shared/cache/cache_.h b/c/src/lib/libcpu/lm32/shared/cache/cache_.h
deleted file mode 100644
index 2a303b7..0000000
--- 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 2800e42..ed07940 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/mcf5223x/cache/cachepd.c b/c/src/lib/libcpu/m68k/mcf5223x/cache/cachepd.c
deleted file mode 100644
index c18cf94..0000000
--- a/c/src/lib/libcpu/m68k/mcf5223x/cache/cachepd.c
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
- *  COPYRIGHT (c) 1989-2008.
- *  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.
- */
-
-#include <rtems.h>
-#include <mcf5223x/mcf5223x.h>
-#include "cache_.h"
-
-/*
- * 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) {}
-
-/*
- * 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) {}
-
-void _CPU_cache_enable_instruction(void) {}
-void _CPU_cache_disable_instruction(void) {}
-void _CPU_cache_invalidate_entire_instruction(void) {}
-void _CPU_cache_invalidate_1_instruction_line(const void *addr) {}
-
-void _CPU_cache_enable_data(void) {}
-void _CPU_cache_disable_data(void) {}
-void _CPU_cache_invalidate_entire_data(void) {}
-void _CPU_cache_invalidate_1_data_line(const void *addr) {}
diff --git a/c/src/lib/libcpu/m68k/mcf5225x/cache/cachepd.c b/c/src/lib/libcpu/m68k/mcf5225x/cache/cachepd.c
deleted file mode 100644
index 031f02b..0000000
--- a/c/src/lib/libcpu/m68k/mcf5225x/cache/cachepd.c
+++ /dev/null
@@ -1,32 +0,0 @@
-/**
- *  @file
- *
- *  Cache Management Support Routines for the MCF5225x
- */
-
-#include <rtems.h>
-#include "cache_.h"
-
-/*
- * 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) {}
-
-/*
- * 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) {}
-
-void _CPU_cache_enable_instruction(void) {}
-void _CPU_cache_disable_instruction(void) {}
-void _CPU_cache_invalidate_entire_instruction(void) {}
-void _CPU_cache_invalidate_1_instruction_line(const void *addr) {}
-
-void _CPU_cache_enable_data(void) {}
-void _CPU_cache_disable_data(void) {}
-void _CPU_cache_invalidate_entire_data(void) {}
-void _CPU_cache_invalidate_1_data_line(const void *addr) {}
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 af4bef6..0000000
--- 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/Makefile.am b/c/src/lib/libcpu/mips/Makefile.am
index 84dc521..8ae999d 100644
--- a/c/src/lib/libcpu/mips/Makefile.am
+++ b/c/src/lib/libcpu/mips/Makefile.am
@@ -6,13 +6,6 @@ EXTRA_DIST =
 
 noinst_PROGRAMS =
 
-## cache
-noinst_PROGRAMS += shared/cache.rel
-shared_cache_rel_SOURCES = shared/cache/cache.c \
-    ../shared/src/cache_manager.c shared/cache/cache_.h
-shared_cache_rel_CPPFLAGS = $(AM_CPPFLAGS) -I$(srcdir)/shared/cache
-shared_cache_rel_LDFLAGS = $(RTEMS_RELLDFLAGS)
-
 ## interrupts
 
 if rm52xx
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 384e7c8..0000000
--- 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 a81c5a0..0000000
--- 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 7641afb..d5bfc57 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 1a83b8e..0000000
--- 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/Makefile.am b/c/src/lib/libcpu/or1k/Makefile.am
deleted file mode 100644
index e34d580..0000000
--- a/c/src/lib/libcpu/or1k/Makefile.am
+++ /dev/null
@@ -1,16 +0,0 @@
-ACLOCAL_AMFLAGS = -I ../../../aclocal
-
-include $(top_srcdir)/../../../automake/compile.am
-
-CLEANFILES =
-DISTCLEANFILES =
-noinst_PROGRAMS =
-
-## shared/cache
-noinst_PROGRAMS += shared/cache.rel
-shared_cache_rel_SOURCES = shared/cache/cache.c ../shared/src/cache_manager.c
-shared_cache_rel_CPPFLAGS = $(AM_CPPFLAGS) -I$(srcdir)/shared/cache
-shared_cache_rel_LDFLAGS = $(RTEMS_RELLDFLAGS)
-
-
-include $(top_srcdir)/../../../automake/local.am
diff --git a/c/src/lib/libcpu/or1k/configure.ac b/c/src/lib/libcpu/or1k/configure.ac
deleted file mode 100644
index 80c67b6..0000000
--- a/c/src/lib/libcpu/or1k/configure.ac
+++ /dev/null
@@ -1,33 +0,0 @@
-## Process this file with autoconf to produce a configure script.
-
-AC_PREREQ([2.69])
-AC_INIT([rtems-c-src-lib-libcpu-or1k],[_RTEMS_VERSION],[https://devel.rtems.org/newticket])
-RTEMS_TOP([../../../../..],[../../..])
-RTEMS_SOURCE_TOP
-RTEMS_BUILD_TOP
-
-RTEMS_CANONICAL_TARGET_CPU
-
-AM_INIT_AUTOMAKE([no-define foreign subdir-objects 1.12.2])
-AM_MAINTAINER_MODE
-
-RTEMS_ENV_RTEMSBSP
-
-RTEMS_PROJECT_ROOT
-
-RTEMS_PROG_CC_FOR_TARGET
-AM_PROG_CC_C_O
-RTEMS_CANONICALIZE_TOOLS
-RTEMS_PROG_CCAS
-
-# At this time all models should use the shared directory so do this
-AM_CONDITIONAL(shared, true)
-
-AC_PATH_PROG([AMPOLISH3],[ampolish3],[])
-
-RTEMS_AMPOLISH3
-
-# Explicitly list all Makefiles here
-AC_CONFIG_FILES([Makefile
-])
-AC_OUTPUT
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 ea37958..0000000
--- 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 514c93d..6cf7713 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 9220a20..0000000
--- 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 3f869fc..0000000
--- 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 4d957da..95e473d 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 98b2ce8..7107f97 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 81d07d4..d5883f5 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 63b6bb1..0000000
--- 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 fc3600f..0000000
--- 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 */




More information about the vc mailing list