Changeset 60307 in vbox for trunk/src/VBox/Devices
- Timestamp:
- Apr 4, 2016 3:23:11 PM (9 years ago)
- Location:
- trunk/src/VBox/Devices
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Makefile.kmk
r59775 r60307 1018 1018 VBoxDD2_DEFS += VBOX_WITH_PXE_ROM 1019 1019 endif 1020 ifdef VBOX_WITH_NEW_APIC 1021 VBoxDD2_DEFS += VBOX_WITH_NEW_APIC 1022 endif 1020 1023 1021 1024 $(call VBOX_SET_VER_INFO_DLL,VBoxDD2,VirtualBox VMM Devices and Drivers 2) # (last!) -
trunk/src/VBox/Devices/PC/DevAPIC.cpp
r57358 r60307 52 52 #include <VBox/vmm/stam.h> 53 53 #include <VBox/vmm/vmcpuset.h> 54 #include <VBox/vmm/vm.h> 54 55 #include <iprt/asm.h> 55 56 #include <iprt/assert.h> … … 378 379 RCPTRTYPE(PPDMCRITSECT) pCritSectRC; 379 380 380 /** APIC specification versionin this virtual hardware configuration. */381 PDMAPIC VERSION enmVersion;381 /** APIC specification mode in this virtual hardware configuration. */ 382 PDMAPICMODE enmMode; 382 383 383 384 /** Number of attempts made to optimize TPR accesses. */ … … 471 472 Log2(("apic: send SIPI vector=%d\n", vector)); 472 473 473 pDev->pApicHlpR3->pfnSendSipi(pDev->pDevInsR3, 474 getCpuFromLapic(pDev, pApic), 475 vector); 474 pDev->pApicHlpR3->pfnSendStartupIpi(pDev->pDevInsR3, getCpuFromLapic(pDev, pApic), vector); 476 475 } 477 476 … … 488 487 DECLINLINE(uint32_t) getApicEnableBits(APICDeviceInfo *pDev) 489 488 { 490 switch (pDev->enm Version)491 { 492 case PDMAPIC VERSION_NONE:489 switch (pDev->enmMode) 490 { 491 case PDMAPICMODE_NONE: 493 492 return 0; 494 case PDMAPIC VERSION_APIC:493 case PDMAPICMODE_APIC: 495 494 return MSR_IA32_APICBASE_ENABLE; 496 case PDMAPIC VERSION_X2APIC:495 case PDMAPICMODE_X2APIC: 497 496 return MSR_IA32_APICBASE_ENABLE | MSR_IA32_APICBASE_X2ENABLE; 498 497 default: 499 AssertMsgFailed(("Unsupported APIC version %d\n", pDev->enmVersion));498 AssertMsgFailed(("Unsupported APIC mode %d\n", pDev->enmMode)); 500 499 return 0; 501 500 } 502 501 } 503 502 504 DECLINLINE(PDMAPIC VERSION) getApicMode(APICState *apic)503 DECLINLINE(PDMAPICMODE) getApicMode(APICState *apic) 505 504 { 506 505 switch (((apic->apicbase) >> 10) & 0x3) 507 506 { 508 507 case 0: 509 return PDMAPIC VERSION_NONE;508 return PDMAPICMODE_NONE; 510 509 case 1: 511 510 default: 512 511 /* Invalid */ 513 return PDMAPIC VERSION_NONE;512 return PDMAPICMODE_NONE; 514 513 case 2: 515 return PDMAPIC VERSION_APIC;514 return PDMAPICMODE_APIC; 516 515 case 3: 517 return PDMAPIC VERSION_X2APIC;516 return PDMAPICMODE_X2APIC; 518 517 } 519 518 } … … 583 582 584 583 585 PDMBOTHCBDECL( void) apicSetBase(PPDMDEVINS pDevIns, VMCPUID idCpu, uint64_t val)584 PDMBOTHCBDECL(VBOXSTRICTRC) apicSetBase(PPDMDEVINS pDevIns, PVMCPU pVCpu, uint64_t val) 586 585 { 587 586 APICDeviceInfo *pDev = PDMINS_2_DATA(pDevIns, APICDeviceInfo *); 588 587 Assert(PDMCritSectIsOwner(pDev->CTX_SUFF(pCritSect))); 589 APICState *pApic = apicGetStateById(pDev, idCpu);588 APICState *pApic = apicGetStateById(pDev, pVCpu->idCpu); 590 589 Log(("apicSetBase: %016RX64\n", val)); 591 590 … … 594 593 /** @todo If this change is valid immediately, then we should change the MMIO registration! */ 595 594 /* We cannot change if this CPU is BSP or not by writing to MSR - it's hardwired */ 596 PDMAPIC VERSIONoldMode = getApicMode(pApic);595 PDMAPICMODE oldMode = getApicMode(pApic); 597 596 pApic->apicbase = (val & 0xfffff000) /* base */ 598 597 | (val & getApicEnableBits(pDev)) /* mode */ 599 598 | (pApic->apicbase & MSR_IA32_APICBASE_BSP) /* keep BSP bit */; 600 PDMAPIC VERSIONnewMode = getApicMode(pApic);599 PDMAPICMODE newMode = getApicMode(pApic); 601 600 602 601 if (oldMode != newMode) … … 604 603 switch (newMode) 605 604 { 606 case PDMAPIC VERSION_NONE:605 case PDMAPICMODE_NONE: 607 606 { 608 607 pApic->spurious_vec &= ~APIC_SV_ENABLE; … … 614 613 * APIC (see Section 10.4.2, 'Presence of the Local APIC') is also set to 0." 615 614 */ 616 pDev->CTX_SUFF(pApicHlp)->pfnChangeFeature(pDevIns, PDMAPIC VERSION_NONE);615 pDev->CTX_SUFF(pApicHlp)->pfnChangeFeature(pDevIns, PDMAPICMODE_NONE); 617 616 break; 618 617 } 619 case PDMAPIC VERSION_APIC:618 case PDMAPICMODE_APIC: 620 619 /** @todo map MMIO ranges, if needed */ 621 620 break; 622 case PDMAPIC VERSION_X2APIC:621 case PDMAPICMODE_X2APIC: 623 622 /** @todo unmap MMIO ranges of this APIC, according to the spec. This is how 624 623 * real hw works! (Remember the problem disabling NMI watchdog timers in … … 630 629 } 631 630 /* APIC_UNLOCK(pDev); */ 632 } 633 634 PDMBOTHCBDECL(uint64_t) apicGetBase(PPDMDEVINS pDevIns, VMCPUID idCpu) 631 return VINF_SUCCESS; 632 } 633 634 PDMBOTHCBDECL(uint64_t) apicGetBase(PPDMDEVINS pDevIns, PVMCPU pVCpu) 635 635 { 636 636 APICDeviceInfo *pDev = PDMINS_2_DATA(pDevIns, APICDeviceInfo *); 637 637 Assert(PDMCritSectIsOwner(pDev->CTX_SUFF(pCritSect))); 638 APICState *pApic = apicGetStateById(pDev, idCpu);638 APICState *pApic = apicGetStateById(pDev, pVCpu->idCpu); 639 639 LogFlow(("apicGetBase: %016llx\n", (uint64_t)pApic->apicbase)); 640 640 return pApic->apicbase; 641 641 } 642 642 643 PDMBOTHCBDECL(void) apicSetTPR(PPDMDEVINS pDevIns, VMCPUID idCpu, uint8_t val)643 PDMBOTHCBDECL(void) apicSetTPR(PPDMDEVINS pDevIns, PVMCPU pVCpu, uint8_t val) 644 644 { 645 645 APICDeviceInfo *pDev = PDMINS_2_DATA(pDevIns, APICDeviceInfo *); 646 646 Assert(PDMCritSectIsOwner(pDev->CTX_SUFF(pCritSect))); 647 APICState *pApic = apicGetStateById(pDev, idCpu);647 APICState *pApic = apicGetStateById(pDev, pVCpu->idCpu); 648 648 LogFlow(("apicSetTPR: val=%#x (trp %#x -> %#x)\n", val, pApic->tpr, val)); 649 649 apic_update_tpr(pDev, pApic, val); 650 650 } 651 651 652 PDMBOTHCBDECL(uint8_t) apicGetTPR(PPDMDEVINS pDevIns, VMCPUID idCpu)652 PDMBOTHCBDECL(uint8_t) apicGetTPR(PPDMDEVINS pDevIns, PVMCPU pVCpu) 653 653 { 654 654 /* We don't perform any locking here as that would cause a lot of contention for VT-x/AMD-V. */ 655 655 APICDeviceInfo *pDev = PDMINS_2_DATA(pDevIns, APICDeviceInfo *); 656 APICState *pApic = apicGetStateById(pDev, idCpu);656 APICState *pApic = apicGetStateById(pDev, pVCpu->idCpu); 657 657 Log2(("apicGetTPR: returns %#x\n", pApic->tpr)); 658 658 return pApic->tpr; … … 1051 1051 * @interface_method_impl{PDMAPICREG,pfnWriteMSRR3} 1052 1052 */ 1053 PDMBOTHCBDECL( int) apicWriteMSR(PPDMDEVINS pDevIns, VMCPUID idCpu, uint32_t u32Reg, uint64_t u64Value)1053 PDMBOTHCBDECL(VBOXSTRICTRC) apicWriteMSR(PPDMDEVINS pDevIns, PVMCPU pVCpu, uint32_t u32Reg, uint64_t u64Value) 1054 1054 { 1055 1055 APICDeviceInfo *pDev = PDMINS_2_DATA(pDevIns, APICDeviceInfo *); 1056 if (pDev->enm Version < PDMAPICVERSION_X2APIC)1056 if (pDev->enmMode < PDMAPICMODE_X2APIC) 1057 1057 return VERR_EM_INTERPRETER; /** @todo tell the caller to raise hell (\#GP(0)). */ 1058 1058 1059 APICState *pApic = apicGetStateById(pDev, idCpu);1059 APICState *pApic = apicGetStateById(pDev, pVCpu->idCpu); 1060 1060 uint32_t iReg = (u32Reg - MSR_IA32_X2APIC_START) & 0xff; 1061 1061 return apicWriteRegister(pDev, pApic, iReg, u64Value, VINF_SUCCESS /*rcBusy*/, true /*fMsr*/); … … 1066 1066 * @interface_method_impl{PDMAPICREG,pfnReadMSRR3} 1067 1067 */ 1068 PDMBOTHCBDECL( int) apicReadMSR(PPDMDEVINS pDevIns, VMCPUID idCpu, uint32_t u32Reg, uint64_t *pu64Value)1068 PDMBOTHCBDECL(VBOXSTRICTRC) apicReadMSR(PPDMDEVINS pDevIns, PVMCPU pVCpu, uint32_t u32Reg, uint64_t *pu64Value) 1069 1069 { 1070 1070 APICDeviceInfo *pDev = PDMINS_2_DATA(pDevIns, APICDeviceInfo *); 1071 1071 1072 if (pDev->enm Version < PDMAPICVERSION_X2APIC)1072 if (pDev->enmMode < PDMAPICMODE_X2APIC) 1073 1073 return VERR_EM_INTERPRETER; 1074 1074 1075 APICState *pApic = apicGetStateById(pDev, idCpu);1075 APICState *pApic = apicGetStateById(pDev, pVCpu->idCpu); 1076 1076 uint32_t iReg = (u32Reg - MSR_IA32_X2APIC_START) & 0xff; 1077 1077 return apicReadRegister(pDev, pApic, iReg, pu64Value, VINF_SUCCESS /*rcBusy*/, true /*fMsr*/); … … 1099 1099 * Normally used for 8259A PIC and NMI. 1100 1100 */ 1101 PDMBOTHCBDECL( int) apicLocalInterrupt(PPDMDEVINS pDevIns, uint8_t u8Pin, uint8_t u8Level)1101 PDMBOTHCBDECL(VBOXSTRICTRC) apicLocalInterrupt(PPDMDEVINS pDevIns, PVMCPU pVCpu, uint8_t u8Pin, uint8_t u8Level, int rcRZ) 1102 1102 { 1103 1103 APICDeviceInfo *pDev = PDMINS_2_DATA(pDevIns, APICDeviceInfo *); 1104 APICState *pApic = apicGetStateById(pDev, 0); 1104 NOREF(rcRZ); 1105 1106 /* NB: We currently only deliver local interrupts to the first CPU. In theory they 1107 * should be delivered to all CPUs and it is the guest's responsibility to ensure 1108 * no more than one CPU has the interrupt unmasked. 1109 */ 1110 APICState *pApic = apicGetStateById(pDev, pVCpu->idCpu); 1105 1111 1106 1112 Assert(PDMCritSectIsOwner(pDev->CTX_SUFF(pCritSect))); … … 1124 1130 AssertMsgReturn(u8Pin <= 1, ("Invalid LAPIC pin %d\n", u8Pin), VERR_INVALID_PARAMETER); 1125 1131 1126 /* NB: We currently only deliver local interrupts to the first CPU. In theory they1127 * should be delivered to all CPUs and it is the guest's responsibility to ensure1128 * no more than one CPU has the interrupt unmasked.1129 */1130 1132 uint32_t u32Lvec; 1131 1133 … … 1133 1135 /* Drop int if entry is masked. May not be correct for level-triggered interrupts. */ 1134 1136 if (!(u32Lvec & APIC_LVT_MASKED)) 1135 { uint8_t u8Delivery; 1137 { 1138 uint8_t u8Delivery; 1136 1139 PDMAPICIRQ enmType; 1137 1140 … … 1229 1232 1230 1233 /* Check if the APIC has a pending interrupt/if a TPR change would active one. */ 1231 PDMBOTHCBDECL(bool) apicHasPendingIrq(PPDMDEVINS pDevIns, VMCPUID idCpu, uint8_t *pu8PendingIrq)1234 PDMBOTHCBDECL(bool) apicHasPendingIrq(PPDMDEVINS pDevIns, PVMCPU pVCpu, uint8_t *pu8PendingIrq) 1232 1235 { 1233 1236 APICDeviceInfo *pDev = PDMINS_2_DATA(pDevIns, APICDeviceInfo *); … … 1237 1240 /* We don't perform any locking here as that would cause a lot of contention for VT-x/AMD-V. */ 1238 1241 1239 APICState *pApic = apicGetStateById(pDev, idCpu);1242 APICState *pApic = apicGetStateById(pDev, pVCpu->idCpu); 1240 1243 1241 1244 /* … … 1444 1447 1445 1448 1446 PDMBOTHCBDECL(int) apicGetInterrupt(PPDMDEVINS pDevIns, VMCPUID idCpu, uint32_t *puTagSrc)1449 PDMBOTHCBDECL(int) apicGetInterrupt(PPDMDEVINS pDevIns, PVMCPU pVCpu, uint32_t *puTagSrc) 1447 1450 { 1448 1451 APICDeviceInfo *pDev = PDMINS_2_DATA(pDevIns, APICDeviceInfo *); … … 1456 1459 Assert(PDMCritSectIsOwner(pDev->CTX_SUFF(pCritSect))); 1457 1460 1458 APICState *pApic = apicGetStateById(pDev, idCpu);1461 APICState *pApic = apicGetStateById(pDev, pVCpu->idCpu); 1459 1462 1460 1463 if (!(pApic->spurious_vec & APIC_SV_ENABLE)) … … 2074 2077 SSMR3PutU32( pSSM, pDev->cCpus); 2075 2078 SSMR3PutBool(pSSM, pDev->fIoApic); 2076 SSMR3PutU32( pSSM, pDev->enm Version);2077 AssertCompile(PDMAPIC VERSION_APIC == 2);2079 SSMR3PutU32( pSSM, pDev->enmMode); 2080 AssertCompile(PDMAPICMODE_APIC == 2); 2078 2081 2079 2082 return VINF_SSM_DONT_CALL_AGAIN; … … 2124 2127 return SSMR3SetCfgError(pSSM, RT_SRC_POS, N_("Config mismatch - fIoApic: saved=%RTbool config=%RTbool"), fIoApic, pDev->fIoApic); 2125 2128 2126 uint32_t uApic Version;2127 rc = SSMR3GetU32(pSSM, &uApic Version); AssertRCReturn(rc, rc);2128 if (uApic Version != (uint32_t)pDev->enmVersion)2129 return SSMR3SetCfgError(pSSM, RT_SRC_POS, N_("Config mismatch - uApic Version: saved=%#x config=%#x"), uApicVersion, pDev->enmVersion);2129 uint32_t uApicMode; 2130 rc = SSMR3GetU32(pSSM, &uApicMode); AssertRCReturn(rc, rc); 2131 if (uApicMode != (uint32_t)pDev->enmMode) 2132 return SSMR3SetCfgError(pSSM, RT_SRC_POS, N_("Config mismatch - uApicMode: saved=%#x config=%#x"), uApicMode, pDev->enmMode); 2130 2133 } 2131 2134 … … 2179 2182 2180 2183 LogRel(("APIC: Re-activating Local APIC\n")); 2181 pDev->pApicHlpR3->pfnChangeFeature(pDev->pDevInsR3, pDev->enm Version);2184 pDev->pApicHlpR3->pfnChangeFeature(pDev->pDevInsR3, pDev->enmMode); 2182 2185 2183 2186 APIC_UNLOCK(pDev); … … 2275 2278 pDev->fIoApic = fIoApic; 2276 2279 /** @todo Finish X2APIC implementation. Must, among other things, set 2277 * PDMAPIC VERSION_X2APIC here when X2APIC is configured. */2278 pDev->enm Version = PDMAPICVERSION_APIC;2280 * PDMAPICMODE_X2APIC here when X2APIC is configured. */ 2281 pDev->enmMode = PDMAPICMODE_APIC; 2279 2282 2280 2283 /* Disable locking in this device. */ … … 2303 2306 ApicReg.pfnGetInterruptR3 = apicGetInterrupt; 2304 2307 ApicReg.pfnHasPendingIrqR3 = apicHasPendingIrq; 2305 ApicReg.pfnSetBase R3= apicSetBase;2306 ApicReg.pfnGetBase R3= apicGetBase;2307 ApicReg.pfnSetT PRR3 = apicSetTPR;2308 ApicReg.pfnGetT PRR3 = apicGetTPR;2309 ApicReg.pfnWriteM SRR3 = apicWriteMSR;2310 ApicReg.pfnReadM SRR3 = apicReadMSR;2308 ApicReg.pfnSetBaseMsrR3 = apicSetBase; 2309 ApicReg.pfnGetBaseMsrR3 = apicGetBase; 2310 ApicReg.pfnSetTprR3 = apicSetTPR; 2311 ApicReg.pfnGetTprR3 = apicGetTPR; 2312 ApicReg.pfnWriteMsrR3 = apicWriteMSR; 2313 ApicReg.pfnReadMsrR3 = apicReadMSR; 2311 2314 ApicReg.pfnBusDeliverR3 = apicBusDeliverCallback; 2312 2315 ApicReg.pfnLocalInterruptR3 = apicLocalInterrupt; … … 2316 2319 ApicReg.pszGetInterruptRC = "apicGetInterrupt"; 2317 2320 ApicReg.pszHasPendingIrqRC = "apicHasPendingIrq"; 2318 ApicReg.pszSetBase RC= "apicSetBase";2319 ApicReg.pszGetBase RC= "apicGetBase";2320 ApicReg.pszSetT PRRC = "apicSetTPR";2321 ApicReg.pszGetT PRRC = "apicGetTPR";2322 ApicReg.pszWriteM SRRC = "apicWriteMSR";2323 ApicReg.pszReadM SRRC = "apicReadMSR";2321 ApicReg.pszSetBaseMsrRC = "apicSetBase"; 2322 ApicReg.pszGetBaseMsrRC = "apicGetBase"; 2323 ApicReg.pszSetTprRC = "apicSetTPR"; 2324 ApicReg.pszGetTprRC = "apicGetTPR"; 2325 ApicReg.pszWriteMsrRC = "apicWriteMSR"; 2326 ApicReg.pszReadMsrRC = "apicReadMSR"; 2324 2327 ApicReg.pszBusDeliverRC = "apicBusDeliverCallback"; 2325 2328 ApicReg.pszLocalInterruptRC = "apicLocalInterrupt"; … … 2328 2331 ApicReg.pszGetInterruptR0 = "apicGetInterrupt"; 2329 2332 ApicReg.pszHasPendingIrqR0 = "apicHasPendingIrq"; 2330 ApicReg.pszSetBase R0= "apicSetBase";2331 ApicReg.pszGetBase R0= "apicGetBase";2332 ApicReg.pszSetT PRR0 = "apicSetTPR";2333 ApicReg.pszGetT PRR0 = "apicGetTPR";2334 ApicReg.pszWriteM SRR0 = "apicWriteMSR";2335 ApicReg.pszReadM SRR0 = "apicReadMSR";2333 ApicReg.pszSetBaseMsrR0 = "apicSetBase"; 2334 ApicReg.pszGetBaseMsrR0 = "apicGetBase"; 2335 ApicReg.pszSetTprR0 = "apicSetTPR"; 2336 ApicReg.pszGetTprR0 = "apicGetTPR"; 2337 ApicReg.pszWriteMsrR0 = "apicWriteMSR"; 2338 ApicReg.pszReadMsrR0 = "apicReadMSR"; 2336 2339 ApicReg.pszBusDeliverR0 = "apicBusDeliverCallback"; 2337 2340 ApicReg.pszLocalInterruptR0 = "apicLocalInterrupt"; … … 2342 2345 ApicReg.pszGetInterruptRC = NULL; 2343 2346 ApicReg.pszHasPendingIrqRC = NULL; 2344 ApicReg.pszSetBase RC= NULL;2345 ApicReg.pszGetBase RC= NULL;2346 ApicReg.pszSetT PRRC = NULL;2347 ApicReg.pszGetT PRRC = NULL;2348 ApicReg.pszWriteM SRRC = NULL;2349 ApicReg.pszReadM SRRC = NULL;2347 ApicReg.pszSetBaseMsrRC = NULL; 2348 ApicReg.pszGetBaseMsrRC = NULL; 2349 ApicReg.pszSetTprRC = NULL; 2350 ApicReg.pszGetTprRC = NULL; 2351 ApicReg.pszWriteMsrRC = NULL; 2352 ApicReg.pszReadMsrRC = NULL; 2350 2353 ApicReg.pszBusDeliverRC = NULL; 2351 2354 ApicReg.pszLocalInterruptRC = NULL; … … 2354 2357 ApicReg.pszGetInterruptR0 = NULL; 2355 2358 ApicReg.pszHasPendingIrqR0 = NULL; 2356 ApicReg.pszSetBase R0= NULL;2357 ApicReg.pszGetBase R0= NULL;2358 ApicReg.pszSetT PRR0 = NULL;2359 ApicReg.pszGetT PRR0 = NULL;2360 ApicReg.pszWriteM SRR0 = NULL;2361 ApicReg.pszReadM SRR0 = NULL;2359 ApicReg.pszSetBaseMsrR0 = NULL; 2360 ApicReg.pszGetBaseMsrR0 = NULL; 2361 ApicReg.pszSetTprR0 = NULL; 2362 ApicReg.pszGetTprR0 = NULL; 2363 ApicReg.pszWriteMsrR0 = NULL; 2364 ApicReg.pszReadMsrR0 = NULL; 2362 2365 ApicReg.pszBusDeliverR0 = NULL; 2363 2366 ApicReg.pszLocalInterruptR0 = NULL; … … 2373 2376 */ 2374 2377 LogRel(("APIC: Activating Local APIC\n")); 2375 pDev->pApicHlpR3->pfnChangeFeature(pDevIns, pDev->enm Version);2378 pDev->pApicHlpR3->pfnChangeFeature(pDevIns, pDev->enmMode); 2376 2379 2377 2380 /* -
trunk/src/VBox/Devices/build/VBoxDD2.cpp
r57358 r60307 59 59 int rc; 60 60 61 #ifndef VBOX_WITH_NEW_APIC 61 62 rc = pCallbacks->pfnRegister(pCallbacks, &g_DeviceAPIC); 62 63 if (RT_FAILURE(rc)) 63 64 return rc; 65 #endif 64 66 rc = pCallbacks->pfnRegister(pCallbacks, &g_DeviceIOAPIC); 65 67 if (RT_FAILURE(rc)) -
trunk/src/VBox/Devices/build/VBoxDD2.h
r56292 r60307 44 44 # endif 45 45 #endif /* !IN_VBOXDD2 */ 46 47 #ifndef VBOX_WITH_NEW_APIC 46 48 extern const PDMDEVREG g_DeviceAPIC; 49 #endif 47 50 extern const PDMDEVREG g_DeviceIOAPIC; 48 51 extern const PDMDEVREG g_DeviceLPC; -
trunk/src/VBox/Devices/testcase/Makefile.kmk
r59804 r60307 23 23 # 24 24 VBOX_PATH_DEVICES_SRC ?= $(PATH_ROOT)/src/VBox/Devices 25 VBOX_PATH_VMM_DEVICES_SRC ?= $(PATH_ROOT)/src/VBox/VMM/include 25 26 VBOX_DEVICES_TEST_OUT_DIR := $(PATH_TARGET)/Devices/testcase 26 27 BLDDIRS += $(VBOX_DEVICES_TEST_OUT_DIR) … … 34 35 $(if $(VBOX_WITH_HGSMI),VBOX_WITH_HGSMI,) \ 35 36 $(if $(VBOX_WITH_LSILOGIC),VBOX_WITH_LSILOGIC,) \ 37 $(if $(VBOX_WITH_NEW_APIC),VBOX_WITH_NEW_APIC,) \ 36 38 $(if $(VBOX_WITH_NEW_PS2M),VBOX_WITH_NEW_PS2M,) \ 37 39 $(if $(VBOX_WITH_NVME_IMPL),VBOX_WITH_NVME_IMPL,) \ … … 74 76 $(VBOX_PATH_DEVICES_SRC)/Bus \ 75 77 $(VBOX_DEVICES_TEST_OUT_DIR) 78 ifdef VBOX_WITH_NEW_APIC 79 tstDeviceStructSizeRC_INCS += $(VBOX_PATH_VMM_DEVICES_SRC) 80 endif 76 81 endif # VBOX_WITH_RAW_MODE 77 82 … … 92 97 ifdef VBOX_WITH_RAW_MODE 93 98 tstDeviceStructSize.cpp_DEPS = $(VBOX_DEVICES_TEST_OUT_DIR)/tstDeviceStructSizeRC.h 99 endif 100 ifdef VBOX_WITH_NEW_APIC 101 tstDeviceStructSize_INCS += $(VBOX_PATH_VMM_DEVICES_SRC) 94 102 endif 95 103 -
trunk/src/VBox/Devices/testcase/tstDeviceStructSize.cpp
r58112 r60307 58 58 #undef LOG_GROUP 59 59 #include "../PC/DevRTC.cpp" 60 #undef LOG_GROUP 61 #include "../PC/DevAPIC.cpp" 60 # undef LOG_GROUP 61 #ifdef VBOX_WITH_NEW_APIC 62 # include "../../VMM/VMMR3/APIC.cpp" 63 #else 64 # include "../PC/DevAPIC.cpp" 65 #endif 62 66 #undef LOG_GROUP 63 67 #include "../PC/DevIoApic.cpp" … … 281 285 CHECK_MEMBER_ALIGNMENT(AHCI, lock, 8); 282 286 CHECK_MEMBER_ALIGNMENT(AHCIPort, StatDMA, 8); 283 #ifdef VBOX_WITH_STATISTICS 287 #ifdef VBOX_WITH_NEW_APIC 288 CHECK_MEMBER_ALIGNMENT(APICDEV, pDevInsR0, 8); 289 CHECK_MEMBER_ALIGNMENT(APICDEV, pDevInsRC, 8); 290 #else 291 # ifdef VBOX_WITH_STATISTICS 284 292 CHECK_MEMBER_ALIGNMENT(APICDeviceInfo, StatMMIOReadGC, 8); 293 # endif 285 294 #endif 286 295 CHECK_MEMBER_ALIGNMENT(ATADevState, cTotalSectors, 8); -
trunk/src/VBox/Devices/testcase/tstDeviceStructSizeRC.cpp
r60026 r60307 60 60 #undef LOG_GROUP 61 61 #include "../PC/DevRTC.cpp" 62 #undef LOG_GROUP 63 #include "../PC/DevAPIC.cpp" 62 # undef LOG_GROUP 63 #ifdef VBOX_WITH_NEW_APIC 64 # include "../../VMM/VMMR3/APIC.cpp" 65 #else 66 # include "../PC/DevAPIC.cpp" 67 #endif 64 68 #undef LOG_GROUP 65 69 #include "../PC/DevIoApic.cpp" … … 740 744 GEN_CHECK_OFF(RTCSTATE, CurHintPeriod); 741 745 746 #ifdef VBOX_WITH_NEW_APIC 747 GEN_CHECK_SIZE(APIC); 748 GEN_CHECK_OFF(APIC, pApicDevR0); 749 GEN_CHECK_OFF(APIC, pApicDevR3); 750 GEN_CHECK_OFF(APIC, pApicDevRC); 751 GEN_CHECK_OFF(APIC, HCPhysApicPib); 752 GEN_CHECK_OFF(APIC, pvApicPibR0); 753 GEN_CHECK_OFF(APIC, pvApicPibR3); 754 GEN_CHECK_OFF(APIC, pvApicPibRC); 755 GEN_CHECK_OFF(APIC, cbApicPib); 756 GEN_CHECK_OFF(APIC, fVirtApicRegsEnabled); 757 GEN_CHECK_OFF(APIC, fPostedIntrsEnabled); 758 GEN_CHECK_OFF(APIC, fSupportsTscDeadline); 759 GEN_CHECK_OFF(APIC, fIoApicPresent); 760 GEN_CHECK_OFF(APIC, fRZEnabled); 761 GEN_CHECK_OFF(APIC, enmOriginalMode); 762 763 GEN_CHECK_SIZE(APICCPU); 764 GEN_CHECK_OFF(APICCPU, pvApicPageR0); 765 GEN_CHECK_OFF(APICCPU, pvApicPageR3); 766 GEN_CHECK_OFF(APICCPU, pvApicPageRC); 767 GEN_CHECK_OFF(APICCPU, cbApicPage); 768 GEN_CHECK_OFF(APICCPU, uEsrInternal); 769 GEN_CHECK_OFF(APICCPU, uApicBaseMsr); 770 GEN_CHECK_OFF(APICCPU, HCPhysApicPib); 771 GEN_CHECK_OFF(APICCPU, pvApicPibR0); 772 GEN_CHECK_OFF(APICCPU, pvApicPibR3); 773 GEN_CHECK_OFF(APICCPU, pvApicPibRC); 774 GEN_CHECK_OFF(APICCPU, ApicPibLevel); 775 GEN_CHECK_OFF(APICCPU, pTimerR0); 776 GEN_CHECK_OFF(APICCPU, pTimerR3); 777 GEN_CHECK_OFF(APICCPU, pTimerRC); 778 GEN_CHECK_OFF(APICCPU, TimerCritSect); 779 GEN_CHECK_OFF(APICCPU, u64TimerInitial); 780 GEN_CHECK_OFF(APICCPU, uHintedTimerInitialCount); 781 GEN_CHECK_OFF(APICCPU, uHintedTimerShift); 782 GEN_CHECK_OFF(APICCPU, StatMmioReadGC); 783 #else 742 784 /* PC/DevAPIC.cpp */ 743 785 GEN_CHECK_SIZE(APICState); … … 773 815 GEN_CHECK_OFF(APICState, uHintedCountShift); 774 816 GEN_CHECK_OFF(APICState, pszDesc); 775 # ifdef VBOX_WITH_STATISTICS817 # ifdef VBOX_WITH_STATISTICS 776 818 GEN_CHECK_OFF(APICState, StatTimerSetInitialCount); 777 819 GEN_CHECK_OFF(APICState, StatTimerSetLvtNoRelevantChange); 778 # endif820 # endif 779 821 780 822 GEN_CHECK_SIZE(APICDeviceInfo); … … 791 833 GEN_CHECK_OFF(APICDeviceInfo, paLapicsRC); 792 834 GEN_CHECK_OFF(APICDeviceInfo, pCritSectRC); 793 GEN_CHECK_OFF(APICDeviceInfo, enm Version);835 GEN_CHECK_OFF(APICDeviceInfo, enmMode); 794 836 GEN_CHECK_OFF(APICDeviceInfo, cTPRPatchAttempts); 795 837 GEN_CHECK_OFF(APICDeviceInfo, cCpus); 796 # ifdef VBOX_WITH_STATISTICS838 # ifdef VBOX_WITH_STATISTICS 797 839 GEN_CHECK_OFF(APICDeviceInfo, StatMMIOReadGC); 798 840 GEN_CHECK_OFF(APICDeviceInfo, StatMMIOWriteHC); 799 #endif 841 # endif 842 #endif /* VBOX_WITH_NEW_APIC */ 800 843 801 844 /* PC/DevIoApic.cpp */
Note:
See TracChangeset
for help on using the changeset viewer.