Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/sparc64/sparc64 sun4v: Implement missing sparc64_ip...



details:   https://anonhg.NetBSD.org/src/rev/0af8acee77ce
branches:  trunk
changeset: 333415:0af8acee77ce
user:      palle <palle%NetBSD.org@localhost>
date:      Sun Nov 02 19:40:06 2014 +0000

description:
sun4v: Implement missing sparc64_ipi_dcache_flush_page_xxx() function. ok martin@

diffstat:

 sys/arch/sparc64/sparc64/ipifuncs.c |  13 +++++++++++--
 sys/arch/sparc64/sparc64/mp_subr.S  |  22 ++++++++++++++++++++--
 2 files changed, 31 insertions(+), 4 deletions(-)

diffs (85 lines):

diff -r 28d7753a4795 -r 0af8acee77ce sys/arch/sparc64/sparc64/ipifuncs.c
--- a/sys/arch/sparc64/sparc64/ipifuncs.c       Sun Nov 02 17:58:14 2014 +0000
+++ b/sys/arch/sparc64/sparc64/ipifuncs.c       Sun Nov 02 19:40:06 2014 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ipifuncs.c,v 1.50 2014/06/08 17:33:24 palle Exp $ */
+/*     $NetBSD: ipifuncs.c,v 1.51 2014/11/02 19:40:06 palle Exp $ */
 
 /*-
  * Copyright (c) 2004 The NetBSD Foundation, Inc.
@@ -27,7 +27,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ipifuncs.c,v 1.50 2014/06/08 17:33:24 palle Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ipifuncs.c,v 1.51 2014/11/02 19:40:06 palle Exp $");
 
 #include "opt_ddb.h"
 
@@ -85,6 +85,9 @@
 #endif
 void   sparc64_ipi_dcache_flush_page_us(void *, void *);
 void   sparc64_ipi_dcache_flush_page_usiii(void *, void *);
+#ifdef SUN4V
+void   sparc64_ipi_dcache_flush_page_sun4v(void *, void *);
+#endif
 void   sparc64_ipi_blast_dcache(void *, void *);
 void   sparc64_ipi_ccall(void *, void *);
 
@@ -491,7 +494,13 @@
 {
        ipifunc_t func;
 
+#ifdef SUN4V
+       if (CPU_ISSUN4V)
+               func = sparc64_ipi_dcache_flush_page_sun4v;
+       else if (CPU_IS_USIII_UP())
+#else          
        if (CPU_IS_USIII_UP())
+#endif         
                func = sparc64_ipi_dcache_flush_page_usiii;
        else
                func = sparc64_ipi_dcache_flush_page_us;
diff -r 28d7753a4795 -r 0af8acee77ce sys/arch/sparc64/sparc64/mp_subr.S
--- a/sys/arch/sparc64/sparc64/mp_subr.S        Sun Nov 02 17:58:14 2014 +0000
+++ b/sys/arch/sparc64/sparc64/mp_subr.S        Sun Nov 02 19:40:06 2014 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: mp_subr.S,v 1.7 2014/09/24 18:32:10 palle Exp $        */
+/*     $NetBSD: mp_subr.S,v 1.8 2014/11/02 19:40:06 palle Exp $        */
 
 /*
  * Copyright (c) 2006-2010 Matthew R. Green
@@ -389,9 +389,10 @@
         nop
 
 /*
- * IPI handler to drop the current FPU state.
+ * Flush data cache page.
  * void sparc64_ipi_dcache_flush_page_usiii(paddr_t pa, int line_size)
  * void sparc64_ipi_dcache_flush_page_us(paddr_t pa, int line_size)
+ * void sparc64_ipi_dcache_flush_page_sun4v(paddr_t pa, int line_size)
  *
  * On entry:
  *     %g2 = pa
@@ -447,4 +448,21 @@
        ba,a    ret_from_intr_vector
         nop
 
+#ifdef SUN4V
+ENTRY(sparc64_ipi_dcache_flush_page_sun4v)
+       set     NBPG, %o1
+       call    hv_mem_sync
+        mov    %g2, %o0
+       cmp     %o0, 0
+       be,pt   %icc, 1f
+        nop
+       sir                             ! crash if hv-call fails
+1:
+       sethi   %hi(KERNBASE), %g5
+       flush   %g5
+       membar  #Sync
+       ba,a    ret_from_intr_vector
+        nop
 #endif
+               
+#endif



Home | Main Index | Thread Index | Old Index