Changeset 108261 in vbox for trunk/src/VBox/VMM/VMMAll
- Timestamp:
- Feb 17, 2025 3:51:04 PM (3 months ago)
- svn:sync-xref-src-repo-rev:
- 167583
- File:
-
- 1 copied
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/VMMAll/target-x86/IEMOpHlp-x86.h
r108255 r108261 26 26 */ 27 27 28 #ifndef VMM_INCLUDED_SRC_ include_IEMOpHlp_h29 #define VMM_INCLUDED_SRC_ include_IEMOpHlp_h28 #ifndef VMM_INCLUDED_SRC_VMMAll_target_x86_IEMOpHlp_x86_h 29 #define VMM_INCLUDED_SRC_VMMAll_target_x86_IEMOpHlp_x86_h 30 30 #ifndef RT_WITHOUT_PRAGMA_ONCE 31 31 # pragma once 32 32 #endif 33 33 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 when43 * working on IEM.44 */45 #if 046 # define IEMOP_BITCH_ABOUT_STUB() \47 do { \48 RTAssertMsg1(NULL, __LINE__, __FILE__, __FUNCTION__); \49 iemOpStubMsg2(pVCpu); \50 RTAssertPanic(); \51 } while (0)52 #else53 # define IEMOP_BITCH_ABOUT_STUB() Log(("Stub: %s (line %d)\n", __FUNCTION__, __LINE__));54 #endif55 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_semicolon65 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_semicolon76 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_semicolon85 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_semicolon96 97 /** @} */98 99 34 100 35 /** @name Opcode Debug Helpers. 101 36 * @{ 102 37 */ 103 #ifdef VBOX_WITH_STATISTICS104 # ifdef IN_RING3105 # define IEMOP_INC_STATS(a_Stats) do { pVCpu->iem.s.StatsR3.a_Stats += 1; } while (0)106 # else107 # define IEMOP_INC_STATS(a_Stats) do { pVCpu->iem.s.StatsRZ.a_Stats += 1; } while (0)108 # endif109 #else110 # define IEMOP_INC_STATS(a_Stats) do { } while (0)111 #endif112 113 38 #ifdef DEBUG 114 39 # define IEMOP_MNEMONIC(a_Stats, a_szMnemonic) \ … … 218 143 */ 219 144 220 #ifdef IN_RING3221 # 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 #else231 # 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 #endif237 238 145 /** The instruction requires a 186 or later. */ 239 146 #if IEM_CFG_TARGET_CPU >= IEMTARGETCPU_186 … … 740 647 741 648 /** 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 /**754 649 * Used the threaded code generator to check if a jump stays within the same 755 650 * page in 64-bit code. … … 768 663 /** @} */ 769 664 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.