Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/mac68k Shadowing and const fixes.



details:   https://anonhg.NetBSD.org/src/rev/e9badc153a5f
branches:  trunk
changeset: 582107:e9badc153a5f
user:      jmc <jmc%NetBSD.org@localhost>
date:      Thu Jun 16 22:45:46 2005 +0000

description:
Shadowing and const fixes.

diffstat:

 sys/arch/mac68k/dev/ncr5380.c    |  16 ++++++------
 sys/arch/mac68k/dev/ncr5380reg.h |   8 +++---
 sys/arch/mac68k/dev/pm_direct.c  |  34 +++++++++++++-------------
 sys/arch/mac68k/mac68k/intr.c    |   7 +++--
 sys/arch/mac68k/mac68k/machdep.c |  21 ++++++++--------
 sys/arch/mac68k/mac68k/macrom.c  |  19 ++++++++-------
 sys/arch/mac68k/obio/iwm_fd.c    |  50 ++++++++++++++++++++--------------------
 sys/arch/mac68k/obio/iwm_fdvar.h |   4 +-
 8 files changed, 81 insertions(+), 78 deletions(-)

diffs (truncated from 558 to 300 lines):

diff -r 972d3c006f4b -r e9badc153a5f sys/arch/mac68k/dev/ncr5380.c
--- a/sys/arch/mac68k/dev/ncr5380.c     Thu Jun 16 22:43:36 2005 +0000
+++ b/sys/arch/mac68k/dev/ncr5380.c     Thu Jun 16 22:45:46 2005 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ncr5380.c,v 1.58 2005/02/21 00:29:06 thorpej Exp $     */
+/*     $NetBSD: ncr5380.c,v 1.59 2005/06/16 22:45:46 jmc Exp $ */
 
 /*
  * Copyright (c) 1995 Leo Weppelman.
@@ -31,7 +31,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ncr5380.c,v 1.58 2005/02/21 00:29:06 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ncr5380.c,v 1.59 2005/06/16 22:45:46 jmc Exp $");
 
 /*
  * Bit mask of targets you want debugging to be shown
@@ -908,10 +908,10 @@
                 */
                if (!reach_msg_out(sc, sizeof(struct scsipi_generic))) {
                        u_long  len   = 1;
-                       u_char  phase = PH_MSGOUT;
+                       u_char  tphase = PH_MSGOUT;
                        u_char  msg   = MSG_ABORT;
 
-                       transfer_pio(&phase, &msg, &len, 0);
+                       transfer_pio(&tphase, &msg, &len, 0);
                }
                else scsi_reset_verbose(sc, "Connected to unidentified target");
 
@@ -1884,7 +1884,7 @@
  * Prefix message with full target info.
  */
 static void
-ncr_tprint(SC_REQ *reqp, char *fmt, ...)
+ncr_tprint(SC_REQ *reqp, const char *fmt, ...)
 {
        va_list ap;
 
@@ -1898,7 +1898,7 @@
  * Prefix message with adapter info.
  */
 static void
-ncr_aprint(struct ncr_softc *sc, char *fmt, ...)
+ncr_aprint(struct ncr_softc *sc, const char *fmt, ...)
 {
        va_list ap;
 
@@ -1930,7 +1930,7 @@
 }
 
 static void
-show_request(SC_REQ *reqp, char *qtxt)
+show_request(SC_REQ *reqp, const char *qtxt)
 {
        printf("REQ-%s: %d %p[%ld] cmd[0]=%x S=%x M=%x R=%x resid=%d dr_flag=%x %s\n",
                        qtxt, reqp->targ_id, reqp->xdata_ptr, reqp->xdata_len,
@@ -1941,7 +1941,7 @@
                show_data_sense(reqp->xs);
 }
 
-static char *sig_names[] = {
+static const char *sig_names[] = {
        "PAR", "SEL", "I/O", "C/D", "MSG", "REQ", "BSY", "RST",
        "ACK", "ATN", "LBSY", "PMATCH", "IRQ", "EPAR", "DREQ", "EDMA"
 };
diff -r 972d3c006f4b -r e9badc153a5f sys/arch/mac68k/dev/ncr5380reg.h
--- a/sys/arch/mac68k/dev/ncr5380reg.h  Thu Jun 16 22:43:36 2005 +0000
+++ b/sys/arch/mac68k/dev/ncr5380reg.h  Thu Jun 16 22:45:46 2005 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ncr5380reg.h,v 1.16 2005/01/15 16:00:59 chs Exp $      */
+/*     $NetBSD: ncr5380reg.h,v 1.17 2005/06/16 22:45:46 jmc Exp $      */
 
 /*
  * Copyright (c) 1995 Leo Weppelman.
@@ -249,11 +249,11 @@
 static void run_main(struct ncr_softc *);
 static void scsi_main(struct ncr_softc *);
 static void ncr_ctrl_intr(struct ncr_softc *);
-static void ncr_tprint(SC_REQ *, char *, ...);
-static void ncr_aprint(struct ncr_softc *, char *, ...);
+static void ncr_tprint(SC_REQ *, const char *, ...);
+static void ncr_aprint(struct ncr_softc *, const char *, ...);
 
 static void show_data_sense(struct scsipi_xfer *);
-static void show_request(SC_REQ *, char *);
+static void show_request(SC_REQ *, const char *);
 /* static void show_phase(SC_REQ *, int); */
 static void show_signals(u_char, u_char);
 
diff -r 972d3c006f4b -r e9badc153a5f sys/arch/mac68k/dev/pm_direct.c
--- a/sys/arch/mac68k/dev/pm_direct.c   Thu Jun 16 22:43:36 2005 +0000
+++ b/sys/arch/mac68k/dev/pm_direct.c   Thu Jun 16 22:45:46 2005 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: pm_direct.c,v 1.23 2005/01/15 16:00:59 chs Exp $       */
+/*     $NetBSD: pm_direct.c,v 1.24 2005/06/16 22:45:46 jmc Exp $       */
 
 /*
  * Copyright (C) 1997 Takashi Hamada
@@ -32,7 +32,7 @@
 /* From: pm_direct.c 1.3 03/18/98 Takashi Hamada */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: pm_direct.c,v 1.23 2005/01/15 16:00:59 chs Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pm_direct.c,v 1.24 2005/06/16 22:45:46 jmc Exp $");
 
 #include "opt_adb.h"
 
@@ -294,13 +294,13 @@
  * Wait until PM IC is busy
  */
 int
-pm_wait_busy(int delay)
+pm_wait_busy(int xdelay)
 {
        while (PM_IS_ON) {
 #ifdef PM_GRAB_SI
                (void)intr_dispatch(0x70);      /* grab any serial interrupts */
 #endif
-               if ((--delay) < 0)
+               if ((--xdelay) < 0)
                        return 1;       /* timeout */
        }
        return 0;
@@ -311,13 +311,13 @@
  * Wait until PM IC is free
  */
 int
-pm_wait_free(int delay)
+pm_wait_free(int xdelay)
 {
        while (PM_IS_OFF) {
 #ifdef PM_GRAB_SI
                (void)intr_dispatch(0x70);      /* grab any serial interrupts */
 #endif
-               if ((--delay) < 0)
+               if ((--xdelay) < 0)
                        return 0;       /* timeout */
        }
        return 1;
@@ -439,13 +439,13 @@
                                        case MACH_MACPB180:
                                        case MACH_MACPB180C:
                                                {
-                                                       int delay = ADBDelay * 16;
+                                                       int xdelay = ADBDelay * 16;
 
                                                        via_reg(VIA2, vDirA) = 0x00;
-                                                       while ((via_reg(VIA2, 0x200) == 0x7f) && (delay >= 0))
-                                                               delay--;
+                                                       while ((via_reg(VIA2, 0x200) == 0x7f) && (xdelay >= 0))
+                                                               xdelay--;
 
-                                                       if (delay < 0) {        /* timeout */
+                                                       if (xdelay < 0) {       /* timeout */
                                                                via_reg(VIA2, vDirA) = 0x00;
                                                                /* restore formar value */
                                                                via_reg(VIA1, vIER) = via1_vIER;
@@ -699,14 +699,14 @@
 
                        if (HwCfgFlags3 & 0x00200000) { 
                                /* PB 160, PB 165(c), PB 180(c)? */
-                               int delay = ADBDelay * 16;
+                               int xdelay = ADBDelay * 16;
 
                                via_reg(VIA2, vDirA) = 0x00;
                                while ((via_reg(VIA2, 0x200) == 0x07) &&
-                                   (delay >= 0))
-                                       delay--;
+                                   (xdelay >= 0))
+                                       xdelay--;
 
-                               if (delay < 0) {
+                               if (xdelay < 0) {
                                        rval = 0xffffcd38;
                                        break;          /* timeout */
                                }
@@ -967,7 +967,7 @@
        int i;
        int s;
        int rval;
-       int delay;
+       int xdelay;
        PMData pmdata;
        struct adbCommand packet;
 
@@ -1033,7 +1033,7 @@
        PM_VIA_INTR_ENABLE();
 
        /* wait until the PM interrupt has occurred */
-       delay = 0x80000;
+       xdelay = 0x80000;
        while (adbWaiting == 1) {
                switch (mac68k_machine.machineid) {
                case MACH_MACPB150:
@@ -1055,7 +1055,7 @@
 #ifdef PM_GRAB_SI
                (void)intr_dispatch(0x70);      /* grab any serial interrupts */
 #endif
-               if ((--delay) < 0) {
+               if ((--xdelay) < 0) {
                        splx(s);
                        return 1;
                }
diff -r 972d3c006f4b -r e9badc153a5f sys/arch/mac68k/mac68k/intr.c
--- a/sys/arch/mac68k/mac68k/intr.c     Thu Jun 16 22:43:36 2005 +0000
+++ b/sys/arch/mac68k/mac68k/intr.c     Thu Jun 16 22:45:46 2005 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: intr.c,v 1.21 2005/03/05 17:34:06 chs Exp $    */
+/*     $NetBSD: intr.c,v 1.22 2005/06/16 22:45:46 jmc Exp $    */
 
 /*-
  * Copyright (c) 1996, 1997 The NetBSD Foundation, Inc.
@@ -41,7 +41,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: intr.c,v 1.21 2005/03/05 17:34:06 chs Exp $");
+__KERNEL_RCSID(0, "$NetBSD: intr.c,v 1.22 2005/06/16 22:45:46 jmc Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -112,7 +112,8 @@
 intr_init(void)
 {
        extern long     intrnames;
-       char            *inames, *g_inames;
+       const char      *inames;
+       char            *g_inames;
 
        mac68k_ipls[MAC68K_IPL_SOFT] = PSL_S|PSL_IPL1;
        mac68k_ipls[MAC68K_IPL_SERIAL] = PSL_S|PSL_IPL4;
diff -r 972d3c006f4b -r e9badc153a5f sys/arch/mac68k/mac68k/machdep.c
--- a/sys/arch/mac68k/mac68k/machdep.c  Thu Jun 16 22:43:36 2005 +0000
+++ b/sys/arch/mac68k/mac68k/machdep.c  Thu Jun 16 22:45:46 2005 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: machdep.c,v 1.304 2005/04/25 15:02:06 lukem Exp $      */
+/*     $NetBSD: machdep.c,v 1.305 2005/06/16 22:45:46 jmc Exp $        */
 
 /*
  * Copyright (c) 1982, 1990 The Regents of the University of California.
@@ -107,7 +107,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.304 2005/04/25 15:02:06 lukem Exp $");
+__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.305 2005/06/16 22:45:46 jmc Exp $");
 
 #include "opt_adb.h"
 #include "opt_ddb.h"
@@ -266,7 +266,7 @@
 void   cpu_init_kcore_hdr(void);
 
 void           getenvvars(u_long, char *);
-static long    getenv(char *);
+static long    getenv(const char *);
 
 /* functions called from locore.s */
 void   dumpsys(void);
@@ -423,7 +423,7 @@
 {
        int vers;
        vaddr_t minaddr, maxaddr;
-       int delay;
+       int xdelay;
        char pbuf[9];
 
        /*
@@ -448,7 +448,7 @@
                printf("Booter version %d.%d is necessary to fully support\n",
                    CURRENTBOOTERVER / 100, CURRENTBOOTERVER % 100);
                printf("this kernel.\n\n");
-               for (delay = 0; delay < 1000000; delay++);
+               for (xdelay = 0; xdelay < 1000000; xdelay++);
        }
        format_bytes(pbuf, sizeof(pbuf), ctob(physmem));
        printf("total memory = %s\n", pbuf);
@@ -1154,7 +1154,7 @@
 }
 
 static long
-getenv(char *str)
+getenv(const char *str)
 {
        /*
         * Returns the value of the environment variable "str".
@@ -1165,7 +1165,8 @@
         * there without an "=val".
         */
 
-       char *s, *s1;
+       char *s;
+       const char *s1;
        int val, base;
 
        s = envbuf;
@@ -2025,7 +2026,7 @@
 identifycpu(void)
 {



Home | Main Index | Thread Index | Old Index