VirtualBox

Changeset 92527 in vbox


Ignore:
Timestamp:
Nov 21, 2021 2:38:43 AM (3 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
148402
Message:

VMM/PDMDevHlp: Added PDMDevHlpGetMainExecutionEngine for VMMDevTesting. bugref:9044

Location:
trunk
Files:
3 edited

Legend:

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

    r92162 r92527  
    24252425
    24262426/** Current PDMDEVHLPR3 version number. */
    2427 #define PDM_DEVHLPR3_VERSION                    PDM_VERSION_MAKE_PP(0xffe7, 62, 0)
     2427#define PDM_DEVHLPR3_VERSION                    PDM_VERSION_MAKE_PP(0xffe7, 63, 0)
    24282428
    24292429/**
     
    47904790
    47914791    /**
     4792     * Gets the main execution engine for the VM.
     4793     *
     4794     * @returns VM_EXEC_ENGINE_XXX
     4795     * @param   pDevIns             The device instance.
     4796     */
     4797    DECLR3CALLBACKMEMBER(uint8_t, pfnGetMainExecutionEngine,(PPDMDEVINS pDevIns));
     4798
     4799    /**
    47924800     * Get the current virtual clock time in a VM. The clock frequency must be
    47934801     * queried separately.
     
    52805288
    52815289    /**
     5290     * Gets the main execution engine for the VM.
     5291     *
     5292     * @returns VM_EXEC_ENGINE_XXX
     5293     * @param   pDevIns             The device instance.
     5294     */
     5295    DECLRCCALLBACKMEMBER(uint8_t, pfnGetMainExecutionEngine,(PPDMDEVINS pDevIns));
     5296
     5297    /**
    52825298     * Get the current virtual clock time in a VM. The clock frequency must be
    52835299     * queried separately.
     
    54765492
    54775493/** Current PDMDEVHLP version number. */
    5478 #define PDM_DEVHLPRC_VERSION                    PDM_VERSION_MAKE(0xffe6, 18, 0)
     5494#define PDM_DEVHLPRC_VERSION                    PDM_VERSION_MAKE(0xffe6, 19, 0)
    54795495
    54805496
     
    56885704     */
    56895705    DECLR0CALLBACKMEMBER(VMCPUID, pfnGetCurrentCpuId,(PPDMDEVINS pDevIns));
     5706
     5707    /**
     5708     * Gets the main execution engine for the VM.
     5709     *
     5710     * @returns VM_EXEC_ENGINE_XXX
     5711     * @param   pDevIns             The device instance.
     5712     */
     5713    DECLR0CALLBACKMEMBER(uint8_t, pfnGetMainExecutionEngine,(PPDMDEVINS pDevIns));
    56905714
    56915715    /** @name Timer handle method wrappers
     
    60376061
    60386062/** Current PDMDEVHLP version number. */
    6039 #define PDM_DEVHLPR0_VERSION                    PDM_VERSION_MAKE(0xffe5, 25, 0)
     6063#define PDM_DEVHLPR0_VERSION                    PDM_VERSION_MAKE(0xffe5, 26, 0)
    60406064
    60416065
     
    93999423
    94009424#ifdef IN_RING3
    9401 
    94029425/**
    94039426 * @copydoc PDMDEVHLPR3::pfnGetCpuId
     
    94079430    pDevIns->pHlpR3->pfnGetCpuId(pDevIns, iLeaf, pEax, pEbx, pEcx, pEdx);
    94089431}
     9432#endif
     9433
     9434/**
     9435 * @copydoc PDMDEVHLPR3::pfnGetMainExecutionEngine
     9436 */
     9437DECLINLINE(uint8_t) PDMDevHlpGetMainExecutionEngine(PPDMDEVINS pDevIns)
     9438{
     9439    return pDevIns->CTX_SUFF(pHlp)->pfnGetMainExecutionEngine(pDevIns);
     9440}
     9441
     9442#ifdef IN_RING3
    94099443
    94109444/**
  • trunk/src/VBox/VMM/VMMR0/PDMR0DevHlp.cpp

    r91980 r92527  
    368368
    369369
    370 /** @interface_method_impl{PDMDEVHLPRC,pfnGetCurrentCpuId} */
     370/** @interface_method_impl{PDMDEVHLPR0,pfnGetCurrentCpuId} */
    371371static DECLCALLBACK(VMCPUID) pdmR0DevHlp_GetCurrentCpuId(PPDMDEVINS pDevIns)
    372372{
     
    375375    LogFlow(("pdmR0DevHlp_GetCurrentCpuId: caller='%p'/%d for CPU %u\n", pDevIns, pDevIns->iInstance, idCpu));
    376376    return idCpu;
     377}
     378
     379
     380/** @interface_method_impl{PDMDEVHLPR0,pfnGetMainExecutionEngine} */
     381static DECLCALLBACK(uint8_t) pdmR0DevHlp_GetMainExecutionEngine(PPDMDEVINS pDevIns)
     382{
     383    PDMDEV_ASSERT_DEVINS(pDevIns);
     384    LogFlow(("pdmR0DevHlp_GetMainExecutionEngine: caller='%s'/%d:\n", pDevIns->pReg->szName, pDevIns->iInstance));
     385    return pDevIns->Internal.s.pGVM->bMainExecutionEngine;
    377386}
    378387
     
    14001409    pdmR0DevHlp_GetVMCPU,
    14011410    pdmR0DevHlp_GetCurrentCpuId,
     1411    pdmR0DevHlp_GetMainExecutionEngine,
    14021412    pdmR0DevHlp_TimerFromMicro,
    14031413    pdmR0DevHlp_TimerFromMilli,
     
    15111521    pdmR0DevHlp_GetVMCPU,
    15121522    pdmR0DevHlp_GetCurrentCpuId,
     1523    pdmR0DevHlp_GetMainExecutionEngine,
    15131524    pdmR0DevHlp_TimerFromMicro,
    15141525    pdmR0DevHlp_TimerFromMilli,
  • trunk/src/VBox/VMM/VMMR3/PDMDevHlp.cpp

    r92162 r92527  
    46324632    LogFlow(("pdmR3DevHlp_GetCpuId: caller='%s'/%d: returns void - *pEax=%#x *pEbx=%#x *pEcx=%#x *pEdx=%#x\n",
    46334633             pDevIns->pReg->szName, pDevIns->iInstance, *pEax, *pEbx, *pEcx, *pEdx));
     4634}
     4635
     4636
     4637/** @interface_method_impl{PDMDEVHLPR3,pfnGetMainExecutionEngine} */
     4638static DECLCALLBACK(uint8_t) pdmR3DevHlp_GetMainExecutionEngine(PPDMDEVINS pDevIns)
     4639{
     4640    PDMDEV_ASSERT_DEVINS(pDevIns);
     4641    VM_ASSERT_EMT(pDevIns->Internal.s.pVMR3);
     4642    LogFlow(("pdmR3DevHlp_GetMainExecutionEngine: caller='%s'/%d:\n", pDevIns->pReg->szName, pDevIns->iInstance));
     4643    return pDevIns->Internal.s.pVMR3->bMainExecutionEngine;
    46344644}
    46354645
     
    51795189    pdmR3DevHlp_A20Set,
    51805190    pdmR3DevHlp_GetCpuId,
     5191    pdmR3DevHlp_GetMainExecutionEngine,
    51815192    pdmR3DevHlp_TMTimeVirtGet,
    51825193    pdmR3DevHlp_TMTimeVirtGetFreq,
     
    55755586    pdmR3DevHlp_A20Set,
    55765587    pdmR3DevHlp_GetCpuId,
     5588    pdmR3DevHlp_GetMainExecutionEngine,
    55775589    pdmR3DevHlp_TMTimeVirtGet,
    55785590    pdmR3DevHlp_TMTimeVirtGetFreq,
     
    57215733    NOREF(iLeaf); NOREF(pEax); NOREF(pEbx); NOREF(pEcx); NOREF(pEdx);
    57225734    AssertReleaseMsgFailed(("Untrusted device called trusted helper! '%s'/%d\n", pDevIns->pReg->szName, pDevIns->iInstance));
     5735}
     5736
     5737
     5738/** @interface_method_impl{PDMDEVHLPR3,pfnGetMainExecutionEngine} */
     5739static DECLCALLBACK(uint8_t) pdmR3DevHlp_Untrusted_GetMainExecutionEngine(PPDMDEVINS pDevIns)
     5740{
     5741    PDMDEV_ASSERT_DEVINS(pDevIns);
     5742    AssertReleaseMsgFailed(("Untrusted device called trusted helper! '%s'/%d\n", pDevIns->pReg->szName, pDevIns->iInstance));
     5743    return VM_EXEC_ENGINE_NOT_SET;
    57235744}
    57245745
     
    62856306    pdmR3DevHlp_Untrusted_A20Set,
    62866307    pdmR3DevHlp_Untrusted_GetCpuId,
     6308    pdmR3DevHlp_Untrusted_GetMainExecutionEngine,
    62876309    pdmR3DevHlp_TMTimeVirtGet,
    62886310    pdmR3DevHlp_TMTimeVirtGetFreq,
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette