Changeset 107856 in vbox for trunk/src/VBox/Devices
- Timestamp:
- Jan 20, 2025 1:12:06 PM (3 weeks ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Storage/DevATA.cpp
r107850 r107856 1441 1441 if (s->cTotalSectors <= (1 << 28) - 1) 1442 1442 { 1443 p[60] = RT_H2LE_U16( s->cTotalSectors);1444 p[61] = RT_H2LE_U16( s->cTotalSectors >> 16);1443 p[60] = RT_H2LE_U16(RT_LO_U16(s->cTotalSectors)); 1444 p[61] = RT_H2LE_U16(RT_HI_U16(s->cTotalSectors)); 1445 1445 } 1446 1446 else … … 1484 1484 if (s->cTotalSectors > (1 << 28) - 1) 1485 1485 { 1486 p[100] = RT_H2LE_U16( s->cTotalSectors);1487 p[101] = RT_H2LE_U16( s->cTotalSectors >> 16);1488 p[102] = RT_H2LE_U16( s->cTotalSectors >> 32);1489 p[103] = RT_H2LE_U16( s->cTotalSectors >> 48);1486 p[100] = RT_H2LE_U16(RT_LO_U16(RT_LO_U32(s->cTotalSectors))); 1487 p[101] = RT_H2LE_U16(RT_HI_U16(RT_LO_U32(s->cTotalSectors))); 1488 p[102] = RT_H2LE_U16(RT_LO_U16(RT_HI_U32(s->cTotalSectors))); 1489 p[103] = RT_H2LE_U16(RT_HI_U16(RT_HI_U32(s->cTotalSectors))); 1490 1490 } 1491 1491 … … 1495 1495 /* Enable reporting of logical sector size. */ 1496 1496 p[106] |= RT_H2LE_U16(RT_BIT(12) | RT_BIT(14)); 1497 p[117] = RT_H2LE_U16( cSectorSizeInWords);1498 p[118] = RT_H2LE_U16( cSectorSizeInWords >> 16);1497 p[117] = RT_H2LE_U16(RT_LO_U16(cSectorSizeInWords)); 1498 p[118] = RT_H2LE_U16(RT_HI_U16(cSectorSizeInWords)); 1499 1499 } 1500 1500 … … 1673 1673 { 1674 1674 /* LBA */ 1675 s->uATARegSelect = (s->uATARegSelect & 0xf0) | (iLBA >> 24);1675 s->uATARegSelect = RT_BYTE4(iLBA) | (s->uATARegSelect & 0xf0); 1676 1676 s->uATARegHCyl = RT_BYTE3(iLBA); 1677 1677 s->uATARegLCyl = RT_BYTE2(iLBA); … … 1873 1873 Assert(cSectors); 1874 1874 iLBA = s->iCurLBA; 1875 Log(("%s: %d sectors at LBA % d\n", __FUNCTION__, cSectors, iLBA));1875 Log(("%s: %d sectors at LBA %llu\n", __FUNCTION__, cSectors, iLBA)); 1876 1876 rc = ataR3ReadSectors(pDevIns, pCtl, s, pDevR3, iLBA, s->abIOBuffer, cSectors, &fRedo); 1877 1877 if (RT_SUCCESS(rc)) … … 1926 1926 Assert(cSectors); 1927 1927 iLBA = s->iCurLBA; 1928 Log(("%s: %d sectors at LBA % d\n", __FUNCTION__, cSectors, iLBA));1928 Log(("%s: %d sectors at LBA %llu\n", __FUNCTION__, cSectors, iLBA)); 1929 1929 rc = ataR3WriteSectors(pDevIns, pCtl, s, pDevR3, iLBA, s->abIOBuffer, cSectors, &fRedo); 1930 1930 if (RT_SUCCESS(rc)) … … 4680 4680 */ 4681 4681 4682 static VBOXSTRICTRC ataIOPortWriteU8(PPDMDEVINS pDevIns, PATACONTROLLER pCtl, uint32_t addr, uint 32_t val, uintptr_t iCtl)4682 static VBOXSTRICTRC ataIOPortWriteU8(PPDMDEVINS pDevIns, PATACONTROLLER pCtl, uint32_t addr, uint8_t val, uintptr_t iCtl) 4683 4683 { 4684 4684 RT_NOREF(iCtl); 4685 Log2(("%s: LUN#%d write addr=%#x val=%#0 4x\n", __FUNCTION__, pCtl->aIfs[pCtl->iSelectedIf & ATA_SELECTED_IF_MASK].iLUN, addr, val));4685 Log2(("%s: LUN#%d write addr=%#x val=%#02x\n", __FUNCTION__, pCtl->aIfs[pCtl->iSelectedIf & ATA_SELECTED_IF_MASK].iLUN, addr, val)); 4686 4686 addr &= 7; 4687 4687 switch (addr) … … 4965 4965 } 4966 4966 } 4967 Log2(("%s: LUN#%d addr=%#x val=%#0 4x\n", __FUNCTION__, s->iLUN, addr, val));4967 Log2(("%s: LUN#%d addr=%#x val=%#02x\n", __FUNCTION__, s->iLUN, addr, val)); 4968 4968 *pu32 = val; 4969 4969 return VINF_SUCCESS; … … 4989 4989 } 4990 4990 4991 static int ataControlWrite(PPDMDEVINS pDevIns, PATACONTROLLER pCtl, uint 32_t val, uint32_t uIoPortForLog)4991 static int ataControlWrite(PPDMDEVINS pDevIns, PATACONTROLLER pCtl, uint8_t val, uint32_t uIoPortForLog) 4992 4992 { 4993 4993 RT_NOREF(uIoPortForLog); … … 4997 4997 #endif /* !IN_RING3 */ 4998 4998 4999 Log2(("%s: LUN#%d write addr=%#x val=%#0 4x\n", __FUNCTION__, pCtl->aIfs[pCtl->iSelectedIf & ATA_SELECTED_IF_MASK].iLUN, uIoPortForLog, val));4999 Log2(("%s: LUN#%d write addr=%#x val=%#02x\n", __FUNCTION__, pCtl->aIfs[pCtl->iSelectedIf & ATA_SELECTED_IF_MASK].iLUN, uIoPortForLog, val)); 5000 5000 /* RESET is common for both drives attached to a controller. */ 5001 5001 if ( !(pCtl->aIfs[0].uATARegDevCtl & ATA_DEVCTL_RESET) … … 6740 6740 Log(("ataIOPortWrite1: suspect write to port %x val=%x size=%d\n", offPort, u32, cb)); 6741 6741 6742 rc = ataIOPortWriteU8(pDevIns, pCtl, offPort, u32, iCtl);6742 rc = ataIOPortWriteU8(pDevIns, pCtl, offPort, RT_BYTE1(u32), iCtl); 6743 6743 6744 6744 PDMDevHlpCritSectLeave(pDevIns, &pCtl->lock); … … 6805 6805 if (rc == VINF_SUCCESS) 6806 6806 { 6807 rc = ataControlWrite(pDevIns, pCtl, u32, offPort);6807 rc = ataControlWrite(pDevIns, pCtl, RT_BYTE1(u32), offPort); 6808 6808 PDMDevHlpCritSectLeave(pDevIns, &pCtl->lock); 6809 6809 }
Note:
See TracChangeset
for help on using the changeset viewer.