Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/i386/stand/lib Sprinkle daddr_t.



details:   https://anonhg.NetBSD.org/src/rev/f800e5c517d1
branches:  trunk
changeset: 760034:f800e5c517d1
user:      jakllsch <jakllsch%NetBSD.org@localhost>
date:      Fri Dec 24 20:36:51 2010 +0000

description:
Sprinkle daddr_t.
Adjust DISK_DEBUG printf formats to match.

diffstat:

 sys/arch/i386/stand/lib/biosdisk.c    |  14 +++++++-------
 sys/arch/i386/stand/lib/biosdisk.h    |   4 ++--
 sys/arch/i386/stand/lib/biosdisk_ll.c |  10 +++++-----
 3 files changed, 14 insertions(+), 14 deletions(-)

diffs (109 lines):

diff -r 6f0971ce4e7c -r f800e5c517d1 sys/arch/i386/stand/lib/biosdisk.c
--- a/sys/arch/i386/stand/lib/biosdisk.c        Fri Dec 24 19:22:37 2010 +0000
+++ b/sys/arch/i386/stand/lib/biosdisk.c        Fri Dec 24 20:36:51 2010 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: biosdisk.c,v 1.31 2010/06/25 15:35:08 tsutsui Exp $    */
+/*     $NetBSD: biosdisk.c,v 1.32 2010/12/24 20:36:51 jakllsch Exp $   */
 
 /*
  * Copyright (c) 1996, 1998
@@ -90,7 +90,7 @@
 
 struct biosdisk {
        struct biosdisk_ll ll;
-       int             boff;
+       daddr_t         boff;
        char            buf[BUFSIZE];
 };
 
@@ -164,7 +164,7 @@
 
 #ifndef NO_DISKLABEL
 static int
-check_label(struct biosdisk *d, int sector)
+check_label(struct biosdisk *d, daddr_t sector)
 {
        struct disklabel *lp;
 
@@ -178,7 +178,7 @@
        lp = (struct disklabel *) (d->buf + LABELOFFSET);
        if (lp->d_magic != DISKMAGIC || dkcksum(lp)) {
 #ifdef DISK_DEBUG
-               printf("warning: no disklabel in sector %u\n", sector);
+               printf("warning: no disklabel in sector %lld\n", sector);
 #endif
                return -1;
        }
@@ -234,7 +234,7 @@
                                continue;
                        sector = this_ext + mbr[i].mbrp_start;
 #ifdef DISK_DEBUG
-                       printf("ptn type %d in sector %u\n", typ, sector);
+                       printf("ptn type %d in sector %lld\n", typ, sector);
 #endif
                        if (typ == MBR_PTYPE_NETBSD) {
                                error = check_label(d, sector);
@@ -377,7 +377,7 @@
  */
 
 int
-biosdisk_findpartition(int biosdev, u_int sector)
+biosdisk_findpartition(int biosdev, daddr_t sector)
 {
 #ifdef NO_DISKLABEL
        return 0;
@@ -386,7 +386,7 @@
        int partition = 0;
        struct disklabel *lp;
 #ifdef DISK_DEBUG
-       printf("looking for partition device %x, sector %u\n", biosdev, sector);
+       printf("looking for partition device %x, sector %lld\n", biosdev, sector);
 #endif
 
        /* Look for netbsd partition that is the dos boot one */
diff -r 6f0971ce4e7c -r f800e5c517d1 sys/arch/i386/stand/lib/biosdisk.h
--- a/sys/arch/i386/stand/lib/biosdisk.h        Fri Dec 24 19:22:37 2010 +0000
+++ b/sys/arch/i386/stand/lib/biosdisk.h        Fri Dec 24 20:36:51 2010 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: biosdisk.h,v 1.7 2008/12/14 17:03:43 christos Exp $    */
+/*     $NetBSD: biosdisk.h,v 1.8 2010/12/24 20:36:51 jakllsch Exp $    */
 
 /*
  * Copyright (c) 1996
@@ -29,4 +29,4 @@
 int biosdisk_open(struct open_file *, ...);
 int biosdisk_close(struct open_file *);
 int biosdisk_ioctl(struct open_file *, u_long, void *);
-int biosdisk_findpartition(int, u_int);
+int biosdisk_findpartition(int, daddr_t);
diff -r 6f0971ce4e7c -r f800e5c517d1 sys/arch/i386/stand/lib/biosdisk_ll.c
--- a/sys/arch/i386/stand/lib/biosdisk_ll.c     Fri Dec 24 19:22:37 2010 +0000
+++ b/sys/arch/i386/stand/lib/biosdisk_ll.c     Fri Dec 24 20:36:51 2010 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: biosdisk_ll.c,v 1.26 2008/04/28 20:23:25 martin Exp $   */
+/*     $NetBSD: biosdisk_ll.c,v 1.27 2010/12/24 20:36:51 jakllsch Exp $         */
 
 /*-
  * Copyright (c) 2005 The NetBSD Foundation, Inc.
@@ -153,8 +153,8 @@
  * this buffer doesn't cross a 64K DMA boundary.
  */
 static int      ra_dev;
-static int      ra_end;
-static int      ra_first;
+static daddr_t  ra_end;
+static daddr_t  ra_first;
 
 /*
  * Because some older BIOSes have bugs in their int13 extensions, we
@@ -264,8 +264,8 @@
                        while ((nsec = do_read(d, dblk, maxsecs, trbuf)) < 0) {
 #ifdef DISK_DEBUG
                                if (!cold)
-                                       printf("read error dblk %d-%d\n", (int)dblk,
-                                              (int)(dblk + maxsecs - 1));
+                                       printf("read error dblk %lld-%lld\n",
+                                           dblk, (dblk + maxsecs - 1));
 #endif
                                if (--retries >= 0)
                                        continue;



Home | Main Index | Thread Index | Old Index