VirtualBox

Changeset 108261 in vbox for trunk/src/VBox/VMM/VMMAll


Ignore:
Timestamp:
Feb 17, 2025 3:51:04 PM (3 months ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
167583
Message:

VMM/IEM: Splitting up IEMOpHlp.h. jiraref:VBP-1531

File:
1 copied

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/VMM/VMMAll/target-x86/IEMOpHlp-x86.h

    r108255 r108261  
    2626 */
    2727
    28 #ifndef VMM_INCLUDED_SRC_include_IEMOpHlp_h
    29 #define VMM_INCLUDED_SRC_include_IEMOpHlp_h
     28#ifndef VMM_INCLUDED_SRC_VMMAll_target_x86_IEMOpHlp_x86_h
     29#define VMM_INCLUDED_SRC_VMMAll_target_x86_IEMOpHlp_x86_h
    3030#ifndef RT_WITHOUT_PRAGMA_ONCE
    3131# pragma once
    3232#endif
    3333
    34 /** @name  Common opcode decoders.
    35  * @{
    36  */
    37 void iemOpStubMsg2(PVMCPUCC pVCpu) RT_NOEXCEPT;
    38 
    39 /**
    40  * Complains about a stub.
    41  *
    42  * Providing two versions of this macro, one for daily use and one for use when
    43  * working on IEM.
    44  */
    45 #if 0
    46 # define IEMOP_BITCH_ABOUT_STUB() \
    47     do { \
    48         RTAssertMsg1(NULL, __LINE__, __FILE__, __FUNCTION__); \
    49         iemOpStubMsg2(pVCpu); \
    50         RTAssertPanic(); \
    51     } while (0)
    52 #else
    53 # define IEMOP_BITCH_ABOUT_STUB() Log(("Stub: %s (line %d)\n", __FUNCTION__, __LINE__));
    54 #endif
    55 
    56 /** Stubs an opcode. */
    57 #define FNIEMOP_STUB(a_Name) \
    58     FNIEMOP_DEF(a_Name) \
    59     { \
    60         RT_NOREF_PV(pVCpu); \
    61         IEMOP_BITCH_ABOUT_STUB(); \
    62         return VERR_IEM_INSTR_NOT_IMPLEMENTED; \
    63     } \
    64     typedef int ignore_semicolon
    65 
    66 /** Stubs an opcode. */
    67 #define FNIEMOP_STUB_1(a_Name, a_Type0, a_Name0) \
    68     FNIEMOP_DEF_1(a_Name, a_Type0, a_Name0) \
    69     { \
    70         RT_NOREF_PV(pVCpu); \
    71         RT_NOREF_PV(a_Name0); \
    72         IEMOP_BITCH_ABOUT_STUB(); \
    73         return VERR_IEM_INSTR_NOT_IMPLEMENTED; \
    74     } \
    75     typedef int ignore_semicolon
    76 
    77 /** Stubs an opcode which currently should raise \#UD. */
    78 #define FNIEMOP_UD_STUB(a_Name) \
    79     FNIEMOP_DEF(a_Name) \
    80     { \
    81         Log(("Unsupported instruction %Rfn\n", __FUNCTION__)); \
    82         IEMOP_RAISE_INVALID_OPCODE_RET(); \
    83     } \
    84     typedef int ignore_semicolon
    85 
    86 /** Stubs an opcode which currently should raise \#UD. */
    87 #define FNIEMOP_UD_STUB_1(a_Name, a_Type0, a_Name0) \
    88     FNIEMOP_DEF_1(a_Name, a_Type0, a_Name0) \
    89     { \
    90         RT_NOREF_PV(pVCpu); \
    91         RT_NOREF_PV(a_Name0); \
    92         Log(("Unsupported instruction %Rfn\n", __FUNCTION__)); \
    93         IEMOP_RAISE_INVALID_OPCODE_RET(); \
    94     } \
    95     typedef int ignore_semicolon
    96 
    97 /** @} */
    98 
    9934
    10035/** @name   Opcode Debug Helpers.
    10136 * @{
    10237 */
    103 #ifdef VBOX_WITH_STATISTICS
    104 # ifdef IN_RING3
    105 #  define IEMOP_INC_STATS(a_Stats) do { pVCpu->iem.s.StatsR3.a_Stats += 1; } while (0)
    106 # else
    107 #  define IEMOP_INC_STATS(a_Stats) do { pVCpu->iem.s.StatsRZ.a_Stats += 1; } while (0)
    108 # endif
    109 #else
    110 # define IEMOP_INC_STATS(a_Stats) do { } while (0)
    111 #endif
    112 
    11338#ifdef DEBUG
    11439# define IEMOP_MNEMONIC(a_Stats, a_szMnemonic) \
     
    218143 */
    219144
    220 #ifdef IN_RING3
    221 # define IEMOP_HLP_MIN_CPU(a_uMinCpu, a_fOnlyIf) \
    222     do { \
    223         if (IEM_GET_TARGET_CPU(pVCpu) >= (a_uMinCpu) || !(a_fOnlyIf)) { } \
    224         else \
    225         { \
    226             (void)DBGFSTOP(pVCpu->CTX_SUFF(pVM)); \
    227             IEMOP_RAISE_INVALID_OPCODE_RET(); \
    228         } \
    229     } while (0)
    230 #else
    231 # define IEMOP_HLP_MIN_CPU(a_uMinCpu, a_fOnlyIf) \
    232     do { \
    233         if (IEM_GET_TARGET_CPU(pVCpu) >= (a_uMinCpu) || !(a_fOnlyIf)) { } \
    234         else IEMOP_RAISE_INVALID_OPCODE_RET(); \
    235     } while (0)
    236 #endif
    237 
    238145/** The instruction requires a 186 or later. */
    239146#if IEM_CFG_TARGET_CPU >= IEMTARGETCPU_186
     
    740647
    741648/**
    742  * Check for a CPUMFEATURES member to be true, raise \#UD if clear.
    743  */
    744 #define IEMOP_HLP_RAISE_UD_IF_MISSING_GUEST_FEATURE(pVCpu, a_fFeature) \
    745     do \
    746     { \
    747         if (IEM_GET_GUEST_CPU_FEATURES(pVCpu)->a_fFeature) \
    748         { /* likely */ } \
    749         else \
    750             IEMOP_RAISE_INVALID_OPCODE_RET(); \
    751     } while (0)
    752 
    753 /**
    754649 * Used the threaded code generator to check if a jump stays within the same
    755650 * page in 64-bit code.
     
    768663/** @}  */
    769664
    770 #endif /* !VMM_INCLUDED_SRC_include_IEMOpHlp_h */
     665#endif /* !VMM_INCLUDED_SRC_VMMAll_target_x86_IEMOpHlp_x86_h */
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