[rtems commit] bsps/sparc: Use inline functions for cache manager

Sebastian Huber sebh at rtems.org
Mon Apr 27 08:32:55 UTC 2015


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

Author:    Sebastian Huber <sebastian.huber at embedded-brains.de>
Date:      Mon Apr 27 10:11:47 2015 +0200

bsps/sparc: Use inline functions for cache manager

---

 c/src/lib/libcpu/sparc/Makefile.am    |  2 +-
 c/src/lib/libcpu/sparc/cache/cache.c  | 42 -----------------------------------
 c/src/lib/libcpu/sparc/cache/cache_.h | 34 +++++++++++++++++++++++++---
 3 files changed, 32 insertions(+), 46 deletions(-)

diff --git a/c/src/lib/libcpu/sparc/Makefile.am b/c/src/lib/libcpu/sparc/Makefile.am
index ceed3bc..c7565d8 100644
--- a/c/src/lib/libcpu/sparc/Makefile.am
+++ b/c/src/lib/libcpu/sparc/Makefile.am
@@ -10,7 +10,7 @@ include_libcpu_HEADERS += include/libcpu/byteorder.h
 include_libcpu_HEADERS += include/libcpu/access.h
 
 noinst_PROGRAMS += cache.rel
-cache_rel_SOURCES = cache/cache.c cache/cache_.h \
+cache_rel_SOURCES = cache/cache_.h \
     ../shared/src/cache_manager.c
 cache_rel_CPPFLAGS = $(AM_CPPFLAGS) -I$(srcdir)/cache
 cache_rel_LDFLAGS = $(RTEMS_RELLDFLAGS)
diff --git a/c/src/lib/libcpu/sparc/cache/cache.c b/c/src/lib/libcpu/sparc/cache/cache.c
deleted file mode 100644
index e87f7c0..0000000
--- a/c/src/lib/libcpu/sparc/cache/cache.c
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- *  Cache Management Support Routines for the SPARC
- */
-
-#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_invalidate_instruction_range(
-  const void *i_addr,
-  size_t n_bytes
-)
-{
-}
-
-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/sparc/cache/cache_.h b/c/src/lib/libcpu/sparc/cache/cache_.h
index 81852a2..f7ff00c 100644
--- a/c/src/lib/libcpu/sparc/cache/cache_.h
+++ b/c/src/lib/libcpu/sparc/cache/cache_.h
@@ -14,12 +14,40 @@
  * FIXME: Some functions simply have not been implemented.
  */
 
+/* This define is set in a Makefile */
 #if defined(HAS_INSTRUCTION_CACHE)
-#define CPU_CACHE_SUPPORT_PROVIDES_RANGE_FUNCTIONS
+
 #define CPU_INSTRUCTION_CACHE_ALIGNMENT 0
-#endif
 
-#include <libcpu/cache.h>
+static inline void _CPU_cache_invalidate_entire_instruction ( void )
+{
+  __asm__ volatile ("flush");
+}
+
+/* XXX these need to be addressed */
+
+static inline void _CPU_cache_invalidate_1_instruction_line (
+  const void * i_addr )
+{
+}
+
+static inline void _CPU_cache_freeze_instruction ( void )
+{
+}
+
+static inline void _CPU_cache_unfreeze_instruction ( void )
+{
+}
+
+static inline void _CPU_cache_enable_instruction ( void )
+{
+}
+
+static inline void _CPU_cache_disable_instruction (   void )
+{
+}
+
+#endif /* defined(HAS_INSTRUCTION_CACHE) */
 
 #endif
 /* end of include file */



More information about the vc mailing list