X-Git-Url: https://gitweb.dragonflybsd.org/dragonfly.git/blobdiff_plain/d31d6d83b77479ab4a835214231c16f30b9ea28f..5fc9dc6d407adf96b8a1f7d4b6e7b5f638645a23:/sys/boot/pc32/libi386/biosdisk.c diff --git a/sys/boot/pc32/libi386/biosdisk.c b/sys/boot/pc32/libi386/biosdisk.c index 177be531a2..c3b1271b36 100644 --- a/sys/boot/pc32/libi386/biosdisk.c +++ b/sys/boot/pc32/libi386/biosdisk.c @@ -382,6 +382,7 @@ print_partition(u_int8_t fstype, unsigned long long offset, if ((fstype == FS_SWAP) || (fstype == FS_VINUM) || (fstype == FS_HAMMER) || + (fstype == FS_HAMMER2) || (fstype == FS_BSDFFS) || (fstype == FS_ZFS) || (fstype == FS_JFS2) || @@ -398,6 +399,7 @@ print_partition(u_int8_t fstype, unsigned long long offset, (fstype == FS_SWAP) ? "swap" : (fstype == FS_VINUM) ? "vinum" : (fstype == FS_HAMMER) ? "HAMMER" : + (fstype == FS_HAMMER2) ? "HAMMER2" : (fstype == FS_JFS2) ? "JFS2" : (fstype == FS_ZFS) ? "ZFS" : (fstype == FS_BSDFFS) ? "FFS" : @@ -414,6 +416,7 @@ print_partition(u_int8_t fstype, unsigned long long offset, (fstype == FS_SWAP) ? "swap" : (fstype == FS_VINUM) ? "vinum" : (fstype == FS_HAMMER) ? "HAMMER" : + (fstype == FS_HAMMER2) ? "HAMMER2" : (fstype == FS_JFS2) ? "JFS2" : (fstype == FS_ZFS) ? "ZFS" : (fstype == FS_BSDFFS) ? "FFS" : @@ -1012,24 +1015,32 @@ bd_read(struct open_disk *od, daddr_t dblk, int blks, caddr_t dest) resid = blks; p = dest; - /* Decide whether we have to bounce */ + /* + * Decide whether we have to bounce. + * + * We have to bounce if the destination buffer is not segment addressable + * or if it crosses a 64KB boundary. + */ if ((od->od_unit < 0x80) && - ((VTOP(dest) >> 16) != (VTOP(dest + blks * BIOSDISK_SECSIZE) >> 16))) { + (VTOP(dest + blks * BIOSDISK_SECSIZE) >= 16384 * 1024 || + ((VTOP(dest) >> 16) != (VTOP(dest + blks * BIOSDISK_SECSIZE) >> 16))) + ) { /* - * There is a 64k physical boundary somewhere in the destination buffer, so we have - * to arrange a suitable bounce buffer. Allocate a buffer twice as large as we - * need to. Use the bottom half unless there is a break there, in which case we - * use the top half. + * There is a 64k physical boundary somewhere in the destination + * buffer, so we have to arrange a suitable bounce buffer. Allocate + * a buffer twice as large as we need to. Use the bottom half unless + * there is a break there, in which case we use the top half. */ x = min(FLOPPY_BOUNCEBUF, (unsigned)blks); bbuf = malloc(x * 2 * BIOSDISK_SECSIZE); - if (((u_int32_t)VTOP(bbuf) & 0xffff0000) == ((u_int32_t)VTOP(bbuf + x * BIOSDISK_SECSIZE) & 0xffff0000)) { + if (((u_int32_t)VTOP(bbuf) & 0xffff0000) == + ((u_int32_t)VTOP(bbuf + x * BIOSDISK_SECSIZE) & 0xffff0000)) { breg = bbuf; } else { breg = bbuf + x * BIOSDISK_SECSIZE; } - maxfer = x; /* limit transfers to bounce region size */ + maxfer = x; /* limit transfers to bounce region size */ } else { breg = bbuf = NULL; maxfer = 0; @@ -1114,7 +1125,7 @@ bd_read(struct open_disk *od, daddr_t dblk, int blks, caddr_t dest) } } - DEBUG("%d sectors from %d/%d/%d to %p (0x%x) %s", x, cyl, hd, sec - 1, p, VTOP(p), result ? "failed" : "ok"); + DEBUG("%u sectors from %u/%u/%d to %p (0x%x) %s", x, cyl, hd, sec - 1, p, VTOP(p), result ? "failed" : "ok"); /* BUG here, cannot use v86 in printf because putchar uses it too */ DEBUG("ax = 0x%04x cx = 0x%04x dx = 0x%04x status 0x%x", 0x200 | x, ((cyl & 0xff) << 8) | ((cyl & 0x300) >> 2) | sec, (hd << 8) | od->od_unit, (v86.eax >> 8) & 0xff); @@ -1156,10 +1167,10 @@ bd_write(struct open_disk *od, daddr_t dblk, int blks, caddr_t dest) ((VTOP(dest) >> 16) != (VTOP(dest + blks * BIOSDISK_SECSIZE) >> 16))) { /* - * There is a 64k physical boundary somewhere in the destination buffer, so we have - * to arrange a suitable bounce buffer. Allocate a buffer twice as large as we - * need to. Use the bottom half unless there is a break there, in which case we - * use the top half. + * There is a 64k physical boundary somewhere in the destination + * buffer, so we have to arrange a suitable bounce buffer. Allocate + * a buffer twice as large as we need to. Use the bottom half + * unless there is a break there, in which case we use the top half. */ x = min(FLOPPY_BOUNCEBUF, (unsigned)blks); @@ -1265,7 +1276,7 @@ bd_write(struct open_disk *od, daddr_t dblk, int blks, caddr_t dest) } } - DEBUG("%d sectors from %d/%d/%d to %p (0x%x) %s", x, cyl, hd, sec - 1, p, VTOP(p), result ? "failed" : "ok"); + DEBUG("%u sectors from %u/%u/%d to %p (0x%x) %s", x, cyl, hd, sec - 1, p, VTOP(p), result ? "failed" : "ok"); /* BUG here, cannot use v86 in printf because putchar uses it too */ DEBUG("ax = 0x%04x cx = 0x%04x dx = 0x%04x status 0x%x", 0x200 | x, ((cyl & 0xff) << 8) | ((cyl & 0x300) >> 2) | sec, (hd << 8) | od->od_unit, (v86.eax >> 8) & 0xff);