Changeset 44720 in vbox
- Timestamp:
- Feb 15, 2013 5:52:37 PM (12 years ago)
- Location:
- trunk/src/VBox/Devices
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/VMMDev/VMMDev.cpp
r44709 r44720 2630 2630 2631 2631 2632 /* -=-=-=-=-=- IVMMDevPort-=-=-=-=-=- */2632 /* -=-=-=-=-=- PDMIVMMDEVPORT (VMMDEV::IPort) -=-=-=-=-=- */ 2633 2633 2634 2634 /** Converts a VMMDev port interface pointer to a VMMDev state pointer. */ … … 2641 2641 static DECLCALLBACK(int) vmmdevIPort_QueryAbsoluteMouse(PPDMIVMMDEVPORT pInterface, int32_t *pxAbs, int32_t *pyAbs) 2642 2642 { 2643 VMMDevState *pThis = IVMMDEVPORT_2_VMMDEVSTATE(pInterface); 2643 PVMMDEV pThis = RT_FROM_MEMBER(pInterface, VMMDEV, IPort); 2644 2644 2645 if (pxAbs) 2645 2646 *pxAbs = ASMAtomicReadS32(&pThis->mouseXAbs); /* why the atomic read? */ … … 2654 2655 static DECLCALLBACK(int) vmmdevIPort_SetAbsoluteMouse(PPDMIVMMDEVPORT pInterface, int32_t xAbs, int32_t yAbs) 2655 2656 { 2656 VMMDevState *pThis = IVMMDEVPORT_2_VMMDEVSTATE(pInterface);2657 PVMMDEV pThis = RT_FROM_MEMBER(pInterface, VMMDEV, IPort); 2657 2658 PDMCritSectEnter(&pThis->CritSect, VERR_SEM_BUSY); 2658 2659 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 2668 2669 PDMCritSectLeave(&pThis->CritSect); 2669 2670 return VINF_SUCCESS; … … 2675 2676 static DECLCALLBACK(int) vmmdevIPort_QueryMouseCapabilities(PPDMIVMMDEVPORT pInterface, uint32_t *pfCapabilities) 2676 2677 { 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 2680 2681 *pfCapabilities = pThis->mouseCapabilities; 2681 2682 return VINF_SUCCESS; … … 2685 2686 * @interface_method_impl{PDMIVMMDEVPORT, pfnUpdateMouseCapabilities} 2686 2687 */ 2687 static DECLCALLBACK(int) vmmdevIPort_UpdateMouseCapabilities(PPDMIVMMDEVPORT pInterface, uint32_t fCapsAdded, uint32_t fCapsRemoved) 2688 { 2689 VMMDevState *pThis = IVMMDEVPORT_2_VMMDEVSTATE(pInterface); 2688 static DECLCALLBACK(int) 2689 vmmdevIPort_UpdateMouseCapabilities(PPDMIVMMDEVPORT pInterface, uint32_t fCapsAdded, uint32_t fCapsRemoved) 2690 { 2691 PVMMDEV pThis = RT_FROM_MEMBER(pInterface, VMMDEV, IPort); 2690 2692 PDMCritSectEnter(&pThis->CritSect, VERR_SEM_BUSY); 2691 2693 2692 2694 uint32_t fOldCaps = pThis->mouseCapabilities; 2693 2695 pThis->mouseCapabilities &= ~(fCapsRemoved & VMMDEV_MOUSE_HOST_MASK); 2694 pThis->mouseCapabilities |= 2695 2696 pThis->mouseCapabilities |= (fCapsAdded & VMMDEV_MOUSE_HOST_MASK) 2697 | VMMDEV_MOUSE_HOST_RECHECKS_NEEDS_HOST_CURSOR; 2696 2698 bool fNotify = fOldCaps != pThis->mouseCapabilities; 2697 2699 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)); 2700 2701 2701 2702 if (fNotify) … … 2713 2714 uint32_t xOrigin, uint32_t yOrigin, bool fEnabled, bool fChangeOrigin) 2714 2715 { 2715 VMMDevState *pThis = IVMMDEVPORT_2_VMMDEVSTATE(pInterface);2716 PVMMDEV pThis = RT_FROM_MEMBER(pInterface, VMMDEV, IPort); 2716 2717 2717 2718 if (idxDisplay >= RT_ELEMENTS(pThis->displayChangeData.aRequests)) … … 2749 2750 if (!fSameResolution) 2750 2751 { 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)); 2753 2753 2754 2754 /* we could validate the information here but hey, the guest can do that as well! */ … … 2777 2777 static DECLCALLBACK(int) vmmdevIPort_RequestSeamlessChange(PPDMIVMMDEVPORT pInterface, bool fEnabled) 2778 2778 { 2779 VMMDevState *pThis = IVMMDEVPORT_2_VMMDEVSTATE(pInterface);2779 PVMMDEV pThis = RT_FROM_MEMBER(pInterface, VMMDEV, IPort); 2780 2780 PDMCritSectEnter(&pThis->CritSect, VERR_SEM_BUSY); 2781 2781 … … 2803 2803 static DECLCALLBACK(int) vmmdevIPort_SetMemoryBalloon(PPDMIVMMDEVPORT pInterface, uint32_t cMbBalloon) 2804 2804 { 2805 VMMDevState *pThis = IVMMDEVPORT_2_VMMDEVSTATE(pInterface);2805 PVMMDEV pThis = RT_FROM_MEMBER(pInterface, VMMDEV, IPort); 2806 2806 PDMCritSectEnter(&pThis->CritSect, VERR_SEM_BUSY); 2807 2807 … … 2826 2826 static DECLCALLBACK(int) vmmdevIPort_VRDPChange(PPDMIVMMDEVPORT pInterface, bool fVRDPEnabled, uint32_t uVRDPExperienceLevel) 2827 2827 { 2828 VMMDevState *pThis = IVMMDEVPORT_2_VMMDEVSTATE(pInterface);2828 PVMMDEV pThis = RT_FROM_MEMBER(pInterface, VMMDEV, IPort); 2829 2829 PDMCritSectEnter(&pThis->CritSect, VERR_SEM_BUSY); 2830 2830 … … 2850 2850 static DECLCALLBACK(int) vmmdevIPort_SetStatisticsInterval(PPDMIVMMDEVPORT pInterface, uint32_t cSecsStatInterval) 2851 2851 { 2852 VMMDevState *pThis = IVMMDEVPORT_2_VMMDEVSTATE(pInterface);2852 PVMMDEV pThis = RT_FROM_MEMBER(pInterface, VMMDEV, IPort); 2853 2853 PDMCritSectEnter(&pThis->CritSect, VERR_SEM_BUSY); 2854 2854 … … 2877 2877 const char *pszPassword, const char *pszDomain, uint32_t fFlags) 2878 2878 { 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); 2881 2881 2882 2882 PDMCritSectEnter(&pThis->CritSect, VERR_SEM_BUSY); 2883 2883 2884 /* logon mode? */ 2884 /* 2885 * Logon mode 2886 */ 2885 2887 if (fFlags & VMMDEV_SETCREDENTIALS_GUESTLOGON) 2886 2888 { … … 2891 2893 pThis->pCredentials->Logon.fAllowInteractiveLogon = !(fFlags & VMMDEV_SETCREDENTIALS_NOLOCALLOGON); 2892 2894 } 2893 /* credentials verification mode? */ 2894 else if (fFlags & VMMDEV_SETCREDENTIALS_JUDGE) 2895 /* 2896 * Credentials verification mode? 2897 */ 2898 else 2895 2899 { 2896 2900 /* memorize the data */ … … 2901 2905 VMMDevNotifyGuest(pThis, VMMDEV_EVENT_JUDGE_CREDENTIALS); 2902 2906 } 2903 else2904 rc = VERR_INVALID_PARAMETER;2905 2907 2906 2908 PDMCritSectLeave(&pThis->CritSect); 2907 return rc;2909 return VINF_SUCCESS; 2908 2910 } 2909 2911 … … 2916 2918 static DECLCALLBACK(void) vmmdevIPort_VBVAChange(PPDMIVMMDEVPORT pInterface, bool fEnabled) 2917 2919 { 2918 VMMDevState *pThis = IVMMDEVPORT_2_VMMDEVSTATE(pInterface);2920 PVMMDEV pThis = RT_FROM_MEMBER(pInterface, VMMDEV, IPort); 2919 2921 2920 2922 Log(("vmmdevIPort_VBVAChange: fEnabled = %d\n", fEnabled)); … … 2933 2935 { 2934 2936 int rc = VINF_SUCCESS; 2935 VMMDevState *pThis = IVMMDEVPORT_2_VMMDEVSTATE(pInterface);2937 PVMMDEV pThis = RT_FROM_MEMBER(pInterface, VMMDEV, IPort); 2936 2938 2937 2939 Log(("vmmdevIPort_CpuHotUnplug: idCpuCore=%u idCpuPackage=%u\n", idCpuCore, idCpuPackage)); … … 2959 2961 { 2960 2962 int rc = VINF_SUCCESS; 2961 VMMDevState *pThis = IVMMDEVPORT_2_VMMDEVSTATE(pInterface);2963 PVMMDEV pThis = RT_FROM_MEMBER(pInterface, VMMDEV, IPort); 2962 2964 2963 2965 Log(("vmmdevCpuPlug: idCpuCore=%u idCpuPackage=%u\n", idCpuCore, idCpuPackage)); -
trunk/src/VBox/Devices/testcase/tstDeviceStructSizeRC.cpp
r44709 r44720 1406 1406 1407 1407 /* VMMDev*.cpp/h */ 1408 GEN_CHECK_SIZE(VMMD evState);1409 GEN_CHECK_OFF(VMMD evState, PciDev);1410 GEN_CHECK_OFF(VMMD evState, CritSect);1411 GEN_CHECK_OFF(VMMD evState, hypervisorSize);1412 GEN_CHECK_OFF(VMMD evState, mouseCapabilities);1413 GEN_CHECK_OFF(VMMD evState, mouseXAbs);1414 GEN_CHECK_OFF(VMMD evState, mouseYAbs);1415 GEN_CHECK_OFF(VMMD evState, fHostCursorRequested);1416 GEN_CHECK_OFF(VMMD evState, pDevIns);1417 GEN_CHECK_OFF(VMMD evState, IBase);1418 GEN_CHECK_OFF(VMMD evState, 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); 1419 1419 #ifdef VBOX_WITH_HGCM 1420 GEN_CHECK_OFF(VMMD evState, IHGCMPort);1421 #endif 1422 GEN_CHECK_OFF(VMMD evState, pDrvBase);1423 GEN_CHECK_OFF(VMMD evState, pDrv);1420 GEN_CHECK_OFF(VMMDEV, IHGCMPort); 1421 #endif 1422 GEN_CHECK_OFF(VMMDEV, pDrvBase); 1423 GEN_CHECK_OFF(VMMDEV, pDrv); 1424 1424 #ifdef VBOX_WITH_HGCM 1425 GEN_CHECK_OFF(VMMD evState, pHGCMDrv);1426 #endif 1427 GEN_CHECK_OFF(VMMD evState, szMsg);1428 GEN_CHECK_OFF(VMMD evState, iMsg);1429 GEN_CHECK_OFF(VMMD evState, PortBase);1430 GEN_CHECK_OFF(VMMD evState, irq);1431 GEN_CHECK_OFF(VMMD evState, u32HostEventFlags);1432 GEN_CHECK_OFF(VMMD evState, u32GuestFilterMask);1433 GEN_CHECK_OFF(VMMD evState, u32NewGuestFilterMask);1434 GEN_CHECK_OFF(VMMD evState, fNewGuestFilterMask);1435 GEN_CHECK_OFF(VMMD evState, GCPhysVMMDevRAM);1436 GEN_CHECK_OFF(VMMD evState, pVMMDevRAMR3);1437 GEN_CHECK_OFF(VMMD evState, pVMMDevHeapR3);1438 GEN_CHECK_OFF(VMMD evState, GCPhysVMMDevHeap);1439 GEN_CHECK_OFF(VMMD evState, guestInfo);1440 GEN_CHECK_OFF(VMMD evState, guestCaps);1441 GEN_CHECK_OFF(VMMD evState, fu32AdditionsOk);1442 GEN_CHECK_OFF(VMMD evState, u32VideoAccelEnabled);1443 GEN_CHECK_OFF(VMMD evState, displayChangeData);1444 GEN_CHECK_OFF(VMMD evState, pCredentials);1445 GEN_CHECK_OFF(VMMD evState, cMbMemoryBalloon);1446 GEN_CHECK_OFF(VMMD evState, cMbMemoryBalloonLast);1447 GEN_CHECK_OFF(VMMD evState, cbGuestRAM);1448 GEN_CHECK_OFF(VMMD evState, idSession);1449 GEN_CHECK_OFF(VMMD evState, u32StatIntervalSize);1450 GEN_CHECK_OFF(VMMD evState, u32LastStatIntervalSize);1451 GEN_CHECK_OFF(VMMD evState, fLastSeamlessEnabled),1452 GEN_CHECK_OFF(VMMD evState, fSeamlessEnabled);1453 GEN_CHECK_OFF(VMMD evState, fVRDPEnabled);1454 GEN_CHECK_OFF(VMMD evState, 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); 1455 1455 #ifdef TIMESYNC_BACKDOOR 1456 GEN_CHECK_OFF(VMMD evState, hostTime);1457 GEN_CHECK_OFF(VMMD evState, fTimesyncBackdoorLo);1458 #endif 1459 GEN_CHECK_OFF(VMMD evState, fGetHostTimeDisabled);1460 GEN_CHECK_OFF(VMMD evState, fBackdoorLogDisabled);1461 GEN_CHECK_OFF(VMMD evState, fKeepCredentials);1462 GEN_CHECK_OFF(VMMD evState, 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); 1463 1463 #ifdef VBOX_WITH_HGCM 1464 GEN_CHECK_OFF(VMMD evState, pHGCMCmdList);1465 GEN_CHECK_OFF(VMMD evState, critsectHGCMCmdList);1466 GEN_CHECK_OFF(VMMD evState, u32HGCMEnabled);1467 #endif 1468 GEN_CHECK_OFF(VMMD evState, SharedFolders);1469 GEN_CHECK_OFF(VMMD evState, SharedFolders.Led);1470 GEN_CHECK_OFF(VMMD evState, SharedFolders.ILeds);1471 GEN_CHECK_OFF(VMMD evState, SharedFolders.pLedsConnector);1472 GEN_CHECK_OFF(VMMD evState, fCpuHotPlugEventsEnabled);1473 GEN_CHECK_OFF(VMMD evState, enmCpuHotPlugEvent);1474 GEN_CHECK_OFF(VMMD evState, idCpuCore);1475 GEN_CHECK_OFF(VMMD evState, idCpuPackage);1476 GEN_CHECK_OFF(VMMD evState, StatMemBalloonChunks);1477 GEN_CHECK_OFF(VMMD evState, fRZEnabled);1478 GEN_CHECK_OFF(VMMD evState, fTestingEnabled);1479 GEN_CHECK_OFF(VMMD evState, u32TestingHighTimestamp);1480 GEN_CHECK_OFF(VMMD evState, u32TestingCmd);1481 GEN_CHECK_OFF(VMMD evState, offTestingData);1482 GEN_CHECK_OFF(VMMD evState, TestingData);1483 GEN_CHECK_OFF(VMMD evState, TestingData.Value.u64Value);1484 GEN_CHECK_OFF(VMMD evState, TestingData.Value.u32Unit);1485 GEN_CHECK_OFF(VMMD evState, 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); 1486 1486 1487 1487 #ifdef VBOX_WITH_BUSLOGIC
Note:
See TracChangeset
for help on using the changeset viewer.