Changeset 62162 in vbox for trunk/src/VBox/Devices/PC
- Timestamp:
- Jul 11, 2016 3:03:44 PM (9 years ago)
- svn:sync-xref-src-repo-rev:
- 108668
- File:
-
- 1 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 /*
Note:
See TracChangeset
for help on using the changeset viewer.