VirtualBox

Changeset 81031 in vbox for trunk/src/VBox/Devices/VMMDev


Ignore:
Timestamp:
Sep 26, 2019 7:26:33 PM (5 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
133634
Message:

PDM,Devices: Moving the PDMPCIDEV structures into the PDMDEVINS allocation. Preps for extending the config space to 4KB. bugref:9218

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

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Devices/VMMDev/VMMDev.cpp

    r80704 r81031  
    32033203                                              RTGCPHYS GCPhysAddress, RTGCPHYS cb, PCIADDRESSSPACE enmType)
    32043204{
    3205     RT_NOREF1(cb);
     3205    PVMMDEV pThis = PDMINS_2_DATA(pDevIns, PVMMDEV);
    32063206    LogFlow(("vmmdevR3IORAMRegionMap: iRegion=%d GCPhysAddress=%RGp cb=%RGp enmType=%d\n", iRegion, GCPhysAddress, cb, enmType));
    3207     PVMMDEV pThis = RT_FROM_MEMBER(pPciDev, VMMDEV, PciDev);
     3207    Assert(pPciDev == pDevIns->apPciDevs[0]);
     3208    RT_NOREF(cb, pPciDev);
     3209
    32083210    int rc;
    32093211
     
    32713273                                               RTGCPHYS GCPhysAddress, RTGCPHYS cb, PCIADDRESSSPACE enmType)
    32723274{
     3275    PVMMDEV pThis = PDMINS_2_DATA(pDevIns, PVMMDEV);
    32733276    LogFlow(("vmmdevIOPortRegionMap: iRegion=%d GCPhysAddress=%RGp cb=%RGp enmType=%d\n", iRegion, GCPhysAddress, cb, enmType));
    3274     RT_NOREF3(iRegion, cb, enmType);
    3275     PVMMDEV pThis = RT_FROM_MEMBER(pPciDev, VMMDEV, PciDev);
    3276 
     3277    RT_NOREF(pPciDev, iRegion, cb, enmType);
     3278
     3279    Assert(pPciDev == pDevIns->apPciDevs[0]);
    32773280    Assert(enmType == PCI_ADDRESS_SPACE_IO);
    32783281    Assert(iRegion == 0);
     
    43634366#endif
    43644367
     4368    PPDMPCIDEV pPciDev = pDevIns->apPciDevs[0];
     4369    PDMPCIDEV_ASSERT_VALID(pDevIns, pPciDev);
     4370
    43654371    /* PCI vendor, just a free bogus value */
    4366     PCIDevSetVendorId(&pThis->PciDev, 0x80ee);
     4372    PDMPciDevSetVendorId(pPciDev,    0x80ee);
    43674373    /* device ID */
    4368     PCIDevSetDeviceId(&pThis->PciDev, 0xcafe);
     4374    PDMPciDevSetDeviceId(pPciDev,    0xcafe);
    43694375    /* class sub code (other type of system peripheral) */
    4370     PCIDevSetClassSub(&pThis->PciDev, 0x80);
     4376    PDMPciDevSetClassSub(pPciDev,      0x80);
    43714377    /* class base code (base system peripheral) */
    4372     PCIDevSetClassBase(&pThis->PciDev, 0x08);
     4378    PDMPciDevSetClassBase(pPciDev,      0x08);
    43734379    /* header type */
    4374     PCIDevSetHeaderType(&pThis->PciDev, 0x00);
     4380    PDMPciDevSetHeaderType(pPciDev,    0x00);
    43754381    /* interrupt on pin 0 */
    4376     PCIDevSetInterruptPin(&pThis->PciDev, 0x01);
     4382    PDMPciDevSetInterruptPin(pPciDev,  0x01);
    43774383
    43784384    RTTIMESPEC TimeStampNow;
     
    45594565     * Register the PCI device.
    45604566     */
    4561     rc = PDMDevHlpPCIRegister(pDevIns, &pThis->PciDev);
     4567    rc = PDMDevHlpPCIRegister(pDevIns, pPciDev);
    45624568    if (RT_FAILURE(rc))
    45634569        return rc;
    4564     if (pThis->PciDev.uDevFn != 32 || iInstance != 0)
    4565         Log(("!!WARNING!!: pThis->PciDev.uDevFn=%d (ignore if testcase or no started by Main)\n", pThis->PciDev.uDevFn));
     4570    if (pPciDev->uDevFn != 32 || iInstance != 0)
     4571        Log(("!!WARNING!!: pThis->PciDev.uDevFn=%d (ignore if testcase or no started by Main)\n", pPciDev->uDevFn));
    45664572    rc = PDMDevHlpPCIIORegionRegister(pDevIns, 0, 0x20, PCI_ADDRESS_SPACE_IO, vmmdevIOPortRegionMap);
    45674573    if (RT_FAILURE(rc))
     
    45834589     * interrupt acknowledge requests more timely.
    45844590     */
    4585     rc = PDMDevHlpMMIO2Register(pDevIns, &pThis->PciDev, 1 /*iRegion*/, VMMDEV_RAM_SIZE, 0 /*fFlags*/,
     4591    rc = PDMDevHlpMMIO2Register(pDevIns, pPciDev, 1 /*iRegion*/, VMMDEV_RAM_SIZE, 0 /*fFlags*/,
    45864592                                (void **)&pThis->pVMMDevRAMR3, "VMMDev");
    45874593    if (RT_FAILURE(rc))
     
    45914597    if (pThis->fRZEnabled)
    45924598    {
    4593         rc = PDMDevHlpMMIO2MapKernel(pDevIns, &pThis->PciDev, 1 /*iRegion*/, 0 /*off*/, PAGE_SIZE, "VMMDev", &pThis->pVMMDevRAMR0);
     4599        rc = PDMDevHlpMMIO2MapKernel(pDevIns, pPciDev, 1 /*iRegion*/, 0 /*off*/, PAGE_SIZE, "VMMDev", &pThis->pVMMDevRAMR0);
    45944600        if (RT_FAILURE(rc))
    45954601            return PDMDevHlpVMSetError(pDevIns, rc, RT_SRC_POS,
     
    45974603
    45984604#ifdef VBOX_WITH_RAW_MODE_KEEP
    4599         rc = PDMDevHlpMMHyperMapMMIO2(pDevIns, &pThis->PciDev, 1 /*iRegion*/, 0 /*off*/, PAGE_SIZE, "VMMDev", &pThis->pVMMDevRAMRC);
     4605        rc = PDMDevHlpMMHyperMapMMIO2(pDevIns, pPciDev, 1 /*iRegion*/, 0 /*off*/, PAGE_SIZE, "VMMDev", &pThis->pVMMDevRAMRC);
    46004606        if (RT_FAILURE(rc))
    46014607            return PDMDevHlpVMSetError(pDevIns, rc, RT_SRC_POS,
     
    46094615    if (pThis->fHeapEnabled)
    46104616    {
    4611         rc = PDMDevHlpMMIO2Register(pDevIns, &pThis->PciDev, 2 /*iRegion*/, VMMDEV_HEAP_SIZE, 0 /*fFlags*/,
     4617        rc = PDMDevHlpMMIO2Register(pDevIns, pPciDev, 2 /*iRegion*/, VMMDEV_HEAP_SIZE, 0 /*fFlags*/,
    46124618                                    (void **)&pThis->pVMMDevHeapR3, "VMMDev Heap");
    46134619        if (RT_FAILURE(rc))
  • trunk/src/VBox/Devices/VMMDev/VMMDevState.h

    r80118 r81031  
    121121typedef struct VMMDevState
    122122{
    123     /** The PCI device structure. */
    124     PDMPCIDEV           PciDev;
    125123    /** The critical section for this device.
    126124     * @remarks We use this rather than the default one, it's simpler with all
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