VirtualBox

Changeset 105695 in vbox for trunk/src/VBox/VMM


Ignore:
Timestamp:
Aug 15, 2024 4:24:06 PM (4 months ago)
Author:
vboxsync
Message:

VMMArm/NEM: Resolve hv_vm_config_create() dynamically as it is only available since 13.0, fixes building with older SDKs, bugref:10747

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/VMM/VMMR3/NEMR3Native-darwin-armv8.cpp

    r105693 r105695  
    134134#endif
    135135
    136 typedef hv_return_t FN_HV_VM_CONFIG_GET_EL2_SUPPORTED(bool *el2_supported);
    137 typedef hv_return_t FN_HV_VM_CONFIG_GET_EL2_ENABLED(hv_vm_config_t config, bool *el2_enabled);
    138 typedef hv_return_t FN_HV_VM_CONFIG_SET_EL2_ENABLED(hv_vm_config_t config, bool el2_enabled);
     136typedef hv_vm_config_t  FN_HV_VM_CONFIG_CREATE(void);
     137typedef hv_return_t     FN_HV_VM_CONFIG_GET_EL2_SUPPORTED(bool *el2_supported);
     138typedef hv_return_t     FN_HV_VM_CONFIG_GET_EL2_ENABLED(hv_vm_config_t config, bool *el2_enabled);
     139typedef hv_return_t     FN_HV_VM_CONFIG_SET_EL2_ENABLED(hv_vm_config_t config, bool el2_enabled);
    139140
    140141typedef struct hv_gic_config_s *hv_gic_config_t;
     
    188189/** @name Optional APIs imported from Hypervisor.framework.
    189190 * @{ */
    190 static FN_HV_VM_CONFIG_GET_EL2_SUPPORTED *g_pfnHvVmConfigGetEl2Supported                        = NULL; /* Since 15.0 */
    191 static FN_HV_VM_CONFIG_GET_EL2_ENABLED   *g_pfnHvVmConfigGetEl2Enabled                          = NULL; /* Since 15.0 */
    192 static FN_HV_VM_CONFIG_SET_EL2_ENABLED   *g_pfnHvVmConfigSetEl2Enabled                          = NULL; /* Since 15.0 */
     191static FN_HV_VM_CONFIG_CREATE                       *g_pfnHvVmConfigCreate                      = NULL; /* Since 13.0 */
     192static FN_HV_VM_CONFIG_GET_EL2_SUPPORTED            *g_pfnHvVmConfigGetEl2Supported             = NULL; /* Since 15.0 */
     193static FN_HV_VM_CONFIG_GET_EL2_ENABLED              *g_pfnHvVmConfigGetEl2Enabled               = NULL; /* Since 15.0 */
     194static FN_HV_VM_CONFIG_SET_EL2_ENABLED              *g_pfnHvVmConfigSetEl2Enabled               = NULL; /* Since 15.0 */
    193195
    194196static FN_HV_GIC_CREATE                             *g_pfnHvGicCreate                           = NULL; /* Since 15.0 */
     
    240242{
    241243#define NEM_DARWIN_IMPORT(a_Pfn, a_Name) { (void **)&(a_Pfn), #a_Name }
     244    NEM_DARWIN_IMPORT(g_pfnHvVmConfigCreate,                    hv_vm_config_create),
    242245    NEM_DARWIN_IMPORT(g_pfnHvVmConfigGetEl2Supported,           hv_vm_config_get_el2_supported),
    243246    NEM_DARWIN_IMPORT(g_pfnHvVmConfigGetEl2Enabled,             hv_vm_config_get_el2_enabled),
     
    287290 */
    288291#ifndef IN_SLICKEDIT
     292# define hv_vm_config_create                        g_pfnHvVmConfigCreate
    289293# define hv_vm_config_get_el2_supported             g_pfnHvVmConfigGetEl2Supported
    290294# define hv_vm_config_get_el2_enabled               g_pfnHvVmConfigGetEl2Enabled
     
    12471251     */
    12481252    PCFGMNODE pCfgCpum = CFGMR3GetChild(CFGMR3GetRoot(pVM), "CPUM/");
    1249     hv_vm_config_t hVmCfg = hv_vm_config_create();
    1250 
    1251     if (hv_vm_config_get_el2_supported)
    1252     {
     1253    hv_vm_config_t hVmCfg = NULL;
     1254
     1255    if (   hv_vm_config_create
     1256        && hv_vm_config_get_el2_supported)
     1257    {
     1258        hVmCfg = hv_vm_config_create();
     1259
    12531260        bool fHvEl2Supported = false;
    12541261        hv_return_t hrc = hv_vm_config_get_el2_supported(&fHvEl2Supported);
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