VirtualBox

Ignore:
Timestamp:
Nov 1, 2019 8:47:17 PM (5 years ago)
Author:
vboxsync
Message:

VMMDev: Converted to the new PDM device style. bugref:9218

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Devices/VMMDev/VMMDevState.h

    r81571 r81625  
    137137    uint32_t            fHostCursorRequested;
    138138
    139     /** Pointer to device instance - R3 poitner. */
    140     PPDMDEVINSR3        pDevInsR3;
    141     /** Pointer to device instance - R0 pointer. */
    142     PPDMDEVINSR0        pDevInsR0;
    143 
    144     /** LUN\#0 + Status: VMMDev port base interface. */
    145     PDMIBASE            IBase;
    146     /** LUN\#0: VMMDev port interface. */
    147     PDMIVMMDEVPORT      IPort;
    148 #ifdef VBOX_WITH_HGCM
    149     /** LUN\#0: HGCM port interface. */
    150     PDMIHGCMPORT        IHGCMPort;
    151 //# if HC_ARCH_BITS == 32
    152 //    RTR3PTR      R3PtrAlignment1;
    153 //# endif
    154 #endif
    155     /** Pointer to base interface of the driver. */
    156     R3PTRTYPE(PPDMIBASE) pDrvBase;
    157     /** VMMDev connector interface */
    158     R3PTRTYPE(PPDMIVMMDEVCONNECTOR) pDrv;
    159 #ifdef VBOX_WITH_HGCM
    160     /** HGCM connector interface */
    161     R3PTRTYPE(PPDMIHGCMCONNECTOR) pHGCMDrv;
    162 #endif
    163139    /** message buffer for backdoor logging. */
    164140    char                szMsg[512];
     
    185161    bool                fNewGuestFilterMaskValid;
    186162    /** Alignment padding. */
    187     bool                afAlignment3[7];
    188 
    189     /** GC physical address of VMMDev RAM area */
    190     RTGCPHYS32                  GCPhysVMMDevRAM;
    191     /** R3 pointer to VMMDev RAM area */
    192     R3PTRTYPE(VMMDevMemory *)   pVMMDevRAMR3;
    193     /** R0 pointer to VMMDev RAM area - first page only, could be NULL! */
    194     R0PTRTYPE(VMMDevMemory *)   pVMMDevRAMR0;
    195 #ifdef VBOX_WITH_RAW_MODE_KEEP
    196     /** R0 pointer to VMMDev RAM area - first page only, could be NULL! */
    197     RCPTRTYPE(VMMDevMemory *)   pVMMDevRAMRC;
    198     RTRCPTR                     RCPtrAlignment3b;
    199 #endif
    200 
    201     /** R3 pointer to VMMDev Heap RAM area. */
    202     R3PTRTYPE(VMMDevMemory *) pVMMDevHeapR3;
    203     /** GC physical address of VMMDev Heap RAM area */
    204     RTGCPHYS32          GCPhysVMMDevHeap;
     163    bool                afAlignment3[3];
    205164
    206165    /** Information reported by guest via VMMDevReportGuestInfo generic request.
     
    236195    DISPLAYCHANGEDATA   displayChangeData;
    237196
    238     /** Pointer to the credentials. */
    239     R3PTRTYPE(VMMDEVCREDS *) pCredentials;
    240 
    241 #if HC_ARCH_BITS == 32
    242     uint32_t            uAlignment4;
    243 #endif
    244 
    245197    /** memory balloon change request */
    246198    uint32_t            cMbMemoryBalloon;
     
    271223    uint64_t            msLatchedHostTime;
    272224    bool                fTimesyncBackdoorLo;
     225    bool                afAlignment6[1];
     226#else
    273227    bool                afAlignment6[2];
    274 #else
    275     bool                afAlignment6[1+2];
    276 #endif
    277 
     228#endif
     229
     230    /** Set if guest should be allowed to trigger state save and power off.  */
     231    bool                fAllowGuestToSaveState;
    278232    /** Set if GetHostTime should fail.
    279233     * Loaded from the GetHostTimeDisabled configuration value. */
     
    292246    /** Number of additional cores to keep around. */
    293247    uint32_t            cGuestCoreDumps;
    294 
    295 #ifdef VBOX_WITH_HGCM
    296     /** List of pending HGCM requests (VBOXHGCMCMD). */
    297     RTLISTANCHORR3      listHGCMCmd;
    298     /** Critical section to protect the list. */
    299     RTCRITSECT          critsectHGCMCmdList;
    300     /** Whether the HGCM events are already automatically enabled. */
    301     uint32_t            u32HGCMEnabled;
    302     /** Saved state version of restored commands. */
    303     uint32_t            u32SSMVersion;
    304     RTMEMCACHE          hHgcmCmdCache;
    305     STAMPROFILE         StatHgcmCmdArrival;
    306     STAMPROFILE         StatHgcmCmdCompletion;
    307     STAMPROFILE         StatHgcmCmdTotal;
    308     STAMCOUNTER         StatHgcmLargeCmdAllocs;
    309     STAMCOUNTER         StatHgcmFailedPageListLocking;
    310 #endif /* VBOX_WITH_HGCM */
    311     STAMCOUNTER         StatReqBufAllocs;
    312 
    313     /** Per CPU request 4K sized buffers, allocated as needed. */
    314     R3PTRTYPE(VMMDevRequestHeader *) apReqBufs[VMM_MAX_CPU_COUNT];
    315 
    316     /** Status LUN: Shared folders LED */
    317     struct
    318     {
    319         /** The LED. */
    320         PDMLED                          Led;
    321         /** The LED ports. */
    322         PDMILEDPORTS                    ILeds;
    323         /** Partner of ILeds. */
    324         R3PTRTYPE(PPDMILEDCONNECTORS)   pLedsConnector;
    325     } SharedFolders;
    326248
    327249    /** FLag whether CPU hotplug events are monitored */
     
    338260    uint32_t            StatMemBalloonChunks;
    339261
    340     /** Set if RC/R0 is enabled. */
    341     bool                fRZEnabled;
    342262    /** Set if testing is enabled. */
    343263    bool                fTestingEnabled;
     
    345265    bool                fTestingMMIO;
    346266    /** Alignment padding. */
    347     bool                afPadding9[HC_ARCH_BITS == 32 ? 1 : 5];
     267    bool                afPadding9[HC_ARCH_BITS == 32 ? 2 : 6];
    348268#ifndef VBOX_WITHOUT_TESTING_FEATURES
    349269    /** The high timestamp value. */
     
    383303        uint8_t         abReadBack[VMMDEV_TESTING_READBACK_SIZE];
    384304    } TestingData;
    385     /** The XML output file name (can be a named pipe, doesn't matter to us). */
    386     R3PTRTYPE(char *)   pszTestingXmlOutput;
    387     /** Testing instance for dealing with the output. */
    388     RTTEST              hTestingTest;
     305
     306    /** Handle for the I/O ports used by the testing component. */
     307    IOMIOPORTHANDLE     hIoPortTesting;
     308    /** Handle for the MMIO region used by the testing component. */
     309    IOMMMIOHANDLE       hMmioTesting;
    389310#endif /* !VBOX_WITHOUT_TESTING_FEATURES */
    390311
     
    406327    uint64_t            cNsHeartbeatTimeout;
    407328    /** Timer for signalling a flatlined guest. */
    408     PTMTIMERR3          pFlatlinedTimer;
     329    TMTIMERHANDLE       hFlatlinedTimer;
    409330    /** @} */
     331
     332    /** Handle for the backdoor logging I/O port. */
     333    IOMIOPORTHANDLE     hIoPortBackdoorLog;
     334    /** Handle for the alternative timesync I/O port. */
     335    IOMIOPORTHANDLE     hIoPortAltTimesync;
     336    /** Handle for the VMM request I/O port (PCI region \#0). */
     337    IOMIOPORTHANDLE     hIoPortReq;
     338    /** Handle for the fast VMM request I/O port (PCI region \#0). */
     339    IOMIOPORTHANDLE     hIoPortFast;
     340    /** Handle for the VMMDev RAM (PCI region \#1). */
     341    PGMMMIO2HANDLE      hMmio2VMMDevRAM;
     342    /** Handle for the VMMDev Heap (PCI region \#2). */
     343    PGMMMIO2HANDLE      hMmio2Heap;
    410344} VMMDEV;
    411 /** Pointer to the VMM device state. */
     345/** Pointer to the shared VMM device state. */
    412346typedef VMMDEV *PVMMDEV;
    413347AssertCompileMemberAlignment(VMMDEV, CritSect, 8);
     
    421355
    422356
    423 void VMMDevNotifyGuest(VMMDEV *pVMMDevState, uint32_t u32EventMask);
    424 void VMMDevCtlSetGuestFilterMask(VMMDEV *pVMMDevState, uint32_t u32OrMask, uint32_t u32NotMask);
     357/**
     358 * State structure for the VMM device, ring-3 edition.
     359 */
     360typedef struct VMMDEVR3
     361{
     362    /** LUN\#0 + Status: VMMDev port base interface. */
     363    PDMIBASE                        IBase;
     364    /** LUN\#0: VMMDev port interface. */
     365    PDMIVMMDEVPORT                  IPort;
     366#ifdef VBOX_WITH_HGCM
     367    /** LUN\#0: HGCM port interface. */
     368    PDMIHGCMPORT                    IHGCMPort;
     369    /** HGCM connector interface */
     370    R3PTRTYPE(PPDMIHGCMCONNECTOR)   pHGCMDrv;
     371#endif
     372    /** Pointer to base interface of the driver. */
     373    R3PTRTYPE(PPDMIBASE)            pDrvBase;
     374    /** VMMDev connector interface */
     375    R3PTRTYPE(PPDMIVMMDEVCONNECTOR) pDrv;
     376    /** Pointer to the device instance.
     377     * @note Only for interface methods to get their bearings. */
     378    PPDMDEVINSR3                    pDevIns;
     379
     380    /** R3 pointer to VMMDev RAM area */
     381    R3PTRTYPE(VMMDevMemory *)       pVMMDevRAMR3;
     382
     383    /** R3 pointer to VMMDev Heap RAM area. */
     384    R3PTRTYPE(VMMDevMemory *)       pVMMDevHeapR3;
     385
     386    /** Pointer to the credentials. */
     387    R3PTRTYPE(VMMDEVCREDS *)        pCredentials;
     388    /** Set if pCredentials is using the RTMemSafer allocator, clear if heap. */
     389    bool                            fSaferCredentials;
     390    bool                            afAlignment[7];
     391
     392#ifdef VBOX_WITH_HGCM
     393    /** Critical section to protect the list. */
     394    RTCRITSECT                      critsectHGCMCmdList;
     395    /** List of pending HGCM requests (VBOXHGCMCMD). */
     396    RTLISTANCHORR3                  listHGCMCmd;
     397    /** Whether the HGCM events are already automatically enabled. */
     398    uint32_t                        u32HGCMEnabled;
     399    /** Saved state version of restored commands. */
     400    uint32_t                        uSavedStateVersion;
     401    RTMEMCACHE                      hHgcmCmdCache;
     402    STAMPROFILE                     StatHgcmCmdArrival;
     403    STAMPROFILE                     StatHgcmCmdCompletion;
     404    STAMPROFILE                     StatHgcmCmdTotal;
     405    STAMCOUNTER                     StatHgcmLargeCmdAllocs;
     406    STAMCOUNTER                     StatHgcmFailedPageListLocking;
     407#endif /* VBOX_WITH_HGCM */
     408    STAMCOUNTER                     StatReqBufAllocs;
     409    /** Per CPU request 4K sized buffers, allocated as needed. */
     410    R3PTRTYPE(VMMDevRequestHeader *) apReqBufs[VMM_MAX_CPU_COUNT];
     411
     412    /** Status LUN: Shared folders LED */
     413    struct
     414    {
     415        /** The LED. */
     416        PDMLED                          Led;
     417        /** The LED ports. */
     418        PDMILEDPORTS                    ILeds;
     419        /** Partner of ILeds. */
     420        R3PTRTYPE(PPDMILEDCONNECTORS)   pLedsConnector;
     421    } SharedFolders;
     422
     423#ifndef VBOX_WITHOUT_TESTING_FEATURES
     424    /** The XML output file name (can be a named pipe, doesn't matter to us). */
     425    R3PTRTYPE(char *)               pszTestingXmlOutput;
     426    /** Testing instance for dealing with the output. */
     427    RTTEST                          hTestingTest;
     428#endif
     429} VMMDEVR3;
     430/** Pointer to the ring-3 VMM device state. */
     431typedef VMMDEVR3 *PVMMDEVR3;
     432
     433
     434/**
     435 * State structure for the VMM device, ring-0 edition.
     436 */
     437typedef struct VMMDEVR0
     438{
     439    /** R0 pointer to VMMDev RAM area - first page only, could be NULL! */
     440    R0PTRTYPE(VMMDevMemory *)   pVMMDevRAMR0;
     441} VMMDEVR0;
     442/** Pointer to the ring-0 VMM device state. */
     443typedef VMMDEVR0 *PVMMDEVR0;
     444
     445
     446/**
     447 * State structure for the VMM device, raw-mode edition.
     448 */
     449typedef struct VMMDEVRC
     450{
     451    /** R0 pointer to VMMDev RAM area - first page only, could be NULL! */
     452    RCPTRTYPE(VMMDevMemory *)   pVMMDevRAMRC;
     453} VMMDEVRC;
     454/** Pointer to the raw-mode VMM device state. */
     455typedef VMMDEVRC *PVMMDEVRC;
     456
     457
     458/** @typedef VMMDEVCC
     459 * The VMMDEV device data for the current context. */
     460typedef CTX_SUFF(VMMDEV) VMMDEVCC;
     461/** @typedef PVMMDEVCC
     462 * Pointer to the VMMDEV device for the current context. */
     463typedef CTX_SUFF(PVMMDEV) PVMMDEVCC;
     464
     465
     466void VMMDevNotifyGuest(PPDMDEVINS pDevIns, PVMMDEV pThis, PVMMDEVCC pThisCC, uint32_t fAddEvents);
     467void VMMDevCtlSetGuestFilterMask(PPDMDEVINS pDevIns, PVMMDEV pThis, PVMMDEVCC pThisCC, uint32_t fOrMask, uint32_t fNotMask);
    425468
    426469
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