VirtualBox

Changeset 100184 in vbox for trunk/include/VBox/vmm/pdmdev.h


Ignore:
Timestamp:
Jun 16, 2023 6:51:39 AM (18 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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/VBox/vmm/pdmdev.h

    r99745 r100184  
    46114611
    46124612    /**
     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    /**
    46134621     * Returns the micro architecture used for the guest.
    46144622     *
     
    73597367{
    73607368    return pDevIns->CTX_SUFF(pHlp)->pfnPhysChangeMemBalloon(pDevIns, fInflate, cPages, paPhysPage);
     7369}
     7370
     7371/**
     7372 * @copydoc PDMDEVHLPR3::pfnCpuGetGuestArch
     7373 */
     7374DECLINLINE(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 */
     7385DECLINLINE(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 */
     7396DECLINLINE(bool) PDMDevHlpCpuIsGuestArchArm(PPDMDEVINS pDevIns)
     7397{
     7398    return pDevIns->CTX_SUFF(pHlp)->pfnCpuGetGuestArch(pDevIns) == kCpumArch_Arm;
    73617399}
    73627400
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