VirtualBox

Changeset 81136 in vbox for trunk/src/VBox


Ignore:
Timestamp:
Oct 8, 2019 8:26:49 AM (5 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
133769
Message:

IOM,RTC,PCI: Make the port parameter in the I/O port callbacks relative to the start of the mapping rather than absolute. For absolute port numbers, use the IOM_IOPORT_F_ABS flag. bugref:9218

Location:
trunk/src/VBox
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Devices/Bus/DevPCI.cpp

    r81048 r81136  
    806806 */
    807807static DECLCALLBACK(VBOXSTRICTRC)
    808 pciIOPortAddressWrite(PPDMDEVINS pDevIns, void *pvUser, RTIOPORT uPort, uint32_t u32, unsigned cb)
    809 {
    810     LogFunc(("uPort=%#x u32=%#x cb=%d\n", uPort, u32, cb));
    811     RT_NOREF2(uPort, pvUser);
     808pciIOPortAddressWrite(PPDMDEVINS pDevIns, void *pvUser, RTIOPORT offPort, uint32_t u32, unsigned cb)
     809{
     810    LogFunc(("offPort=%#x u32=%#x cb=%d\n", offPort, u32, cb));
     811    Assert(offPort == 0); RT_NOREF2(offPort, pvUser);
    812812    if (cb == 4)
    813813    {
     
    827827 */
    828828static DECLCALLBACK(VBOXSTRICTRC)
    829 pciIOPortAddressRead(PPDMDEVINS pDevIns, void *pvUser, RTIOPORT uPort, uint32_t *pu32, unsigned cb)
    830 {
    831     RT_NOREF2(uPort, pvUser);
     829pciIOPortAddressRead(PPDMDEVINS pDevIns, void *pvUser, RTIOPORT offPort, uint32_t *pu32, unsigned cb)
     830{
     831    Assert(offPort == 0); RT_NOREF2(offPort, pvUser);
    832832    if (cb == 4)
    833833    {
     
    836836        *pu32 = pThis->uConfigReg;
    837837        PCI_UNLOCK(pDevIns);
    838         LogFunc(("uPort=%#x cb=%d -> %#x\n", uPort, cb, *pu32));
     838        LogFunc(("offPort=%#x cb=%d -> %#x\n", offPort, cb, *pu32));
    839839        return VINF_SUCCESS;
    840840    }
    841841    /* else: 440FX does "pass through to the bus" for other writes, what ever that means.
    842842     * Linux probes for cmd640 using byte writes/reads during ide init. We'll just ignore it. */
    843     LogFunc(("uPort=%#x cb=%d VERR_IOM_IOPORT_UNUSED\n", uPort, cb));
     843    LogFunc(("offPort=%#x cb=%d VERR_IOM_IOPORT_UNUSED\n", offPort, cb));
    844844    return VERR_IOM_IOPORT_UNUSED;
    845845}
     
    850850 */
    851851static DECLCALLBACK(VBOXSTRICTRC)
    852 pciIOPortDataWrite(PPDMDEVINS pDevIns, void *pvUser, RTIOPORT uPort, uint32_t u32, unsigned cb)
    853 {
    854     LogFunc(("uPort=%#x u32=%#x cb=%d\n", uPort, u32, cb));
    855     NOREF(pvUser);
     852pciIOPortDataWrite(PPDMDEVINS pDevIns, void *pvUser, RTIOPORT offPort, uint32_t u32, unsigned cb)
     853{
     854    LogFunc(("offPort=%#x u32=%#x cb=%d\n", offPort, u32, cb));
     855    Assert(offPort < 4); NOREF(pvUser);
    856856    VBOXSTRICTRC rcStrict = VINF_SUCCESS;
    857     if (!(uPort % cb))
     857    if (!(offPort % cb))
    858858    {
    859859        PCI_LOCK(pDevIns, VINF_IOM_R3_IOPORT_WRITE);
    860         rcStrict = pci_data_write(pDevIns, PDMINS_2_DATA(pDevIns, PDEVPCIROOT), uPort, u32, cb);
     860        rcStrict = pci_data_write(pDevIns, PDMINS_2_DATA(pDevIns, PDEVPCIROOT), offPort, u32, cb);
    861861        PCI_UNLOCK(pDevIns);
    862862    }
    863863    else
    864         AssertMsgFailed(("Write to port %#x u32=%#x cb=%d\n", uPort, u32, cb));
     864        AssertMsgFailed(("Write to port %#x u32=%#x cb=%d\n", offPort, u32, cb));
    865865    return rcStrict;
    866866}
     
    871871 */
    872872static DECLCALLBACK(VBOXSTRICTRC)
    873 pciIOPortDataRead(PPDMDEVINS pDevIns, void *pvUser, RTIOPORT uPort, uint32_t *pu32, unsigned cb)
    874 {
    875     NOREF(pvUser);
    876     if (!(uPort % cb))
     873pciIOPortDataRead(PPDMDEVINS pDevIns, void *pvUser, RTIOPORT offPort, uint32_t *pu32, unsigned cb)
     874{
     875    Assert(offPort < 4); NOREF(pvUser);
     876    if (!(offPort % cb))
    877877    {
    878878        PCI_LOCK(pDevIns, VINF_IOM_R3_IOPORT_READ);
    879         VBOXSTRICTRC rcStrict = pci_data_read(PDMINS_2_DATA(pDevIns, PDEVPCIROOT), uPort, cb, pu32);
     879        VBOXSTRICTRC rcStrict = pci_data_read(PDMINS_2_DATA(pDevIns, PDEVPCIROOT), offPort, cb, pu32);
    880880        PCI_UNLOCK(pDevIns);
    881         LogFunc(("uPort=%#x cb=%#x -> %#x (%Rrc)\n", uPort, cb, *pu32, VBOXSTRICTRC_VAL(rcStrict)));
     881        LogFunc(("offPort=%#x cb=%#x -> %#x (%Rrc)\n", offPort, cb, *pu32, VBOXSTRICTRC_VAL(rcStrict)));
    882882        return rcStrict;
    883883    }
    884     AssertMsgFailed(("Read from port %#x cb=%d\n", uPort, cb));
     884    AssertMsgFailed(("Read from port %#x cb=%d\n", offPort, cb));
    885885    return VERR_IOM_IOPORT_UNUSED;
    886886}
     
    892892 */
    893893static DECLCALLBACK(VBOXSTRICTRC)
    894 pciR3IOPortMagicPCIWrite(PPDMDEVINS pDevIns, void *pvUser, RTIOPORT uPort, uint32_t u32, unsigned cb)
    895 {
    896     RT_NOREF2(pvUser, uPort);
    897     LogFunc(("uPort=%#x u32=%#x cb=%d\n", uPort, u32, cb));
     894pciR3IOPortMagicPCIWrite(PPDMDEVINS pDevIns, void *pvUser, RTIOPORT offPort, uint32_t u32, unsigned cb)
     895{
     896    Assert(offPort == 0); RT_NOREF2(pvUser, offPort);
     897    LogFunc(("offPort=%#x u32=%#x cb=%d\n", offPort, u32, cb));
    898898    if (cb == 4)
    899899    {
     
    912912 */
    913913static DECLCALLBACK(VBOXSTRICTRC)
    914 pciR3IOPortMagicPCIRead(PPDMDEVINS pDevIns, void *pvUser, RTIOPORT uPort, uint32_t *pu32, unsigned cb)
    915 {
    916     RT_NOREF5(pDevIns, pvUser, uPort, pu32, cb);
    917     LogFunc(("uPort=%#x cb=%d VERR_IOM_IOPORT_UNUSED\n", uPort, cb));
     914pciR3IOPortMagicPCIRead(PPDMDEVINS pDevIns, void *pvUser, RTIOPORT offPort, uint32_t *pu32, unsigned cb)
     915{
     916    Assert(offPort == 0); RT_NOREF5(pDevIns, pvUser, offPort, pu32, cb);
     917    LogFunc(("offPort=%#x cb=%d VERR_IOM_IOPORT_UNUSED\n", offPort, cb));
    918918    return VERR_IOM_IOPORT_UNUSED;
    919919}
  • trunk/src/VBox/Devices/Bus/DevPciIch9.cpp

    r81051 r81136  
    215215}
    216216
    217 
    218217#ifdef IN_RING3
    219218
     
    223222 */
    224223static DECLCALLBACK(VBOXSTRICTRC)
    225 ich9pciR3IOPortMagicPCIWrite(PPDMDEVINS pDevIns, void *pvUser, RTIOPORT uPort, uint32_t u32, unsigned cb)
    226 {
    227     RT_NOREF2(pvUser, uPort);
    228     LogFlowFunc(("Port=%#x u32=%#x cb=%d\n", uPort, u32, cb));
     224ich9pciR3IOPortMagicPCIWrite(PPDMDEVINS pDevIns, void *pvUser, RTIOPORT offPort, uint32_t u32, unsigned cb)
     225{
     226    Assert(offPort == 0); RT_NOREF2(pvUser, offPort);
     227    LogFlowFunc(("offPort=%#x u32=%#x cb=%d\n", offPort, u32, cb));
    229228    if (cb == 4)
    230229    {
     
    245244 */
    246245static DECLCALLBACK(VBOXSTRICTRC)
    247 ich9pciR3IOPortMagicPCIRead(PPDMDEVINS pDevIns, void *pvUser, RTIOPORT uPort, uint32_t *pu32, unsigned cb)
    248 {
    249     RT_NOREF5(pDevIns, pvUser, uPort, pu32, cb);
    250     LogFunc(("Port=%#x cb=%d VERR_IOM_IOPORT_UNUSED\n", uPort, cb));
     246ich9pciR3IOPortMagicPCIRead(PPDMDEVINS pDevIns, void *pvUser, RTIOPORT offPort, uint32_t *pu32, unsigned cb)
     247{
     248    Assert(offPort == 0); RT_NOREF5(pDevIns, pvUser, offPort, pu32, cb);
     249    LogFunc(("offPort=%#x cb=%d VERR_IOM_IOPORT_UNUSED\n", offPort, cb));
    251250    return VERR_IOM_IOPORT_UNUSED;
    252251}
    253252
    254253#endif /* IN_RING3 */
    255 
    256254
    257255/**
     
    263261 */
    264262static DECLCALLBACK(VBOXSTRICTRC)
    265 ich9pciIOPortAddressWrite(PPDMDEVINS pDevIns, void *pvUser, RTIOPORT uPort, uint32_t u32, unsigned cb)
    266 {
    267     LogFlowFunc(("Port=%#x u32=%#x cb=%d\n", uPort, u32, cb));
    268     RT_NOREF2(uPort, pvUser);
     263ich9pciIOPortAddressWrite(PPDMDEVINS pDevIns, void *pvUser, RTIOPORT offPort, uint32_t u32, unsigned cb)
     264{
     265    LogFlowFunc(("offPort=%#x u32=%#x cb=%d\n", offPort, u32, cb));
     266    Assert(offPort == 0); RT_NOREF2(offPort, pvUser);
    269267    if (cb == 4)
    270268    {
     
    294292 */
    295293static DECLCALLBACK(VBOXSTRICTRC)
    296 ich9pciIOPortAddressRead(PPDMDEVINS pDevIns, void *pvUser, RTIOPORT uPort, uint32_t *pu32, unsigned cb)
    297 {
    298     RT_NOREF2(uPort, pvUser);
     294ich9pciIOPortAddressRead(PPDMDEVINS pDevIns, void *pvUser, RTIOPORT offPort, uint32_t *pu32, unsigned cb)
     295{
     296    Assert(offPort == 0); RT_NOREF2(offPort, pvUser);
    299297    if (cb == 4)
    300298    {
     
    305303        PCI_UNLOCK(pDevIns);
    306304
    307         LogFlowFunc(("Port=%#x cb=%d -> %#x\n", uPort, cb, *pu32));
     305        LogFlowFunc(("offPort=%#x cb=%d -> %#x\n", offPort, cb, *pu32));
    308306        return VINF_SUCCESS;
    309307    }
    310308
    311     LogFunc(("Port=%#x cb=%d VERR_IOM_IOPORT_UNUSED\n", uPort, cb));
     309    LogFunc(("offPort=%#x cb=%d VERR_IOM_IOPORT_UNUSED\n", offPort, cb));
    312310    return VERR_IOM_IOPORT_UNUSED;
    313311}
     
    374372 */
    375373static DECLCALLBACK(VBOXSTRICTRC)
    376 ich9pciIOPortDataWrite(PPDMDEVINS pDevIns, void *pvUser, RTIOPORT uPort, uint32_t u32, unsigned cb)
     374ich9pciIOPortDataWrite(PPDMDEVINS pDevIns, void *pvUser, RTIOPORT offPort, uint32_t u32, unsigned cb)
    377375{
    378376    PDEVPCIROOT pThis = PDMINS_2_DATA(pDevIns, PDEVPCIROOT);
    379     LogFlowFunc(("Port=%#x u32=%#x cb=%d (config=%#10x)\n", uPort, u32, cb, pThis->uConfigReg));
    380     NOREF(pvUser);
     377    LogFlowFunc(("offPort=%u u32=%#x cb=%d (config=%#10x)\n", offPort, u32, cb, pThis->uConfigReg));
     378    Assert(offPort < 4); NOREF(pvUser);
    381379
    382380    VBOXSTRICTRC rcStrict = VINF_SUCCESS;
    383     if (!(uPort % cb))
     381    if (!(offPort % cb))
    384382    {
    385383        PCI_LOCK(pDevIns, VINF_IOM_R3_IOPORT_WRITE);
     
    390388            /* Decode target device from Configuration Address Port */
    391389            PciAddress aPciAddr;
    392             ich9pciStateToPciAddr(pThis, uPort, &aPciAddr);
     390            ich9pciStateToPciAddr(pThis, offPort, &aPciAddr);
    393391
    394392            /* Perform configuration space write */
     
    399397    }
    400398    else
    401         AssertMsgFailed(("Unaligned write to port %#x u32=%#x cb=%d\n", uPort, u32, cb));
     399        AssertMsgFailed(("Unaligned write to offPort=%u u32=%#x cb=%d\n", offPort, u32, cb));
    402400
    403401    return rcStrict;
     
    472470 */
    473471static DECLCALLBACK(VBOXSTRICTRC)
    474 ich9pciIOPortDataRead(PPDMDEVINS pDevIns, void *pvUser, RTIOPORT uPort, uint32_t *pu32, unsigned cb)
     472ich9pciIOPortDataRead(PPDMDEVINS pDevIns, void *pvUser, RTIOPORT offPort, uint32_t *pu32, unsigned cb)
    475473{
    476474    NOREF(pvUser);
    477     if (!(uPort % cb))
     475    Assert(offPort < 4);
     476    if (!(offPort % cb))
    478477    {
    479478        PDEVPCIROOT pThis = PDMINS_2_DATA(pDevIns, PDEVPCIROOT);
     
    490489            /* Decode target device and configuration space register */
    491490            PciAddress aPciAddr;
    492             ich9pciStateToPciAddr(pThis, uPort, &aPciAddr);
     491            ich9pciStateToPciAddr(pThis, offPort, &aPciAddr);
    493492
    494493            /* Perform configuration space read */
     
    498497        PCI_UNLOCK(pDevIns);
    499498
    500         LogFlowFunc(("Port=%#x cb=%#x (config=%#10x) -> %#x (%Rrc)\n", uPort, cb, *pu32, pThis->uConfigReg, VBOXSTRICTRC_VAL(rcStrict)));
     499        LogFlowFunc(("offPort=%u cb=%#x (config=%#10x) -> %#x (%Rrc)\n", offPort, cb, *pu32, pThis->uConfigReg, VBOXSTRICTRC_VAL(rcStrict)));
    501500        return rcStrict;
    502501    }
    503     AssertMsgFailed(("Unaligned read from port %#x cb=%d\n", uPort, cb));
     502    AssertMsgFailed(("Unaligned read from offPort=%u cb=%d\n", offPort, cb));
    504503    return VERR_IOM_IOPORT_UNUSED;
    505504}
  • trunk/src/VBox/Devices/PC/DevRTC.cpp

    r80960 r81136  
    348348 * @callback_method_impl{FNIOMIOPORTIN}
    349349 */
    350 PDMBOTHCBDECL(VBOXSTRICTRC) rtcIOPortRead(PPDMDEVINS pDevIns, void *pvUser, RTIOPORT uPort, uint32_t *pu32, unsigned cb)
     350PDMBOTHCBDECL(VBOXSTRICTRC) rtcIOPortRead(PPDMDEVINS pDevIns, void *pvUser, RTIOPORT offPort, uint32_t *pu32, unsigned cb)
    351351{
    352352    NOREF(pvUser);
     353    Assert(offPort < 4);
     354
    353355    if (cb != 1)
    354356        return VERR_IOM_IOPORT_UNUSED;
    355357
    356358    PRTCSTATE pThis = PDMINS_2_DATA(pDevIns, PRTCSTATE);
    357     if ((uPort & 1) == 0)
     359    if ((offPort & 1) == 0)
    358360        *pu32 = 0xff;
    359361    else
    360362    {
    361         unsigned bank = (uPort >> 1) & 1;
     363        unsigned bank = (offPort >> 1) & 1;
    362364        switch (pThis->cmos_index[bank])
    363365        {
     
    406408 * @callback_method_impl{FNIOMIOPORTOUT}
    407409 */
    408 PDMBOTHCBDECL(VBOXSTRICTRC) rtcIOPortWrite(PPDMDEVINS pDevIns, void *pvUser, RTIOPORT uPort, uint32_t u32, unsigned cb)
     410PDMBOTHCBDECL(VBOXSTRICTRC) rtcIOPortWrite(PPDMDEVINS pDevIns, void *pvUser, RTIOPORT offPort, uint32_t u32, unsigned cb)
    409411{
    410412    NOREF(pvUser);
     413    Assert(offPort < 4);
     414
    411415    if (cb != 1)
    412416        return VINF_SUCCESS;
    413417
    414418    PRTCSTATE pThis = PDMINS_2_DATA(pDevIns, PRTCSTATE);
    415     uint32_t bank = (uPort >> 1) & 1;
    416     if ((uPort & 1) == 0)
     419    uint32_t bank = (offPort >> 1) & 1;
     420    if ((offPort & 1) == 0)
    417421    {
    418422        pThis->cmos_index[bank] = (u32 & 0x7f) + (bank * CMOS_BANK_SIZE);
  • trunk/src/VBox/VMM/VMMAll/IOMAll.cpp

    r80960 r81136  
    104104         * Found an entry, get the data so we can leave the IOM lock.
    105105         */
     106        uint16_t const    fFlags        = pRegEntry->fFlags;
    106107        PFNIOMIOPORTNEWIN pfnInCallback = pRegEntry->pfnInCallback;
    107108        PPDMDEVINS        pDevIns       = pRegEntry->pDevIns;
     
    130131        {
    131132            STAM_PROFILE_START(&pStats->CTX_SUFF_Z(ProfIn), a);
    132             rcStrict = pfnInCallback(pDevIns, pvUser, Port, pu32Value, (unsigned)cbValue);
     133            rcStrict = pfnInCallback(pDevIns, pvUser, fFlags & IOM_IOPORT_F_ABS ? Port : offPort, pu32Value, (unsigned)cbValue);
    133134            STAM_PROFILE_STOP(&pStats->CTX_SUFF_Z(ProfIn), a);
    134135            PDMCritSectLeave(pDevIns->CTX_SUFF(pCritSectRo));
     
    349350         * Found an entry, get the data so we can leave the IOM lock.
    350351         */
     352        uint16_t const          fFlags           = pRegEntry->fFlags;
    351353        PFNIOMIOPORTNEWINSTRING pfnInStrCallback = pRegEntry->pfnInStrCallback;
    352354        PFNIOMIOPORTNEWIN       pfnInCallback    = pRegEntry->pfnInCallback;
     
    381383            {
    382384                STAM_PROFILE_START(&pStats->CTX_SUFF_Z(ProfIn), a);
    383                 rcStrict = pfnInStrCallback(pDevIns, pvUser, uPort, (uint8_t *)pvDst, pcTransfers, cb);
     385                rcStrict = pfnInStrCallback(pDevIns, pvUser, fFlags & IOM_IOPORT_F_ABS ? uPort : offPort,
     386                                            (uint8_t *)pvDst, pcTransfers, cb);
    384387                STAM_PROFILE_STOP(&pStats->CTX_SUFF_Z(ProfIn), a);
    385388            }
     
    396399                    uint32_t u32Value = 0;
    397400                    STAM_PROFILE_START(&pStats->CTX_SUFF_Z(ProfIn), a);
    398                     rcStrict = pfnInCallback(pDevIns, pvUser, uPort, &u32Value, cb);
     401                    rcStrict = pfnInCallback(pDevIns, pvUser, fFlags & IOM_IOPORT_F_ABS ? uPort : offPort, &u32Value, cb);
    399402                    STAM_PROFILE_STOP(&pStats->CTX_SUFF_Z(ProfIn), a);
    400403                    if (rcStrict == VERR_IOM_IOPORT_UNUSED)
     
    671674         * Found an entry, get the data so we can leave the IOM lock.
    672675         */
     676        uint16_t const     fFlags           = pRegEntry->fFlags;
    673677        PFNIOMIOPORTNEWOUT pfnOutCallback   = pRegEntry->pfnOutCallback;
    674678        PPDMDEVINS         pDevIns          = pRegEntry->pDevIns;
     
    697701        {
    698702            STAM_PROFILE_START(&pStats->CTX_SUFF_Z(ProfOut), a);
    699             rcStrict = pfnOutCallback(pDevIns, pvUser, Port, u32Value, (unsigned)cbValue);
     703            rcStrict = pfnOutCallback(pDevIns, pvUser, fFlags & IOM_IOPORT_F_ABS ? Port : offPort, u32Value, (unsigned)cbValue);
    700704            STAM_PROFILE_STOP(&pStats->CTX_SUFF_Z(ProfOut), a);
    701705
     
    892896         * Found an entry, get the data so we can leave the IOM lock.
    893897         */
     898        uint16_t const             fFlags            = pRegEntry->fFlags;
    894899        PFNIOMIOPORTNEWOUTSTRING   pfnOutStrCallback = pRegEntry->pfnOutStrCallback;
    895900        PFNIOMIOPORTNEWOUT         pfnOutCallback    = pRegEntry->pfnOutCallback;
     
    924929            {
    925930                STAM_PROFILE_START(&pStats->CTX_SUFF_Z(ProfOut), a);
    926                 rcStrict = pfnOutStrCallback(pDevIns, pvUser, uPort, (uint8_t const *)pvSrc, pcTransfers, cb);
     931                rcStrict = pfnOutStrCallback(pDevIns, pvUser, fFlags & IOM_IOPORT_F_ABS ? uPort : offPort,
     932                                             (uint8_t const *)pvSrc, pcTransfers, cb);
    927933                STAM_PROFILE_STOP(&pStats->CTX_SUFF_Z(ProfOut), a);
    928934            }
     
    946952                    }
    947953                    STAM_PROFILE_START(&pStats->CTX_SUFF_Z(ProfOut), a);
    948                     rcStrict = pfnOutCallback(pDevIns, pvUser, uPort, u32Value, cb);
     954                    rcStrict = pfnOutCallback(pDevIns, pvUser, fFlags & IOM_IOPORT_F_ABS ? uPort : offPort, u32Value, cb);
    949955                    STAM_PROFILE_STOP(&pStats->CTX_SUFF_Z(ProfOut), a);
    950956                    if (IOM_SUCCESS(rcStrict))
  • trunk/src/VBox/VMM/VMMR0/IOMR0.cpp

    r81056 r81136  
    111111    AssertPtrNullReturn(pfnInStr, VERR_INVALID_POINTER);
    112112
     113    uint16_t const fFlags = pGVM->iomr0.s.paIoPortRing3Regs[hIoPorts].fFlags;
    113114    RTIOPORT const cPorts = pGVM->iomr0.s.paIoPortRing3Regs[hIoPorts].cPorts;
    114115    AssertMsgReturn(cPorts > 0 && cPorts <= _8K, ("cPorts=%s\n", cPorts), VERR_IOM_INVALID_IOPORT_HANDLE);
     
    124125    pGVM->iomr0.s.paIoPortRegs[hIoPorts].pfnInStrCallback   = pfnInStr;
    125126    pGVM->iomr0.s.paIoPortRegs[hIoPorts].cPorts             = cPorts;
     127    pGVM->iomr0.s.paIoPortRegs[hIoPorts].fFlags             = fFlags;
    126128#ifdef VBOX_WITH_STATISTICS
    127129    uint16_t const idxStats = pGVM->iomr0.s.paIoPortRing3Regs[hIoPorts].idxStats;
  • trunk/src/VBox/VMM/VMMR3/IOM.cpp

    r81056 r81136  
    471471
    472472    AssertMsgReturn(cPorts > 0 && cPorts <= _8K, ("cPorts=%s\n", cPorts), VERR_OUT_OF_RANGE);
    473     AssertReturn(!fFlags, VERR_INVALID_FLAGS);
     473    AssertReturn(!(fFlags & ~IOM_IOPORT_F_VALID_MASK), VERR_INVALID_FLAGS);
    474474
    475475    AssertReturn(pfnOut || pfnIn || pfnOutStr || pfnInStr, VERR_INVALID_PARAMETER);
     
    540540    pVM->iom.s.paIoPortRegs[idx].idxStats           = (uint16_t)idxStats;
    541541    pVM->iom.s.paIoPortRegs[idx].fMapped            = false;
     542    pVM->iom.s.paIoPortRegs[idx].fFlags             = (uint8_t)fFlags;
    542543    pVM->iom.s.paIoPortRegs[idx].idxSelf            = idx;
    543544
  • trunk/src/VBox/VMM/include/IOMInternal.h

    r81056 r81136  
    180180    /** Same as the handle index. */
    181181    uint16_t                            idxSelf;
     182    /** IOM_IOPORT_F_XXX (copied from ring-3). */
     183    uint16_t                            fFlags;
    182184} IOMIOPORTENTRYR0;
    183185/** Pointer to a ring-0 I/O port handle table entry. */
     
    225227    /** Set if there is an raw-mode entry too. */
    226228    bool                                fRawMode;
    227     bool                                fUnused;
     229    /** IOM_IOPORT_F_XXX */
     230    uint8_t                             fFlags;
    228231    /** Same as the handle index. */
    229232    uint16_t                            idxSelf;
Note: See TracChangeset for help on using the changeset viewer.

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