Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/sandpoint/stand/altboot The disk's unittag is not e...



details:   https://anonhg.NetBSD.org/src/rev/e7e38582a535
branches:  trunk
changeset: 810903:e7e38582a535
user:      phx <phx%NetBSD.org@localhost>
date:      Tue Sep 29 15:12:52 2015 +0000

description:
The disk's unittag is not equal to the channel, so we need an additional
unitchan entry to make lba_read() work in all cases.
The libsa-printf() does not seem to support 64-bit output, so cast the
block number to unsigned when printing an error message.

diffstat:

 sys/arch/sandpoint/stand/altboot/dsk.c     |  8 +++++---
 sys/arch/sandpoint/stand/altboot/globals.h |  3 ++-
 2 files changed, 7 insertions(+), 4 deletions(-)

diffs (53 lines):

diff -r dad3f3798f72 -r e7e38582a535 sys/arch/sandpoint/stand/altboot/dsk.c
--- a/sys/arch/sandpoint/stand/altboot/dsk.c    Tue Sep 29 14:31:22 2015 +0000
+++ b/sys/arch/sandpoint/stand/altboot/dsk.c    Tue Sep 29 15:12:52 2015 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: dsk.c,v 1.17 2014/08/05 17:55:20 joerg Exp $ */
+/* $NetBSD: dsk.c,v 1.18 2015/09/29 15:12:52 phx Exp $ */
 
 /*-
  * Copyright (c) 2010 The NetBSD Foundation, Inc.
@@ -125,6 +125,7 @@
                }
                d = &ldisk[ndrive];
                d->dvops = l;
+               d->unitchan = n;
                d->unittag = ndrive;
                snprintf(d->xname, sizeof(d->xname), "wd%d", d->unittag);
                set_xfermode(l, n);
@@ -404,7 +405,7 @@
        int error;
 
        l = d->dvops;
-       n = d->unittag;
+       n = d->unitchan;
        p = (uint16_t *)buf;
        chan = &l->chan[n];
        error = 0;
@@ -414,7 +415,8 @@
                (*issue)(chan, bno, rdcnt);
                for (k = 0; k < rdcnt; k++) {
                        if (spinwait_unbusy(l, n, 1000, &err) == 0) {
-                               printf("%s blk %lld %s\n", d->xname, bno, err);
+                               printf("%s blk %u %s\n",
+                                  d->xname, (unsigned)bno, err);
                                error = EIO;
                                break;
                        }
diff -r dad3f3798f72 -r e7e38582a535 sys/arch/sandpoint/stand/altboot/globals.h
--- a/sys/arch/sandpoint/stand/altboot/globals.h        Tue Sep 29 14:31:22 2015 +0000
+++ b/sys/arch/sandpoint/stand/altboot/globals.h        Tue Sep 29 15:12:52 2015 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: globals.h,v 1.19 2012/04/26 19:59:37 phx Exp $ */
+/* $NetBSD: globals.h,v 1.20 2015/09/29 15:12:52 phx Exp $ */
 
 #ifdef DEBUG
 #define        DPRINTF(x)      printf x
@@ -172,6 +172,7 @@
 struct disk {
        char xname[8];
        void *dvops;
+       unsigned unitchan;
        unsigned unittag;
        uint16_t ident[128];
        uint64_t nsect;



Home | Main Index | Thread Index | Old Index