Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/x68k/dev make it compilable even if FDDEBUG was def...



details:   https://anonhg.NetBSD.org/src/rev/a19944ab5c6a
branches:  trunk
changeset: 555357:a19944ab5c6a
user:      isaki <isaki%NetBSD.org@localhost>
date:      Sat Nov 15 15:02:08 2003 +0000

description:
make it compilable even if FDDEBUG was defined.

diffstat:

 sys/arch/x68k/dev/fd.c |  27 +++++++++++++--------------
 1 files changed, 13 insertions(+), 14 deletions(-)

diffs (78 lines):

diff -r b419263be298 -r a19944ab5c6a sys/arch/x68k/dev/fd.c
--- a/sys/arch/x68k/dev/fd.c    Sat Nov 15 14:55:32 2003 +0000
+++ b/sys/arch/x68k/dev/fd.c    Sat Nov 15 15:02:08 2003 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: fd.c,v 1.59 2003/11/01 12:41:59 jdolecek Exp $ */
+/*     $NetBSD: fd.c,v 1.60 2003/11/15 15:02:08 isaki Exp $    */
 
 /*-
  * Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -71,7 +71,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: fd.c,v 1.59 2003/11/01 12:41:59 jdolecek Exp $");
+__KERNEL_RCSID(0, "$NetBSD: fd.c,v 1.60 2003/11/15 15:02:08 isaki Exp $");
 
 #include "rnd.h"
 #include "opt_ddb.h"
@@ -518,6 +518,7 @@
        int drive = fa->fa_drive;
        bus_space_tag_t iot = fdc->sc_iot;
        bus_space_handle_t ioh = fdc->sc_ioh;
+       int n = 0;
        int found = 0;
        int i;
 
@@ -541,18 +542,8 @@
        i = 25000;
        while (--i > 0) {
                if ((intio_get_sicilian_intr() & SICILIAN_STAT_FDC)) {
-                       int n;
-
                        out_fdc(iot, ioh, NE7CMD_SENSEI);
                        n = fdcresult(fdc);
-
-                       if (n == 2) {
-                               if ((fdc->sc_status[0] & 0xf0) == 0x20)
-                                       found = 1;
-                               else if ((fdc->sc_status[0] & 0xf0) == 0xc0)
-                                       goto retry;
-                       }
-
                        break;
                }
                DELAY(100);
@@ -568,6 +559,13 @@
        }
 #endif
 
+       if (n == 2) {
+               if ((fdc->sc_status[0] & 0xf0) == 0x20)
+                       found = 1;
+               else if ((fdc->sc_status[0] & 0xf0) == 0xc0)
+                       goto retry;
+       }
+
        /* turn off motor */
        bus_space_write_1(fdc->sc_iot, fdc->sc_ioh,
                          fdctl, (type->rate << 4)| drive);
@@ -660,7 +658,8 @@
            (fd = fd_cd.cd_devs[unit]) == 0 ||
            bp->b_blkno < 0 ||
            (bp->b_bcount % FDC_BSIZE) != 0) {
-               DPRINTF(("fdstrategy: unit=%d, blkno=%d, bcount=%ld\n", unit,
+               DPRINTF(("fdstrategy: unit=%d, blkno=%" PRId64 ", "
+                        "bcount=%ld\n", unit,
                         bp->b_blkno, bp->b_bcount));
                bp->b_error = EINVAL;
                goto bad;
@@ -694,7 +693,7 @@
        bp->b_cylinder = bp->b_blkno / (FDC_BSIZE / DEV_BSIZE)
                / (fd->sc_type->seccyl * (1 << (fd->sc_type->secsize - 2)));
 
-       DPRINTF(("fdstrategy: %s b_blkno %d b_bcount %ld cylin %ld\n",
+       DPRINTF(("fdstrategy: %s b_blkno %" PRId64 " b_bcount %ld cylin %ld\n",
                 bp->b_flags & B_READ ? "read" : "write",
                 bp->b_blkno, bp->b_bcount, bp->b_cylinder));
        /* Queue transfer on drive, activate drive and controller if idle. */



Home | Main Index | Thread Index | Old Index