Index: c/src/lib/libcpu/lm32/ChangeLog
===================================================================
--- c/src/lib/libcpu/lm32/ChangeLog	(revision 74c6f36dc854e225262d5df88c8e5ad63db33c2c)
+++ c/src/lib/libcpu/lm32/ChangeLog	(revision 74c6f36dc854e225262d5df88c8e5ad63db33c2c)
@@ -0,0 +1,5 @@
+2008-12-04	Jukka Pietarinen <jukka.pietarinen@mrf.fi>
+
+	* ChangeLog, Makefile.am, configure.ac, preinstall.am,
+	shared/cache/cache.c, shared/cache/cache_.h, shared/misc/memcpy.c: New files.
+
Index: c/src/lib/libcpu/lm32/Makefile.am
===================================================================
--- c/src/lib/libcpu/lm32/Makefile.am	(revision 74c6f36dc854e225262d5df88c8e5ad63db33c2c)
+++ c/src/lib/libcpu/lm32/Makefile.am	(revision 74c6f36dc854e225262d5df88c8e5ad63db33c2c)
@@ -0,0 +1,34 @@
+##
+## $Id$
+##
+
+ACLOCAL_AMFLAGS = -I ../../../aclocal
+
+include $(top_srcdir)/../../../automake/compile.am
+
+CLEANFILES =
+DISTCLEANFILES =
+noinst_PROGRAMS =
+
+if shared
+include_libcpudir = $(includedir)/libcpu
+
+## shared/cache
+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_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
+shared_misc_rel_CPPFLAGS = $(AM_CPPFLAGS) $(LM32_CPPFLAGS)
+shared_misc_rel_LDFLAGS = $(RTEMS_RELLDFLAGS)
+endif
+
+include $(srcdir)/preinstall.am
+
+include $(top_srcdir)/../../../automake/local.am
Index: c/src/lib/libcpu/lm32/configure.ac
===================================================================
--- c/src/lib/libcpu/lm32/configure.ac	(revision 74c6f36dc854e225262d5df88c8e5ad63db33c2c)
+++ c/src/lib/libcpu/lm32/configure.ac	(revision 74c6f36dc854e225262d5df88c8e5ad63db33c2c)
@@ -0,0 +1,35 @@
+## Process this file with autoconf to produce a configure script.
+## 
+## $Id$
+
+AC_PREREQ(2.60)
+AC_INIT([rtems-c-src-lib-libcpu-lm32],[_RTEMS_VERSION],[http://www.rtems.org/bugzilla])
+RTEMS_TOP([../../../../..],[../../..])
+
+RTEMS_CANONICAL_TARGET_CPU
+
+AM_INIT_AUTOMAKE([no-define foreign subdir-objects 1.10])
+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],[])
+AM_CONDITIONAL([AMPOLISH3],[test x"$USE_MAINTAINER_MODE" = x"yes" \
+  && test -n "$AMPOLISH3"])
+
+RTEMS_AMPOLISH3
+
+# Explicitly list all Makefiles here
+AC_CONFIG_FILES([Makefile
+])
+AC_OUTPUT
Index: c/src/lib/libcpu/lm32/preinstall.am
===================================================================
--- c/src/lib/libcpu/lm32/preinstall.am	(revision 74c6f36dc854e225262d5df88c8e5ad63db33c2c)
+++ c/src/lib/libcpu/lm32/preinstall.am	(revision 74c6f36dc854e225262d5df88c8e5ad63db33c2c)
@@ -0,0 +1,25 @@
+## Automatically generated by ampolish3 - Do not edit
+
+if AMPOLISH3
+$(srcdir)/preinstall.am: Makefile.am
+	$(AMPOLISH3) $(srcdir)/Makefile.am > $(srcdir)/preinstall.am
+endif
+
+PREINSTALL_DIRS =
+DISTCLEANFILES += $(PREINSTALL_DIRS)
+
+all-am: $(PREINSTALL_FILES)
+
+PREINSTALL_FILES =
+CLEANFILES += $(PREINSTALL_FILES)
+
+if shared
+$(PROJECT_INCLUDE)/libcpu/$(dirstamp):
+	@$(MKDIR_P) $(PROJECT_INCLUDE)/libcpu
+	@: > $(PROJECT_INCLUDE)/libcpu/$(dirstamp)
+PREINSTALL_DIRS += $(PROJECT_INCLUDE)/libcpu/$(dirstamp)
+
+$(PROJECT_INCLUDE)/libcpu/cache.h: ../shared/include/cache.h $(PROJECT_INCLUDE)/libcpu/$(dirstamp)
+	$(INSTALL_DATA) $< $(PROJECT_INCLUDE)/libcpu/cache.h
+PREINSTALL_FILES += $(PROJECT_INCLUDE)/libcpu/cache.h
+endif
Index: c/src/lib/libcpu/lm32/shared/cache/cache.c
===================================================================
--- c/src/lib/libcpu/lm32/shared/cache/cache.c	(revision 74c6f36dc854e225262d5df88c8e5ad63db33c2c)
+++ c/src/lib/libcpu/lm32/shared/cache/cache.c	(revision 74c6f36dc854e225262d5df88c8e5ad63db33c2c)
@@ -0,0 +1,67 @@
+/*
+ *  Cache Management Support Routines for the MC68040
+ *
+ *  $Id$
+ */
+
+#include <rtems.h>
+#include "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.
+ */
+
+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 * p_address = (void *) _CPU_virtual_to_physical( d_addr );
+}
+
+void _CPU_cache_invalidate_1_data_line (
+  const void * d_addr )
+{
+  void * p_address = (void *) _CPU_virtual_to_physical( 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 * p_address = (void *)  _CPU_virtual_to_physical( i_addr );
+}
+
+void _CPU_cache_invalidate_entire_instruction ( void )
+{
+}
+
+void _CPU_cache_enable_instruction ( void )
+{
+}
+
+void _CPU_cache_disable_instruction ( void )
+{
+}
+/* end of file */
Index: c/src/lib/libcpu/lm32/shared/cache/cache_.h
===================================================================
--- c/src/lib/libcpu/lm32/shared/cache/cache_.h	(revision 74c6f36dc854e225262d5df88c8e5ad63db33c2c)
+++ c/src/lib/libcpu/lm32/shared/cache/cache_.h	(revision 74c6f36dc854e225262d5df88c8e5ad63db33c2c)
@@ -0,0 +1,13 @@
+/*
+ *  LM32 Cache Manager Support
+ *
+ *  $Id$
+ */
+
+#ifndef __LM32_CACHE_h
+#define __LM32_CACHE_h
+
+#include <libcpu/cache.h>
+
+#endif
+/* end of include file */
Index: c/src/lib/libcpu/lm32/shared/misc/memcpy.c
===================================================================
--- c/src/lib/libcpu/lm32/shared/misc/memcpy.c	(revision 74c6f36dc854e225262d5df88c8e5ad63db33c2c)
+++ c/src/lib/libcpu/lm32/shared/misc/memcpy.c	(revision 74c6f36dc854e225262d5df88c8e5ad63db33c2c)
@@ -0,0 +1,23 @@
+/*
+ *  C library memcpy routine
+ *
+ *  This routine shall get code to optimize performance on NIOS II
+ *
+ *  The routine is placed in this source directory to ensure that it
+ *  is picked up by all applications.
+ *
+ *  $Id$
+ */
+
+#include <string.h>
+
+void *
+memcpy(void *s1, const void *s2, size_t n)
+{
+  char *p1 = s1;
+  const char *p2 = s2;
+  size_t left = n;
+
+  while(left > 0) *(p1++) = *(p2++);
+    return s1;
+}
