Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/sparc Remote CPU_ISSUN4OR4C and CPU_ISSUN4COR4M, an...



details:   https://anonhg.NetBSD.org/src/rev/5f34c6456542
branches:  trunk
changeset: 534112:5f34c6456542
user:      thorpej <thorpej%NetBSD.org@localhost>
date:      Wed Jul 17 04:55:56 2002 +0000

description:
Remote CPU_ISSUN4OR4C and CPU_ISSUN4COR4M, and instead express them
as (CPU_ISSUN4 || CPU_ISSUN4C) and (CPU_ISSUN4C || CPU_ISSUN4M),
respectively.  The compiler can still optimize as desired by expressing
them this way, and it simplifies adding new tests.

While here, just remove CPU_ISSUN4MOR4U; it's not used by anything.

diffstat:

 sys/arch/sparc/dev/zs_kgdb.c    |   4 ++--
 sys/arch/sparc/include/param.h  |  19 +------------------
 sys/arch/sparc/sparc/autoconf.c |   6 +++---
 sys/arch/sparc/sparc/iommu.c    |   4 ++--
 sys/arch/sparc/sparc/machdep.c  |   4 ++--
 sys/arch/sparc/sparc/pmap.c     |  34 +++++++++++++++++-----------------
 sys/arch/sparc/sparc/timer.c    |   4 ++--
 7 files changed, 29 insertions(+), 46 deletions(-)

diffs (truncated from 305 to 300 lines):

diff -r bfc794684c4c -r 5f34c6456542 sys/arch/sparc/dev/zs_kgdb.c
--- a/sys/arch/sparc/dev/zs_kgdb.c      Wed Jul 17 03:11:07 2002 +0000
+++ b/sys/arch/sparc/dev/zs_kgdb.c      Wed Jul 17 04:55:56 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: zs_kgdb.c,v 1.8 2001/09/26 20:53:06 eeh Exp $  */
+/*     $NetBSD: zs_kgdb.c,v 1.9 2002/07/17 04:55:56 thorpej Exp $      */
 
 /*-
  * Copyright (c) 1996 The NetBSD Foundation, Inc.
@@ -352,7 +352,7 @@
 #endif
 
 #if defined(SUN4C) || defined(SUN4M)
-       if (CPU_ISSUN4COR4M) {
+       if (CPU_ISSUN4C || CPU_ISSUN4M) {
                int node;
 
                node = firstchild(findroot());
diff -r bfc794684c4c -r 5f34c6456542 sys/arch/sparc/include/param.h
--- a/sys/arch/sparc/include/param.h    Wed Jul 17 03:11:07 2002 +0000
+++ b/sys/arch/sparc/include/param.h    Wed Jul 17 04:55:56 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: param.h,v 1.52 2002/07/17 02:43:43 thorpej Exp $ */
+/*     $NetBSD: param.h,v 1.53 2002/07/17 04:55:57 thorpej Exp $ */
 
 /*
  * Copyright (c) 1992, 1993
@@ -211,13 +211,10 @@
  * extra memory references they'll generate.
  */
 #define CPU_ISSUN4U    (0)
-#define CPU_ISSUN4MOR4U        (CPU_ISSUN4M)
 #if   defined(SUN4M) && defined(SUN4C) && defined(SUN4)
 #      define CPU_ISSUN4M      (cputyp == CPU_SUN4M)
 #      define CPU_ISSUN4C      (cputyp == CPU_SUN4C)
 #      define CPU_ISSUN4       (cputyp == CPU_SUN4)
-#      define CPU_ISSUN4OR4C   (cputyp == CPU_SUN4 || cputyp == CPU_SUN4C)
-#      define CPU_ISSUN4COR4M  (cputyp == CPU_SUN4C || cputyp == CPU_SUN4M)
 #      define NBPG             nbpg
 #      define PGOFSET          pgofset
 #      define PGSHIFT          pgshift
@@ -225,8 +222,6 @@
 #      define CPU_ISSUN4M      (cputyp == CPU_SUN4M)
 #      define CPU_ISSUN4C      (cputyp == CPU_SUN4C)
 #      define CPU_ISSUN4       (0)
-#      define CPU_ISSUN4OR4C   (cputyp == CPU_SUN4C)
-#      define CPU_ISSUN4COR4M  (cputyp == CPU_SUN4C || cputyp == CPU_SUN4M)
 #      define NBPG             4096
 #      define PGOFSET          (NBPG-1)
 #      define PGSHIFT          SUN4CM_PGSHIFT
@@ -234,8 +229,6 @@
 #      define CPU_ISSUN4M      (cputyp == CPU_SUN4M)
 #      define CPU_ISSUN4C      (0)
 #      define CPU_ISSUN4       (cputyp == CPU_SUN4)
-#      define CPU_ISSUN4OR4C   (cputyp == CPU_SUN4)
-#      define CPU_ISSUN4COR4M  (cputyp == CPU_SUN4M)
 #      define NBPG             nbpg
 #      define PGOFSET          pgofset
 #      define PGSHIFT          pgshift
@@ -243,8 +236,6 @@
 #      define CPU_ISSUN4M      (1)
 #      define CPU_ISSUN4C      (0)
 #      define CPU_ISSUN4       (0)
-#      define CPU_ISSUN4OR4C   (0)
-#      define CPU_ISSUN4COR4M  (1)
 #      define NBPG             4096
 #      define PGOFSET          (NBPG-1)
 #      define PGSHIFT          SUN4CM_PGSHIFT
@@ -252,8 +243,6 @@
 #      define CPU_ISSUN4M      (0)
 #      define CPU_ISSUN4C      (cputyp == CPU_SUN4C)
 #      define CPU_ISSUN4       (cputyp == CPU_SUN4)
-#      define CPU_ISSUN4OR4C   (1)
-#      define CPU_ISSUN4COR4M  (cputyp == CPU_SUN4C)
 #      define NBPG             nbpg
 #      define PGOFSET          pgofset
 #      define PGSHIFT          pgshift
@@ -261,8 +250,6 @@
 #      define CPU_ISSUN4M      (0)
 #      define CPU_ISSUN4C      (1)
 #      define CPU_ISSUN4       (0)
-#      define CPU_ISSUN4OR4C   (1)
-#      define CPU_ISSUN4COR4M  (1)
 #      define NBPG             4096
 #      define PGOFSET          (NBPG-1)
 #      define PGSHIFT          SUN4CM_PGSHIFT
@@ -270,8 +257,6 @@
 #      define CPU_ISSUN4M      (0)
 #      define CPU_ISSUN4C      (0)
 #      define CPU_ISSUN4       (1)
-#      define CPU_ISSUN4OR4C   (1)
-#      define CPU_ISSUN4COR4M  (0)
 #      define NBPG             8192
 #      define PGOFSET          (NBPG-1)
 #      define PGSHIFT          SUN4_PGSHIFT
@@ -279,8 +264,6 @@
 #      define CPU_ISSUN4M      (cputyp == CPU_SUN4M)
 #      define CPU_ISSUN4C      (cputyp == CPU_SUN4C)
 #      define CPU_ISSUN4       (cputyp == CPU_SUN4)
-#      define CPU_ISSUN4OR4C   (cputyp == CPU_SUN4 || cputyp == CPU_SUN4C)
-#      define CPU_ISSUN4COR4M  (cputyp == CPU_SUN4C || cputyp == CPU_SUN4M)
 #      define NBPG             nbpg
 #      define PGOFSET          pgofset
 #      define PGSHIFT          pgshift
diff -r bfc794684c4c -r 5f34c6456542 sys/arch/sparc/sparc/autoconf.c
--- a/sys/arch/sparc/sparc/autoconf.c   Wed Jul 17 03:11:07 2002 +0000
+++ b/sys/arch/sparc/sparc/autoconf.c   Wed Jul 17 04:55:56 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: autoconf.c,v 1.169 2002/06/21 14:38:36 lukem Exp $ */
+/*     $NetBSD: autoconf.c,v 1.170 2002/07/17 04:55:57 thorpej Exp $ */
 
 /*
  * Copyright (c) 1996
@@ -302,7 +302,7 @@
 #endif /* SUN4M */
 
 #if defined(SUN4) || defined(SUN4C)
-       if (CPU_ISSUN4OR4C) {
+       if (CPU_ISSUN4 || CPU_ISSUN4C) {
                /* Map Interrupt Enable Register */
                pmap_kenter_pa(INTRREG_VA,
                    INT_ENABLE_REG_PHYSADR | PMAP_NC | PMAP_OBIO,
@@ -940,7 +940,7 @@
 #endif /* SUN4M */
 
 #if defined(SUN4) || defined(SUN4C)
-       if (CPU_ISSUN4OR4C)
+       if (CPU_ISSUN4 || CPU_ISSUN4C)
                ienab_bis(IE_ALLIE);
 #endif
 
diff -r bfc794684c4c -r 5f34c6456542 sys/arch/sparc/sparc/iommu.c
--- a/sys/arch/sparc/sparc/iommu.c      Wed Jul 17 03:11:07 2002 +0000
+++ b/sys/arch/sparc/sparc/iommu.c      Wed Jul 17 04:55:56 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: iommu.c,v 1.64 2002/06/02 14:44:39 drochner Exp $ */
+/*     $NetBSD: iommu.c,v 1.65 2002/07/17 04:55:57 thorpej Exp $ */
 
 /*
  * Copyright (c) 1996
@@ -156,7 +156,7 @@
 {
        struct mainbus_attach_args *ma = aux;
 
-       if (CPU_ISSUN4OR4C)
+       if (CPU_ISSUN4 || CPU_ISSUN4C)
                return (0);
        return (strcmp(cf->cf_driver->cd_name, ma->ma_name) == 0);
 }
diff -r bfc794684c4c -r 5f34c6456542 sys/arch/sparc/sparc/machdep.c
--- a/sys/arch/sparc/sparc/machdep.c    Wed Jul 17 03:11:07 2002 +0000
+++ b/sys/arch/sparc/sparc/machdep.c    Wed Jul 17 04:55:56 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: machdep.c,v 1.195 2002/07/04 23:32:06 thorpej Exp $ */
+/*     $NetBSD: machdep.c,v 1.196 2002/07/17 04:55:57 thorpej Exp $ */
 
 /*-
  * Copyright (c) 1996, 1997, 1998 The NetBSD Foundation, Inc.
@@ -336,7 +336,7 @@
         exec_map = uvm_km_suballoc(kernel_map, &minaddr, &maxaddr,
                                  16*NCARGS, VM_MAP_PAGEABLE, FALSE, NULL);
 
-       if (CPU_ISSUN4OR4C) {
+       if (CPU_ISSUN4 || CPU_ISSUN4C) {
                /*
                 * Allocate dma map for 24-bit devices (le, ie)
                 * [dvma_base - dvma_end] is for VME devices..
diff -r bfc794684c4c -r 5f34c6456542 sys/arch/sparc/sparc/pmap.c
--- a/sys/arch/sparc/sparc/pmap.c       Wed Jul 17 03:11:07 2002 +0000
+++ b/sys/arch/sparc/sparc/pmap.c       Wed Jul 17 04:55:56 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: pmap.c,v 1.208 2002/06/02 14:44:39 drochner Exp $ */
+/*     $NetBSD: pmap.c,v 1.209 2002/07/17 04:55:57 thorpej Exp $ */
 
 /*
  * Copyright (c) 1996
@@ -956,14 +956,14 @@
 #define CTX_USABLE(pm,rp)      ((pm)->pm_ctx != NULL )
 #endif
 
-#define GAP_WIDEN(pm,vr) do if (CPU_ISSUN4OR4C) {      \
-       if (vr + 1 == pm->pm_gap_start)                 \
-               pm->pm_gap_start = vr;                  \
-       if (vr == pm->pm_gap_end)                       \
-               pm->pm_gap_end = vr + 1;                \
+#define GAP_WIDEN(pm,vr) do if (CPU_ISSUN4 || CPU_ISSUN4C) {   \
+       if (vr + 1 == pm->pm_gap_start)                         \
+               pm->pm_gap_start = vr;                          \
+       if (vr == pm->pm_gap_end)                               \
+               pm->pm_gap_end = vr + 1;                        \
 } while (0)
 
-#define GAP_SHRINK(pm,vr) do if (CPU_ISSUN4OR4C) {                     \
+#define GAP_SHRINK(pm,vr) do if (CPU_ISSUN4 || CPU_ISSUN4C) {          \
        int x;                                                          \
        x = pm->pm_gap_start + (pm->pm_gap_end - pm->pm_gap_start) / 2; \
        if (vr > x) {                                                   \
@@ -1950,7 +1950,7 @@
        if (pmapdebug & PDB_CTX_ALLOC)
                printf("ctx_alloc(%p)\n", pm);
 #endif
-       if (CPU_ISSUN4OR4C) {
+       if (CPU_ISSUN4 || CPU_ISSUN4C) {
                gap_start = pm->pm_gap_start;
                gap_end = pm->pm_gap_end;
        }
@@ -1979,7 +1979,7 @@
 #endif
                c->c_pmap->pm_ctx = NULL;
                doflush = (CACHEINFO.c_vactype != VAC_NONE);
-               if (CPU_ISSUN4OR4C) {
+               if (CPU_ISSUN4 || CPU_ISSUN4C) {
                        if (gap_start < c->c_pmap->pm_gap_start)
                                gap_start = c->c_pmap->pm_gap_start;
                        if (gap_end > c->c_pmap->pm_gap_end)
@@ -1992,7 +1992,7 @@
        pm->pm_ctx = c;
        pm->pm_ctxnum = cnum;
 
-       if (CPU_ISSUN4OR4C) {
+       if (CPU_ISSUN4 || CPU_ISSUN4C) {
                /*
                 * Write pmap's region (3-level MMU) or segment table into
                 * the MMU.
@@ -2769,7 +2769,7 @@
                pv_changepte4m(pv, 0, SRMMU_PG_C);
 #endif
 #if defined(SUN4) || defined(SUN4C)
-       if (CPU_ISSUN4OR4C)
+       if (CPU_ISSUN4 || CPU_ISSUN4C)
                pv_changepte4_4c(pv, PG_NC, 0);
 #endif
 }
@@ -2881,7 +2881,7 @@
 #if defined(SUN4M)
                pmap_bootstrap4m();
 #endif
-       } else if (CPU_ISSUN4OR4C) {
+       } else if (CPU_ISSUN4 || CPU_ISSUN4C) {
 #if defined(SUN4) || defined(SUN4C)
                pmap_bootstrap4_4c(nctx, nregion, nsegment);
 #endif
@@ -3843,7 +3843,7 @@
 {
        int vs, vr;
 
-       if (CPU_ISSUN4OR4C) {
+       if (CPU_ISSUN4 || CPU_ISSUN4C) {
 #if defined(SUN4_MMU3L)
                if (pm->pm_reglist.tqh_first)
                        panic("pmap_destroy: region list not empty");
@@ -3855,7 +3855,7 @@
        for (vr = 0; vr < NUREG; vr++) {
                struct regmap *rp = &pm->pm_regmap[vr];
 
-               if (CPU_ISSUN4OR4C) {
+               if (CPU_ISSUN4 || CPU_ISSUN4C) {
 #if defined(SUN4_MMU3L)
                        if (HASSUN4_MMU3L) {
                                if (rp->rg_smeg != reginval)
@@ -3923,7 +3923,7 @@
        /* pm->pm_ctx = NULL; */
        simple_lock_init(&pm->pm_lock);
 
-       if (CPU_ISSUN4OR4C) {
+       if (CPU_ISSUN4 || CPU_ISSUN4C) {
                TAILQ_INIT(&pm->pm_seglist);
 #if defined(SUN4_MMU3L)
                TAILQ_INIT(&pm->pm_reglist);
@@ -7369,7 +7369,7 @@
        sz += npmemarr * sizeof(phys_ram_seg_t);
        sz += sizeof(kernel_segmap_store);
 
-       if (CPU_ISSUN4OR4C)
+       if (CPU_ISSUN4 || CPU_ISSUN4C)
                /* For each pmeg in the MMU, we'll write NPTESG PTEs. */
                sz += (seginval + 1) * NPTESG * sizeof(int);
 
@@ -7440,7 +7440,7 @@
        kcpup->segmapoffset = segmapoffset =
                memsegoffset + npmemarr * sizeof(phys_ram_seg_t);
 
-       kcpup->npmeg = (CPU_ISSUN4OR4C) ? seginval + 1 : 0;
+       kcpup->npmeg = (CPU_ISSUN4 || CPU_ISSUN4C) ? seginval + 1 : 0;
        kcpup->pmegoffset = pmegoffset =
                segmapoffset + kcpup->nsegmap * sizeof(struct segmap);
 
diff -r bfc794684c4c -r 5f34c6456542 sys/arch/sparc/sparc/timer.c
--- a/sys/arch/sparc/sparc/timer.c      Wed Jul 17 03:11:07 2002 +0000
+++ b/sys/arch/sparc/sparc/timer.c      Wed Jul 17 04:55:56 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: timer.c,v 1.4 2002/07/14 19:42:58 thorpej Exp $ */
+/*     $NetBSD: timer.c,v 1.5 2002/07/17 04:55:58 thorpej Exp $ */
 
 /*
  * Copyright (c) 1992, 1993
@@ -378,7 +378,7 @@
        printf(": delay constant %d\n", timerblurb);
 
 #if defined(SUN4) || defined(SUN4C)



Home | Main Index | Thread Index | Old Index