VirtualBox

Changeset 25817 in vbox for trunk/src/VBox/Devices/PC/ACPI


Ignore:
Timestamp:
Jan 13, 2010 10:08:17 PM (15 years ago)
Author:
vboxsync
Message:

CPU hotplug: Merge the second patch. ACPI changes to support CPU hotplugging. ACPI table changes are in a separate file which is used if CPU hotplugging is enabled for a VM to not break untested guests

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Devices/PC/ACPI/VBoxAcpi.cpp

    r20920 r25817  
    2929#include <VBox/log.h>
    3030#include <VBox/param.h>
     31#include <VBox/cfgm.h>
    3132#include <iprt/assert.h>
    3233#include <iprt/alloc.h>
     
    3940/* Statically compiled AML */
    4041# include <vboxaml.hex>
     42# include <vboxaml-cpuhotplug.hex>
    4143#endif
    4244
     
    140142    return prepareDynamicDsdt(pDevIns, ppPtr, puDsdtLen);
    141143#else
    142     patchAml(pDevIns, AmlCode, sizeof(AmlCode));
    143     *ppPtr = AmlCode;
    144     *puDsdtLen = sizeof(AmlCode);
     144    unsigned char *pbAmlCode = NULL;
     145    size_t cbAmlCode = 0;
     146    bool fCpuHotplug = false;
     147    int rc = CFGMR3QueryBoolDef(pDevIns->pCfgHandle, "CpuHotplug", &fCpuHotplug, false);
     148    if (RT_FAILURE(rc))
     149        return PDMDEV_SET_ERROR(pDevIns, rc,
     150                                N_("Configuration error: Failed to read \"CpuHotplug\""));
     151
     152    if (fCpuHotplug)
     153    {
     154        pbAmlCode = AmlCodeCpuHotplug;
     155        cbAmlCode = sizeof(AmlCodeCpuHotplug);
     156    }
     157    else
     158    {
     159        pbAmlCode = AmlCode;
     160        cbAmlCode = sizeof(AmlCode);
     161    }
     162
     163    patchAml(pDevIns, pbAmlCode, cbAmlCode);
     164    *ppPtr = pbAmlCode;
     165    *puDsdtLen = cbAmlCode;
    145166    return 0;
    146167#endif
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