Changeset 26376 in vbox for trunk/src/VBox/Devices/PC
- Timestamp:
- Feb 9, 2010 2:25:28 PM (15 years ago)
- svn:sync-xref-src-repo-rev:
- 57469
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/PC/DevHPET.cpp
r26329 r26376 177 177 /* main counter */ 178 178 uint64_t u64HpetCounter; 179 180 /* Global device lock */ 181 PDMCRITSECT csLock; 179 182 } HpetState; 180 183 … … 199 202 static const bool fHpetLocking = true; 200 203 201 DECLINLINE(int) hpetLock(HpetState* pThis )204 DECLINLINE(int) hpetLock(HpetState* pThis, int rcBusy) 202 205 { 203 206 if (!fHpetLocking) 204 return 0; 205 206 return pThis->CTX_SUFF(pHpetHlp)->pfnLock(pThis->CTX_SUFF(pDevIns), 207 VERR_INTERNAL_ERROR); 207 return VINF_SUCCESS; 208 209 return PDMCritSectEnter(&pThis->csLock, rcBusy); 208 210 } 209 211 … … 213 215 return; 214 216 215 pThis->CTX_SUFF(pHpetHlp)->pfnUnlock(pThis->CTX_SUFF(pDevIns));217 PDMCritSectLeave(&pThis->csLock); 216 218 } 217 219 … … 706 708 LogFlow(("hpetMMIORead: %llx (%x)\n", (uint64_t)GCPhysAddr, iIndex)); 707 709 708 rc = hpetLock(pThis); 709 AssertLogRelRCReturn(rc, rc); 710 rc = hpetLock(pThis, VINF_IOM_HC_MMIO_READ); 711 if (RT_UNLIKELY(rc != VINF_SUCCESS)) 712 return rc; 710 713 711 714 switch (cb) … … 748 751 (uint64_t)GCPhysAddr, iIndex, *(uint32_t*)pv)); 749 752 750 rc = hpetLock(pThis); 751 AssertLogRelRCReturn(rc, rc); 753 rc = hpetLock(pThis, VINF_IOM_HC_MMIO_WRITE); 754 if (RT_UNLIKELY(rc != VINF_SUCCESS)) 755 return rc; 752 756 753 757 switch (cb) … … 921 925 return; 922 926 923 rc = hpetLock(pThis); 927 /* Lock in R3 must either block or succeed */ 928 rc = hpetLock(pThis, VERR_IGNORED); 929 924 930 AssertLogRelRCReturnVoid(rc); 925 931 … … 1122 1128 return rc; 1123 1129 } 1130 1131 /* 1132 * Initialize critical section. 1133 */ 1134 rc = PDMDevHlpCritSectInit(pDevIns, &pThis->csLock, RT_SRC_POS, "HPET"); 1135 if (RT_FAILURE(rc)) 1136 return PDMDEV_SET_ERROR(pDevIns, rc, N_("HPET cannot initialize critical section")); 1137 1124 1138 /* 1125 1139 * Register the MMIO range, PDM API requests page aligned
Note:
See TracChangeset
for help on using the changeset viewer.