diff options
author | kato <kato@FreeBSD.org> | 2000-02-01 08:57:21 +0000 |
---|---|---|
committer | kato <kato@FreeBSD.org> | 2000-02-01 08:57:21 +0000 |
commit | 60a186b3e86afb8409f88f602aa33132078729b9 (patch) | |
tree | e6758457dd8490b0856b50878b2d41eec59ab13e | |
parent | 30a54f99921be7af07b193c181bd87cdf812a121 (diff) | |
download | FreeBSD-src-60a186b3e86afb8409f88f602aa33132078729b9.zip FreeBSD-src-60a186b3e86afb8409f88f602aa33132078729b9.tar.gz |
Synced with sys/i386/isa/wd.c revision 1.219.
Approved by: jkh
-rw-r--r-- | sys/pc98/pc98/wd.c | 44 |
1 files changed, 22 insertions, 22 deletions
diff --git a/sys/pc98/pc98/wd.c b/sys/pc98/pc98/wd.c index 83aa52a..12d2843 100644 --- a/sys/pc98/pc98/wd.c +++ b/sys/pc98/pc98/wd.c @@ -834,8 +834,7 @@ wdstart(int ctrlr) sector = (blknum >> 0) & 0xff; cylin = (blknum >> 8) & 0xffff; head = ((blknum >> 24) & 0xf) | WDSD_LBA; - } - else { + } else { cylin = blknum / secpercyl; head = (blknum % secpercyl) / secpertrk; sector = blknum % secpertrk; @@ -2062,7 +2061,7 @@ wddump(dev_t dev) long num; /* number of sectors to write */ int lunit, part; long blkoff, blknum; - long blkchk, blkcnt, blknext; + long blkcnt, blknext; u_long ds_offset; u_long nblocks; static int wddoingadump = 0; @@ -2099,8 +2098,8 @@ wddump(dev_t dev) blkoff += ds_offset; #if 0 - pg("part %x, nblocks %d, dumplo %d num %d\n", - part, nblocks, dumplo, num); + printf("part %d, nblocks %lu, dumplo %ld num %ld\n", + part, nblocks, dumplo, num); #endif /* Check transfer bounds against partition size. */ @@ -2133,29 +2132,30 @@ wddump(dev_t dev) blkcnt = num; if (blkcnt > MAXTRANSFER) blkcnt = MAXTRANSFER; - /* Keep transfer within current cylinder. */ - if ((blknum + blkcnt - 1) / secpercyl != blknum / secpercyl) - blkcnt = secpercyl - (blknum % secpercyl); + if ((du->dk_flags & DKFL_LBA) == 0) { + /* XXX keep transfer within current cylinder. */ + if ((blknum + blkcnt - 1) / secpercyl != + blknum / secpercyl) + blkcnt = secpercyl - (blknum % secpercyl); + } blknext = blknum + blkcnt; - /* - * See if one of the sectors is in the bad sector list - * (if we have one). If the first sector is bad, then - * reduce the transfer to this one bad sector; if another - * sector is bad, then reduce reduce the transfer to - * avoid any bad sectors. - */ -out: - /* Compute disk address. */ - cylin = blknum / secpercyl; - head = (blknum % secpercyl) / secpertrk; - sector = blknum % secpertrk; + if (du->dk_flags & DKFL_LBA) { + sector = (blknum >> 0) & 0xff; + cylin = (blknum >> 8) & 0xffff; + head = ((blknum >> 24) & 0xf) | WDSD_LBA; + } else { + cylin = blknum / secpercyl; + head = (blknum % secpercyl) / secpertrk; + sector = blknum % secpertrk; + } #if 0 /* Let's just talk about this first... */ - pg("cylin l%d head %ld sector %ld addr 0x%x count %ld", - cylin, head, sector, addr, blkcnt); + printf("cylin %ld head %ld sector %ld addr %p count %ld\n", + cylin, head, sector, addr, blkcnt); + cngetc(); #endif /* Do the write. */ |