VirtualBox

Changeset 81867 in vbox


Ignore:
Timestamp:
Nov 15, 2019 11:50:16 AM (5 years ago)
Author:
vboxsync
Message:

DevATA: Some structure naming cleanup. bugref:9218

Location:
trunk/src/VBox/Devices
Files:
2 edited

Legend:

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

    r81862 r81867  
    193193 * The shared state of an ATA device.
    194194 */
    195 typedef struct ATADevState
     195typedef struct ATADEVSTATE
    196196{
    197197    /** The I/O buffer.
     
    381381    /** Padding the structure to a multiple of 4096 for better I/O buffer alignment. */
    382382    uint8_t                             abAlignment4[7 + 3544];
    383 } ATADEVSTATE, ATADevState;
     383} ATADEVSTATE;
    384384AssertCompileMemberAlignment(ATADEVSTATE, cTotalSectors, 8);
    385385AssertCompileMemberAlignment(ATADEVSTATE, StatATADMA, 8);
     
    509509{
    510510    /** The ATA/ATAPI interfaces of this controller. */
    511     ATADevState         aIfs[2];
     511    ATADEVSTATE         aIfs[2];
    512512
    513513    /** The base of the first I/O Port range. */
     
    591591AssertCompileMemberAlignment(ATACONTROLLER, AsyncIORequestLock, 8);
    592592AssertCompileSizeAlignment(ATACONTROLLER, 4096); /* To align the controllers, devices and I/O buffers on page boundaries. */
    593 
    594593/** Pointer to the shared state of an ATA controller. */
    595594typedef ATACONTROLLER *PATACONTROLLER;
     
    631630    CHIPSET_PIIX3 = 0,
    632631    /** PIIX4 chipset, must be 1 for saved state compatibility */
    633     CHIPSET_PIIX4 = 1,
     632    CHIPSET_PIIX4,
    634633    /** ICH6 chipset */
    635     CHIPSET_ICH6 = 2
     634    CHIPSET_ICH6,
     635    CHIPSET_32BIT_HACK=0x7fffffff
    636636} CHIPSET;
     637AssertCompileSize(CHIPSET, 4);
    637638
    638639/**
    639640 * The shared state of a ATA PCI device.
    640641 */
    641 typedef struct PCIATAState
     642typedef struct ATASTATE
    642643{
    643644    /** The controllers. */
    644645    ATACONTROLLER                   aCts[2];
    645     /** Flag indicating chipset being emulated (CHIPSET). */
    646     uint8_t                         u8Type;
     646    /** Flag indicating chipset being emulated. */
     647    CHIPSET                         enmChipset;
    647648    /** Explicit alignment padding. */
    648649    uint8_t                         abAlignment1[7];
    649650    /** PCI region \#4: Bus-master DMA I/O ports. */
    650651    IOMIOPORTHANDLE                 hIoPortsBmDma;
    651 } PCIATAState, ATASTATE;
     652} ATASTATE;
    652653/** Pointer to the shared state of an ATA PCI device. */
    653654typedef ATASTATE *PATASTATE;
     
    710711
    711712#ifdef IN_RING3
    712 DECLINLINE(void) ataSetStatusValue(PATACONTROLLER pCtl, ATADevState *s, uint8_t stat)
     713DECLINLINE(void) ataSetStatusValue(PATACONTROLLER pCtl, PATADEVSTATE s, uint8_t stat)
    713714{
    714715    /* Freeze status register contents while processing RESET. */
     
    722723
    723724
    724 DECLINLINE(void) ataSetStatus(PATACONTROLLER pCtl, ATADevState *s, uint8_t stat)
     725DECLINLINE(void) ataSetStatus(PATACONTROLLER pCtl, PATADEVSTATE s, uint8_t stat)
    725726{
    726727    /* Freeze status register contents while processing RESET. */
     
    733734
    734735
    735 DECLINLINE(void) ataUnsetStatus(PATACONTROLLER pCtl, ATADevState *s, uint8_t stat)
     736DECLINLINE(void) ataUnsetStatus(PATACONTROLLER pCtl, PATADEVSTATE s, uint8_t stat)
    736737{
    737738    /* Freeze status register contents while processing RESET. */
     
    10631064 * @param   fChainedTransfer    Whether this is a transfer that is part of the previous command/transfer.
    10641065 */
    1065 static void ataR3StartTransfer(PPDMDEVINS pDevIns, PATACONTROLLER pCtl, ATADevState *s,
     1066static void ataR3StartTransfer(PPDMDEVINS pDevIns, PATACONTROLLER pCtl, PATADEVSTATE s,
    10661067                               uint32_t cbTotalTransfer, uint8_t uTxDir, ATAFNBT iBeginTransfer,
    10671068                               ATAFNSS iSourceSink, bool fChainedTransfer)
     
    11161117 * @param   fResetDrive Whether to reset the drive or just abort a command.
    11171118 */
    1118 static void ataR3AbortCurrentCommand(PPDMDEVINS pDevIns, PATACONTROLLER pCtl, ATADevState *s, bool fResetDrive)
     1119static void ataR3AbortCurrentCommand(PPDMDEVINS pDevIns, PATACONTROLLER pCtl, PATADEVSTATE s, bool fResetDrive)
    11191120{
    11201121    ATARequest Req;
     
    11461147 * @param   s           Pointer to the ATA device state data.
    11471148 */
    1148 static void ataHCSetIRQ(PPDMDEVINS pDevIns, PATACONTROLLER pCtl, ATADevState *s)
     1149static void ataHCSetIRQ(PPDMDEVINS pDevIns, PATACONTROLLER pCtl, PATADEVSTATE s)
    11491150{
    11501151    if (!s->fIrqPending)
     
    11801181 * @param   s           Pointer to the ATA device state data.
    11811182 */
    1182 static void ataUnsetIRQ(PPDMDEVINS pDevIns, PATACONTROLLER pCtl, ATADevState *s)
     1183static void ataUnsetIRQ(PPDMDEVINS pDevIns, PATACONTROLLER pCtl, PATADEVSTATE s)
    11831184{
    11841185    if (s->fIrqPending)
     
    12021203#if defined(IN_RING0) || defined(IN_RING3)
    12031204
    1204 static void ataHCPIOTransferStart(PATACONTROLLER pCtl, ATADevState *s, uint32_t start, uint32_t size)
     1205static void ataHCPIOTransferStart(PATACONTROLLER pCtl, PATADEVSTATE s, uint32_t start, uint32_t size)
    12051206{
    12061207    Log2(("%s: LUN#%d start %d size %d\n", __FUNCTION__, s->iLUN, start, size));
     
    12121213
    12131214
    1214 static void ataHCPIOTransferStop(PPDMDEVINS pDevIns, PATACONTROLLER pCtl, ATADevState *s)
     1215static void ataHCPIOTransferStop(PPDMDEVINS pDevIns, PATACONTROLLER pCtl, PATADEVSTATE s)
    12151216{
    12161217    Log2(("%s: LUN#%d\n", __FUNCTION__, s->iLUN));
     
    12311232
    12321233
    1233 static void ataHCPIOTransferLimitATAPI(ATADevState *s)
     1234static void ataHCPIOTransferLimitATAPI(PATADEVSTATE s)
    12341235{
    12351236    uint32_t cbLimit, cbTransfer;
     
    12831284}
    12841285
    1285 static uint32_t ataR3GetNSectors(ATADevState *s)
     1286static uint32_t ataR3GetNSectors(PATADEVSTATE s)
    12861287{
    12871288    /* 0 means either 256 (LBA28) or 65536 (LBA48) sectors. */
     
    13451346#endif /* unused */
    13461347
    1347 static void ataR3CmdOK(PATACONTROLLER pCtl, ATADevState *s, uint8_t status)
     1348static void ataR3CmdOK(PATACONTROLLER pCtl, PATADEVSTATE s, uint8_t status)
    13481349{
    13491350    s->uATARegError = 0; /* Not needed by ATA spec, but cannot hurt. */
     
    13521353
    13531354
    1354 static void ataR3CmdError(PATACONTROLLER pCtl, ATADevState *s, uint8_t uErrorCode)
     1355static void ataR3CmdError(PATACONTROLLER pCtl, PATADEVSTATE s, uint8_t uErrorCode)
    13551356{
    13561357    Log(("%s: code=%#x\n", __FUNCTION__, uErrorCode));
     
    15851586
    15861587
    1587 static void ataR3SetSignature(ATADevState *s)
     1588static void ataR3SetSignature(PATADEVSTATE s)
    15881589{
    15891590    s->uATARegSelect &= 0xf0; /* clear head */
     
    16041605
    16051606
    1606 static uint64_t ataR3GetSector(ATADevState *s)
     1607static uint64_t ataR3GetSector(PATADEVSTATE s)
    16071608{
    16081609    uint64_t iLBA;
     
    16401641}
    16411642
    1642 static void ataR3SetSector(ATADevState *s, uint64_t iLBA)
     1643static void ataR3SetSector(PATADEVSTATE s, uint64_t iLBA)
    16431644{
    16441645    uint32_t cyl, r;
     
    17401741
    17411742
    1742 static int ataR3ReadSectors(PPDMDEVINS pDevIns, PATACONTROLLER pCtl, ATADevState *s, PATADEVSTATER3 pDevR3,
     1743static int ataR3ReadSectors(PPDMDEVINS pDevIns, PATACONTROLLER pCtl, PATADEVSTATE s, PATADEVSTATER3 pDevR3,
    17431744                            uint64_t u64Sector, void *pvBuf, uint32_t cSectors, bool *pfRedo)
    17441745{
     
    17711772
    17721773
    1773 static int ataR3WriteSectors(PPDMDEVINS pDevIns, PATACONTROLLER pCtl, ATADevState *s, PATADEVSTATER3 pDevR3,
     1774static int ataR3WriteSectors(PPDMDEVINS pDevIns, PATACONTROLLER pCtl, PATADEVSTATE s, PATADEVSTATER3 pDevR3,
    17741775                             uint64_t u64Sector, const void *pvBuf, uint32_t cSectors, bool *pfRedo)
    17751776{
     
    18131814 * Begin Transfer: READ/WRITE SECTORS
    18141815 */
    1815 static void ataR3ReadWriteSectorsBT(PATACONTROLLER pCtl, ATADevState *s)
     1816static void ataR3ReadWriteSectorsBT(PATACONTROLLER pCtl, PATADEVSTATE s)
    18161817{
    18171818    uint32_t const cbSector = RT_MAX(s->cbSector, 1);
     
    19121913
    19131914
    1914 static void atapiR3CmdOK(PATACONTROLLER pCtl, ATADevState *s)
     1915static void atapiR3CmdOK(PATACONTROLLER pCtl, PATADEVSTATE s)
    19151916{
    19161917    s->uATARegError = 0;
     
    19271928
    19281929
    1929 static void atapiR3CmdError(PATACONTROLLER pCtl, ATADevState *s, const uint8_t *pabATAPISense, size_t cbATAPISense)
     1930static void atapiR3CmdError(PATACONTROLLER pCtl, PATADEVSTATE s, const uint8_t *pabATAPISense, size_t cbATAPISense)
    19301931{
    19311932    Log(("%s: sense=%#x (%s) asc=%#x ascq=%#x (%s)\n", __FUNCTION__, pabATAPISense[2] & 0x0f, SCSISenseText(pabATAPISense[2] & 0x0f),
     
    19501951/** @todo deprecated function - doesn't provide enough info. Replace by direct
    19511952 * calls to atapiR3CmdError()  with full data. */
    1952 static void atapiR3CmdErrorSimple(PATACONTROLLER pCtl, ATADevState *s, uint8_t uATAPISenseKey, uint8_t uATAPIASC)
     1953static void atapiR3CmdErrorSimple(PATACONTROLLER pCtl, PATADEVSTATE s, uint8_t uATAPISenseKey, uint8_t uATAPIASC)
    19531954{
    19541955    uint8_t abATAPISense[ATAPI_SENSE_SIZE];
     
    19651966 * Begin Transfer: ATAPI command
    19661967 */
    1967 static void atapiR3CmdBT(PATACONTROLLER pCtl, ATADevState *s)
     1968static void atapiR3CmdBT(PATACONTROLLER pCtl, PATADEVSTATE s)
    19681969{
    19691970    s->fATAPITransfer = true;
     
    19791980 * Begin Transfer: ATAPI Passthrough command
    19801981 */
    1981 static void atapiR3PassthroughCmdBT(PATACONTROLLER pCtl, ATADevState *s)
     1982static void atapiR3PassthroughCmdBT(PATACONTROLLER pCtl, PATADEVSTATE s)
    19821983{
    19831984    atapiR3CmdBT(pCtl, s);
     
    21062107 * Sets the given media track type.
    21072108 */
    2108 static uint32_t ataR3MediumTypeSet(ATADevState *s, uint32_t MediaTrackType)
     2109static uint32_t ataR3MediumTypeSet(PATADEVSTATE s, uint32_t MediaTrackType)
    21092110{
    21102111    return ASMAtomicXchgU32(&s->MediaTrackType, MediaTrackType);
     
    25742575
    25752576
    2576 static bool atapiR3ReadSectors(PPDMDEVINS pDevIns, PATACONTROLLER pCtl, ATADevState *s,
     2577static bool atapiR3ReadSectors(PPDMDEVINS pDevIns, PATACONTROLLER pCtl, PATADEVSTATE s,
    25772578                               uint32_t iATAPILBA, uint32_t cSectors, uint32_t cbSector)
    25782579{
     
    27292730}
    27302731
    2731 static DECLCALLBACK(uint32_t) atapiR3GetConfigurationFillFeatureListProfiles(ATADevState *s, uint8_t *pbBuf, size_t cbBuf)
     2732static DECLCALLBACK(uint32_t) atapiR3GetConfigurationFillFeatureListProfiles(PATADEVSTATE s, uint8_t *pbBuf, size_t cbBuf)
    27322733{
    27332734    RT_NOREF(s);
     
    27482749}
    27492750
    2750 static DECLCALLBACK(uint32_t) atapiR3GetConfigurationFillFeatureCore(ATADevState *s, uint8_t *pbBuf, size_t cbBuf)
     2751static DECLCALLBACK(uint32_t) atapiR3GetConfigurationFillFeatureCore(PATADEVSTATE s, uint8_t *pbBuf, size_t cbBuf)
    27512752{
    27522753    RT_NOREF(s);
     
    27642765}
    27652766
    2766 static DECLCALLBACK(uint32_t) atapiR3GetConfigurationFillFeatureMorphing(ATADevState *s, uint8_t *pbBuf, size_t cbBuf)
     2767static DECLCALLBACK(uint32_t) atapiR3GetConfigurationFillFeatureMorphing(PATADEVSTATE s, uint8_t *pbBuf, size_t cbBuf)
    27672768{
    27682769    RT_NOREF(s);
     
    27792780}
    27802781
    2781 static DECLCALLBACK(uint32_t) atapiR3GetConfigurationFillFeatureRemovableMedium(ATADevState *s, uint8_t *pbBuf, size_t cbBuf)
     2782static DECLCALLBACK(uint32_t) atapiR3GetConfigurationFillFeatureRemovableMedium(PATADEVSTATE s, uint8_t *pbBuf, size_t cbBuf)
    27822783{
    27832784    RT_NOREF(s);
     
    27952796}
    27962797
    2797 static DECLCALLBACK(uint32_t) atapiR3GetConfigurationFillFeatureRandomReadable (ATADevState *s, uint8_t *pbBuf, size_t cbBuf)
     2798static DECLCALLBACK(uint32_t) atapiR3GetConfigurationFillFeatureRandomReadable (PATADEVSTATE s, uint8_t *pbBuf, size_t cbBuf)
    27982799{
    27992800    RT_NOREF(s);
     
    28122813}
    28132814
    2814 static DECLCALLBACK(uint32_t) atapiR3GetConfigurationFillFeatureCDRead(ATADevState *s, uint8_t *pbBuf, size_t cbBuf)
     2815static DECLCALLBACK(uint32_t) atapiR3GetConfigurationFillFeatureCDRead(PATADEVSTATE s, uint8_t *pbBuf, size_t cbBuf)
    28152816{
    28162817    RT_NOREF(s);
     
    28272828}
    28282829
    2829 static DECLCALLBACK(uint32_t) atapiR3GetConfigurationFillFeaturePowerManagement(ATADevState *s, uint8_t *pbBuf, size_t cbBuf)
     2830static DECLCALLBACK(uint32_t) atapiR3GetConfigurationFillFeaturePowerManagement(PATADEVSTATE s, uint8_t *pbBuf, size_t cbBuf)
    28302831{
    28312832    RT_NOREF(s);
     
    28402841}
    28412842
    2842 static DECLCALLBACK(uint32_t) atapiR3GetConfigurationFillFeatureTimeout(ATADevState *s, uint8_t *pbBuf, size_t cbBuf)
     2843static DECLCALLBACK(uint32_t) atapiR3GetConfigurationFillFeatureTimeout(PATADEVSTATE s, uint8_t *pbBuf, size_t cbBuf)
    28432844{
    28442845    RT_NOREF(s);
     
    28622863 * @param   cbBuf   Size of the buffer.
    28632864 */
    2864 typedef DECLCALLBACK(uint32_t) FNATAPIR3FEATUREFILL(ATADevState *s, uint8_t *pbBuf, size_t cbBuf);
     2865typedef DECLCALLBACK(uint32_t) FNATAPIR3FEATUREFILL(PATADEVSTATE s, uint8_t *pbBuf, size_t cbBuf);
    28652866/** Pointer to a feature fill callback. */
    28662867typedef FNATAPIR3FEATUREFILL *PFNATAPIR3FEATUREFILL;
     
    40024003 * from now on, regardless if there was a medium inserted or not.
    40034004 */
    4004 static void ataR3MediumRemoved(ATADevState *s)
     4005static void ataR3MediumRemoved(PATADEVSTATE s)
    40054006{
    40064007    ASMAtomicWriteU32(&s->MediaEventStatus, ATA_EVENT_STATUS_MEDIA_REMOVED);
     
    40134014 * removed" event first.
    40144015 */
    4015 static void ataR3MediumInserted(ATADevState *s)
     4016static void ataR3MediumInserted(PATADEVSTATE s)
    40164017{
    40174018    uint32_t OldStatus, NewStatus;
     
    40924093 * Begin Transfer: PACKET
    40934094 */
    4094 static void ataR3PacketBT(PATACONTROLLER pCtl, ATADevState *s)
     4095static void ataR3PacketBT(PATACONTROLLER pCtl, PATADEVSTATE s)
    40954096{
    40964097    s->cbElementaryTransfer = s->cbTotalTransfer;
     
    41024103
    41034104
    4104 static void ataR3ResetDevice(PPDMDEVINS pDevIns, PATACONTROLLER pCtl, ATADevState *s)
     4105static void ataR3ResetDevice(PPDMDEVINS pDevIns, PATACONTROLLER pCtl, PATADEVSTATE s)
    41054106{
    41064107    s->cMultSectors = ATA_MAX_MULT_SECTORS;
     
    41284129
    41294130
    4130 static void ataR3DeviceDiag(PATACONTROLLER pCtl, ATADevState *s)
     4131static void ataR3DeviceDiag(PATACONTROLLER pCtl, PATADEVSTATE s)
    41314132{
    41324133    ataR3SetSignature(s);
     
    46904691static VBOXSTRICTRC ataIOPortReadU8(PPDMDEVINS pDevIns, PATACONTROLLER pCtl, uint32_t addr, uint32_t *pu32)
    46914692{
    4692     ATADevState *s = &pCtl->aIfs[pCtl->iSelectedIf & ATA_SELECTED_IF_MASK];
     4693    PATADEVSTATE s = &pCtl->aIfs[pCtl->iSelectedIf & ATA_SELECTED_IF_MASK];
    46934694    uint32_t    val;
    46944695    bool        fHOB;
     
    48734874static uint32_t ataStatusRead(PATACONTROLLER pCtl, uint32_t uIoPortForLog)
    48744875{
    4875     ATADevState *s = &pCtl->aIfs[pCtl->iSelectedIf & ATA_SELECTED_IF_MASK];
     4876    PATADEVSTATE s = &pCtl->aIfs[pCtl->iSelectedIf & ATA_SELECTED_IF_MASK];
    48764877    uint32_t val;
    48774878    RT_NOREF(uIoPortForLog);
     
    50025003static void ataHCPIOTransfer(PPDMDEVINS pDevIns, PATACONTROLLER pCtl)
    50035004{
    5004     ATADevState *s;
     5005    PATADEVSTATE s;
    50055006
    50065007    s = &pCtl->aIfs[pCtl->iAIOIf & ATA_SELECTED_IF_MASK];
     
    50655066
    50665067
    5067 DECLINLINE(void) ataHCPIOTransferFinish(PPDMDEVINS pDevIns, PATACONTROLLER pCtl, ATADevState *s)
     5068DECLINLINE(void) ataHCPIOTransferFinish(PPDMDEVINS pDevIns, PATACONTROLLER pCtl, PATADEVSTATE s)
    50685069{
    50695070    /* Do not interfere with RESET processing if the PIO transfer finishes
     
    51255126 * @param   cbCopy      The number of bytes to copy, either 1, 2 or 4 bytes.
    51265127 */
    5127 DECL_NO_INLINE(static, void) ataCopyPioData124Slow(ATADevState *pIf, uint8_t *pbDst, const uint8_t *pbSrc,
     5128DECL_NO_INLINE(static, void) ataCopyPioData124Slow(PATADEVSTATE pIf, uint8_t *pbDst, const uint8_t *pbSrc,
    51285129                                                   uint32_t offStart, uint32_t cbCopy)
    51295130{
     
    51705171 * @param   cbCopy      The number of bytes to copy, either 1, 2 or 4 bytes.
    51715172 */
    5172 DECLINLINE(void) ataCopyPioData124(ATADevState *pIf, uint8_t *pbDst, const uint8_t *pbSrc, uint32_t offStart, uint32_t cbCopy)
     5173DECLINLINE(void) ataCopyPioData124(PATADEVSTATE pIf, uint8_t *pbDst, const uint8_t *pbSrc, uint32_t offStart, uint32_t cbCopy)
    51735174{
    51745175    /*
     
    52045205ataIOPortWrite1Data(PPDMDEVINS pDevIns, void *pvUser, RTIOPORT offPort, uint32_t u32, unsigned cb)
    52055206{
    5206     PCIATAState   *pThis = PDMDEVINS_2_DATA(pDevIns, PCIATAState *);
     5207    PATASTATE      pThis = PDMDEVINS_2_DATA(pDevIns, PATASTATE);
    52075208    PATACONTROLLER pCtl  = &pThis->aCts[(uintptr_t)pvUser % RT_ELEMENTS(pThis->aCts)];
    52085209    RT_NOREF(offPort);
     
    52155216    if (rc == VINF_SUCCESS)
    52165217    {
    5217         ATADevState *s = &pCtl->aIfs[pCtl->iSelectedIf & ATA_SELECTED_IF_MASK];
     5218        PATADEVSTATE s = &pCtl->aIfs[pCtl->iSelectedIf & ATA_SELECTED_IF_MASK];
    52185219        uint32_t const iIOBufferPIODataStart = RT_MIN(s->iIOBufferPIODataStart, sizeof(s->abIOBuffer));
    52195220        uint32_t const iIOBufferPIODataEnd   = RT_MIN(s->iIOBufferPIODataEnd,   sizeof(s->abIOBuffer));
     
    52755276ataIOPortRead1Data(PPDMDEVINS pDevIns, void *pvUser, RTIOPORT offPort, uint32_t *pu32, unsigned cb)
    52765277{
    5277     PCIATAState   *pThis = PDMDEVINS_2_DATA(pDevIns, PCIATAState *);
     5278    PATASTATE      pThis = PDMDEVINS_2_DATA(pDevIns, PATASTATE);
    52785279    PATACONTROLLER pCtl  = &pThis->aCts[(uintptr_t)pvUser % RT_ELEMENTS(pThis->aCts)];
    52795280    RT_NOREF(offPort);
     
    52915292    if (rc == VINF_SUCCESS)
    52925293    {
    5293         ATADevState *s = &pCtl->aIfs[pCtl->iSelectedIf & ATA_SELECTED_IF_MASK];
     5294        PATADEVSTATE s = &pCtl->aIfs[pCtl->iSelectedIf & ATA_SELECTED_IF_MASK];
    52945295
    52955296        if (s->iIOBufferPIODataStart < s->iIOBufferPIODataEnd)
     
    53635364ataIOPortReadStr1Data(PPDMDEVINS pDevIns, void *pvUser, RTIOPORT offPort, uint8_t *pbDst, uint32_t *pcTransfers, unsigned cb)
    53645365{
    5365     PCIATAState   *pThis = PDMDEVINS_2_DATA(pDevIns, PCIATAState *);
     5366    PATASTATE      pThis = PDMDEVINS_2_DATA(pDevIns, PATASTATE);
    53665367    PATACONTROLLER pCtl  = &pThis->aCts[(uintptr_t)pvUser % RT_ELEMENTS(pThis->aCts)];
    53675368    RT_NOREF(offPort);
     
    53775378        if (rc == VINF_SUCCESS)
    53785379        {
    5379             ATADevState *s = &pCtl->aIfs[pCtl->iSelectedIf & ATA_SELECTED_IF_MASK];
     5380            PATADEVSTATE s = &pCtl->aIfs[pCtl->iSelectedIf & ATA_SELECTED_IF_MASK];
    53805381
    53815382            uint32_t const offStart = s->iIOBufferPIODataStart;
     
    54545455ataIOPortWriteStr1Data(PPDMDEVINS pDevIns, void *pvUser, RTIOPORT offPort, uint8_t const *pbSrc, uint32_t *pcTransfers, unsigned cb)
    54555456{
    5456     PCIATAState   *pThis = PDMDEVINS_2_DATA(pDevIns, PCIATAState *);
     5457    PATASTATE      pThis = PDMDEVINS_2_DATA(pDevIns, PATASTATE);
    54575458    PATACONTROLLER pCtl  = &pThis->aCts[(uintptr_t)pvUser % RT_ELEMENTS(pThis->aCts)];
    54585459    RT_NOREF(offPort);
     
    54685469        if (rc == VINF_SUCCESS)
    54695470        {
    5470             ATADevState *s = &pCtl->aIfs[pCtl->iSelectedIf & ATA_SELECTED_IF_MASK];
     5471            PATADEVSTATE s = &pCtl->aIfs[pCtl->iSelectedIf & ATA_SELECTED_IF_MASK];
    54715472
    54725473            uint32_t const offStart = s->iIOBufferPIODataStart;
     
    55355536#ifdef IN_RING3
    55365537
    5537 static void ataR3DMATransferStop(ATADevState *s)
     5538static void ataR3DMATransferStop(PATADEVSTATE s)
    55385539{
    55395540    s->cbTotalTransfer = 0;
     
    63856386ataBMDMAIOPortRead(PPDMDEVINS pDevIns, void *pvUser, RTIOPORT offPort, uint32_t *pu32, unsigned cb)
    63866387{
    6387     PCIATAState   *pThis = PDMDEVINS_2_DATA(pDevIns, PCIATAState *);
     6388    PATASTATE      pThis = PDMDEVINS_2_DATA(pDevIns, PATASTATE);
    63886389    PATACONTROLLER pCtl  = &pThis->aCts[(offPort >> BM_DMA_CTL_IOPORTS_SHIFT) % RT_ELEMENTS(pThis->aCts)];
    63896390    RT_NOREF(pvUser);
     
    64206421ataBMDMAIOPortWrite(PPDMDEVINS pDevIns, void *pvUser, RTIOPORT offPort, uint32_t u32, unsigned cb)
    64216422{
    6422     PCIATAState   *pThis = PDMDEVINS_2_DATA(pDevIns, PCIATAState *);
     6423    PATASTATE      pThis = PDMDEVINS_2_DATA(pDevIns, PATASTATE);
    64236424    PATACONTROLLER pCtl  = &pThis->aCts[(offPort >> BM_DMA_CTL_IOPORTS_SHIFT) % RT_ELEMENTS(pThis->aCts)];
    64246425    RT_NOREF(pvUser);
     
    64566457#ifdef IN_RING3
    64576458
    6458 /* -=-=-=-=-=- PCIATAState::IBase  -=-=-=-=-=- */
     6459/* -=-=-=-=-=- ATASTATE::IBase  -=-=-=-=-=- */
    64596460
    64606461/**
     
    64706471
    64716472
    6472 /* -=-=-=-=-=- PCIATAState::ILeds  -=-=-=-=-=- */
     6473/* -=-=-=-=-=- ATASTATE::ILeds  -=-=-=-=-=- */
    64736474
    64746475/**
     
    65006501
    65016502
    6502 /* -=-=-=-=-=- ATADevState::IBase   -=-=-=-=-=- */
     6503/* -=-=-=-=-=- ATADEVSTATE::IBase   -=-=-=-=-=- */
    65036504
    65046505/**
     
    65156516
    65166517
    6517 /* -=-=-=-=-=- ATADevState::IPort  -=-=-=-=-=- */
     6518/* -=-=-=-=-=- ATADEVSTATE::IPort  -=-=-=-=-=- */
    65186519
    65196520/**
     
    65536554
    65546555#ifdef VBOX_STRICT
    6555     PCIATAState *pThis = PDMDEVINS_2_DATA(pDevIns, PCIATAState *);
    6556     PATACONTROLLER pCtl = &pThis->aCts[(uintptr_t)pvUser % RT_ELEMENTS(pThis->aCts)];
     6556    PATASTATE      pThis = PDMDEVINS_2_DATA(pDevIns, PATASTATE);
     6557    PATACONTROLLER pCtl  = &pThis->aCts[(uintptr_t)pvUser % RT_ELEMENTS(pThis->aCts)];
    65576558    Assert((uintptr_t)pvUser < 2);
    65586559    Assert(!pCtl->aIfs[0].fPresent && !pCtl->aIfs[1].fPresent);
     
    65766577
    65776578#ifdef VBOX_STRICT
    6578     PCIATAState   *pThis = PDMDEVINS_2_DATA(pDevIns, PCIATAState *);
     6579    PATASTATE      pThis = PDMDEVINS_2_DATA(pDevIns, PATASTATE);
    65796580    PATACONTROLLER pCtl = &pThis->aCts[(uintptr_t)pvUser % RT_ELEMENTS(pThis->aCts)];
    65806581    Assert((uintptr_t)pvUser < 2);
     
    66086609ataIOPortWrite1Other(PPDMDEVINS pDevIns, void *pvUser, RTIOPORT offPort, uint32_t u32, unsigned cb)
    66096610{
    6610     PCIATAState   *pThis = PDMDEVINS_2_DATA(pDevIns, PCIATAState *);
     6611    PATASTATE      pThis = PDMDEVINS_2_DATA(pDevIns, PATASTATE);
    66116612    uintptr_t      iCtl = (uintptr_t)pvUser % RT_ELEMENTS(pThis->aCts);
    66126613    PATACONTROLLER pCtl = &pThis->aCts[iCtl];
     
    66406641ataIOPortRead1Other(PPDMDEVINS pDevIns, void *pvUser, RTIOPORT offPort, uint32_t *pu32, unsigned cb)
    66416642{
    6642     PCIATAState   *pThis = PDMDEVINS_2_DATA(pDevIns, PCIATAState *);
     6643    PATASTATE      pThis = PDMDEVINS_2_DATA(pDevIns, PATASTATE);
    66436644    PATACONTROLLER pCtl = &pThis->aCts[(uintptr_t)pvUser % RT_ELEMENTS(pThis->aCts)];
    66446645
     
    66786679ataIOPortWrite2(PPDMDEVINS pDevIns, void *pvUser, RTIOPORT offPort, uint32_t u32, unsigned cb)
    66796680{
    6680     PCIATAState   *pThis = PDMDEVINS_2_DATA(pDevIns, PCIATAState *);
     6681    PATASTATE      pThis = PDMDEVINS_2_DATA(pDevIns, PATASTATE);
    66816682    PATACONTROLLER pCtl = &pThis->aCts[(uintptr_t)pvUser % RT_ELEMENTS(pThis->aCts)];
    66826683    int rc;
     
    67106711ataIOPortRead2(PPDMDEVINS pDevIns, void *pvUser, RTIOPORT offPort, uint32_t *pu32, unsigned cb)
    67116712{
    6712     PCIATAState   *pThis = PDMDEVINS_2_DATA(pDevIns, PCIATAState *);
     6713    PATASTATE      pThis = PDMDEVINS_2_DATA(pDevIns, PATASTATE);
    67136714    PATACONTROLLER pCtl = &pThis->aCts[(uintptr_t)pvUser % RT_ELEMENTS(pThis->aCts)];
    67146715    int            rc;
     
    70867087static DECLCALLBACK(int) ataR3SaveLoadPrep(PPDMDEVINS pDevIns, PSSMHANDLE pSSM)
    70877088{
     7089    PATASTATE pThis = PDMDEVINS_2_DATA(pDevIns, PATASTATE);
    70887090    RT_NOREF(pSSM);
    7089     PCIATAState *pThis = PDMDEVINS_2_DATA(pDevIns, PCIATAState *);
    70907091
    70917092    /* sanity - the suspend notification will wait on the async stuff. */
     
    71077108    RT_NOREF(uPass);
    71087109
    7109     pHlp->pfnSSMPutU8(pSSM, pThis->u8Type);
     7110    pHlp->pfnSSMPutU8(pSSM, (uint8_t)pThis->enmChipset);
    71107111    for (uint32_t i = 0; i < RT_ELEMENTS(pThis->aCts); i++)
    71117112    {
     
    72477248        rc = pHlp->pfnSSMGetU8(pSSM, &u8Type);
    72487249        AssertRCReturn(rc, rc);
    7249         if (u8Type != pThis->u8Type)
    7250             return pHlp->pfnSSMSetCfgError(pSSM, RT_SRC_POS, N_("Config mismatch: u8Type - saved=%u config=%u"), u8Type, pThis->u8Type);
     7250        if ((CHIPSET)u8Type != pThis->enmChipset)
     7251            return pHlp->pfnSSMSetCfgError(pSSM, RT_SRC_POS, N_("Config mismatch: enmChipset - saved=%u config=%u"), u8Type, pThis->enmChipset);
    72517252
    72527253        for (uint32_t i = 0; i < RT_ELEMENTS(pThis->aCts); i++)
     
    72987299
    72997300    /*
    7300      * Restore valid parts of the PCIATAState structure
     7301     * Restore valid parts of the ATASTATE structure
    73017302     */
    73027303    for (uint32_t i = 0; i < RT_ELEMENTS(pThis->aCts); i++)
     
    74317432    }
    74327433    if (uVersion <= ATA_SAVED_STATE_VERSION_VBOX_30)
    7433         pHlp->pfnSSMGetU8(pSSM, &pThis->u8Type);
     7434        PDMDEVHLP_SSM_GET_ENUM8_RET(pHlp, pSSM, pThis->enmChipset, CHIPSET);
    74347435
    74357436    rc = pHlp->pfnSSMGetU32(pSSM, &u32);
     
    75037504static DECLCALLBACK(bool) ataR3IsAsyncResetDone(PPDMDEVINS pDevIns)
    75047505{
    7505     PCIATAState *pThis = PDMDEVINS_2_DATA(pDevIns, PCIATAState *);
     7506    PATASTATE pThis = PDMDEVINS_2_DATA(pDevIns, PATASTATE);
    75067507
    75077508    if (!ataR3AllAsyncIOIsIdle(pDevIns))
     
    77937794    if (RT_FAILURE(rc))
    77947795        return rc;
    7795     pThis->u8Type = (uint8_t)enmChipset;
     7796    pThis->enmChipset = enmChipset;
    77967797
    77977798    /*
     
    79227923        for (uint32_t j = 0; j < RT_ELEMENTS(pThis->aCts[i].aIfs); j++)
    79237924        {
    7924             ATADevState *pIf = &pThis->aCts[i].aIfs[j];
     7925            PATADEVSTATE pIf = &pThis->aCts[i].aIfs[j];
    79257926            PDMDevHlpSTAMRegisterF(pDevIns, &pIf->StatATADMA,       STAMTYPE_COUNTER,    STAMVISIBILITY_ALWAYS, STAMUNIT_OCCURENCES,
    79267927                                   "Number of ATA DMA transfers.",              "/Devices/IDE%d/ATA%d/Unit%d/DMA", iInstance, i, j);
     
    82348235{
    82358236    PDMDEV_CHECK_VERSIONS_RETURN(pDevIns);
    8236     PCIATAState *pThis = PDMDEVINS_2_DATA(pDevIns, PCIATAState *);
     8237    PATASTATE pThis = PDMDEVINS_2_DATA(pDevIns, PATASTATE);
    82378238
    82388239    int rc = PDMDevHlpSetDeviceCritSect(pDevIns, PDMDevHlpCritSectGetNop(pDevIns));
  • trunk/src/VBox/Devices/testcase/tstDeviceStructSize.cpp

    r81782 r81867  
    329329    CHECK_MEMBER_ALIGNMENT(APICDEV, pDevInsR0, 8);
    330330
    331     CHECK_MEMBER_ALIGNMENT(ATADevState, cTotalSectors, 8);
    332     CHECK_MEMBER_ALIGNMENT(ATADevState, StatATADMA, 8);
    333     CHECK_MEMBER_ALIGNMENT(ATADevState, StatReads, 8);
     331    CHECK_MEMBER_ALIGNMENT(ATADEVSTATE, cTotalSectors, 8);
     332    CHECK_MEMBER_ALIGNMENT(ATADEVSTATE, StatATADMA, 8);
     333    CHECK_MEMBER_ALIGNMENT(ATADEVSTATE, StatReads, 8);
    334334    CHECK_MEMBER_ALIGNMENT(ATACONTROLLER, lock, 8);
    335335    CHECK_MEMBER_ALIGNMENT(ATACONTROLLER, StatAsyncOps, 8);
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