VirtualBox

Ignore:
Timestamp:
Oct 6, 2023 1:22:15 AM (16 months ago)
Author:
vboxsync
Message:

Main/Global.cpp: Move the macros for compose the x64/x86/arm64/arm32 guest OS IDs to the VirtualBox API header so the GUI and others can make use of them as well. bugref:10384

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/VMM/VMMAll/IEMAllN8veRecompiler.cpp

    r101305 r101369  
    4848#define IEM_WITH_OPAQUE_DECODER_STATE
    4949#define VMCPU_INCL_CPUM_GST_CTX
     50#define VMM_INCLUDED_SRC_include_IEMMc_h /* block IEMMc.h inclusion. */
    5051#include <VBox/vmm/iem.h>
    5152#include <VBox/vmm/cpum.h>
     
    11261127 * Called before starting a new recompile job.
    11271128 */
    1128 static PIEMRECOMPILERSTATE iemNativeReInit(PIEMRECOMPILERSTATE pReNative)
     1129static PIEMRECOMPILERSTATE iemNativeReInit(PIEMRECOMPILERSTATE pReNative, PCIEMTB pTb)
    11291130{
    11301131    pReNative->cLabels   = 0;
    11311132    pReNative->cFixups   = 0;
     1133    pReNative->pTbOrg    = pTb;
    11321134    return pReNative;
    11331135}
     
    11421144 * @param   pVCpu   The cross context virtual CPU structure of the calling
    11431145 *                  thread.
     1146 * @param   pTb     The TB that's about to be recompiled.
    11441147 * @thread  EMT(pVCpu)
    11451148 */
    1146 static PIEMRECOMPILERSTATE iemNativeInit(PVMCPUCC pVCpu)
     1149static PIEMRECOMPILERSTATE iemNativeInit(PVMCPUCC pVCpu, PCIEMTB pTb)
    11471150{
    11481151    VMCPU_ASSERT_EMT(pVCpu);
     
    11721175         */
    11731176        pVCpu->iem.s.pNativeRecompilerStateR3 = pReNative;
    1174         return iemNativeReInit(pReNative);
     1177        return iemNativeReInit(pReNative, pTb);
    11751178    }
    11761179
     
    19061909
    19071910
     1911/** Same as iemRegFinishClearingRF. */
     1912DECLINLINE(uint32_t) iemNativeEmitFinishClearingRF(PIEMRECOMPILERSTATE pReNative, uint32_t off)
     1913{
     1914    uint32_t const fFlags = pReNative->pTbOrg->fFlags;
     1915    if (fFlags & IEMTB_F_INHIBIT_SHADOW)
     1916    {
     1917    }
     1918    IEMTB_F_IEM_F_MASK
     1919
     1920    //
     1921        if (RT_LIKELY(!(  pVCpu->cpum.GstCtx.eflags.uBoth
     1922                        & (X86_EFL_TF | X86_EFL_RF | CPUMCTX_INHIBIT_SHADOW | CPUMCTX_DBG_HIT_DRX_MASK | CPUMCTX_DBG_DBGF_MASK)) ))
     1923            return VINF_SUCCESS;
     1924        return iemFinishInstructionWithFlagsSet(pVCpu);
     1925}
     1926
     1927
     1928/** Same as iemRegAddToEip32AndFinishingClearingRF. */
     1929DECLINLINE(uint32_t) iemNativeEmitAddToEip32AndFinishingClearingRF(PIEMRECOMPILERSTATE pReNative, uint32_t off, uint8_t cbInstr)
     1930{
     1931    /* Increment RIP. */
     1932    pVCpu->cpum.GstCtx.rip = (uint32_t)(pVCpu->cpum.GstCtx.eip + cbInstr);
     1933
     1934    /* Consider flags. */
     1935    return iemNativeEmitFinishClearingRF(pReNative, off);
     1936}
     1937
     1938
    19081939/*
    19091940 * MC definitions for the native recompiler.
     
    19211952#define IEM_MC_DEFER_TO_CIMPL_3_RET_THREADED(a_cbInstr, a_fFlags, a_pfnCImpl, a0, a1, a2) \
    19221953    return iemNativeEmitCImplCall3(pReNative, off, pCallEntry->idxInstr, (uintptr_t)a_pfnCImpl, a_cbInstr, a0, a1, a2)
     1954
     1955
     1956#define IEM_MC_BEGIN(a_cArgs, a_cLocals, a_fFlags)      {
     1957
     1958#define IEM_MC_END()                                    } AssertFailedReturn(UINT32_MAX /* shouldn't be reached! */)
     1959
     1960#define IEM_MC_ADVANCE_RIP_AND_FINISH_THREADED_PC16(a_cbInstr) \
     1961    return iemNativeEmitAddToIp16AndFinishingClearingRF(pReNative, off, a_cbInstr)
     1962
     1963#define IEM_MC_ADVANCE_RIP_AND_FINISH_THREADED_PC32(a_cbInstr) \
     1964    return iemNativeEmitAddToEip32AndFinishingClearingRF(pReNative, off, a_cbInstr)
     1965
     1966#define IEM_MC_ADVANCE_RIP_AND_FINISH_THREADED_PC64(a_cbInstr) \
     1967    return iemNativeEmitAddToRip64AndFinishingClearingRF(pReNative, off, a_cbInstr)
     1968
    19231969
    19241970/*
     
    19652011    PIEMRECOMPILERSTATE pReNative = pVCpu->iem.s.pNativeRecompilerStateR3;
    19662012    if (RT_LIKELY(pReNative))
    1967         iemNativeReInit(pReNative);
     2013        iemNativeReInit(pReNative, pTb);
    19682014    else
    19692015    {
    1970         pReNative = iemNativeInit(pVCpu);
     2016        pReNative = iemNativeInit(pVCpu, pTb);
    19712017        AssertReturn(pReNative, pTb);
    19722018    }
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