VirtualBox

Changeset 7768 in vbox for trunk/src/VBox


Ignore:
Timestamp:
Apr 7, 2008 1:22:40 PM (17 years ago)
Author:
vboxsync
Message:

Added a VMState dev/usb/drvhlp.

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

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/VMM/PDMDevice.cpp

    r7755 r7768  
    144144static DECLCALLBACK(int) pdmR3DevHlp_PhysReserve(PPDMDEVINS pDevIns, RTGCPHYS GCPhys, RTUINT cbRange, const char *pszDesc);
    145145static DECLCALLBACK(int) pdmR3DevHlp_PhysGCPtr2GCPhys(PPDMDEVINS pDevIns, RTGCPTR GCPtr, PRTGCPHYS pGCPhys);
     146static DECLCALLBACK(VMSTATE) pdmR3DevHlp_VMState(PPDMDEVINS pDevIns);
    146147static DECLCALLBACK(bool) pdmR3DevHlp_A20IsEnabled(PPDMDEVINS pDevIns);
    147148static DECLCALLBACK(void) pdmR3DevHlp_A20Set(PPDMDEVINS pDevIns, bool fEnable);
     
    268269
    269270/** @def PDMDEV_ASSERT_DEVINS
    270  * Asserts the validity of the driver instance.
     271 * Asserts the validity of the device instance.
    271272 */
    272273#ifdef VBOX_STRICT
    273 # define PDMDEV_ASSERT_DEVINS(pDevIns)   do { Assert(pDevIns); Assert(pDevIns->u32Version == PDM_DEVINS_VERSION); Assert(pDevIns->pvInstanceDataR3 == (void *)&pDevIns->achInstanceData[0]); } while (0)
     274# define PDMDEV_ASSERT_DEVINS(pDevIns)   \
     275    do { \
     276        AssertPtr(pDevIns); \
     277        Assert(pDevIns->u32Version == PDM_DEVINS_VERSION); \
     278        Assert(pDevIns->pvInstanceDataR3 == (void *)&pDevIns->achInstanceData[0]); \
     279    } while (0)
    274280#else
    275281# define PDMDEV_ASSERT_DEVINS(pDevIns)   do { } while (0)
     
    334340    pdmR3DevHlp_PDMThreadCreate,
    335341    pdmR3DevHlp_PhysGCPtr2GCPhys,
    336     0,
     342    pdmR3DevHlp_VMState,
    337343    0,
    338344    0,
     
    428434    pdmR3DevHlp_PDMThreadCreate,
    429435    pdmR3DevHlp_PhysGCPtr2GCPhys,
    430     0,
     436    pdmR3DevHlp_VMState,
    431437    0,
    432438    0,
     
    32853291}
    32863292
     3293
    32873294/** @copydoc PDMDEVHLP::pfnPhysGCPtr2GCPhys */
    32883295static DECLCALLBACK(int) pdmR3DevHlp_PhysGCPtr2GCPhys(PPDMDEVINS pDevIns, RTGCPTR GCPtr, PRTGCPHYS pGCPhys)
     
    33023309
    33033310    return rc;
     3311}
     3312
     3313
     3314/** @copydoc PDMDEVHLP::pfnVMState */
     3315static DECLCALLBACK(VMSTATE) pdmR3DevHlp_VMState(PPDMDEVINS pDevIns)
     3316{
     3317    PDMDEV_ASSERT_DEVINS(pDevIns);
     3318
     3319    VMSTATE enmVMState = VMR3GetState(pDevIns->Internal.s.pVMHC);
     3320
     3321    LogFlow(("pdmR3DevHlp_VMState: caller='%s'/%d: returns %d (%s)\n", pDevIns->pDevReg->szDeviceName, pDevIns->iInstance,
     3322             enmVMState, VMR3GetStateName(enmVMState)));
     3323    return enmVMState;
    33043324}
    33053325
  • trunk/src/VBox/VMM/PDMDriver.cpp

    r6796 r7768  
    9393static DECLCALLBACK(int) pdmR3DrvHlp_PDMThreadCreate(PPDMDRVINS pDrvIns, PPPDMTHREAD ppThread, void *pvUser, PFNPDMTHREADDRV pfnThread,
    9494                                                     PFNPDMTHREADWAKEUPDRV pfnWakeup, size_t cbStack, RTTHREADTYPE enmType, const char *pszName);
     95static DECLCALLBACK(VMSTATE) pdmR3DrvHlp_VMState(PPDMDRVINS pDrvIns);
     96
    9597
    9698#ifdef VBOX_WITH_PDM_ASYNC_COMPLETION
     
    103105 */
    104106#ifdef VBOX_STRICT
    105 # define PDMDRV_ASSERT_DRVINS(pDrvIns)   do { Assert(pDrvIns); Assert(pDrvIns->u32Version == PDM_DRVINS_VERSION); Assert(pDrvIns->pvInstanceData == (void *)&pDrvIns->achInstanceData[0]); } while (0)
     107# define PDMDRV_ASSERT_DRVINS(pDrvIns) \
     108    do { \
     109        AssertPtr(pDrvIns); \
     110        Assert(pDrvIns->u32Version == PDM_DRVINS_VERSION); \
     111        Assert(pDrvIns->pvInstanceData == (void *)&pDrvIns->achInstanceData[0]); \
     112    } while (0)
    106113#else
    107114# define PDMDRV_ASSERT_DRVINS(pDrvIns)   do { } while (0)
     
    145152    pdmR3DrvHlp_USBRegisterHub,
    146153    pdmR3DrvHlp_PDMThreadCreate,
     154    pdmR3DrvHlp_VMState,
    147155#ifdef VBOX_WITH_PDM_ASYNC_COMPLETION
    148156    pdmR3DrvHlp_PDMAsyncCompletionTemplateCreate,
     
    10741082}
    10751083
     1084
     1085/** @copydoc PDMDEVHLP::pfnVMState */
     1086static DECLCALLBACK(VMSTATE) pdmR3DrvHlp_VMState(PPDMDRVINS pDrvIns)
     1087{
     1088    PDMDRV_ASSERT_DRVINS(pDrvIns);
     1089
     1090    VMSTATE enmVMState = VMR3GetState(pDrvIns->Internal.s.pVM);
     1091
     1092    LogFlow(("pdmR3DrvHlp_VMState: caller='%s'/%d: returns %d (%s)\n", pDrvIns->pDrvReg->szDriverName, pDrvIns->iInstance,
     1093             enmVMState, VMR3GetStateName(enmVMState)));
     1094    return enmVMState;
     1095}
     1096
     1097
    10761098#ifdef VBOX_WITH_PDM_ASYNC_COMPLETION
     1099/** @copydoc PDMDRVHLP::pfnPDMAsyncCompletionTemplateCreate */
    10771100static DECLCALLBACK(int) pdmR3DrvHlp_PDMAsyncCompletionTemplateCreate(PPDMDRVINS pDrvIns, PPPDMASYNCCOMPLETIONTEMPLATE ppTemplate,
    10781101                                                                      PFNPDMASYNCCOMPLETEDRV pfnCompleted, const char *pszDesc)
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