VirtualBox

Changeset 28319 in vbox


Ignore:
Timestamp:
Apr 14, 2010 6:25:23 PM (15 years ago)
Author:
vboxsync
Message:

pdmdev: Made PDMDevHlpVMState available in R0 and RC.

Location:
trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/VBox/pdmdev.h

    r27935 r28319  
    31963196
    31973197    /**
     3198     * Gets the VM state.
     3199     *
     3200     * @returns VM state.
     3201     * @param   pDevIns             The device instance.
     3202     * @thread  Any thread (just keep in mind that it's volatile info).
     3203     */
     3204    DECLRCCALLBACKMEMBER(VMSTATE, pfnVMState, (PPDMDEVINS pDevIns));
     3205
     3206    /**
    31983207     * Set the VM error message
    31993208     *
     
    33403349     */
    33413350    DECLR0CALLBACKMEMBER(bool, pfnA20IsEnabled,(PPDMDEVINS pDevIns));
     3351
     3352    /**
     3353     * Gets the VM state.
     3354     *
     3355     * @returns VM state.
     3356     * @param   pDevIns             The device instance.
     3357     * @thread  Any thread (just keep in mind that it's volatile info).
     3358     */
     3359    DECLR0CALLBACKMEMBER(VMSTATE, pfnVMState, (PPDMDEVINS pDevIns));
    33423360
    33433361    /**
     
    39123930    pDevIns->pHlpR3->pfnMMHeapFree(pDevIns, pv);
    39133931}
     3932#endif /* IN_RING3 */
    39143933
    39153934/**
     
    39183937DECLINLINE(VMSTATE) PDMDevHlpVMState(PPDMDEVINS pDevIns)
    39193938{
    3920     return pDevIns->pHlpR3->pfnVMState(pDevIns);
    3921 }
    3922 
     3939    return pDevIns->CTX_SUFF(pHlp)->pfnVMState(pDevIns);
     3940}
     3941
     3942#ifdef IN_RING3
    39233943/**
    39243944 * @copydoc PDMDEVHLPR3::pfnVMTeleportedAndNotFullyResumedYet
     
    39283948    return pDevIns->pHlpR3->pfnVMTeleportedAndNotFullyResumedYet(pDevIns);
    39293949}
    3930 
    39313950#endif /* IN_RING3 */
    39323951
  • trunk/src/VBox/VMM/VMMGC/PDMGCDevice.cpp

    r26376 r28319  
    160160
    161161
     162/** @interface_method_impl{PDMDEVHLPRC,pfnVMState} */
     163static DECLCALLBACK(VMSTATE) pdmRCDevHlp_VMState(PPDMDEVINS pDevIns)
     164{
     165    PDMDEV_ASSERT_DEVINS(pDevIns);
     166
     167    VMSTATE enmVMState = pDevIns->Internal.s.pVMRC->enmVMState;
     168
     169    LogFlow(("pdmRCDevHlp_VMState: caller=%p/%d: returns %d\n", pDevIns, pDevIns->iInstance, enmVMState));
     170    return enmVMState;
     171}
     172
     173
    162174/** @interface_method_impl{PDMDEVHLPRC,pfnVMSetError} */
    163175static DECLCALLBACK(int) pdmRCDevHlp_VMSetError(PPDMDEVINS pDevIns, int rc, RT_SRC_POS_DECL, const char *pszFormat, ...)
     
    241253    pdmRCDevHlp_PhysWrite,
    242254    pdmRCDevHlp_A20IsEnabled,
     255    pdmRCDevHlp_VMState,
    243256    pdmRCDevHlp_VMSetError,
    244257    pdmRCDevHlp_VMSetErrorV,
  • trunk/src/VBox/VMM/VMMR0/PDMR0Device.cpp

    r26376 r28319  
    162162
    163163
     164/** @interface_method_impl{PDMDEVHLPR0,pfnVMState} */
     165static DECLCALLBACK(VMSTATE) pdmR0DevHlp_VMState(PPDMDEVINS pDevIns)
     166{
     167    PDMDEV_ASSERT_DEVINS(pDevIns);
     168
     169    VMSTATE enmVMState = pDevIns->Internal.s.pVMR0->enmVMState;
     170
     171    LogFlow(("pdmR0DevHlp_VMState: caller=%p/%d: returns %d\n", pDevIns, pDevIns->iInstance, enmVMState));
     172    return enmVMState;
     173}
     174
     175
    164176/** @interface_method_impl{PDMDEVHLPR0,pfnVMSetError} */
    165177static DECLCALLBACK(int) pdmR0DevHlp_VMSetError(PPDMDEVINS pDevIns, int rc, RT_SRC_POS_DECL, const char *pszFormat, ...)
     
    255267    pdmR0DevHlp_PhysWrite,
    256268    pdmR0DevHlp_A20IsEnabled,
     269    pdmR0DevHlp_VMState,
    257270    pdmR0DevHlp_VMSetError,
    258271    pdmR0DevHlp_VMSetErrorV,
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