VirtualBox

Changeset 107856 in vbox for trunk/src/VBox/Devices


Ignore:
Timestamp:
Jan 20, 2025 1:12:06 PM (3 weeks ago)
Author:
vboxsync
Message:

DevATA: Fixed more Parfait warnings.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Devices/Storage/DevATA.cpp

    r107850 r107856  
    14411441    if (s->cTotalSectors <= (1 << 28) - 1)
    14421442    {
    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));
    14451445    }
    14461446    else
     
    14841484    if (s->cTotalSectors > (1 << 28) - 1)
    14851485    {
    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)));
    14901490    }
    14911491
     
    14951495        /* Enable reporting of logical sector size. */
    14961496        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));
    14991499    }
    15001500
     
    16731673        {
    16741674            /* LBA */
    1675             s->uATARegSelect = (s->uATARegSelect & 0xf0) | (iLBA >> 24);
     1675            s->uATARegSelect = RT_BYTE4(iLBA) | (s->uATARegSelect & 0xf0);
    16761676            s->uATARegHCyl   = RT_BYTE3(iLBA);
    16771677            s->uATARegLCyl   = RT_BYTE2(iLBA);
     
    18731873    Assert(cSectors);
    18741874    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));
    18761876    rc = ataR3ReadSectors(pDevIns, pCtl, s, pDevR3, iLBA, s->abIOBuffer, cSectors, &fRedo);
    18771877    if (RT_SUCCESS(rc))
     
    19261926    Assert(cSectors);
    19271927    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));
    19291929    rc = ataR3WriteSectors(pDevIns, pCtl, s, pDevR3, iLBA, s->abIOBuffer, cSectors, &fRedo);
    19301930    if (RT_SUCCESS(rc))
     
    46804680 */
    46814681
    4682 static VBOXSTRICTRC ataIOPortWriteU8(PPDMDEVINS pDevIns, PATACONTROLLER pCtl, uint32_t addr, uint32_t val, uintptr_t iCtl)
     4682static VBOXSTRICTRC ataIOPortWriteU8(PPDMDEVINS pDevIns, PATACONTROLLER pCtl, uint32_t addr, uint8_t val, uintptr_t iCtl)
    46834683{
    46844684    RT_NOREF(iCtl);
    4685     Log2(("%s: LUN#%d write addr=%#x val=%#04x\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));
    46864686    addr &= 7;
    46874687    switch (addr)
     
    49654965        }
    49664966    }
    4967     Log2(("%s: LUN#%d addr=%#x val=%#04x\n", __FUNCTION__, s->iLUN, addr, val));
     4967    Log2(("%s: LUN#%d addr=%#x val=%#02x\n", __FUNCTION__, s->iLUN, addr, val));
    49684968    *pu32 = val;
    49694969    return VINF_SUCCESS;
     
    49894989}
    49904990
    4991 static int ataControlWrite(PPDMDEVINS pDevIns, PATACONTROLLER pCtl, uint32_t val, uint32_t uIoPortForLog)
     4991static int ataControlWrite(PPDMDEVINS pDevIns, PATACONTROLLER pCtl, uint8_t val, uint32_t uIoPortForLog)
    49924992{
    49934993    RT_NOREF(uIoPortForLog);
     
    49974997#endif /* !IN_RING3 */
    49984998
    4999     Log2(("%s: LUN#%d write addr=%#x val=%#04x\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));
    50005000    /* RESET is common for both drives attached to a controller. */
    50015001    if (   !(pCtl->aIfs[0].uATARegDevCtl & ATA_DEVCTL_RESET)
     
    67406740            Log(("ataIOPortWrite1: suspect write to port %x val=%x size=%d\n", offPort, u32, cb));
    67416741
    6742         rc = ataIOPortWriteU8(pDevIns, pCtl, offPort, u32, iCtl);
     6742        rc = ataIOPortWriteU8(pDevIns, pCtl, offPort, RT_BYTE1(u32), iCtl);
    67436743
    67446744        PDMDevHlpCritSectLeave(pDevIns, &pCtl->lock);
     
    68056805        if (rc == VINF_SUCCESS)
    68066806        {
    6807             rc = ataControlWrite(pDevIns, pCtl, u32, offPort);
     6807            rc = ataControlWrite(pDevIns, pCtl, RT_BYTE1(u32), offPort);
    68086808            PDMDevHlpCritSectLeave(pDevIns, &pCtl->lock);
    68096809        }
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette