VirtualBox

Changeset 2636 in vbox for trunk/src/VBox/Devices


Ignore:
Timestamp:
May 14, 2007 7:13:31 PM (18 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
21161
Message:
enable local APIC if IOAPIC is enabled or CPU == Intel
CPU == AMD
File:
1 edited

Legend:

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

    r2538 r2636  
    16121612    int             rc;
    16131613    int             i;
     1614    bool            fIOAPIC;
    16141615    bool            fGCEnabled;
    16151616    bool            fR0Enabled;
     
    16191620     * Validate configuration.
    16201621     */
    1621     if (!CFGMR3AreValuesValid(pCfgHandle, "GCEnabled\0R0Enabled"))
     1622    if (!CFGMR3AreValuesValid(pCfgHandle, "0IOAPIC\0GCEnabled\0R0Enabled\0"))
    16221623        return VERR_PDM_DEVINS_UNKNOWN_CFG_VALUES;
     1624
     1625    rc = CFGMR3QueryBool (pCfgHandle, "IOAPIC", &fIOAPIC);
     1626    if (rc == VERR_CFGM_VALUE_NOT_FOUND)
     1627        fIOAPIC = true;
     1628    else if (VBOX_FAILURE (rc))
     1629        return PDMDEV_SET_ERROR(pDevIns, rc,
     1630                                N_("Configuration error: Failed to read \"IOAPIC\"."));
    16231631
    16241632    rc = CFGMR3QueryBool(pCfgHandle, "GCEnabled", &fGCEnabled);
     
    17011709     * The the CPUID feature bit.
    17021710     */
    1703     pData->pApicHlpR3->pfnChangeFeature(pDevIns, true);
     1711    uint32_t u32Eax, u32Ebx, u32Ecx, u32Edx;
     1712    PDMDevHlpQueryCPUId(pDevIns, 0, &u32Eax, &u32Ebx, &u32Ecx, &u32Edx);
     1713    if (u32Eax >= 1)
     1714    {
     1715        if (   fIOAPIC                       /* If IOAPIC is enabled, enable Local APIC in any case */
     1716            || u32Ebx == 0x756e6547 && u32Ecx == 0x6c65746e && u32Edx == 0x49656e69 /* GenuineIntel */
     1717            || u32Ebx == 0x68747541 && u32Ecx == 0x69746e65 && u32Edx == 0x444d4163 /* AuthenticAMD */)
     1718            pData->pApicHlpR3->pfnChangeFeature(pDevIns, true);
     1719    }
    17041720
    17051721    /*
     
    19381954     * Validate and read the configuration.
    19391955     */
    1940     if (!CFGMR3AreValuesValid(pCfgHandle, "GCEnabled\0R0Enabled"))
     1956    if (!CFGMR3AreValuesValid(pCfgHandle, "GCEnabled\0R0Enabled\0"))
    19411957        return VERR_PDM_DEVINS_UNKNOWN_CFG_VALUES;
    19421958
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette