Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/sgimips Avoid a global name "netmask" - it causes l...



details:   https://anonhg.NetBSD.org/src/rev/d2ed6467b2f2
branches:  trunk
changeset: 581680:d2ed6467b2f2
user:      martin <martin%NetBSD.org@localhost>
date:      Fri Jun 03 19:02:33 2005 +0000

description:
Avoid a global name "netmask" - it causes lots of shadow warnings all over
the place. Collect all interrupt masks into a single array instead.
Constify a bit and fix a bogus argument to config_rootfound().

diffstat:

 sys/arch/sgimips/include/intr.h     |  15 ++++------
 sys/arch/sgimips/sgimips/autoconf.c |  11 ++++---
 sys/arch/sgimips/sgimips/machdep.c  |  51 +++++++++++++++++-------------------
 3 files changed, 36 insertions(+), 41 deletions(-)

diffs (185 lines):

diff -r 03a001118c4e -r d2ed6467b2f2 sys/arch/sgimips/include/intr.h
--- a/sys/arch/sgimips/include/intr.h   Fri Jun 03 18:58:40 2005 +0000
+++ b/sys/arch/sgimips/include/intr.h   Fri Jun 03 19:02:33 2005 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: intr.h,v 1.17 2004/07/07 00:08:43 sekiya Exp $ */
+/*     $NetBSD: intr.h,v 1.18 2005/06/03 19:02:33 martin Exp $ */
 
 /*
  * Copyright (c) 2000 Soren S. Jorvang
@@ -104,19 +104,16 @@
 extern void            _setsoftintr(int);
 extern void            _clrsoftintr(int);
 
-extern u_int32_t       biomask;
-extern u_int32_t       netmask;
-extern u_int32_t       ttymask;
-extern u_int32_t       clockmask;
+extern u_int32_t       splmasks[];
 
 #define splhigh()      _splraise(MIPS_INT_MASK)
 #define spl0()         (void)_spllower(0)
 #define splx(s)                (void)_splset(s)
-#define splbio()       _splraise(biomask)
-#define splnet()       _splraise(netmask)
-#define spltty()       _splraise(ttymask)
+#define splbio()       _splraise(splmasks[IPL_BIO])
+#define splnet()       _splraise(splmasks[IPL_NET])
+#define spltty()       _splraise(splmasks[IPL_TTY])
 #define splvm()                spltty()
-#define splclock()     _splraise(clockmask)
+#define splclock()     _splraise(splmasks[IPL_CLOCK])
 #define splstatclock() splclock()
 
 #define        splsched()      splhigh()
diff -r 03a001118c4e -r d2ed6467b2f2 sys/arch/sgimips/sgimips/autoconf.c
--- a/sys/arch/sgimips/sgimips/autoconf.c       Fri Jun 03 18:58:40 2005 +0000
+++ b/sys/arch/sgimips/sgimips/autoconf.c       Fri Jun 03 19:02:33 2005 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: autoconf.c,v 1.23 2004/12/18 00:51:30 sekiya Exp $     */
+/*     $NetBSD: autoconf.c,v 1.24 2005/06/03 19:02:33 martin Exp $     */
 
 /*
  * Copyright (c) 2000 Soren S. Jorvang
@@ -33,7 +33,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: autoconf.c,v 1.23 2004/12/18 00:51:30 sekiya Exp $");
+__KERNEL_RCSID(0, "$NetBSD: autoconf.c,v 1.24 2005/06/03 19:02:33 martin Exp $");
 
 #include "opt_ddb.h"
 
@@ -54,7 +54,7 @@
 
 static struct device *booted_controller = NULL;
 static int     booted_slot, booted_unit;
-static char    *booted_protocol = NULL;
+static const char      *booted_protocol = NULL;
 
 extern struct platform platform;
 
@@ -66,7 +66,7 @@
        softintr_init();
 
        s = splhigh();
-       if (config_rootfound("mainbus", "mainbus") == NULL)
+       if (config_rootfound("mainbus", NULL) == NULL)
                panic("no mainbus found");
 
        /*
@@ -76,7 +76,8 @@
        (*platform.bus_reset)();
 
        printf("biomask %02x netmask %02x ttymask %02x clockmask %02x\n",
-           biomask >> 8, netmask >> 8, ttymask >> 8, clockmask >> 8);
+           splmasks[IPL_BIO] >> 8, splmasks[IPL_NET] >> 8, 
+           splmasks[IPL_TTY] >> 8, splmasks[IPL_CLOCK] >> 8);
 
        _splnone();
 }
diff -r 03a001118c4e -r d2ed6467b2f2 sys/arch/sgimips/sgimips/machdep.c
--- a/sys/arch/sgimips/sgimips/machdep.c        Fri Jun 03 18:58:40 2005 +0000
+++ b/sys/arch/sgimips/sgimips/machdep.c        Fri Jun 03 19:02:33 2005 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: machdep.c,v 1.92 2005/04/25 15:02:07 lukem Exp $       */
+/*     $NetBSD: machdep.c,v 1.93 2005/06/03 19:02:33 martin Exp $      */
 
 /*
  * Copyright (c) 2000 Soren S. Jorvang
@@ -34,7 +34,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.92 2005/04/25 15:02:07 lukem Exp $");
+__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.93 2005/06/03 19:02:33 martin Exp $");
 
 #include "opt_ddb.h"
 #include "opt_kgdb.h"
@@ -133,10 +133,7 @@
 int ncpus;
 
 /* CPU interrupt masks */
-u_int32_t biomask;
-u_int32_t netmask;
-u_int32_t ttymask;
-u_int32_t clockmask;
+u_int32_t splmasks[IPL_CLOCK+1];
 
 phys_ram_seg_t mem_clusters[VM_PHYSSEG_MAX];
 int mem_cluster_cnt;
@@ -225,7 +222,7 @@
        caddr_t v;
        vsize_t size;
        struct arcbios_mem *mem;
-       char *cpufreq;
+       const char *cpufreq;
        struct btinfo_symtab *bi_syms;
        caddr_t ssym;
        vaddr_t kernend;
@@ -416,10 +413,10 @@
                                mach_subtype = MACH_SGI_IP12_HPLC;
                 }
 
-               biomask = 0x0b00;
-               netmask = 0x0b00;
-               ttymask = 0x1b00;
-               clockmask = 0x7f00;
+               splmasks[IPL_BIO] = 0x0b00;
+               splmasks[IPL_NET] = 0x0b00;
+               splmasks[IPL_TTY] = 0x1b00;
+               splmasks[IPL_CLOCK] = 0x7f00;
                platform.intr3 = mips1_clock_intr;
                platform.clkread = mips1_clkread;
                break;
@@ -430,34 +427,34 @@
                i = *(volatile u_int32_t *)MIPS_PHYS_TO_KSEG1(0x1fbd0000);
                mach_boardrev = (i & 0x7000) >> 12;
 
-               biomask = 0x0700;
-               netmask = 0x0700;
-               ttymask = 0x0f00;
-               clockmask = 0xbf00;
+               splmasks[IPL_BIO] = 0x0700;
+               splmasks[IPL_NET] = 0x0700;
+               splmasks[IPL_TTY] = 0x0f00;
+               splmasks[IPL_CLOCK] = 0xbf00;
                platform.intr5 = mips3_clock_intr;
                platform.clkread = mips3_clkread;
                break;
        case MACH_SGI_IP22:
-               biomask = 0x0700;
-               netmask = 0x0700;
-               ttymask = 0x0f00;
-               clockmask = 0xbf00;
+               splmasks[IPL_BIO] = 0x0700;
+               splmasks[IPL_NET] = 0x0700;
+               splmasks[IPL_TTY] = 0x0f00;
+               splmasks[IPL_CLOCK] = 0xbf00;
                platform.intr5 = mips3_clock_intr;
                platform.clkread = mips3_clkread;
                break;
        case MACH_SGI_IP30:
-               biomask = 0x0700;
-               netmask = 0x0700;
-               ttymask = 0x0700;
-               clockmask = 0x8700;
+               splmasks[IPL_BIO] = 0x0700;
+               splmasks[IPL_NET] = 0x0700;
+               splmasks[IPL_TTY] = 0x0700;
+               splmasks[IPL_CLOCK] = 0x8700;
                platform.intr5 = mips3_clock_intr;
                platform.clkread = mips3_clkread;
                break;
        case MACH_SGI_IP32:
-               biomask = 0x0700;
-               netmask = 0x0700;
-               ttymask = 0x0700;
-               clockmask = 0x8700;
+               splmasks[IPL_BIO] = 0x0700;
+               splmasks[IPL_NET] = 0x0700;
+               splmasks[IPL_TTY] = 0x0700;
+               splmasks[IPL_CLOCK] = 0x8700;
                platform.intr5 = mips3_clock_intr;
                platform.clkread = mips3_clkread;
                break;



Home | Main Index | Thread Index | Old Index