VirtualBox

Changeset 12976 in vbox for trunk


Ignore:
Timestamp:
Oct 3, 2008 10:40:40 PM (16 years ago)
Author:
vboxsync
Message:

PDM: fixed PDMAPICVERSION.

Location:
trunk
Files:
5 edited

Legend:

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

    r12972 r12976  
    232232typedef FNPDMDEVINITCOMPLETE *PFNPDMDEVINITCOMPLETE;
    233233
    234 /**
    235  * APIC version.
    236  */
    237 typedef enum
    238 {
    239     APIC_NONE = 0,
    240     APIC_XAPIC,
    241     APIC_X2APIC,
    242     /** The usual 32-bit paranoia. */
    243     PDMAPICVERSION_32BIT_HACK = 0x7fffffff
    244 } PDMAPICVERSION;
     234
    245235
    246236/** PDM Device Registration Structure,
     
    10541044
    10551045/**
     1046 * APIC version argument for pfnChangeFeature.
     1047 */
     1048typedef enum PDMAPICVERSION
     1049{
     1050    /** Invalid 0 entry. */
     1051    PDMAPICVERSION_INVALID = 0,
     1052    /** No APIC. */
     1053    PDMAPICVERSION_NONE,
     1054    /** Standard APIC (X86_CPUID_FEATURE_EDX_APIC). */
     1055    PDMAPICVERSION_APIC,
     1056    /** Intel X2APIC (X86_CPUID_FEATURE_ECX_X2APIC). */
     1057    PDMAPICVERSION_X2APIC,
     1058    /** The usual 32-bit paranoia. */
     1059    PDMAPICVERSION_32BIT_HACK = 0x7fffffff
     1060} PDMAPICVERSION;
     1061
     1062
     1063/**
    10561064 * APIC RC helpers.
    10571065 */
     
    10811089     *
    10821090     * @param   pDevIns         Device instance of the APIC.
    1083      * @param   version         Supported APIC version.
    1084      */
    1085     DECLRCCALLBACKMEMBER(void, pfnChangeFeature,(PPDMDEVINS pDevIns, PDMAPICVERSION version));
     1091     * @param   enmVersion      Supported APIC version.
     1092     */
     1093    DECLRCCALLBACKMEMBER(void, pfnChangeFeature,(PPDMDEVINS pDevIns, PDMAPICVERSION enmVersion));
    10861094
    10871095    /**
     
    11491157     *
    11501158     * @param   pDevIns         Device instance of the APIC.
    1151      * @param   version         Supported APIC version.
    1152      */
    1153     DECLR0CALLBACKMEMBER(void, pfnChangeFeature,(PPDMDEVINS pDevIns, PDMAPICVERSION version));
     1159     * @param   enmVersion      Supported APIC version.
     1160     */
     1161    DECLR0CALLBACKMEMBER(void, pfnChangeFeature,(PPDMDEVINS pDevIns, PDMAPICVERSION enmVersion));
    11541162
    11551163    /**
     
    12161224     *
    12171225     * @param   pDevIns         Device instance of the APIC.
    1218      * @param   version         Supported APIC version.
    1219      */
    1220     DECLR3CALLBACKMEMBER(void, pfnChangeFeature,(PPDMDEVINS pDevIns, PDMAPICVERSION version));
     1226     * @param   enmVersion      Supported APIC version.
     1227     */
     1228    DECLR3CALLBACKMEMBER(void, pfnChangeFeature,(PPDMDEVINS pDevIns, PDMAPICVERSION enmVersion));
    12211229
    12221230    /**
  • trunk/src/VBox/Devices/PC/DevAPIC.cpp

    r12972 r12976  
    481481        /* Clear any pending APIC interrupt action flag. */
    482482        cpuClearInterrupt(dev, s);
    483         dev->CTX_SUFF(pApicHlp)->pfnChangeFeature(pDevIns, APIC_NONE);
     483        dev->CTX_SUFF(pApicHlp)->pfnChangeFeature(pDevIns, PDMAPICVERSION_NONE);
    484484    }
    485485    /* APIC_UNLOCK(dev); */
     
    18321832    /* Reset should re-enable the APIC. */
    18331833    s->apicbase = 0xfee00000 | MSR_IA32_APICBASE_BSP | MSR_IA32_APICBASE_ENABLE;
    1834     dev->pApicHlpR3->pfnChangeFeature(dev->pDevInsR3, APIC_XAPIC);
     1834    dev->pApicHlpR3->pfnChangeFeature(dev->pDevInsR3, PDMAPICVERSION_APIC);
    18351835    /* Clear any pending APIC interrupt action flag. */
    18361836    cpuClearInterrupt(dev, s);
     
    20112011        {
    20122012            LogRel(("Activating Local APIC\n"));
    2013             pThis->pApicHlpR3->pfnChangeFeature(pDevIns, APIC_XAPIC);
     2013            pThis->pApicHlpR3->pfnChangeFeature(pDevIns, PDMAPICVERSION_APIC);
    20142014        }
    20152015    }
  • trunk/src/VBox/VMM/PDMDevice.cpp

    r12975 r12976  
    236236static DECLCALLBACK(void) pdmR3ApicHlp_SetInterruptFF(PPDMDEVINS pDevIns, VMCPUID idCpu);
    237237static DECLCALLBACK(void) pdmR3ApicHlp_ClearInterruptFF(PPDMDEVINS pDevIns, VMCPUID idCpu);
    238 static DECLCALLBACK(void) pdmR3ApicHlp_ChangeFeature(PPDMDEVINS pDevIns, PDMAPICVERSION version);
     238static DECLCALLBACK(void) pdmR3ApicHlp_ChangeFeature(PPDMDEVINS pDevIns, PDMAPICVERSION enmVersion);
    239239static DECLCALLBACK(int) pdmR3ApicHlp_Lock(PPDMDEVINS pDevIns, int rc);
    240240static DECLCALLBACK(void) pdmR3ApicHlp_Unlock(PPDMDEVINS pDevIns);
     
    41714171
    41724172/** @copydoc PDMAPICHLPR3::pfnChangeFeature */
    4173 static DECLCALLBACK(void) pdmR3ApicHlp_ChangeFeature(PPDMDEVINS pDevIns, PDMAPICVERSION version)
     4173static DECLCALLBACK(void) pdmR3ApicHlp_ChangeFeature(PPDMDEVINS pDevIns, PDMAPICVERSION enmVersion)
    41744174{
    41754175    PDMDEV_ASSERT_DEVINS(pDevIns);
    41764176    LogFlow(("pdmR3ApicHlp_ChangeFeature: caller='%s'/%d: version=%d\n",
    4177              pDevIns->pDevReg->szDeviceName, pDevIns->iInstance, (int)version));
    4178     switch (version)
    4179     {
    4180         case APIC_NONE:
     4177             pDevIns->pDevReg->szDeviceName, pDevIns->iInstance, (int)enmVersion));
     4178    switch (enmVersion)
     4179    {
     4180        case PDMAPICVERSION_NONE:
    41814181            CPUMClearGuestCpuIdFeature(pDevIns->Internal.s.pVMR3, CPUMCPUIDFEATURE_APIC);
    41824182            CPUMClearGuestCpuIdFeature(pDevIns->Internal.s.pVMR3, CPUMCPUIDFEATURE_X2APIC);
    41834183            break;
    4184         case APIC_XAPIC:
     4184        case PDMAPICVERSION_APIC:
    41854185            CPUMSetGuestCpuIdFeature(pDevIns->Internal.s.pVMR3, CPUMCPUIDFEATURE_APIC);
    41864186            CPUMClearGuestCpuIdFeature(pDevIns->Internal.s.pVMR3, CPUMCPUIDFEATURE_X2APIC);
    41874187            break;
    4188         case APIC_X2APIC:
     4188        case PDMAPICVERSION_X2APIC:
    41894189            CPUMSetGuestCpuIdFeature(pDevIns->Internal.s.pVMR3, CPUMCPUIDFEATURE_X2APIC);
    41904190            CPUMSetGuestCpuIdFeature(pDevIns->Internal.s.pVMR3, CPUMCPUIDFEATURE_APIC);
    41914191            break;
    41924192        default:
    4193             AssertMsgFailed(("Unknown APIC version: %d\n", (int)version));
     4193            AssertMsgFailed(("Unknown APIC version: %d\n", (int)enmVersion));
    41944194    }
    41954195}
  • trunk/src/VBox/VMM/VMMGC/PDMGCDevice.cpp

    r12972 r12976  
    101101static DECLCALLBACK(void) pdmRCApicHlp_SetInterruptFF(PPDMDEVINS pDevIns, VMCPUID idCpu);
    102102static DECLCALLBACK(void) pdmRCApicHlp_ClearInterruptFF(PPDMDEVINS pDevIns, VMCPUID idCpu);
    103 static DECLCALLBACK(void) pdmRCApicHlp_ChangeFeature(PPDMDEVINS pDevIns, PDMAPICVERSION version);
     103static DECLCALLBACK(void) pdmRCApicHlp_ChangeFeature(PPDMDEVINS pDevIns, PDMAPICVERSION enmVersion);
    104104static DECLCALLBACK(int) pdmRCApicHlp_Lock(PPDMDEVINS pDevIns, int rc);
    105105static DECLCALLBACK(void) pdmRCApicHlp_Unlock(PPDMDEVINS pDevIns);
     
    415415
    416416/** @copydoc PDMAPICHLPRC::pfnChangeFeature */
    417 static DECLCALLBACK(void) pdmRCApicHlp_ChangeFeature(PPDMDEVINS pDevIns, PDMAPICVERSION version)
    418 {
    419     PDMDEV_ASSERT_DEVINS(pDevIns);
    420     LogFlow(("pdmRCApicHlp_ChangeFeature: caller=%p/%d: version=%d\n", pDevIns, pDevIns->iInstance, version));
    421     switch (version)
     417static DECLCALLBACK(void) pdmRCApicHlp_ChangeFeature(PPDMDEVINS pDevIns, PDMAPICVERSION enmVersion)
     418{
     419    PDMDEV_ASSERT_DEVINS(pDevIns);
     420    LogFlow(("pdmRCApicHlp_ChangeFeature: caller=%p/%d: version=%d\n", pDevIns, pDevIns->iInstance, (int)enmVersion));
     421    switch (enmVersion)
    422422    {
    423         case APIC_NONE:
     423        case PDMAPICVERSION_NONE:
    424424            CPUMClearGuestCpuIdFeature(pDevIns->Internal.s.pVMRC, CPUMCPUIDFEATURE_APIC);
    425425            CPUMClearGuestCpuIdFeature(pDevIns->Internal.s.pVMRC, CPUMCPUIDFEATURE_X2APIC);
    426426            break;
    427         case APIC_XAPIC:
     427        case PDMAPICVERSION_APIC:
    428428            CPUMSetGuestCpuIdFeature(pDevIns->Internal.s.pVMRC, CPUMCPUIDFEATURE_APIC);
    429429            CPUMClearGuestCpuIdFeature(pDevIns->Internal.s.pVMRC, CPUMCPUIDFEATURE_X2APIC);
    430430            break;
    431         case APIC_X2APIC:
     431        case PDMAPICVERSION_X2APIC:
    432432            CPUMSetGuestCpuIdFeature(pDevIns->Internal.s.pVMRC, CPUMCPUIDFEATURE_X2APIC);
    433433            CPUMSetGuestCpuIdFeature(pDevIns->Internal.s.pVMRC, CPUMCPUIDFEATURE_APIC);
    434434            break;
    435435        default:
    436             AssertMsgFailed(("Unknown APIC version: %d\n", (int)version));
     436            AssertMsgFailed(("Unknown APIC version: %d\n", (int)enmVersion));
    437437    }
    438438}
  • trunk/src/VBox/VMM/VMMR0/PDMR0Device.cpp

    r12972 r12976  
    101101static DECLCALLBACK(void) pdmR0ApicHlp_SetInterruptFF(PPDMDEVINS pDevIns, VMCPUID idCpu);
    102102static DECLCALLBACK(void) pdmR0ApicHlp_ClearInterruptFF(PPDMDEVINS pDevIns, VMCPUID idCpu);
    103 static DECLCALLBACK(void) pdmR0ApicHlp_ChangeFeature(PPDMDEVINS pDevIns, PDMAPICVERSION version);
     103static DECLCALLBACK(void) pdmR0ApicHlp_ChangeFeature(PPDMDEVINS pDevIns, PDMAPICVERSION enmVersion);
    104104static DECLCALLBACK(int) pdmR0ApicHlp_Lock(PPDMDEVINS pDevIns, int rc);
    105105static DECLCALLBACK(void) pdmR0ApicHlp_Unlock(PPDMDEVINS pDevIns);
     
    420420
    421421/** @copydoc PDMAPICHLPR0::pfnChangeFeature */
    422 static DECLCALLBACK(void) pdmR0ApicHlp_ChangeFeature(PPDMDEVINS pDevIns, PDMAPICVERSION version)
    423 {
    424     PDMDEV_ASSERT_DEVINS(pDevIns);
    425     LogFlow(("pdmR0ApicHlp_ChangeFeature: caller=%p/%d: version=%d\n", pDevIns, pDevIns->iInstance, version));
    426     switch (version)
     422static DECLCALLBACK(void) pdmR0ApicHlp_ChangeFeature(PPDMDEVINS pDevIns, PDMAPICVERSION enmVersion)
     423{
     424    PDMDEV_ASSERT_DEVINS(pDevIns);
     425    LogFlow(("pdmR0ApicHlp_ChangeFeature: caller=%p/%d: version=%d\n", pDevIns, pDevIns->iInstance, (int)enmVersion));
     426    switch (enmVersion)
    427427    {
    428         case APIC_NONE:
     428        case PDMAPICVERSION_NONE:
    429429            CPUMClearGuestCpuIdFeature(pDevIns->Internal.s.pVMR0, CPUMCPUIDFEATURE_APIC);
    430430            CPUMClearGuestCpuIdFeature(pDevIns->Internal.s.pVMR0, CPUMCPUIDFEATURE_X2APIC);
    431431            break;
    432         case APIC_XAPIC:
     432        case PDMAPICVERSION_APIC:
    433433            CPUMSetGuestCpuIdFeature(pDevIns->Internal.s.pVMR0, CPUMCPUIDFEATURE_APIC);
    434434            CPUMClearGuestCpuIdFeature(pDevIns->Internal.s.pVMR0, CPUMCPUIDFEATURE_X2APIC);
    435435            break;
    436         case APIC_X2APIC:
     436        case PDMAPICVERSION_X2APIC:
    437437            CPUMSetGuestCpuIdFeature(pDevIns->Internal.s.pVMR0, CPUMCPUIDFEATURE_X2APIC);
    438438            CPUMSetGuestCpuIdFeature(pDevIns->Internal.s.pVMR0, CPUMCPUIDFEATURE_APIC);
    439439            break;
    440440        default:
    441             AssertMsgFailed(("Unknown APIC version: %d\n", (int)version));
     441            AssertMsgFailed(("Unknown APIC version: %d\n", (int)enmVersion));
    442442    }
    443443}
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