VirtualBox

Changeset 45645 in vbox


Ignore:
Timestamp:
Apr 19, 2013 1:46:48 PM (12 years ago)
Author:
vboxsync
Message:

VMM/PDMDevHlp: Add helper to get the SUPDrv session handle (intended for the semaphore API)

Location:
trunk
Files:
2 edited

Legend:

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

    r45024 r45645  
    4040#include <VBox/err.h>
    4141#include <VBox/pci.h>
     42#include <VBox/sup.h>
    4243#include <iprt/stdarg.h>
    4344
     
    36023603    DECLR3CALLBACKMEMBER(uint64_t, pfnTMTimeVirtGetNano,(PPDMDEVINS pDevIns));
    36033604
     3605    /**
     3606     * Gets the support driver session.
     3607     *
     3608     * This is intended for working with the semaphore API.
     3609     *
     3610     * @returns Support driver session handle.
     3611     * @param   pDrvIns         The driver instance.
     3612     */
     3613    DECLR3CALLBACKMEMBER(PSUPDRVSESSION, pfnGetSupDrvSession,(PPDMDEVINS pDevIns));
     3614
    36043615    /** @} */
    36053616
     
    36143625
    36153626/** Current PDMDEVHLPR3 version number. */
    3616 #define PDM_DEVHLPR3_VERSION                    PDM_VERSION_MAKE(0xffe7, 11, 0)
     3627#define PDM_DEVHLPR3_VERSION                    PDM_VERSION_MAKE(0xffe7, 12, 0)
    36173628
    36183629
     
    51905201}
    51915202
     5203/*
     5204 * @copydoc PDMDEVHLPR3::pfnGetSupDrvSession
     5205 */
     5206DECLINLINE(PSUPDRVSESSION) PDMDevHlpGetSupDrvSession(PPDMDEVINS pDevIns)
     5207{
     5208    return pDevIns->pHlpR3->pfnGetSupDrvSession(pDevIns);
     5209}
    51925210#endif /* IN_RING3 */
    51935211#ifdef IN_RING0
  • trunk/src/VBox/VMM/VMMR3/PDMDevHlp.cpp

    r44902 r45645  
    670670    LogFlow(("pdmR3DevHlp_TMTimeVirtGetNano: caller='%s'/%d: returns %RU64\n", pDevIns->pReg->szName, pDevIns->iInstance, u64Nano));
    671671    return u64Nano;
     672}
     673
     674
     675/** @interface_method_impl{PDMDEVHLPR3,pfnGetSupDrvSession} */
     676static DECLCALLBACK(PSUPDRVSESSION) pdmR3DevHlp_GetSupDrvSession(PPDMDEVINS pDevIns)
     677{
     678    PDMDEV_ASSERT_DEVINS(pDevIns);
     679    LogFlow(("pdmR3DevHlp_GetSupDrvSession: caller='%s'\n",
     680             pDevIns->pReg->szName, pDevIns->iInstance));
     681
     682    PSUPDRVSESSION pSession = pDevIns->Internal.s.pVMR3->pSession;
     683
     684    LogFlow(("pdmR3DevHlp_GetSupDrvSession: caller='%s'/%d: returns %#p\n", pDevIns->pReg->szName, pDevIns->iInstance, pSession));
     685    return pSession;
    672686}
    673687
     
    34933507    pdmR3DevHlp_TMTimeVirtGetFreq,
    34943508    pdmR3DevHlp_TMTimeVirtGetNano,
     3509    pdmR3DevHlp_GetSupDrvSession,
    34953510    PDM_DEVHLPR3_VERSION /* the end */
    34963511};
     
    36073622    NOREF(iLeaf); NOREF(pEax); NOREF(pEbx); NOREF(pEcx); NOREF(pEdx);
    36083623    AssertReleaseMsgFailed(("Untrusted device called trusted helper! '%s'/%d\n", pDevIns->pReg->szName, pDevIns->iInstance));
     3624}
     3625
     3626
     3627/** @interface_method_impl{PDMDEVHLPR3,pfnGetSupDrvSession} */
     3628static DECLCALLBACK(PSUPDRVSESSION) pdmR3DevHlp_Untrusted_GetSupDrvSession(PPDMDEVINS pDevIns)
     3629{
     3630    PDMDEV_ASSERT_DEVINS(pDevIns);
     3631    AssertReleaseMsgFailed(("Untrusted device called trusted helper! '%s'/%d\n", pDevIns->pReg->szName, pDevIns->iInstance));
     3632    return (PSUPDRVSESSION)0;
    36093633}
    36103634
     
    37243748    pdmR3DevHlp_TMTimeVirtGetFreq,
    37253749    pdmR3DevHlp_TMTimeVirtGetNano,
     3750    pdmR3DevHlp_Untrusted_GetSupDrvSession,
    37263751    PDM_DEVHLPR3_VERSION /* the end */
    37273752};
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