Changeset 12667 in vbox for trunk/src/VBox/Devices
- Timestamp:
- Sep 23, 2008 11:25:46 AM (17 years ago)
- svn:sync-xref-src-repo-rev:
- 36960
- File:
-
- 1 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 }
Note:
See TracChangeset
for help on using the changeset viewer.