Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/sparc64 sun4v: Removed a bunch of ifdef SUN4V since...



details:   https://anonhg.NetBSD.org/src/rev/72f15338dcb2
branches:  trunk
changeset: 333445:72f15338dcb2
user:      palle <palle%NetBSD.org@localhost>
date:      Tue Nov 04 18:11:42 2014 +0000

description:
sun4v: Removed a bunch of ifdef SUN4V since the CPU_ISSUN4V already has the necessary logic. Noticed by mrg@

diffstat:

 sys/arch/sparc64/dev/ebus_mainbus.c |   6 ++----
 sys/arch/sparc64/sparc64/cache.h    |   6 ++----
 sys/arch/sparc64/sparc64/cpu.c      |  12 ++----------
 sys/arch/sparc64/sparc64/ipifuncs.c |  14 ++------------
 sys/arch/sparc64/sparc64/pmap.c     |   8 ++------
 5 files changed, 10 insertions(+), 36 deletions(-)

diffs (235 lines):

diff -r 56183dee1ed0 -r 72f15338dcb2 sys/arch/sparc64/dev/ebus_mainbus.c
--- a/sys/arch/sparc64/dev/ebus_mainbus.c       Tue Nov 04 16:01:58 2014 +0000
+++ b/sys/arch/sparc64/dev/ebus_mainbus.c       Tue Nov 04 18:11:42 2014 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ebus_mainbus.c,v 1.14 2014/08/27 19:02:17 palle Exp $  */
+/*     $NetBSD: ebus_mainbus.c,v 1.15 2014/11/04 18:11:42 palle Exp $  */
 /*     $OpenBSD: ebus_mainbus.c,v 1.7 2010/11/11 17:58:23 miod Exp $   */
 
 /*
@@ -18,7 +18,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ebus_mainbus.c,v 1.14 2014/08/27 19:02:17 palle Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ebus_mainbus.c,v 1.15 2014/11/04 18:11:42 palle Exp $");
 
 #ifdef DEBUG
 #define        EDB_PROM        0x01
@@ -277,7 +277,6 @@
        u_int64_t *imap, *iclr;
        int ino;
 
-#ifdef SUN4V
 #if 0
 XXX
        if (CPU_ISSUN4V) {
@@ -329,7 +328,6 @@
                return (ih);
        }
 #endif
-#endif
 
        ino = INTINO(ihandle);
 
diff -r 56183dee1ed0 -r 72f15338dcb2 sys/arch/sparc64/sparc64/cache.h
--- a/sys/arch/sparc64/sparc64/cache.h  Tue Nov 04 16:01:58 2014 +0000
+++ b/sys/arch/sparc64/sparc64/cache.h  Tue Nov 04 18:11:42 2014 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: cache.h,v 1.23 2014/06/08 17:33:24 palle Exp $ */
+/*     $NetBSD: cache.h,v 1.24 2014/11/04 18:11:42 palle Exp $ */
 
 /*
  * Copyright (c) 2011 Matthew R. Green
@@ -140,10 +140,8 @@
                else
                        sp_tlb_flush_pte_us(va, ctx);
        }
-#ifdef SUN4V   
-       else
+       else if (CPU_ISSUN4V)
                sp_tlb_flush_pte_sun4v(va, ctx);
-#endif
 }
 
 static __inline__ void
diff -r 56183dee1ed0 -r 72f15338dcb2 sys/arch/sparc64/sparc64/cpu.c
--- a/sys/arch/sparc64/sparc64/cpu.c    Tue Nov 04 16:01:58 2014 +0000
+++ b/sys/arch/sparc64/sparc64/cpu.c    Tue Nov 04 18:11:42 2014 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: cpu.c,v 1.118 2014/09/24 18:32:10 palle Exp $ */
+/*     $NetBSD: cpu.c,v 1.119 2014/11/04 18:11:42 palle Exp $ */
 
 /*
  * Copyright (c) 1996
@@ -52,7 +52,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: cpu.c,v 1.118 2014/09/24 18:32:10 palle Exp $");
+__KERNEL_RCSID(0, "$NetBSD: cpu.c,v 1.119 2014/11/04 18:11:42 palle Exp $");
 
 #include "opt_multiprocessor.h"
 
@@ -140,7 +140,6 @@
                id = prom_getpropint(cpu_node, "portid", -1);
        if (id == -1)
                id = prom_getpropint(cpu_node, "cpuid", -1);
-#ifdef SUN4V   
        if (CPU_ISSUN4V) {
                int reg[4];
                int* regp=reg;
@@ -152,7 +151,6 @@
                /* cpuid in the lower 24 bits - sun4v hypervisor arch */
                id = reg[0] & 0x0fffffff;
        }
-#endif 
        if (id == -1)
                panic("failed to determine cpuid");
        
@@ -210,10 +208,8 @@
        cpi->ci_spinup = NULL;
        cpi->ci_paddr = pa0;
        cpi->ci_self = cpi;
-#ifdef SUN4V
        if (CPU_ISSUN4V)
                cpi->ci_mmfsa = pa0;
-#endif
        cpi->ci_node = cpu_node;
        cpi->ci_idepth = -1;
        memset(cpi->ci_intrpending, -1, sizeof(cpi->ci_intrpending));
@@ -461,7 +457,6 @@
         * CPU specific ipi setup
         * Currently only necessary for SUN4V
         */
-#ifdef SUN4V   
        if (CPU_ISSUN4V) {
                paddr_t pa = ci->ci_paddr;
                int err;
@@ -487,7 +482,6 @@
                ci->ci_cpuset = pa;
                pa += 64;
        }
-#endif 
        
 }
 
@@ -497,13 +491,11 @@
        char buf[32];
        int impl;
 
-#ifdef SUN4V
        if (CPU_ISSUN4V) {
                uint64_t myid;
                hv_cpu_myid(&myid);
                return myid;
        }
-#endif
        if (OF_getprop(findroot(), "name", buf, sizeof(buf)) > 0 &&
            strcmp(buf, "SUNW,Ultra-Enterprise-10000") == 0)
                return lduwa(0x1fff40000d0UL, ASI_PHYS_NON_CACHED);
diff -r 56183dee1ed0 -r 72f15338dcb2 sys/arch/sparc64/sparc64/ipifuncs.c
--- a/sys/arch/sparc64/sparc64/ipifuncs.c       Tue Nov 04 16:01:58 2014 +0000
+++ b/sys/arch/sparc64/sparc64/ipifuncs.c       Tue Nov 04 18:11:42 2014 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ipifuncs.c,v 1.51 2014/11/02 19:40:06 palle Exp $ */
+/*     $NetBSD: ipifuncs.c,v 1.52 2014/11/04 18:11:42 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.51 2014/11/02 19:40:06 palle Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ipifuncs.c,v 1.52 2014/11/04 18:11:42 palle Exp $");
 
 #include "opt_ddb.h"
 
@@ -219,11 +219,9 @@
 void
 sparc64_send_ipi(int upaid, ipifunc_t func, uint64_t arg1, uint64_t arg2)
 {
-#ifdef SUN4V   
        if (CPU_ISSUN4V)
                sparc64_send_ipi_sun4v(upaid, func, arg1, arg2);
        else
-#endif         
                sparc64_send_ipi_sun4u(upaid, func, arg1, arg2);
                    
 }
@@ -451,13 +449,9 @@
        int ctx;
        bool kpm = (pm == pmap_kernel());
        ipifunc_t func;
-#ifdef SUN4V
        if (CPU_ISSUN4V)
                func = sparc64_ipi_flush_pte_sun4v;
        else if (CPU_IS_USIII_UP())
-#else
-       if (CPU_IS_USIII_UP())
-#endif         
                func = sparc64_ipi_flush_pte_usiii;
        else
                func = sparc64_ipi_flush_pte_us;
@@ -494,13 +488,9 @@
 {
        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 56183dee1ed0 -r 72f15338dcb2 sys/arch/sparc64/sparc64/pmap.c
--- a/sys/arch/sparc64/sparc64/pmap.c   Tue Nov 04 16:01:58 2014 +0000
+++ b/sys/arch/sparc64/sparc64/pmap.c   Tue Nov 04 18:11:42 2014 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: pmap.c,v 1.291 2014/10/30 13:57:14 palle Exp $ */
+/*     $NetBSD: pmap.c,v 1.292 2014/11/04 18:11:42 palle Exp $ */
 /*
  *
  * Copyright (C) 1996-1999 Eduardo Horvath.
@@ -26,7 +26,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.291 2014/10/30 13:57:14 palle Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.292 2014/11/04 18:11:42 palle Exp $");
 
 #undef NO_VCACHE /* Don't forget the locked TLB in dostart */
 #define        HWREF
@@ -1155,12 +1155,10 @@
                cpus->ci_eintstack = NULL;
                cpus->ci_spinup = main; /* Call main when we're running. */
                cpus->ci_paddr = cpu0paddr;
-#ifdef SUN4V
                if (CPU_ISSUN4V) {
                        cpus->ci_mmfsa = cpu0paddr;
                        cpus->ci_tsb_desc = NULL;
                }
-#endif
                cpus->ci_cpcb = (struct pcb *)u0va;
                cpus->ci_idepth = -1;
                memset(cpus->ci_intrpending, -1, sizeof(cpus->ci_intrpending));
@@ -1244,7 +1242,6 @@
                ci->ci_ctxbusy = curcpu()->ci_ctxbusy;
        }
 
-#ifdef SUN4V
        if (CPU_ISSUN4V) {
                ci->ci_tsb_desc = (struct tsb_desc *)kdata_alloc(
                        sizeof(struct tsb_desc), 16);
@@ -1261,7 +1258,6 @@
                    ci->ci_index, ci->ci_tsb_desc, sizeof(struct tsb_desc),
                    ci->ci_tsb_desc->td_pa));
        }
-#endif
 
        BDPRINTF(PDB_BOOT1, ("cpu %d: TSB allocated at %p/%p size %08x\n",
            ci->ci_index, ci->ci_tsb_dmmu, ci->ci_tsb_immu, TSBSIZE));



Home | Main Index | Thread Index | Old Index