socsvn commit: r257338 - soc2013/zcore/head/usr.sbin/bhyve

zcore at FreeBSD.org zcore at FreeBSD.org
Sat Sep 14 16:03:47 UTC 2013


Author: zcore
Date: Sat Sep 14 16:03:46 2013
New Revision: 257338
URL: http://svnweb.FreeBSD.org/socsvn/?view=rev&rev=257338

Log:
  correct ATAPI sectors

Modified:
  soc2013/zcore/head/usr.sbin/bhyve/pci_ahci.c

Modified: soc2013/zcore/head/usr.sbin/bhyve/pci_ahci.c
==============================================================================
--- soc2013/zcore/head/usr.sbin/bhyve/pci_ahci.c	Sat Sep 14 16:03:03 2013	(r257337)
+++ soc2013/zcore/head/usr.sbin/bhyve/pci_ahci.c	Sat Sep 14 16:03:46 2013	(r257338)
@@ -637,6 +637,7 @@
 	uint32_t *ptr = (uint32_t *)buf;
 
 	sectors = blockif_size(p->bctx) / blockif_sectsz(p->bctx);
+	sectors >>= 2;
 	ptr[0] = cpu_to_be32(sectors - 1);
 	ptr[1] = cpu_to_be32(2048);
 	cfis[4] = (cfis[4] & ~7) | ATA_I_CMD | ATA_I_IN;
@@ -694,6 +695,7 @@
 		*bp++ = 0xaa;
 		*bp++ = 0;
 		sectors = blockif_size(p->bctx) / blockif_sectsz(p->bctx);
+		sectors >>= 2;
 		if (msf) {
 			*bp++ = 0;
 			lba_to_msf(bp, sectors);
@@ -770,6 +772,7 @@
 		*bp++ = 0;
 		*bp++ = 0;
 		sectors = blockif_size(p->bctx) / blockif_sectsz(p->bctx);
+		sectors >>= 2;
 		if (msf) {
 			*bp++ = 0;
 			lba_to_msf(bp, sectors);


More information about the svn-soc-all mailing list