- Timestamp:
- Jun 16, 2023 6:51:39 AM (18 months ago)
- Location:
- trunk
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/VBox/vmm/cpum.h
r99051 r100184 69 69 CPUMCPUVENDOR_32BIT_HACK = 0x7fffffff 70 70 } CPUMCPUVENDOR; 71 72 73 /** 74 * CPU architecture. 75 */ 76 typedef enum CPUMARCH 77 { 78 /** Invalid zero value. */ 79 kCpumArch_Invalid = 0, 80 /** x86 based architecture (includes 64-bit). */ 81 kCpumArch_X86, 82 /** ARM based architecture (includs both AArch32 and AArch64). */ 83 kCpumArch_Arm, 84 85 /** @todo RiscV, Mips, ... ;). */ 86 87 /* 88 * Unknown. 89 */ 90 kCpumArch_Unknown, 91 92 kCpumArch_32BitHack = 0x7fffffff 93 } CPUMARCH; 71 94 72 95 … … 352 375 VMMDECL(uint64_t) CPUMGetGuestFlatSP(PVMCPU pVCpu); 353 376 VMMDECL(CPUMCPUVENDOR) CPUMGetGuestCpuVendor(PVM pVM); 377 VMMDECL(CPUMARCH) CPUMGetGuestArch(PCVM pVM); 354 378 VMMDECL(CPUMMICROARCH) CPUMGetGuestMicroarch(PCVM pVM); 355 379 VMMDECL(void) CPUMGetGuestAddrWidths(PCVM pVM, uint8_t *pcPhysAddrWidth, uint8_t *pcLinearAddrWidth); … … 362 386 363 387 VMMDECL(CPUMCPUVENDOR) CPUMGetHostCpuVendor(PVM pVM); 388 VMMDECL(CPUMARCH) CPUMGetHostArch(PCVM pVM); 364 389 VMMDECL(CPUMMICROARCH) CPUMGetHostMicroarch(PCVM pVM); 365 390 -
trunk/include/VBox/vmm/pdmdev.h
r99745 r100184 4611 4611 4612 4612 /** 4613 * Returns the architecture used for the guest. 4614 * 4615 * @returns CPU architecture enum. 4616 * @param pDevIns The device instance. 4617 */ 4618 DECLR3CALLBACKMEMBER(CPUMARCH, pfnCpuGetGuestArch,(PPDMDEVINS pDevIns)); 4619 4620 /** 4613 4621 * Returns the micro architecture used for the guest. 4614 4622 * … … 7359 7367 { 7360 7368 return pDevIns->CTX_SUFF(pHlp)->pfnPhysChangeMemBalloon(pDevIns, fInflate, cPages, paPhysPage); 7369 } 7370 7371 /** 7372 * @copydoc PDMDEVHLPR3::pfnCpuGetGuestArch 7373 */ 7374 DECLINLINE(CPUMARCH) PDMDevHlpCpuGetGuestArch(PPDMDEVINS pDevIns) 7375 { 7376 return pDevIns->CTX_SUFF(pHlp)->pfnCpuGetGuestArch(pDevIns); 7377 } 7378 7379 /** 7380 * Returns a flag whether the current guest CPU architecture is x86. 7381 * 7382 * @returns Flag whether the current guest architecture is x86. 7383 * @param pDevIns The device instance. 7384 */ 7385 DECLINLINE(bool) PDMDevHlpCpuIsGuestArchX86(PPDMDEVINS pDevIns) 7386 { 7387 return pDevIns->CTX_SUFF(pHlp)->pfnCpuGetGuestArch(pDevIns) == kCpumArch_X86; 7388 } 7389 7390 /** 7391 * Returns a flag whether the current guest CPU architecture is ARM. 7392 * 7393 * @returns Flag whether the current guest architecture is ARM. 7394 * @param pDevIns The device instance. 7395 */ 7396 DECLINLINE(bool) PDMDevHlpCpuIsGuestArchArm(PPDMDEVINS pDevIns) 7397 { 7398 return pDevIns->CTX_SUFF(pHlp)->pfnCpuGetGuestArch(pDevIns) == kCpumArch_Arm; 7361 7399 } 7362 7400 -
trunk/include/VBox/vmm/vmmr3vtable-def.h
r99547 r100184 370 370 VTABLE_ENTRY(CPUMGetHostCpuVendor) 371 371 VTABLE_ENTRY(CPUMGetHostMicroarch) 372 VTABLE_ENTRY(CPUMGetGuestCpuVendor) 373 VTABLE_ENTRY(CPUMGetGuestArch) 374 VTABLE_ENTRY(CPUMGetGuestMicroarch) 372 375 373 376 VTABLE_RESERVED(pfnCPUMR3Reserved1) -
trunk/include/VBox/vmm/vmmr3vtable.h
r99547 r100184 72 72 73 73 /** Magic and version for the VMM vtable. (Magic: Emmet Cohen) */ 74 #define VMMR3VTABLE_MAGIC_VERSION RT_MAKE_U64(0x19900525, 0x000 40000)74 #define VMMR3VTABLE_MAGIC_VERSION RT_MAKE_U64(0x19900525, 0x00050000) 75 75 /** Compatibility mask: These bits must match - magic and major version. */ 76 76 #define VMMR3VTABLE_MAGIC_VERSION_MASK RT_MAKE_U64(0xffffffff, 0xffff0000) -
trunk/src/VBox/VMM/VMMAll/CPUMAllRegs-armv8.cpp
r100167 r100184 173 173 174 174 /** 175 * Gets the guest CPU architecture. 176 * 177 * @returns CPU architecture. 178 * @param pVM The cross context VM structure. 179 */ 180 VMMDECL(CPUMARCH) CPUMGetGuestArch(PCVM pVM) 181 { 182 RT_NOREF(pVM); 183 return kCpumArch_Arm; /* Static as we are in the ARM VMM module here. */ 184 } 185 186 187 /** 175 188 * Gets the guest CPU microarchitecture. 176 189 * -
trunk/src/VBox/VMM/VMMAll/CPUMAllRegs.cpp
r99739 r100184 1097 1097 { 1098 1098 return (CPUMCPUVENDOR)pVM->cpum.s.GuestFeatures.enmCpuVendor; 1099 } 1100 1101 1102 /** 1103 * Gets the guest CPU architecture. 1104 * 1105 * @returns CPU architecture. 1106 * @param pVM The cross context VM structure. 1107 */ 1108 VMMDECL(CPUMARCH) CPUMGetGuestArch(PCVM pVM) 1109 { 1110 RT_NOREF(pVM); 1111 return kCpumArch_X86; /* Static as we are in the x86 VMM module here. */ 1099 1112 } 1100 1113 -
trunk/src/VBox/VMM/VMMR3/PDMDevHlp.cpp
r100108 r100184 1193 1193 Log(("pdmR3DevHlp_PhysChangeMemBalloon: caller='%s'/%d: returns %Rrc\n", pDevIns->pReg->szName, pDevIns->iInstance, rc)); 1194 1194 return rc; 1195 } 1196 1197 1198 /** @interface_method_impl{PDMDEVHLPR3,pfnCpuGetGuestArch} */ 1199 static DECLCALLBACK(CPUMARCH) pdmR3DevHlp_CpuGetGuestArch(PPDMDEVINS pDevIns) 1200 { 1201 PDMDEV_ASSERT_DEVINS(pDevIns); 1202 PVM pVM = pDevIns->Internal.s.pVMR3; 1203 LogFlow(("pdmR3DevHlp_CpuGetGuestArch: caller='%s'/%d\n", 1204 pDevIns->pReg->szName, pDevIns->iInstance)); 1205 1206 CPUMARCH enmArch = CPUMGetGuestArch(pVM); 1207 1208 Log(("pdmR3DevHlp_CpuGetGuestArch: caller='%s'/%d: returns %u\n", pDevIns->pReg->szName, pDevIns->iInstance, enmArch)); 1209 return enmArch; 1195 1210 } 1196 1211 … … 5197 5212 pdmR3DevHlp_PhysBulkGCPhys2CCPtrReadOnly, 5198 5213 pdmR3DevHlp_PhysBulkReleasePageMappingLocks, 5214 pdmR3DevHlp_CpuGetGuestArch, 5199 5215 pdmR3DevHlp_CpuGetGuestMicroarch, 5200 5216 pdmR3DevHlp_CpuGetGuestAddrWidths, … … 5595 5611 pdmR3DevHlp_PhysBulkGCPhys2CCPtrReadOnly, 5596 5612 pdmR3DevHlp_PhysBulkReleasePageMappingLocks, 5613 pdmR3DevHlp_CpuGetGuestArch, 5597 5614 pdmR3DevHlp_CpuGetGuestMicroarch, 5598 5615 pdmR3DevHlp_CpuGetGuestAddrWidths, … … 6313 6330 pdmR3DevHlp_PhysBulkGCPhys2CCPtrReadOnly, 6314 6331 pdmR3DevHlp_PhysBulkReleasePageMappingLocks, 6332 pdmR3DevHlp_CpuGetGuestArch, 6315 6333 pdmR3DevHlp_CpuGetGuestMicroarch, 6316 6334 pdmR3DevHlp_CpuGetGuestAddrWidths, -
trunk/src/VBox/VMM/VMMR3/VMMR3.def
r98103 r100184 107 107 108 108 CPUMGetHostMicroarch 109 CPUMGetGuestArch 109 110 CPUMGetGuestMicroarch 110 111
Note:
See TracChangeset
for help on using the changeset viewer.