VirtualBox

Changeset 100184 in vbox for trunk/src/VBox/VMM/VMMR3


Ignore:
Timestamp:
Jun 16, 2023 6:51:39 AM (19 months ago)
Author:
vboxsync
Message:

VMM: Add a CPUMGetGuestArch() method and PDM device helper to make it easier to determine the guest architecture and not having to deal with the massive CPUMMICROARCH enum, bugref:10385

Location:
trunk/src/VBox/VMM/VMMR3
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/VMM/VMMR3/PDMDevHlp.cpp

    r100108 r100184  
    11931193    Log(("pdmR3DevHlp_PhysChangeMemBalloon: caller='%s'/%d: returns %Rrc\n", pDevIns->pReg->szName, pDevIns->iInstance, rc));
    11941194    return rc;
     1195}
     1196
     1197
     1198/** @interface_method_impl{PDMDEVHLPR3,pfnCpuGetGuestArch} */
     1199static 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;
    11951210}
    11961211
     
    51975212    pdmR3DevHlp_PhysBulkGCPhys2CCPtrReadOnly,
    51985213    pdmR3DevHlp_PhysBulkReleasePageMappingLocks,
     5214    pdmR3DevHlp_CpuGetGuestArch,
    51995215    pdmR3DevHlp_CpuGetGuestMicroarch,
    52005216    pdmR3DevHlp_CpuGetGuestAddrWidths,
     
    55955611    pdmR3DevHlp_PhysBulkGCPhys2CCPtrReadOnly,
    55965612    pdmR3DevHlp_PhysBulkReleasePageMappingLocks,
     5613    pdmR3DevHlp_CpuGetGuestArch,
    55975614    pdmR3DevHlp_CpuGetGuestMicroarch,
    55985615    pdmR3DevHlp_CpuGetGuestAddrWidths,
     
    63136330    pdmR3DevHlp_PhysBulkGCPhys2CCPtrReadOnly,
    63146331    pdmR3DevHlp_PhysBulkReleasePageMappingLocks,
     6332    pdmR3DevHlp_CpuGetGuestArch,
    63156333    pdmR3DevHlp_CpuGetGuestMicroarch,
    63166334    pdmR3DevHlp_CpuGetGuestAddrWidths,
  • trunk/src/VBox/VMM/VMMR3/VMMR3.def

    r98103 r100184  
    107107
    108108    CPUMGetHostMicroarch
     109    CPUMGetGuestArch
    109110    CPUMGetGuestMicroarch
    110111
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