VirtualBox

Changeset 39135 in vbox


Ignore:
Timestamp:
Oct 28, 2011 9:47:55 AM (13 years ago)
Author:
vboxsync
Message:

Changed PDMDevHlpMMIORegister to take flags and drop pfnFill. Added PDMDevHlpMMIORegisterEx for the one user of pfnFill.

Location:
trunk
Files:
16 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/VBox/vmm/pdmdev.h

    r39111 r39135  
    41064106 */
    41074107DECLINLINE(int) PDMDevHlpMMIORegister(PPDMDEVINS pDevIns, RTGCPHYS GCPhysStart, RTUINT cbRange, RTHCPTR pvUser,
    4108                                       PFNIOMMMIOWRITE pfnWrite, PFNIOMMMIOREAD pfnRead, PFNIOMMMIOFILL pfnFill,
    4109                                       const char *pszDesc)
     4108                                      uint32_t fFlags, PFNIOMMMIOWRITE pfnWrite, PFNIOMMMIOREAD pfnRead, const char *pszDesc)
     4109{
     4110    return pDevIns->pHlpR3->pfnMMIORegister(pDevIns, GCPhysStart, cbRange, pvUser, pfnWrite, pfnRead, NULL /*pfnFill*/,
     4111                                            fFlags, pszDesc);
     4112}
     4113
     4114/**
     4115 * @copydoc PDMDEVHLPR3::pfnMMIORegister
     4116 */
     4117DECLINLINE(int) PDMDevHlpMMIORegisterEx(PPDMDEVINS pDevIns, RTGCPHYS GCPhysStart, RTUINT cbRange, RTHCPTR pvUser,
     4118                                        uint32_t fFlags, PFNIOMMMIOWRITE pfnWrite, PFNIOMMMIOREAD pfnRead,
     4119                                        PFNIOMMMIOFILL pfnFill, const char *pszDesc)
    41104120{
    41114121    return pDevIns->pHlpR3->pfnMMIORegister(pDevIns, GCPhysStart, cbRange, pvUser, pfnWrite, pfnRead, pfnFill,
    4112                                             IOMMMIO_FLAGS_WRITE_PASSTHRU | IOMMMIO_FLAGS_READ_PASSTHRU, pszDesc);
     4122                                            fFlags, pszDesc);
    41134123}
    41144124
  • trunk/src/VBox/Devices/Audio/DevIchIntelHDA.cpp

    r37654 r39135  
    20412041
    20422042    Assert(enmType == PCI_ADDRESS_SPACE_MEM);
    2043     rc = PDMDevHlpMMIORegister(pPciDev->pDevIns, GCPhysAddress, cb, 0,
    2044                                hdaMMIOWrite, hdaMMIORead, NULL, "ICH6_HDA");
     2043    rc = PDMDevHlpMMIORegister(pPciDev->pDevIns, GCPhysAddress, cb, NULL /*pvUser*/,
     2044                               IOMMMIO_FLAGS_READ_PASSTHRU | IOMMMIO_FLAGS_WRITE_PASSTHRU,
     2045                               hdaMMIOWrite, hdaMMIORead, "ICH6_HDA");
    20452046
    20462047    if (RT_FAILURE(rc))
  • trunk/src/VBox/Devices/Bus/DevPciIch9.cpp

    r39091 r39135  
    112112    uint8_t             uBus;
    113113#endif
    114     /* Physical address of PCI config space MMIO region */
     114    /** Physical address of PCI config space MMIO region. */
    115115    uint64_t            u64PciConfigMMioAddress;
    116     /* Length of PCI config space MMIO region */
     116    /** Length of PCI config space MMIO region. */
    117117    uint64_t            u64PciConfigMMioLength;
    118118
     
    25142514    if (pGlobals->u64PciConfigMMioAddress != 0)
    25152515    {
    2516         rc = PDMDevHlpMMIORegister(pDevIns,
    2517                                    pGlobals->u64PciConfigMMioAddress,
    2518                                    pGlobals->u64PciConfigMMioLength,
    2519                                    0,
    2520                                    ich9pciMcfgMMIOWrite,
    2521                                    ich9pciMcfgMMIORead,
    2522                                    NULL /* fill */,
    2523                                    "MCFG ranges");
    2524         if (RT_FAILURE(rc))
    2525         {
    2526             AssertMsgRC(rc, ("Cannot register MCFG MMIO: %Rrc\n", rc));
    2527             return rc;
    2528         }
     2516        rc = PDMDevHlpMMIORegister(pDevIns, pGlobals->u64PciConfigMMioAddress, pGlobals->u64PciConfigMMioLength, NULL /*pvUser*/,
     2517                                   IOMMMIO_FLAGS_READ_PASSTHRU | IOMMMIO_FLAGS_WRITE_PASSTHRU,
     2518                                   ich9pciMcfgMMIOWrite, ich9pciMcfgMMIORead, "MCFG ranges");
     2519        AssertMsgRCReturn(rc, ("rc=%Rrc %#llx/%#llx\n", rc,  pGlobals->u64PciConfigMMioAddress, pGlobals->u64PciConfigMMioLength), rc);
    25292520
    25302521        if (fGCEnabled)
  • trunk/src/VBox/Devices/Bus/MsixCommon.cpp

    r39091 r39135  
    157157
    158158    int rc = PDMDevHlpMMIORegister(pPciDev->pDevIns, GCPhysAddress, cb, pPciDev,
    159                                    msixMMIOWrite, msixMMIORead, NULL, "MSI-X tables");
     159                                   IOMMMIO_FLAGS_READ_PASSTHRU | IOMMMIO_FLAGS_WRITE_PASSTHRU,
     160                                   msixMMIOWrite, msixMMIORead, "MSI-X tables");
    160161
    161162    if (RT_FAILURE(rc))
  • trunk/src/VBox/Devices/Graphics/DevVGA.cpp

    r39091 r39135  
    59835983
    59845984    /* vga mmio */
    5985     rc = PDMDevHlpMMIORegister(pDevIns, 0x000a0000, 0x00020000, 0, vgaMMIOWrite, vgaMMIORead, vgaMMIOFill, "VGA - VGA Video Buffer");
     5985    rc = PDMDevHlpMMIORegisterEx(pDevIns, 0x000a0000, 0x00020000, NULL /*pvUser*/,
     5986                                 IOMMMIO_FLAGS_READ_PASSTHRU | IOMMMIO_FLAGS_WRITE_PASSTHRU,
     5987                                 vgaMMIOWrite, vgaMMIORead, vgaMMIOFill, "VGA - VGA Video Buffer");
    59865988    if (RT_FAILURE(rc))
    59875989        return rc;
  • trunk/src/VBox/Devices/Network/DevE1000.cpp

    r39011 r39135  
    46354635        case PCI_ADDRESS_SPACE_MEM:
    46364636            pState->addrMMReg = GCPhysAddress;
    4637             rc = PDMDevHlpMMIORegister(pPciDev->pDevIns, GCPhysAddress, cb, 0,
    4638                                        e1kMMIOWrite, e1kMMIORead, NULL, "E1000");
     4637            rc = PDMDevHlpMMIORegister(pPciDev->pDevIns, GCPhysAddress, cb, NULL /*pvUser*/,
     4638                                       IOMMMIO_FLAGS_READ_PASSTHRU | IOMMMIO_FLAGS_WRITE_PASSTHRU,
     4639                                       e1kMMIOWrite, e1kMMIORead, "E1000");
    46394640            if (pState->fR0Enabled)
    46404641            {
  • trunk/src/VBox/Devices/Network/DevPCNet.cpp

    r37636 r39135  
    40524052    /* We use the assigned size here, because we currently only support page aligned MMIO ranges. */
    40534053    rc = PDMDevHlpMMIORegister(pPciDev->pDevIns, GCPhysAddress, cb, pThis,
    4054                                pcnetMMIOWrite, pcnetMMIORead, NULL, "PCNet");
     4054                               IOMMMIO_FLAGS_READ_PASSTHRU | IOMMMIO_FLAGS_WRITE_PASSTHRU,
     4055                               pcnetMMIOWrite, pcnetMMIORead, "PCNet");
    40554056    if (RT_FAILURE(rc))
    40564057        return rc;
  • trunk/src/VBox/Devices/PC/DevAPIC.cpp

    r39060 r39135  
    22802280    uint32_t ApicBase = pDev->paLapicsR3[0].apicbase & ~0xfff;
    22812281    rc = PDMDevHlpMMIORegister(pDevIns, ApicBase, 0x1000, pDev,
    2282                                apicMMIOWrite, apicMMIORead, NULL, "APIC Memory");
     2282                               IOMMMIO_FLAGS_READ_PASSTHRU | IOMMMIO_FLAGS_WRITE_PASSTHRU,
     2283                               apicMMIOWrite, apicMMIORead, "APIC Memory");
    22832284    if (RT_FAILURE(rc))
    22842285        return rc;
  • trunk/src/VBox/Devices/PC/DevHPET.cpp

    r39091 r39135  
    14441444     */
    14451445    rc = PDMDevHlpMMIORegister(pDevIns, HPET_BASE, 0x1000, pThis,
    1446                                hpetMMIOWrite, hpetMMIORead, NULL, "HPET Memory");
     1446                               IOMMMIO_FLAGS_READ_PASSTHRU | IOMMMIO_FLAGS_WRITE_PASSTHRU,
     1447                               hpetMMIOWrite, hpetMMIORead, "HPET Memory");
    14471448    AssertRCReturn(rc, rc);
    14481449
  • trunk/src/VBox/Devices/PC/DevIoApic.cpp

    r39059 r39135  
    629629     */
    630630    rc = PDMDevHlpMMIORegister(pDevIns, 0xfec00000, 0x1000, s,
    631                                ioapicMMIOWrite, ioapicMMIORead, NULL, "I/O APIC Memory");
     631                               IOMMMIO_FLAGS_READ_PASSTHRU | IOMMMIO_FLAGS_WRITE_PASSTHRU,
     632                               ioapicMMIOWrite, ioapicMMIORead, "I/O APIC Memory");
    632633    if (RT_FAILURE(rc))
    633634        return rc;
  • trunk/src/VBox/Devices/PC/DevLPC.cpp

    r37636 r39135  
    337337     */
    338338    rc = PDMDevHlpMMIORegister(pDevIns, RCBA_BASE, 0x4000, pThis,
    339                                lpcMMIOWrite, lpcMMIORead, NULL, "LPC Memory");
     339                               IOMMMIO_FLAGS_READ_PASSTHRU | IOMMMIO_FLAGS_WRITE_PASSTHRU,
     340                               lpcMMIOWrite, lpcMMIORead, "LPC Memory");
    340341    if (RT_FAILURE(rc))
    341342        return rc;
  • trunk/src/VBox/Devices/Storage/DevAHCI.cpp

    r38970 r39135  
    25062506
    25072507    /* We use the assigned size here, because we currently only support page aligned MMIO ranges. */
    2508     rc = PDMDevHlpMMIORegister(pDevIns, GCPhysAddress, cb, NULL,
    2509                                ahciMMIOWrite, ahciMMIORead, NULL, "AHCI");
     2508    rc = PDMDevHlpMMIORegisterEx(pDevIns, GCPhysAddress, cb, NULL /*pvUser*/,
     2509                                 IOMMMIO_FLAGS_READ_PASSTHRU | IOMMMIO_FLAGS_WRITE_PASSTHRU,
     2510                                 ahciMMIOWrite, ahciMMIORead, NULL, "AHCI");
    25102511    if (RT_FAILURE(rc))
    25112512        return rc;
     
    61176118        /*
    61186119         * Count the number of valid ranges in the buffer.
    6119          * A length of 0 is invalid and is only used for padding 
     6120         * A length of 0 is invalid and is only used for padding
    61206121         */
    61216122        for (unsigned i = 0; i < RT_ELEMENTS(aRanges); i++)
  • trunk/src/VBox/Devices/Storage/DevBusLogic.cpp

    r38782 r39135  
    20742074    {
    20752075        /* We use the assigned size here, because we currently only support page aligned MMIO ranges. */
    2076         rc = PDMDevHlpMMIORegister(pDevIns, GCPhysAddress, cb, NULL,
    2077                                    buslogicMMIOWrite, buslogicMMIORead, NULL, "BusLogic");
     2076        rc = PDMDevHlpMMIORegister(pDevIns, GCPhysAddress, cb, NULL /*pvUser*/,
     2077                                   IOMMMIO_FLAGS_READ_PASSTHRU | IOMMMIO_FLAGS_WRITE_PASSTHRU,
     2078                                   buslogicMMIOWrite, buslogicMMIORead, "BusLogic");
    20782079        if (RT_FAILURE(rc))
    20792080            return rc;
  • trunk/src/VBox/Devices/Storage/DevLsiLogicSCSI.cpp

    r37636 r39135  
    38413841    {
    38423842        /* We use the assigned size here, because we currently only support page aligned MMIO ranges. */
    3843         rc = PDMDevHlpMMIORegister(pDevIns, GCPhysAddress, cb, NULL,
    3844                                    lsilogicMMIOWrite, lsilogicMMIORead, NULL, pcszCtrl);
     3843        rc = PDMDevHlpMMIORegister(pDevIns, GCPhysAddress, cb, NULL /*pvUser*/,
     3844                                   IOMMMIO_FLAGS_READ_PASSTHRU | IOMMMIO_FLAGS_WRITE_PASSTHRU,
     3845                                   lsilogicMMIOWrite, lsilogicMMIORead, pcszCtrl);
    38453846        if (RT_FAILURE(rc))
    38463847            return rc;
     
    38643865        pThis->GCPhysMMIOBase = GCPhysAddress;
    38653866    }
    3866     else if ((enmType == PCI_ADDRESS_SPACE_MEM) && (iRegion == 2))
     3867    else if (enmType == PCI_ADDRESS_SPACE_MEM && iRegion == 2)
    38673868    {
    38683869        /* We use the assigned size here, because we currently only support page aligned MMIO ranges. */
    3869         rc = PDMDevHlpMMIORegister(pDevIns, GCPhysAddress, cb, NULL,
    3870                                    lsilogicDiagnosticWrite, lsilogicDiagnosticRead, NULL, pcszDiag);
     3870        rc = PDMDevHlpMMIORegister(pDevIns, GCPhysAddress, cb, NULL /*pvUser*/,
     3871                                   IOMMMIO_FLAGS_READ_PASSTHRU | IOMMMIO_FLAGS_WRITE_PASSTHRU,
     3872                                   lsilogicDiagnosticWrite, lsilogicDiagnosticRead, pcszDiag);
    38713873        if (RT_FAILURE(rc))
    38723874            return rc;
  • trunk/src/VBox/Devices/USB/DevOHCI.cpp

    r38350 r39135  
    48774877{
    48784878    POHCI pOhci = (POHCI)pPciDev;
    4879     int rc = PDMDevHlpMMIORegister(pOhci->CTX_SUFF(pDevIns),
    4880                                    GCPhysAddress,
    4881                                    cb,
    4882                                    NULL,
    4883                                    ohciWrite,
    4884                                    ohciRead,
    4885                                    NULL,
    4886                                    "USB OHCI");
     4879    int rc = PDMDevHlpMMIORegister(pOhci->CTX_SUFF(pDevIns), GCPhysAddress, cb, NULL /*pvUser*/,
     4880                                   IOMMMIO_FLAGS_READ_PASSTHRU | IOMMMIO_FLAGS_WRITE_PASSTHRU,
     4881                                   ohciWrite, ohciRead, "USB OHCI");
    48874882    if (RT_FAILURE(rc))
    48884883        return rc;
  • trunk/src/VBox/Devices/VMMDev/VMMDevTesting.cpp

    r37636 r39135  
    337337     */
    338338    int rc = PDMDevHlpMMIORegister(pDevIns, VMMDEV_TESTING_MMIO_BASE, VMMDEV_TESTING_MMIO_SIZE, NULL /*pvUser*/,
    339                                    vmmdevTestingMmioWrite,
    340                                    vmmdevTestingMmioRead,
    341                                    NULL /*pfnFill*/,
    342                                    "VMMDev Testing");
     339                                   IOMMMIO_FLAGS_READ_PASSTHRU | IOMMMIO_FLAGS_WRITE_PASSTHRU,
     340                                   vmmdevTestingMmioWrite, vmmdevTestingMmioRead, "VMMDev Testing");
    343341    AssertRCReturn(rc, rc);
    344342    if (pThis->fRZEnabled)
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