- Timestamp:
- Jul 11, 2016 3:03:44 PM (9 years ago)
- Location:
- trunk/src/VBox
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/PC/DevIOAPIC_New.cpp
r62033 r62162 177 177 #endif 178 178 179 #define IOAPIC_WITH_PDM_CRITSECT 180 #ifdef IOAPIC_WITH_PDM_CRITSECT 181 # define IOAPIC_LOCK(pThis, rcBusy) (pThis)->CTX_SUFF(pIoApicHlp)->pfnLock((pThis)->CTX_SUFF(pDevIns), (rcBusy)) 182 # define IOAPIC_UNLOCK(pThis) (pThis)->CTX_SUFF(pIoApicHlp)->pfnUnlock((pThis)->CTX_SUFF(pDevIns)) 183 #else 184 # define IOAPIC_LOCK(pThis, rcBusy) PDMCritSectEnter(&(pThis)->CritSect, (rcBusy)) 185 # define IOAPIC_UNLOCK(pThis) PDMCritSectLeave(&(pThis)->CritSect) 186 #endif 187 179 188 180 189 /********************************************************************************************************************************* … … 220 229 uint32_t uIrr; 221 230 231 #ifndef IOAPIC_WITH_PDM_CRITSECT 222 232 /** The critsect for updating to the RTEs. */ 223 233 PDMCRITSECT CritSect; 234 #endif 224 235 225 236 #ifdef VBOX_WITH_STATISTICS … … 362 373 static void ioapicSignalIntrForRte(PIOAPIC pThis, uint8_t idxRte) 363 374 { 375 #ifndef IOAPIC_WITH_PDM_CRITSECT 364 376 Assert(PDMCritSectIsOwner(&pThis->CritSect)); 377 #endif 365 378 366 379 /* Ensure the RTE isn't masked. */ … … 463 476 RT_ELEMENTS(pThis->au64RedirTable))); 464 477 465 int rc = PDMCritSectEnter(&pThis->CritSect, VINF_IOM_R3_MMIO_WRITE);478 int rc = IOAPIC_LOCK(pThis, VINF_IOM_R3_MMIO_WRITE); 466 479 if (rc == VINF_SUCCESS) 467 480 { … … 496 509 ioapicSignalIntrForRte(pThis, idxRte); 497 510 498 PDMCritSectLeave(&pThis->CritSect);511 IOAPIC_UNLOCK(pThis); 499 512 LogFlow(("IOAPIC: ioapicSetRedirTableEntry: uIndex=%#RX32 idxRte=%u uValue=%#RX32\n", uIndex, idxRte, uValue)); 500 513 } … … 579 592 580 593 bool fRemoteIrrCleared = false; 581 int rc = PDMCritSectEnter(&pThis->CritSect, VINF_IOM_R3_MMIO_WRITE);594 int rc = IOAPIC_LOCK(pThis, VINF_IOM_R3_MMIO_WRITE); 582 595 if (rc == VINF_SUCCESS) 583 596 { … … 605 618 } 606 619 607 PDMCritSectLeave(&pThis->CritSect);620 IOAPIC_UNLOCK(pThis); 608 621 AssertMsg(fRemoteIrrCleared, ("Failed to clear remote IRR for vector %#x (%u)\n", u8Vector, u8Vector)); 609 622 } … … 633 646 if (RT_LIKELY(iIrq >= 0 && iIrq < (int)RT_ELEMENTS(pThis->au64RedirTable))) 634 647 { 635 int rc = PDMCritSectEnter(&pThis->CritSect, VINF_SUCCESS);648 int rc = IOAPIC_LOCK(pThis, VINF_SUCCESS); 636 649 AssertRC(rc); 637 650 … … 651 664 { 652 665 pThis->uIrr &= ~uPinMask; 653 PDMCritSectLeave(&pThis->CritSect);666 IOAPIC_UNLOCK(pThis); 654 667 return; 655 668 } … … 704 717 } 705 718 706 PDMCritSectLeave(&pThis->CritSect);719 IOAPIC_UNLOCK(pThis); 707 720 } 708 721 #undef IOAPIC_ASSERT_IRQ … … 1078 1091 1079 1092 /* There might be devices threads calling ioapicSetIrq() in parallel, hence the lock. */ 1080 PDMCritSectEnter(&pThis->CritSect, VERR_IGNORED);1093 IOAPIC_LOCK(pThis, VERR_IGNORED); 1081 1094 1082 1095 pThis->uIrr = 0; … … 1090 1103 } 1091 1104 1092 PDMCritSectLeave(&pThis->CritSect);1105 IOAPIC_UNLOCK(pThis); 1093 1106 } 1094 1107 … … 1116 1129 PDMDEV_CHECK_VERSIONS_RETURN_QUIET(pDevIns); 1117 1130 1131 #ifndef IOAPIC_WITH_PDM_CRITSECT 1118 1132 /* 1119 1133 * Destroy the RTE critical section. … … 1121 1135 if (PDMCritSectIsInitialized(&pThis->CritSect)) 1122 1136 PDMR3CritSectDelete(&pThis->CritSect); 1137 #endif 1123 1138 1124 1139 return VINF_SUCCESS; … … 1169 1184 AssertRCReturn(rc, rc); 1170 1185 1186 #ifndef IOAPIC_WITH_PDM_CRITSECT 1171 1187 /* 1172 1188 * Setup the critical section to protect concurrent writes to the RTEs. … … 1175 1191 if (RT_FAILURE(rc)) 1176 1192 return PDMDevHlpVMSetError(pDevIns, rc, RT_SRC_POS, N_("IOAPIC: Failed to create critical section. rc=%Rrc"), rc); 1193 #endif 1177 1194 1178 1195 /* -
trunk/src/VBox/VMM/VMMR0/PDMR0Device.cpp
r61776 r62162 716 716 { 717 717 PDMDEV_ASSERT_DEVINS(pDevIns); 718 #ifdef VBOX_WITH_NEW_IOAPIC719 AssertFailed();720 #endif721 718 return pdmLockEx(pDevIns->Internal.s.pVMR0, rc); 722 719 } … … 727 724 { 728 725 PDMDEV_ASSERT_DEVINS(pDevIns); 729 #ifdef VBOX_WITH_NEW_IOAPIC730 AssertFailed();731 #endif732 726 pdmUnlock(pDevIns->Internal.s.pVMR0); 733 727 } -
trunk/src/VBox/VMM/VMMR3/PDMDevMiscHlp.cpp
r61776 r62162 482 482 PDMDEV_ASSERT_DEVINS(pDevIns); 483 483 LogFlow(("pdmR3IoApicHlp_Lock: caller='%s'/%d: rc=%Rrc\n", pDevIns->pReg->szName, pDevIns->iInstance, rc)); 484 #ifdef VBOX_WITH_NEW_IOAPIC485 AssertFailed();486 #endif487 484 return pdmLockEx(pDevIns->Internal.s.pVMR3, rc); 488 485 } … … 494 491 PDMDEV_ASSERT_DEVINS(pDevIns); 495 492 LogFlow(("pdmR3IoApicHlp_Unlock: caller='%s'/%d:\n", pDevIns->pReg->szName, pDevIns->iInstance)); 496 #ifdef VBOX_WITH_NEW_IOAPIC497 AssertFailed();498 #endif499 493 pdmUnlock(pDevIns->Internal.s.pVMR3); 500 494 } -
trunk/src/VBox/VMM/VMMRC/PDMRCDevice.cpp
r61776 r62162 671 671 { 672 672 PDMDEV_ASSERT_DEVINS(pDevIns); 673 #ifdef VBOX_WITH_NEW_IOAPIC674 AssertFailed();675 #endif676 673 return pdmLockEx(pDevIns->Internal.s.pVMRC, rc); 677 674 } … … 682 679 { 683 680 PDMDEV_ASSERT_DEVINS(pDevIns); 684 #ifdef VBOX_WITH_NEW_IOAPIC685 AssertFailed();686 #endif687 681 pdmUnlock(pDevIns->Internal.s.pVMRC); 688 682 }
Note:
See TracChangeset
for help on using the changeset viewer.