[PATCH 26/62] Move CPU cache support from mcf5225x BSP to libcpu
Joel Sherrill
joel.sherrill at oarcorp.com
Wed Oct 15 20:00:16 UTC 2014
---
c/src/lib/libbsp/m68k/mcf5225x/Makefile.am | 1 +
c/src/lib/libbsp/m68k/mcf5225x/startup/bspstart.c | 24 ----------------
c/src/lib/libcpu/m68k/Makefile.am | 20 +++++++++----
c/src/lib/libcpu/m68k/mcf5225x/cache/cachepd.c | 34 +++++++++++++++++++++++
4 files changed, 49 insertions(+), 30 deletions(-)
create mode 100644 c/src/lib/libcpu/m68k/mcf5225x/cache/cachepd.c
diff --git a/c/src/lib/libbsp/m68k/mcf5225x/Makefile.am b/c/src/lib/libbsp/m68k/mcf5225x/Makefile.am
index 1758c1a..0c2fd55 100644
--- a/c/src/lib/libbsp/m68k/mcf5225x/Makefile.am
+++ b/c/src/lib/libbsp/m68k/mcf5225x/Makefile.am
@@ -42,6 +42,7 @@ libbsp_a_SOURCES += timer/timer.c
libbsp_a_LIBADD = \
../../../libcpu/@RTEMS_CPU@/shared/cache.rel \
+ ../../../libcpu/@RTEMS_CPU@/mcf5225x/cachepd.rel \
../../../libcpu/@RTEMS_CPU@/shared/misc.rel
include $(srcdir)/preinstall.am
diff --git a/c/src/lib/libbsp/m68k/mcf5225x/startup/bspstart.c b/c/src/lib/libbsp/m68k/mcf5225x/startup/bspstart.c
index af47202..d5e0f37 100644
--- a/c/src/lib/libbsp/m68k/mcf5225x/startup/bspstart.c
+++ b/c/src/lib/libbsp/m68k/mcf5225x/startup/bspstart.c
@@ -18,30 +18,6 @@
#include <bsp.h>
#include <bsp/bootcard.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) {}
-
void __attribute__((weak)) bsp_start(void)
{
}
diff --git a/c/src/lib/libcpu/m68k/Makefile.am b/c/src/lib/libcpu/m68k/Makefile.am
index c61fa49..2c46834 100644
--- a/c/src/lib/libcpu/m68k/Makefile.am
+++ b/c/src/lib/libcpu/m68k/Makefile.am
@@ -11,9 +11,10 @@ include_libcpudir = $(includedir)/libcpu
include_libcpu_HEADERS = ../shared/include/cache.h
noinst_PROGRAMS += shared/cache.rel
-shared_cache_rel_SOURCES = shared/cache/cache.c shared/cache/cache_.h \
- ../shared/src/cache_aligned_malloc.c \
- ../shared/src/cache_manager.c
+shared_cache_rel_SOURCES = shared/cache/cache.c
+shared_cache_rel_SOURCES += shared/cache/cache_.h
+shared_cache_rel_SOURCES += ../shared/src/cache_aligned_malloc.c
+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)
@@ -108,7 +109,7 @@ include_mcf5223x_HEADERS = mcf5223x/include/mcf5223x.h
## mcf5223x/cache
noinst_PROGRAMS += mcf5223x/cachepd.rel
mcf5223x_cachepd_rel_SOURCES = mcf5223x/cache/cachepd.c
-mcf5223x_cachepd_rel_CPPFLAGS = $(AM_CPPFLAGS)
+mcf5223x_cachepd_rel_CPPFLAGS = $(AM_CPPFLAGS) -I$(srcdir)/shared/cache
mcf5223x_cachepd_rel_LDFLAGS = $(RTEMS_RELLDFLAGS)
endif
@@ -116,6 +117,13 @@ if mcf5225x
## mcf5225x/include
include_mcf5225xdir = $(includedir)/mcf5225x
include_mcf5225x_HEADERS = mcf5225x/include/mcf5225x.h
+
+# 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
include_mcf5225x_HEADERS += mcf5225x/include/fec.h
@@ -130,7 +138,7 @@ include_mcf5235_HEADERS = mcf5235/include/mcf5235.h
## mcf5235/cache
noinst_PROGRAMS += mcf5235/cachepd.rel
mcf5235_cachepd_rel_SOURCES = mcf5235/cache/cachepd.c
-mcf5235_cachepd_rel_CPPFLAGS = $(AM_CPPFLAGS)
+mcf5235_cachepd_rel_CPPFLAGS = $(AM_CPPFLAGS) -I$(srcdir)/shared/cache
mcf5235_cachepd_rel_LDFLAGS = $(RTEMS_RELLDFLAGS)
endif
@@ -142,7 +150,7 @@ include_mcf532x_HEADERS = mcf532x/include/mcf532x.h
## mcf532x/cache
noinst_PROGRAMS += mcf532x/cachepd.rel
mcf532x_cachepd_rel_SOURCES = mcf532x/cache/cachepd.c
-mcf532x_cachepd_rel_CPPFLAGS = $(AM_CPPFLAGS)
+mcf532x_cachepd_rel_CPPFLAGS = $(AM_CPPFLAGS) -I$(srcdir)/shared/cache
mcf532x_cachepd_rel_LDFLAGS = $(RTEMS_RELLDFLAGS)
endif
diff --git a/c/src/lib/libcpu/m68k/mcf5225x/cache/cachepd.c b/c/src/lib/libcpu/m68k/mcf5225x/cache/cachepd.c
new file mode 100644
index 0000000..69c6b64
--- /dev/null
+++ b/c/src/lib/libcpu/m68k/mcf5225x/cache/cachepd.c
@@ -0,0 +1,34 @@
+/**
+ * @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) {}
+
+
--
1.9.3
More information about the devel
mailing list