Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src Implement __clear_cache using __syncicache on PPC



details:   https://anonhg.NetBSD.org/src/rev/d8eeba0b1d91
branches:  trunk
changeset: 824739:d8eeba0b1d91
user:      joerg <joerg%NetBSD.org@localhost>
date:      Fri Jun 16 21:22:14 2017 +0000

description:
Implement __clear_cache using __syncicache on PPC

diffstat:

 lib/libc/compiler_rt/Makefile.inc                            |  7 ++++++-
 sys/external/bsd/compiler_rt/dist/lib/builtins/clear_cache.c |  6 ++++++
 2 files changed, 12 insertions(+), 1 deletions(-)

diffs (44 lines):

diff -r eed0a8fabc4b -r d8eeba0b1d91 lib/libc/compiler_rt/Makefile.inc
--- a/lib/libc/compiler_rt/Makefile.inc Fri Jun 16 18:48:22 2017 +0000
+++ b/lib/libc/compiler_rt/Makefile.inc Fri Jun 16 21:22:14 2017 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile.inc,v 1.33 2017/05/26 22:56:50 joerg Exp $
+# $NetBSD: Makefile.inc,v 1.34 2017/06/16 21:22:14 joerg Exp $
 
 COMPILER_RT_SRCDIR=    ${NETBSDSRCDIR}/sys/external/bsd/compiler_rt/dist
 
@@ -242,6 +242,11 @@
        clear_cache.c
 .endif
 
+.if ${LIBC_MACHINE_ARCH} == "powerpc" || ${LIBC_MACHINE_ARCH} == "powerpc64"
+GENERIC_SRCS+= \
+       clear_cache.c
+.endif
+
 .if ${LIBC_MACHINE_ARCH} == "sparc" || ${LIBC_MACHINE_ARCH} == "sparc64"
 GENERIC_SRCS+= \
        clear_cache.c
diff -r eed0a8fabc4b -r d8eeba0b1d91 sys/external/bsd/compiler_rt/dist/lib/builtins/clear_cache.c
--- a/sys/external/bsd/compiler_rt/dist/lib/builtins/clear_cache.c      Fri Jun 16 18:48:22 2017 +0000
+++ b/sys/external/bsd/compiler_rt/dist/lib/builtins/clear_cache.c      Fri Jun 16 21:22:14 2017 +0000
@@ -23,6 +23,10 @@
   #include <machine/sysarch.h>
 #endif
 
+#if defined(__NetBSD__) && defined(__ppc__)
+  #include <machine/cpu.h>
+#endif
+
 #if defined(__mips__)
   #include <sys/cachectl.h>
   #include <sys/syscall.h>
@@ -154,6 +158,8 @@
   for (; xstart < xend; xstart += 4) {
     __asm __volatile("flush %0" :: "r" (xstart));
   }
+#elif defined(__NetBSD__) && defined(__ppc__)
+  __syncicache(start, (uintptr_t)end - (uintptr_t)start);
 #else
     #if __APPLE__
         /* On Darwin, sys_icache_invalidate() provides this functionality */



Home | Main Index | Thread Index | Old Index