Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/luna68k/stand/boot Remove unused code (from OpenBSD...



details:   https://anonhg.NetBSD.org/src/rev/32f1ce9e8210
branches:  trunk
changeset: 325671:32f1ce9e8210
user:      tsutsui <tsutsui%NetBSD.org@localhost>
date:      Fri Jan 03 02:03:12 2014 +0000

description:
Remove unused code (from OpenBSD/luna88k). Some KNF.

diffstat:

 sys/arch/luna68k/stand/boot/autoconf.c |   5 +-
 sys/arch/luna68k/stand/boot/device.h   |  40 ++-----------
 sys/arch/luna68k/stand/boot/ioconf.c   |  22 +++----
 sys/arch/luna68k/stand/boot/sd.c       |   9 +--
 sys/arch/luna68k/stand/boot/sio.c      |  96 +++++++++++++++++++--------------
 5 files changed, 76 insertions(+), 96 deletions(-)

diffs (truncated from 379 to 300 lines):

diff -r 7fcb4ed24ef3 -r 32f1ce9e8210 sys/arch/luna68k/stand/boot/autoconf.c
--- a/sys/arch/luna68k/stand/boot/autoconf.c    Fri Jan 03 00:33:06 2014 +0000
+++ b/sys/arch/luna68k/stand/boot/autoconf.c    Fri Jan 03 02:03:12 2014 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: autoconf.c,v 1.7 2013/01/22 15:48:40 tsutsui Exp $     */
+/*     $NetBSD: autoconf.c,v 1.8 2014/01/03 02:03:12 tsutsui Exp $     */
 
 /*
  * Copyright (c) 1992 OMRON Corporation.
@@ -470,9 +470,6 @@
        case SCSI:
                found = dr_type(hd->hp_driver, "scsi");
                break;
-       case VME:
-       case MISC:
-               break;
        }
        return(found);
 }
diff -r 7fcb4ed24ef3 -r 32f1ce9e8210 sys/arch/luna68k/stand/boot/device.h
--- a/sys/arch/luna68k/stand/boot/device.h      Fri Jan 03 00:33:06 2014 +0000
+++ b/sys/arch/luna68k/stand/boot/device.h      Fri Jan 03 02:03:12 2014 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: device.h,v 1.5 2013/01/14 12:28:11 tsutsui Exp $       */
+/*     $NetBSD: device.h,v 1.6 2014/01/03 02:03:12 tsutsui Exp $       */
 
 /*
  * Copyright (c) 1992 OMRON Corporation.
@@ -98,49 +98,25 @@
        int             hp_ipl;
 };
 
-struct devqueue {
-       struct  devqueue *dq_forw;
-       struct  devqueue *dq_back;
-       int     dq_ctlr;
-       int     dq_unit;
-       int     dq_slave;
-       struct  driver *dq_driver;
-};
-
 struct hp_hw {
        uint8_t *hw_addr;       /* physical address of registers */
        short   hw_type;        /* type (defined below) */
        char    *hw_name;       /* HP product name */
 };
 
-#define        MAX_CTLR        16      /* Totally arbitrary */
-#define        MAXSLAVES       8       /* Currently the HPIB limit */
+#define        MAX_CTLR        8       /* Totally arbitrary */
+#define        MAXSLAVES       8       /* Currently the SCSI limit */
 
 #define        WILD_CARD_CTLR  0
 
 /* A controller is a card which can have one or more slaves attached */
 #define        CONTROLLER      0x10
-#define        HPIB            0x16
-#define        SCSI            0x17
-#define        VME             0x18
-#define        FLINK           0x19
-
-/* Slaves are devices which attach to controllers, e.g. disks, tapes */
-#define        RD              0x2a
-#define        PPI             0x2b
-#define        CT              0x2c
+#define        SCSI            (CONTROLLER | 0)
 
-/* These are not controllers, but may have their own HPIB address */
-#define        BITMAP          1
-#define        NET             2
-#define        FPA             4
-#define        MISC            5
-#define        KEYBOARD        6
-#define        COMMDCA         7
-#define        COMMDCM         8
-#define        COMMDCL         9
-#define        PPORT           10
-#define        SIO             11
+/* Non-disk device types */
+#define        NET             1
+#define        KEYBOARD        2
+#define        SIO             3
 
 extern struct hp_ctlr  hp_cinit[];
 extern struct hp_device        hp_dinit[];
diff -r 7fcb4ed24ef3 -r 32f1ce9e8210 sys/arch/luna68k/stand/boot/ioconf.c
--- a/sys/arch/luna68k/stand/boot/ioconf.c      Fri Jan 03 00:33:06 2014 +0000
+++ b/sys/arch/luna68k/stand/boot/ioconf.c      Fri Jan 03 02:03:12 2014 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ioconf.c,v 1.3 2013/01/14 01:37:57 tsutsui Exp $       */
+/*     $NetBSD: ioconf.c,v 1.4 2014/01/03 02:03:12 tsutsui Exp $       */
 
 /*
  * Copyright (c) 1992 OMRON Corporation.
@@ -74,10 +74,6 @@
 #include <luna68k/stand/boot/samachdep.h>
 #include <luna68k/stand/boot/device.h>
 
-
-#define C (void *)
-#define D (struct driver *)
-
 extern struct driver scdriver;
 extern struct driver sddriver;
 extern struct driver ledriver;
@@ -85,20 +81,20 @@
 
 struct hp_ctlr hp_cinit[] = {
 /*     driver,         unit,   alive,  addr,   flags */
-       { &scdriver,    0,      0,      C 0x0,  0x0 },
-       { &scdriver,    1,      0,      C 0x0,  0x0 },
+       { &scdriver,    0,      0,      NULL,   0x0 },
+       { &scdriver,    1,      0,      NULL,   0x0 },
        {0},
 };
 
 struct hp_device hp_dinit[] = {
 /*driver,      cdriver,        unit,   ctlr,   slave,  addr,   dk,     flags*/
-{ &sddriver,   &scdriver,      0,      0,      6,      C 0x0,  1,      0x0 },
-{ &sddriver,   &scdriver,      1,      0,      5,      C 0x0,  1,      0x0 },
-{ &sddriver,   &scdriver,      2,      1,      6,      C 0x0,  1,      0x0 },
-{ &sddriver,   &scdriver,      3,      1,      5,      C 0x0,  1,      0x0 },
-{ &ledriver,   NULL,           0,      0,      0,      C 0x0,  0,      0x0 },
+{ &sddriver,   &scdriver,      0,      0,      6,      NULL,   1,      0x0 },
+{ &sddriver,   &scdriver,      1,      0,      5,      NULL,   1,      0x0 },
+{ &sddriver,   &scdriver,      2,      1,      6,      NULL,   1,      0x0 },
+{ &sddriver,   &scdriver,      3,      1,      5,      NULL,   1,      0x0 },
+{ &ledriver,   NULL,           0,      0,      0,      NULL,   0,      0x0 },
 #ifdef notyet
-{ &stdriver,   &scdriver,      0,      0,      4,      C 0x0,  0,      0x0 },
+{ &stdriver,   &scdriver,      0,      0,      4,      NULL,   0,      0x0 },
 #endif
 {0}
 };
diff -r 7fcb4ed24ef3 -r 32f1ce9e8210 sys/arch/luna68k/stand/boot/sd.c
--- a/sys/arch/luna68k/stand/boot/sd.c  Fri Jan 03 00:33:06 2014 +0000
+++ b/sys/arch/luna68k/stand/boot/sd.c  Fri Jan 03 02:03:12 2014 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: sd.c,v 1.5 2013/01/22 15:48:40 tsutsui Exp $   */
+/*     $NetBSD: sd.c,v 1.6 2014/01/03 02:03:12 tsutsui Exp $   */
 
 /*
  * Copyright (c) 1992 OMRON Corporation.
@@ -89,15 +89,12 @@
 
 struct sd_softc {
        struct  hp_device *sc_hd;
-       struct  devqueue sc_dq;
-       int     sc_format_pid;  /* process using "format" mode */
        short   sc_flags;
        short   sc_type;        /* drive type */
        short   sc_punit;       /* physical unit (scsi lun) */
        u_short sc_bshift;      /* convert device blocks to DEV_BSIZE blks */
        u_int   sc_blks;        /* number of blocks on device */
        int     sc_blksize;     /* device block size in bytes */
-       u_int   sc_wpms;        /* average xfer rate in 16 bit wds/sec. */
 };
 
 struct sd_devdata {
@@ -120,7 +117,6 @@
 
 #define        sdunit(x)       ((minor(x) >> 3) & 0x7)
 #define sdpart(x)      (minor(x) & 0x7)
-#define        sdpunit(x)      ((x) & 7)
 
 static struct scsi_inquiry inqbuf;
 static struct scsi_fmt_cdb inq = {
@@ -210,7 +206,6 @@
                        ++sc->sc_bshift;
                sc->sc_blks <<= sc->sc_bshift;
        }
-       sc->sc_wpms = 32 * (60 * DEV_BSIZE / 2);        /* XXX */
        return(inqbuf.type);
 }
 
@@ -228,7 +223,7 @@
               hd->hp_ctlr, hd->hp_slave);
 #endif
        sc->sc_hd = hd;
-       sc->sc_punit = sdpunit(hd->hp_flags);
+       sc->sc_punit = 0;       /* XXX no LUN support yet */
        sc->sc_type = sdident(sc, hd);
        if (sc->sc_type < 0)
                return(0);
diff -r 7fcb4ed24ef3 -r 32f1ce9e8210 sys/arch/luna68k/stand/boot/sio.c
--- a/sys/arch/luna68k/stand/boot/sio.c Fri Jan 03 00:33:06 2014 +0000
+++ b/sys/arch/luna68k/stand/boot/sio.c Fri Jan 03 02:03:12 2014 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: sio.c,v 1.3 2013/01/21 11:58:12 tsutsui Exp $  */
+/*     $NetBSD: sio.c,v 1.4 2014/01/03 02:03:12 tsutsui Exp $  */
 
 /*
  * Copyright (c) 1992 OMRON Corporation.
@@ -87,12 +87,6 @@
 
 int    sioconsole = -1;
 struct siodevice *sio_addr[2];
-int    cur_unit;
-
-
-#define        siounit(x)      ( x & 0xffff )
-#define isprint(c)      ((c >= 0x20) && (c < 0x7F) ? 1 : 0)
-
 
 void
 _siointr(void)
@@ -106,7 +100,9 @@
 void
 siointr(int unit)
 {
-/*     struct siodevice *sio = sio_addr[unit]; */
+#if 0
+       struct siodevice *sio = sio_addr[unit];
+#endif
        int rr0 = sioreg(REG(unit, RR0), 0);
        int rr1 = sioreg(REG(unit, RR1), 0);
 
@@ -114,8 +110,10 @@
                if (rr1 & RR1_FRAMING)
                        return;
 
-               if (rr1 & (RR1_PARITY | RR1_OVERRUN))
-                   sioreg(REG(unit, WR0), WR0_ERRRST); /* Channel-A Error Reset */
+               if (rr1 & (RR1_PARITY | RR1_OVERRUN)) {
+                       /* Channel-A Error Reset */
+                       sioreg(REG(unit, WR0), WR0_ERRRST);
+               }
 
                if (unit == 1) {
                        int c = kbd_decode(sio_addr[unit]->sio_data);
@@ -137,8 +135,8 @@
 void
 siocnprobe(struct consdev *cp)
 {
-       sio_addr[0] = (struct siodevice *) 0x51000000;
-       sio_addr[1] = (struct siodevice *) 0x51000004;
+       sio_addr[0] = (struct siodevice *)0x51000000;
+       sio_addr[1] = (struct siodevice *)0x51000004;
 
        /* make sure hardware exists */
        if (badaddr((short *)sio_addr[0])) {
@@ -149,14 +147,14 @@
        /* locate the major number */
 
        /* initialize required fields */
-       cp->cn_dev = cur_unit = 0;
+       cp->cn_dev = 0;
        cp->cn_pri = CN_NORMAL;
 }
 
 void
 siocninit(struct consdev *cp)
 {
-       int unit = siounit(cp->cn_dev);
+       int unit = cp->cn_dev;
 
        sioinit();
        sioconsole = unit;
@@ -165,36 +163,38 @@
 int
 siocngetc(dev_t dev)
 {
-       int c, unit = siounit(dev);
+       int c, unit = dev;
 
        if (RBUF_EMPTY(unit))
                return 0;
 
        POP_RBUF(unit, c);
 
-       return(c);
+       return c;
 }
 
 void
 siocnputc(dev_t dev, int c)
 {
-       int unit = siounit(dev);
+       int unit = dev;
        int s;
 
        if (sioconsole == -1) {
-               (void) sioinit();
+               (void)sioinit();
                sioconsole = unit;
        }
 
        s = splsio();
 
        /* wait for any pending transmission to finish */
-       while ((sioreg(REG(unit, RR0), 0) & RR0_TXEMPTY) == 0);
+       while ((sioreg(REG(unit, RR0), 0) & RR0_TXEMPTY) == 0)
+               continue;
 
        sio_addr[unit]->sio_data = (c & 0xFF);
 
        /* wait for any pending transmission to finish */
-       while ((sioreg(REG(unit, RR0), 0) & RR0_TXEMPTY) == 0);
+       while ((sioreg(REG(unit, RR0), 0) & RR0_TXEMPTY) == 0)
+               continue;



Home | Main Index | Thread Index | Old Index