VirtualBox

Changeset 44720 in vbox


Ignore:
Timestamp:
Feb 15, 2013 5:52:37 PM (12 years ago)
Author:
vboxsync
Message:

VMMDev: More cleanups.

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

Legend:

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

    r44709 r44720  
    26302630
    26312631
    2632 /* -=-=-=-=-=- IVMMDevPort -=-=-=-=-=- */
     2632/* -=-=-=-=-=- PDMIVMMDEVPORT (VMMDEV::IPort) -=-=-=-=-=- */
    26332633
    26342634/** Converts a VMMDev port interface pointer to a VMMDev state pointer. */
     
    26412641static DECLCALLBACK(int) vmmdevIPort_QueryAbsoluteMouse(PPDMIVMMDEVPORT pInterface, int32_t *pxAbs, int32_t *pyAbs)
    26422642{
    2643     VMMDevState *pThis = IVMMDEVPORT_2_VMMDEVSTATE(pInterface);
     2643    PVMMDEV pThis = RT_FROM_MEMBER(pInterface, VMMDEV, IPort);
     2644
    26442645    if (pxAbs)
    26452646        *pxAbs = ASMAtomicReadS32(&pThis->mouseXAbs); /* why the atomic read? */
     
    26542655static DECLCALLBACK(int) vmmdevIPort_SetAbsoluteMouse(PPDMIVMMDEVPORT pInterface, int32_t xAbs, int32_t yAbs)
    26552656{
    2656     VMMDevState *pThis = IVMMDEVPORT_2_VMMDEVSTATE(pInterface);
     2657    PVMMDEV pThis = RT_FROM_MEMBER(pInterface, VMMDEV, IPort);
    26572658    PDMCritSectEnter(&pThis->CritSect, VERR_SEM_BUSY);
    26582659
    2659     if (pThis->mouseXAbs == xAbs && pThis->mouseYAbs == yAbs)
    2660     {
    2661         PDMCritSectLeave(&pThis->CritSect);
    2662         return VINF_SUCCESS;
    2663     }
    2664     Log2(("vmmdevIPort_SetAbsoluteMouse : settings absolute position to x = %d, y = %d\n", xAbs, yAbs));
    2665     pThis->mouseXAbs = xAbs;
    2666     pThis->mouseYAbs = yAbs;
    2667     VMMDevNotifyGuest(pThis, VMMDEV_EVENT_MOUSE_POSITION_CHANGED);
     2660    if (   pThis->mouseXAbs != xAbs
     2661        || pThis->mouseYAbs != yAbs)
     2662    {
     2663        Log2(("vmmdevIPort_SetAbsoluteMouse : settings absolute position to x = %d, y = %d\n", xAbs, yAbs));
     2664        pThis->mouseXAbs = xAbs;
     2665        pThis->mouseYAbs = yAbs;
     2666        VMMDevNotifyGuest(pThis, VMMDEV_EVENT_MOUSE_POSITION_CHANGED);
     2667    }
     2668
    26682669    PDMCritSectLeave(&pThis->CritSect);
    26692670    return VINF_SUCCESS;
     
    26752676static DECLCALLBACK(int) vmmdevIPort_QueryMouseCapabilities(PPDMIVMMDEVPORT pInterface, uint32_t *pfCapabilities)
    26762677{
    2677     VMMDevState *pThis = IVMMDEVPORT_2_VMMDEVSTATE(pInterface);
    2678     if (!pfCapabilities)
    2679         return VERR_INVALID_PARAMETER;
     2678    PVMMDEV pThis = RT_FROM_MEMBER(pInterface, VMMDEV, IPort);
     2679    AssertPtrReturn(pfCapabilities, VERR_INVALID_PARAMETER);
     2680
    26802681    *pfCapabilities = pThis->mouseCapabilities;
    26812682    return VINF_SUCCESS;
     
    26852686 * @interface_method_impl{PDMIVMMDEVPORT, pfnUpdateMouseCapabilities}
    26862687 */
    2687 static DECLCALLBACK(int) vmmdevIPort_UpdateMouseCapabilities(PPDMIVMMDEVPORT pInterface, uint32_t fCapsAdded, uint32_t fCapsRemoved)
    2688 {
    2689     VMMDevState *pThis = IVMMDEVPORT_2_VMMDEVSTATE(pInterface);
     2688static DECLCALLBACK(int)
     2689vmmdevIPort_UpdateMouseCapabilities(PPDMIVMMDEVPORT pInterface, uint32_t fCapsAdded, uint32_t fCapsRemoved)
     2690{
     2691    PVMMDEV pThis = RT_FROM_MEMBER(pInterface, VMMDEV, IPort);
    26902692    PDMCritSectEnter(&pThis->CritSect, VERR_SEM_BUSY);
    26912693
    26922694    uint32_t fOldCaps = pThis->mouseCapabilities;
    26932695    pThis->mouseCapabilities &= ~(fCapsRemoved & VMMDEV_MOUSE_HOST_MASK);
    2694     pThis->mouseCapabilities |=   (fCapsAdded & VMMDEV_MOUSE_HOST_MASK)
    2695                                 | VMMDEV_MOUSE_HOST_RECHECKS_NEEDS_HOST_CURSOR;
     2696    pThis->mouseCapabilities |= (fCapsAdded & VMMDEV_MOUSE_HOST_MASK)
     2697                              | VMMDEV_MOUSE_HOST_RECHECKS_NEEDS_HOST_CURSOR;
    26962698    bool fNotify = fOldCaps != pThis->mouseCapabilities;
    26972699
    2698     LogRelFlowFunc(("fCapsAdded=0x%x, fCapsRemoved=0x%x, fNotify %s\n",
    2699                     fCapsAdded, fCapsRemoved, fNotify ? "TRUE" : "FALSE"));
     2700    LogRelFlowFunc(("fCapsAdded=0x%x, fCapsRemoved=0x%x, fNotify=%RTbool\n", fCapsAdded, fCapsRemoved, fNotify));
    27002701
    27012702    if (fNotify)
     
    27132714                                 uint32_t xOrigin, uint32_t yOrigin, bool fEnabled, bool fChangeOrigin)
    27142715{
    2715     VMMDevState *pThis = IVMMDEVPORT_2_VMMDEVSTATE(pInterface);
     2716    PVMMDEV pThis = RT_FROM_MEMBER(pInterface, VMMDEV, IPort);
    27162717
    27172718    if (idxDisplay >= RT_ELEMENTS(pThis->displayChangeData.aRequests))
     
    27492750    if (!fSameResolution)
    27502751    {
    2751         LogRel(("VMMDev::SetVideoModeHint: got a video mode hint (%dx%dx%d) at %d\n",
    2752                 cx, cy, cBits, idxDisplay));
     2752        LogRel(("VMMDev::SetVideoModeHint: got a video mode hint (%dx%dx%d) at %d\n", cx, cy, cBits, idxDisplay));
    27532753
    27542754        /* we could validate the information here but hey, the guest can do that as well! */
     
    27772777static DECLCALLBACK(int) vmmdevIPort_RequestSeamlessChange(PPDMIVMMDEVPORT pInterface, bool fEnabled)
    27782778{
    2779     VMMDevState *pThis = IVMMDEVPORT_2_VMMDEVSTATE(pInterface);
     2779    PVMMDEV pThis = RT_FROM_MEMBER(pInterface, VMMDEV, IPort);
    27802780    PDMCritSectEnter(&pThis->CritSect, VERR_SEM_BUSY);
    27812781
     
    28032803static DECLCALLBACK(int) vmmdevIPort_SetMemoryBalloon(PPDMIVMMDEVPORT pInterface, uint32_t cMbBalloon)
    28042804{
    2805     VMMDevState *pThis = IVMMDEVPORT_2_VMMDEVSTATE(pInterface);
     2805    PVMMDEV pThis = RT_FROM_MEMBER(pInterface, VMMDEV, IPort);
    28062806    PDMCritSectEnter(&pThis->CritSect, VERR_SEM_BUSY);
    28072807
     
    28262826static DECLCALLBACK(int) vmmdevIPort_VRDPChange(PPDMIVMMDEVPORT pInterface, bool fVRDPEnabled, uint32_t uVRDPExperienceLevel)
    28272827{
    2828     VMMDevState *pThis = IVMMDEVPORT_2_VMMDEVSTATE(pInterface);
     2828    PVMMDEV pThis = RT_FROM_MEMBER(pInterface, VMMDEV, IPort);
    28292829    PDMCritSectEnter(&pThis->CritSect, VERR_SEM_BUSY);
    28302830
     
    28502850static DECLCALLBACK(int) vmmdevIPort_SetStatisticsInterval(PPDMIVMMDEVPORT pInterface, uint32_t cSecsStatInterval)
    28512851{
    2852     VMMDevState *pThis = IVMMDEVPORT_2_VMMDEVSTATE(pInterface);
     2852    PVMMDEV pThis = RT_FROM_MEMBER(pInterface, VMMDEV, IPort);
    28532853    PDMCritSectEnter(&pThis->CritSect, VERR_SEM_BUSY);
    28542854
     
    28772877                                                    const char *pszPassword, const char *pszDomain, uint32_t fFlags)
    28782878{
    2879     VMMDevState *pThis = IVMMDEVPORT_2_VMMDEVSTATE(pInterface);
    2880     int          rc = VINF_SUCCESS;
     2879    PVMMDEV pThis = RT_FROM_MEMBER(pInterface, VMMDEV, IPort);
     2880    AssertReturn(fFlags & (VMMDEV_SETCREDENTIALS_GUESTLOGON | VMMDEV_SETCREDENTIALS_JUDGE), VERR_INVALID_PARAMETER);
    28812881
    28822882    PDMCritSectEnter(&pThis->CritSect, VERR_SEM_BUSY);
    28832883
    2884     /* logon mode? */
     2884    /*
     2885     * Logon mode
     2886     */
    28852887    if (fFlags & VMMDEV_SETCREDENTIALS_GUESTLOGON)
    28862888    {
     
    28912893        pThis->pCredentials->Logon.fAllowInteractiveLogon = !(fFlags & VMMDEV_SETCREDENTIALS_NOLOCALLOGON);
    28922894    }
    2893     /* credentials verification mode? */
    2894     else if (fFlags & VMMDEV_SETCREDENTIALS_JUDGE)
     2895    /*
     2896     * Credentials verification mode?
     2897     */
     2898    else
    28952899    {
    28962900        /* memorize the data */
     
    29012905        VMMDevNotifyGuest(pThis, VMMDEV_EVENT_JUDGE_CREDENTIALS);
    29022906    }
    2903     else
    2904         rc = VERR_INVALID_PARAMETER;
    29052907
    29062908    PDMCritSectLeave(&pThis->CritSect);
    2907     return rc;
     2909    return VINF_SUCCESS;
    29082910}
    29092911
     
    29162918static DECLCALLBACK(void) vmmdevIPort_VBVAChange(PPDMIVMMDEVPORT pInterface, bool fEnabled)
    29172919{
    2918     VMMDevState *pThis = IVMMDEVPORT_2_VMMDEVSTATE(pInterface);
     2920    PVMMDEV pThis = RT_FROM_MEMBER(pInterface, VMMDEV, IPort);
    29192921
    29202922    Log(("vmmdevIPort_VBVAChange: fEnabled = %d\n", fEnabled));
     
    29332935{
    29342936    int rc = VINF_SUCCESS;
    2935     VMMDevState *pThis = IVMMDEVPORT_2_VMMDEVSTATE(pInterface);
     2937    PVMMDEV pThis = RT_FROM_MEMBER(pInterface, VMMDEV, IPort);
    29362938
    29372939    Log(("vmmdevIPort_CpuHotUnplug: idCpuCore=%u idCpuPackage=%u\n", idCpuCore, idCpuPackage));
     
    29592961{
    29602962    int rc = VINF_SUCCESS;
    2961     VMMDevState *pThis = IVMMDEVPORT_2_VMMDEVSTATE(pInterface);
     2963    PVMMDEV pThis = RT_FROM_MEMBER(pInterface, VMMDEV, IPort);
    29622964
    29632965    Log(("vmmdevCpuPlug: idCpuCore=%u idCpuPackage=%u\n", idCpuCore, idCpuPackage));
  • trunk/src/VBox/Devices/testcase/tstDeviceStructSizeRC.cpp

    r44709 r44720  
    14061406
    14071407    /* VMMDev*.cpp/h */
    1408     GEN_CHECK_SIZE(VMMDevState);
    1409     GEN_CHECK_OFF(VMMDevState, PciDev);
    1410     GEN_CHECK_OFF(VMMDevState, CritSect);
    1411     GEN_CHECK_OFF(VMMDevState, hypervisorSize);
    1412     GEN_CHECK_OFF(VMMDevState, mouseCapabilities);
    1413     GEN_CHECK_OFF(VMMDevState, mouseXAbs);
    1414     GEN_CHECK_OFF(VMMDevState, mouseYAbs);
    1415     GEN_CHECK_OFF(VMMDevState, fHostCursorRequested);
    1416     GEN_CHECK_OFF(VMMDevState, pDevIns);
    1417     GEN_CHECK_OFF(VMMDevState, IBase);
    1418     GEN_CHECK_OFF(VMMDevState, IPort);
     1408    GEN_CHECK_SIZE(VMMDEV);
     1409    GEN_CHECK_OFF(VMMDEV, PciDev);
     1410    GEN_CHECK_OFF(VMMDEV, CritSect);
     1411    GEN_CHECK_OFF(VMMDEV, hypervisorSize);
     1412    GEN_CHECK_OFF(VMMDEV, mouseCapabilities);
     1413    GEN_CHECK_OFF(VMMDEV, mouseXAbs);
     1414    GEN_CHECK_OFF(VMMDEV, mouseYAbs);
     1415    GEN_CHECK_OFF(VMMDEV, fHostCursorRequested);
     1416    GEN_CHECK_OFF(VMMDEV, pDevIns);
     1417    GEN_CHECK_OFF(VMMDEV, IBase);
     1418    GEN_CHECK_OFF(VMMDEV, IPort);
    14191419#ifdef VBOX_WITH_HGCM
    1420     GEN_CHECK_OFF(VMMDevState, IHGCMPort);
    1421 #endif
    1422     GEN_CHECK_OFF(VMMDevState, pDrvBase);
    1423     GEN_CHECK_OFF(VMMDevState, pDrv);
     1420    GEN_CHECK_OFF(VMMDEV, IHGCMPort);
     1421#endif
     1422    GEN_CHECK_OFF(VMMDEV, pDrvBase);
     1423    GEN_CHECK_OFF(VMMDEV, pDrv);
    14241424#ifdef VBOX_WITH_HGCM
    1425     GEN_CHECK_OFF(VMMDevState, pHGCMDrv);
    1426 #endif
    1427     GEN_CHECK_OFF(VMMDevState, szMsg);
    1428     GEN_CHECK_OFF(VMMDevState, iMsg);
    1429     GEN_CHECK_OFF(VMMDevState, PortBase);
    1430     GEN_CHECK_OFF(VMMDevState, irq);
    1431     GEN_CHECK_OFF(VMMDevState, u32HostEventFlags);
    1432     GEN_CHECK_OFF(VMMDevState, u32GuestFilterMask);
    1433     GEN_CHECK_OFF(VMMDevState, u32NewGuestFilterMask);
    1434     GEN_CHECK_OFF(VMMDevState, fNewGuestFilterMask);
    1435     GEN_CHECK_OFF(VMMDevState, GCPhysVMMDevRAM);
    1436     GEN_CHECK_OFF(VMMDevState, pVMMDevRAMR3);
    1437     GEN_CHECK_OFF(VMMDevState, pVMMDevHeapR3);
    1438     GEN_CHECK_OFF(VMMDevState, GCPhysVMMDevHeap);
    1439     GEN_CHECK_OFF(VMMDevState, guestInfo);
    1440     GEN_CHECK_OFF(VMMDevState, guestCaps);
    1441     GEN_CHECK_OFF(VMMDevState, fu32AdditionsOk);
    1442     GEN_CHECK_OFF(VMMDevState, u32VideoAccelEnabled);
    1443     GEN_CHECK_OFF(VMMDevState, displayChangeData);
    1444     GEN_CHECK_OFF(VMMDevState, pCredentials);
    1445     GEN_CHECK_OFF(VMMDevState, cMbMemoryBalloon);
    1446     GEN_CHECK_OFF(VMMDevState, cMbMemoryBalloonLast);
    1447     GEN_CHECK_OFF(VMMDevState, cbGuestRAM);
    1448     GEN_CHECK_OFF(VMMDevState, idSession);
    1449     GEN_CHECK_OFF(VMMDevState, u32StatIntervalSize);
    1450     GEN_CHECK_OFF(VMMDevState, u32LastStatIntervalSize);
    1451     GEN_CHECK_OFF(VMMDevState, fLastSeamlessEnabled),
    1452     GEN_CHECK_OFF(VMMDevState, fSeamlessEnabled);
    1453     GEN_CHECK_OFF(VMMDevState, fVRDPEnabled);
    1454     GEN_CHECK_OFF(VMMDevState, uVRDPExperienceLevel);
     1425    GEN_CHECK_OFF(VMMDEV, pHGCMDrv);
     1426#endif
     1427    GEN_CHECK_OFF(VMMDEV, szMsg);
     1428    GEN_CHECK_OFF(VMMDEV, iMsg);
     1429    GEN_CHECK_OFF(VMMDEV, PortBase);
     1430    GEN_CHECK_OFF(VMMDEV, irq);
     1431    GEN_CHECK_OFF(VMMDEV, u32HostEventFlags);
     1432    GEN_CHECK_OFF(VMMDEV, u32GuestFilterMask);
     1433    GEN_CHECK_OFF(VMMDEV, u32NewGuestFilterMask);
     1434    GEN_CHECK_OFF(VMMDEV, fNewGuestFilterMask);
     1435    GEN_CHECK_OFF(VMMDEV, GCPhysVMMDevRAM);
     1436    GEN_CHECK_OFF(VMMDEV, pVMMDevRAMR3);
     1437    GEN_CHECK_OFF(VMMDEV, pVMMDevHeapR3);
     1438    GEN_CHECK_OFF(VMMDEV, GCPhysVMMDevHeap);
     1439    GEN_CHECK_OFF(VMMDEV, guestInfo);
     1440    GEN_CHECK_OFF(VMMDEV, guestCaps);
     1441    GEN_CHECK_OFF(VMMDEV, fu32AdditionsOk);
     1442    GEN_CHECK_OFF(VMMDEV, u32VideoAccelEnabled);
     1443    GEN_CHECK_OFF(VMMDEV, displayChangeData);
     1444    GEN_CHECK_OFF(VMMDEV, pCredentials);
     1445    GEN_CHECK_OFF(VMMDEV, cMbMemoryBalloon);
     1446    GEN_CHECK_OFF(VMMDEV, cMbMemoryBalloonLast);
     1447    GEN_CHECK_OFF(VMMDEV, cbGuestRAM);
     1448    GEN_CHECK_OFF(VMMDEV, idSession);
     1449    GEN_CHECK_OFF(VMMDEV, u32StatIntervalSize);
     1450    GEN_CHECK_OFF(VMMDEV, u32LastStatIntervalSize);
     1451    GEN_CHECK_OFF(VMMDEV, fLastSeamlessEnabled),
     1452    GEN_CHECK_OFF(VMMDEV, fSeamlessEnabled);
     1453    GEN_CHECK_OFF(VMMDEV, fVRDPEnabled);
     1454    GEN_CHECK_OFF(VMMDEV, uVRDPExperienceLevel);
    14551455#ifdef TIMESYNC_BACKDOOR
    1456     GEN_CHECK_OFF(VMMDevState, hostTime);
    1457     GEN_CHECK_OFF(VMMDevState, fTimesyncBackdoorLo);
    1458 #endif
    1459     GEN_CHECK_OFF(VMMDevState, fGetHostTimeDisabled);
    1460     GEN_CHECK_OFF(VMMDevState, fBackdoorLogDisabled);
    1461     GEN_CHECK_OFF(VMMDevState, fKeepCredentials);
    1462     GEN_CHECK_OFF(VMMDevState, fHeapEnabled);
     1456    GEN_CHECK_OFF(VMMDEV, hostTime);
     1457    GEN_CHECK_OFF(VMMDEV, fTimesyncBackdoorLo);
     1458#endif
     1459    GEN_CHECK_OFF(VMMDEV, fGetHostTimeDisabled);
     1460    GEN_CHECK_OFF(VMMDEV, fBackdoorLogDisabled);
     1461    GEN_CHECK_OFF(VMMDEV, fKeepCredentials);
     1462    GEN_CHECK_OFF(VMMDEV, fHeapEnabled);
    14631463#ifdef VBOX_WITH_HGCM
    1464     GEN_CHECK_OFF(VMMDevState, pHGCMCmdList);
    1465     GEN_CHECK_OFF(VMMDevState, critsectHGCMCmdList);
    1466     GEN_CHECK_OFF(VMMDevState, u32HGCMEnabled);
    1467 #endif
    1468     GEN_CHECK_OFF(VMMDevState, SharedFolders);
    1469     GEN_CHECK_OFF(VMMDevState, SharedFolders.Led);
    1470     GEN_CHECK_OFF(VMMDevState, SharedFolders.ILeds);
    1471     GEN_CHECK_OFF(VMMDevState, SharedFolders.pLedsConnector);
    1472     GEN_CHECK_OFF(VMMDevState, fCpuHotPlugEventsEnabled);
    1473     GEN_CHECK_OFF(VMMDevState, enmCpuHotPlugEvent);
    1474     GEN_CHECK_OFF(VMMDevState, idCpuCore);
    1475     GEN_CHECK_OFF(VMMDevState, idCpuPackage);
    1476     GEN_CHECK_OFF(VMMDevState, StatMemBalloonChunks);
    1477     GEN_CHECK_OFF(VMMDevState, fRZEnabled);
    1478     GEN_CHECK_OFF(VMMDevState, fTestingEnabled);
    1479     GEN_CHECK_OFF(VMMDevState, u32TestingHighTimestamp);
    1480     GEN_CHECK_OFF(VMMDevState, u32TestingCmd);
    1481     GEN_CHECK_OFF(VMMDevState, offTestingData);
    1482     GEN_CHECK_OFF(VMMDevState, TestingData);
    1483     GEN_CHECK_OFF(VMMDevState, TestingData.Value.u64Value);
    1484     GEN_CHECK_OFF(VMMDevState, TestingData.Value.u32Unit);
    1485     GEN_CHECK_OFF(VMMDevState, TestingData.Value.szName);
     1464    GEN_CHECK_OFF(VMMDEV, pHGCMCmdList);
     1465    GEN_CHECK_OFF(VMMDEV, critsectHGCMCmdList);
     1466    GEN_CHECK_OFF(VMMDEV, u32HGCMEnabled);
     1467#endif
     1468    GEN_CHECK_OFF(VMMDEV, SharedFolders);
     1469    GEN_CHECK_OFF(VMMDEV, SharedFolders.Led);
     1470    GEN_CHECK_OFF(VMMDEV, SharedFolders.ILeds);
     1471    GEN_CHECK_OFF(VMMDEV, SharedFolders.pLedsConnector);
     1472    GEN_CHECK_OFF(VMMDEV, fCpuHotPlugEventsEnabled);
     1473    GEN_CHECK_OFF(VMMDEV, enmCpuHotPlugEvent);
     1474    GEN_CHECK_OFF(VMMDEV, idCpuCore);
     1475    GEN_CHECK_OFF(VMMDEV, idCpuPackage);
     1476    GEN_CHECK_OFF(VMMDEV, StatMemBalloonChunks);
     1477    GEN_CHECK_OFF(VMMDEV, fRZEnabled);
     1478    GEN_CHECK_OFF(VMMDEV, fTestingEnabled);
     1479    GEN_CHECK_OFF(VMMDEV, u32TestingHighTimestamp);
     1480    GEN_CHECK_OFF(VMMDEV, u32TestingCmd);
     1481    GEN_CHECK_OFF(VMMDEV, offTestingData);
     1482    GEN_CHECK_OFF(VMMDEV, TestingData);
     1483    GEN_CHECK_OFF(VMMDEV, TestingData.Value.u64Value);
     1484    GEN_CHECK_OFF(VMMDEV, TestingData.Value.u32Unit);
     1485    GEN_CHECK_OFF(VMMDEV, TestingData.Value.szName);
    14861486
    14871487#ifdef VBOX_WITH_BUSLOGIC
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