- Timestamp:
- Sep 23, 2008 11:25:46 AM (16 years ago)
- Location:
- trunk/src/VBox
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/PC/DevAPIC.cpp
r12634 r12667 309 309 DECLINLINE(APICState*) getLapic(APICDeviceInfo* dev) 310 310 { 311 uint32_t id = dev->CTX_SUFF(pApicHlp)->pfnGetCpuId(dev->CTX_SUFF(pDevIns)); 311 /* LAPIC's array is indexed by CPU id */ 312 VMCPUID id = dev->CTX_SUFF(pApicHlp)->pfnGetCpuId(dev->CTX_SUFF(pDevIns)); 312 313 return LAPIC_BASE(dev) + id; 313 314 } 314 315 315 316 DECLINLINE(void) cpuSetInterrupt(APICDeviceInfo* dev, uint32_t cpuid) 317 { 318 dev->CTX_SUFF(pApicHlp)->pfnSetInterruptFF(dev->CTX_SUFF(pDevIns)); 319 } 320 321 DECLINLINE(void) cpuClearInterrupt(APICDeviceInfo* dev, uint32_t cpuid) 322 { 323 dev->CTX_SUFF(pApicHlp)->pfnClearInterruptFF(dev->CTX_SUFF(pDevIns)); 324 } 316 DECLINLINE(VMCPUID) getCpuFromLapic(APICDeviceInfo* dev, APICState *s) 317 { 318 /* for now we assume LAPIC id == CPU id */ 319 return VMCPUID(s->id); 320 } 321 322 DECLINLINE(void) cpuSetInterrupt(APICDeviceInfo* dev, APICState *s) 323 { 324 dev->CTX_SUFF(pApicHlp)->pfnSetInterruptFF(dev->CTX_SUFF(pDevIns), 325 getCpuFromLapic(dev, s)); 326 } 327 328 DECLINLINE(void) cpuClearInterrupt(APICDeviceInfo* dev, APICState *s) 329 { 330 dev->CTX_SUFF(pApicHlp)->pfnClearInterruptFF(dev->CTX_SUFF(pDevIns), 331 getCpuFromLapic(dev, s)); 332 } 333 334 325 335 #endif /* VBOX */ 326 336 … … 393 403 /** @todo: what do we really do with SMI */ 394 404 foreach_apic(dev, deliver_bitmask, 395 cpuSetInterrupt(dev, apic ->id));405 cpuSetInterrupt(dev, apic)); 396 406 return; 397 407 … … 399 409 /** @todo: what do we really do with NMI */ 400 410 foreach_apic(dev, deliver_bitmask, 401 cpuSetInterrupt(dev, apic ->id));411 cpuSetInterrupt(dev, apic)); 402 412 return; 403 413 … … 470 480 471 481 /* Clear any pending APIC interrupt action flag. */ 472 cpuClearInterrupt(dev, s ->id);482 cpuClearInterrupt(dev, s); 473 483 dev->CTX_SUFF(pApicHlp)->pfnChangeFeature(pDevIns, false); 474 484 } … … 632 642 { 633 643 /* Clear any pending APIC interrupt action flag. */ 634 cpuClearInterrupt(dev, s ->id);644 cpuClearInterrupt(dev, s); 635 645 return false; 636 646 } … … 647 657 cpu_interrupt(s->cpu_env, CPU_INTERRUPT_HARD); 648 658 #else 649 cpuSetInterrupt(dev, s ->id);659 cpuSetInterrupt(dev, s); 650 660 return true; 651 661 #endif … … 693 703 Log(("apic_update_tpr: deactivate interrupt that was masked by the TPR update (%x)\n", val)); 694 704 STAM_COUNTER_INC(&dev->StatClearedActiveIrq); 695 cpuClearInterrupt(dev, s ->id);705 cpuClearInterrupt(dev, s); 696 706 } 697 707 } … … 1804 1814 dev->pApicHlpR3->pfnChangeFeature(dev->pDevInsR3, true); 1805 1815 /* Clear any pending APIC interrupt action flag. */ 1806 cpuClearInterrupt(dev, s ->id);1816 cpuClearInterrupt(dev, s); 1807 1817 APIC_UNLOCK(dev); 1808 1818 } -
trunk/src/VBox/VMM/PDMDevice.cpp
r12653 r12667 230 230 * @{ 231 231 */ 232 static DECLCALLBACK(void) pdmR3ApicHlp_SetInterruptFF(PPDMDEVINS pDevIns );233 static DECLCALLBACK(void) pdmR3ApicHlp_ClearInterruptFF(PPDMDEVINS pDevIns );232 static DECLCALLBACK(void) pdmR3ApicHlp_SetInterruptFF(PPDMDEVINS pDevIns, VMCPUID cpuid); 233 static DECLCALLBACK(void) pdmR3ApicHlp_ClearInterruptFF(PPDMDEVINS pDevIns, VMCPUID cpuid); 234 234 static DECLCALLBACK(void) pdmR3ApicHlp_ChangeFeature(PPDMDEVINS pDevIns, bool fEnabled); 235 235 static DECLCALLBACK(int) pdmR3ApicHlp_Lock(PPDMDEVINS pDevIns, int rc); 236 236 static DECLCALLBACK(void) pdmR3ApicHlp_Unlock(PPDMDEVINS pDevIns); 237 static DECLCALLBACK( uint32_t) pdmR3ApicHlp_GetCpuId(PPDMDEVINS pDevIns);237 static DECLCALLBACK(VMCPUID) pdmR3ApicHlp_GetCpuId(PPDMDEVINS pDevIns); 238 238 static DECLCALLBACK(PCPDMAPICHLPRC) pdmR3ApicHlp_GetRCHelpers(PPDMDEVINS pDevIns); 239 239 static DECLCALLBACK(PCPDMAPICHLPR0) pdmR3ApicHlp_GetR0Helpers(PPDMDEVINS pDevIns); … … 4073 4073 4074 4074 /** @copydoc PDMAPICHLPR3::pfnSetInterruptFF */ 4075 static DECLCALLBACK(void) pdmR3ApicHlp_SetInterruptFF(PPDMDEVINS pDevIns )4075 static DECLCALLBACK(void) pdmR3ApicHlp_SetInterruptFF(PPDMDEVINS pDevIns, VMCPUID cpuid) 4076 4076 { 4077 4077 PDMDEV_ASSERT_DEVINS(pDevIns); … … 4086 4086 4087 4087 /** @copydoc PDMAPICHLPR3::pfnClearInterruptFF */ 4088 static DECLCALLBACK(void) pdmR3ApicHlp_ClearInterruptFF(PPDMDEVINS pDevIns )4088 static DECLCALLBACK(void) pdmR3ApicHlp_ClearInterruptFF(PPDMDEVINS pDevIns, VMCPUID cpuid) 4089 4089 { 4090 4090 PDMDEV_ASSERT_DEVINS(pDevIns); … … 4100 4100 { 4101 4101 PDMDEV_ASSERT_DEVINS(pDevIns); 4102 LogFlow(("pdmR3ApicHlp_C learInterruptFF: caller='%s'/%d: fEnabled=%RTbool\n",4102 LogFlow(("pdmR3ApicHlp_ChangeFeature: caller='%s'/%d: fEnabled=%RTbool\n", 4103 4103 pDevIns->pDevReg->szDeviceName, pDevIns->iInstance, fEnabled)); 4104 4104 if (fEnabled) … … 4125 4125 4126 4126 /** @copydoc PDMAPICHLPR3::pfnGetCpuId */ 4127 static DECLCALLBACK( uint32_t) pdmR3ApicHlp_GetCpuId(PPDMDEVINS pDevIns)4127 static DECLCALLBACK(VMCPUID) pdmR3ApicHlp_GetCpuId(PPDMDEVINS pDevIns) 4128 4128 { 4129 4129 PDMDEV_ASSERT_DEVINS(pDevIns); -
trunk/src/VBox/VMM/VMMAll/VMMAll.cpp
r12573 r12667 67 67 * @thread EMT 68 68 */ 69 uint32_tVMMGetCpuId(PVM pVM)69 VMCPUID VMMGetCpuId(PVM pVM) 70 70 { 71 #ifdef VBOX_WITH_GUEST_SMPT 71 #ifdef VBOX_WITH_SMP_GUESTS 72 /* Only emulation thread(s) allowed to ask for CPU id */ 73 VM_ASSERT_EMT(pVM); 74 72 75 # if defined(IN_GC) 73 76 /* There is only one CPU if we're in GC. */ -
trunk/src/VBox/VMM/VMMGC/PDMGCDevice.cpp
r12653 r12667 99 99 * @{ 100 100 */ 101 static DECLCALLBACK(void) pdmRCApicHlp_SetInterruptFF(PPDMDEVINS pDevIns );102 static DECLCALLBACK(void) pdmRCApicHlp_ClearInterruptFF(PPDMDEVINS pDevIns );101 static DECLCALLBACK(void) pdmRCApicHlp_SetInterruptFF(PPDMDEVINS pDevIns, VMCPUID cpuid); 102 static DECLCALLBACK(void) pdmRCApicHlp_ClearInterruptFF(PPDMDEVINS pDevIns, VMCPUID cpuid); 103 103 static DECLCALLBACK(void) pdmRCApicHlp_ChangeFeature(PPDMDEVINS pDevIns, bool fEnabled); 104 104 static DECLCALLBACK(int) pdmRCApicHlp_Lock(PPDMDEVINS pDevIns, int rc); 105 105 static DECLCALLBACK(void) pdmRCApicHlp_Unlock(PPDMDEVINS pDevIns); 106 static DECLCALLBACK( uint32_t) pdmRCApicHlp_GetCpuId(PPDMDEVINS pDevIns);106 static DECLCALLBACK(VMCPUID) pdmRCApicHlp_GetCpuId(PPDMDEVINS pDevIns); 107 107 /** @} */ 108 108 … … 393 393 394 394 /** @copydoc PDMAPICHLPRC::pfnSetInterruptFF */ 395 static DECLCALLBACK(void) pdmRCApicHlp_SetInterruptFF(PPDMDEVINS pDevIns )395 static DECLCALLBACK(void) pdmRCApicHlp_SetInterruptFF(PPDMDEVINS pDevIns, VMCPUID cpuid) 396 396 { 397 397 PDMDEV_ASSERT_DEVINS(pDevIns); … … 403 403 404 404 /** @copydoc PDMAPICHLPRC::pfnClearInterruptFF */ 405 static DECLCALLBACK(void) pdmRCApicHlp_ClearInterruptFF(PPDMDEVINS pDevIns )405 static DECLCALLBACK(void) pdmRCApicHlp_ClearInterruptFF(PPDMDEVINS pDevIns, VMCPUID cpuid) 406 406 { 407 407 PDMDEV_ASSERT_DEVINS(pDevIns); … … 441 441 442 442 /** @copydoc PDMAPICHLPRC::pfnGetCpuId */ 443 static DECLCALLBACK( uint32_t) pdmRCApicHlp_GetCpuId(PPDMDEVINS pDevIns)443 static DECLCALLBACK(VMCPUID) pdmRCApicHlp_GetCpuId(PPDMDEVINS pDevIns) 444 444 { 445 445 PDMDEV_ASSERT_DEVINS(pDevIns); 446 446 return VMMGetCpuId(pDevIns->Internal.s.pVMGC); 447 447 } 448 449 450 451 448 452 449 /** @copydoc PDMIOAPICHLPRC::pfnApicBusDeliver */ -
trunk/src/VBox/VMM/VMMR0/PDMR0Device.cpp
r12653 r12667 99 99 * @{ 100 100 */ 101 static DECLCALLBACK(void) pdmR0ApicHlp_SetInterruptFF(PPDMDEVINS pDevIns );102 static DECLCALLBACK(void) pdmR0ApicHlp_ClearInterruptFF(PPDMDEVINS pDevIns );101 static DECLCALLBACK(void) pdmR0ApicHlp_SetInterruptFF(PPDMDEVINS pDevIns, VMCPUID cpuid); 102 static DECLCALLBACK(void) pdmR0ApicHlp_ClearInterruptFF(PPDMDEVINS pDevIns, VMCPUID cpuid); 103 103 static DECLCALLBACK(void) pdmR0ApicHlp_ChangeFeature(PPDMDEVINS pDevIns, bool fEnabled); 104 104 static DECLCALLBACK(int) pdmR0ApicHlp_Lock(PPDMDEVINS pDevIns, int rc); 105 105 static DECLCALLBACK(void) pdmR0ApicHlp_Unlock(PPDMDEVINS pDevIns); 106 static DECLCALLBACK( uint32_t) pdmR0ApicHlp_GetCpuId(PPDMDEVINS pDevIns);106 static DECLCALLBACK(VMCPUID) pdmR0ApicHlp_GetCpuId(PPDMDEVINS pDevIns); 107 107 /** @} */ 108 108 … … 397 397 398 398 /** @copydoc PDMAPICHLPR0::pfnSetInterruptFF */ 399 static DECLCALLBACK(void) pdmR0ApicHlp_SetInterruptFF(PPDMDEVINS pDevIns )399 static DECLCALLBACK(void) pdmR0ApicHlp_SetInterruptFF(PPDMDEVINS pDevIns, VMCPUID cpuid) 400 400 { 401 401 PDMDEV_ASSERT_DEVINS(pDevIns); … … 407 407 408 408 /** @copydoc PDMAPICHLPR0::pfnClearInterruptFF */ 409 static DECLCALLBACK(void) pdmR0ApicHlp_ClearInterruptFF(PPDMDEVINS pDevIns )409 static DECLCALLBACK(void) pdmR0ApicHlp_ClearInterruptFF(PPDMDEVINS pDevIns, VMCPUID cpuid) 410 410 { 411 411 PDMDEV_ASSERT_DEVINS(pDevIns); … … 445 445 446 446 /** @copydoc PDMAPICHLPR0::pfnGetCpuId */ 447 static DECLCALLBACK( uint32_t) pdmR0ApicHlp_GetCpuId(PPDMDEVINS pDevIns)447 static DECLCALLBACK(VMCPUID) pdmR0ApicHlp_GetCpuId(PPDMDEVINS pDevIns) 448 448 { 449 449 PDMDEV_ASSERT_DEVINS(pDevIns); 450 450 return VMMGetCpuId(pDevIns->Internal.s.pVMHC); 451 451 } 452 453 454 452 455 453
Note:
See TracChangeset
for help on using the changeset viewer.