2000-11-14 Jiri Gaisler <jgais@ws.estec.esa.nl>

* Makefile.am, configure.in: Added support for instruction
	cache enabling based on CPU model.
	* cache/.cvsignore, cache/Makefile.am, cache/cache.c,
	cache/cache_.h: New files.
This commit is contained in:
Joel Sherrill
2000-11-15 21:40:05 +00:00
parent cb887486ef
commit ca4060826d
7 changed files with 100 additions and 1 deletions

View File

@@ -1,3 +1,10 @@
2000-11-14 Jiri Gaisler <jgais@ws.estec.esa.nl>
* Makefile.am, configure.in: Added support for instruction
cache enabling based on CPU model.
* cache/.cvsignore, cache/Makefile.am, cache/cache.c,
cache/cache_.h: New files.
2000-11-09 Ralf Corsepius <corsepiu@faw.uni-ulm.de>
* Makefile.am: Use ... instead of RTEMS_TOPdir in ACLOCAL_AMFLAGS.

View File

@@ -5,7 +5,7 @@
AUTOMAKE_OPTIONS = foreign 1.4
ACLOCAL_AMFLAGS = -I ../../../../../aclocal
SUBDIRS = include reg_win syscall
SUBDIRS = include cache reg_win syscall
include $(top_srcdir)/../../../../../automake/subdirs.am
include $(top_srcdir)/../../../../../automake/local.am

View File

@@ -0,0 +1,2 @@
Makefile
Makefile.in

View File

@@ -0,0 +1,43 @@
##
## $Id$
##
AUTOMAKE_OPTIONS = foreign 1.4
VPATH = @srcdir@:@srcdir@/../../shared/src
C_FILES = cache.c cache_aligned_malloc.c cache_manager.c
C_O_FILES = $(C_FILES:%.c=$(ARCH)/%.o)
H_FILES = cache_.h
INSTALLED_H_FILES =
OBJS = $(C_O_FILES)
include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg
include $(top_srcdir)/../../../../../automake/compile.am
include $(top_srcdir)/../../../../../automake/lib.am
if has_instruction_cache
AM_CPPFLAGS += -I$(srcdir) -DHAS_INSTRUCTION_CACHE
else
AM_CPPFLAGS += -I$(srcdir)
endif
$(PROJECT_INCLUDE)/libcpu:
$(mkinstalldirs) $@
$(PROJECT_INCLUDE)/libcpu/%.h: %.h
$(INSTALL_DATA) $< $@
$(PROJECT_INCLUDE)/libcpu/cache.h: $(top_srcdir)/../shared/include/cache.h
$(INSTALL_DATA) $< $@
PREINSTALL_FILES += $(PROJECT_INCLUDE)/libcpu \
$(PROJECT_INCLUDE)/libcpu/cache.h
all-local: $(ARCH) $(PREINSTALL_FILES) $(OBJS)
EXTRA_DIST = cache.c cache_.h
include $(top_srcdir)/../../../../../automake/local.am

19
c/src/lib/libcpu/sparc/cache/cache.c vendored Normal file
View File

@@ -0,0 +1,19 @@
/*
* Cache Management Support Routines for the MC68040
*
* $Id$
*/
#include <rtems.h>
#include "cache_.h"
#if defined(HAS_INSTRUCTION_CACHE)
void _CPU_cache_invalidate_entire_instruction ( void )
{
asm volatile ("flush");
}
#endif
/* end of file */

24
c/src/lib/libcpu/sparc/cache/cache_.h vendored Normal file
View File

@@ -0,0 +1,24 @@
/*
* 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
* 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 <libcpu/cache.h>
#endif
/* end of include file */

View File

@@ -26,9 +26,13 @@ RTEMS_CANONICALIZE_TOOLS
RTEMS_CHECK_CUSTOM_BSP(RTEMS_BSP)
RTEMS_CHECK_BSP_CACHE(RTEMS_BSP)
AM_CONDITIONAL(has_instruction_cache, test "$RTEMS_CPU_MODEL" = "leon1" \
|| test "$RTEMS_CPU_MODEL" = "leon2" )
# Explicitly list all Makefiles here
AC_OUTPUT(
Makefile
cache/Makefile
include/Makefile
reg_win/Makefile
syscall/Makefile)