Changeset 82329 in vbox
- Timestamp:
- Dec 2, 2019 6:16:13 PM (5 years ago)
- svn:sync-xref-src-repo-rev:
- 135153
- Location:
- trunk
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/VBox/vmm/pdmdev.h
r82316 r82329 1964 1964 1965 1965 /** Current PDMDEVHLPR3 version number. */ 1966 #define PDM_DEVHLPR3_VERSION PDM_VERSION_MAKE_PP(0xffe7, 4 0, 0)1966 #define PDM_DEVHLPR3_VERSION PDM_VERSION_MAKE_PP(0xffe7, 41, 0) 1967 1967 1968 1968 /** … … 2467 2467 DECLR3CALLBACKMEMBER(bool, pfnTimerIsActive,(PPDMDEVINS pDevIns, TMTIMERHANDLE hTimer)); 2468 2468 DECLR3CALLBACKMEMBER(bool, pfnTimerIsLockOwner,(PPDMDEVINS pDevIns, TMTIMERHANDLE hTimer)); 2469 DECLR3CALLBACKMEMBER(int, pfnTimerLock,(PPDMDEVINS pDevIns, TMTIMERHANDLE hTimer, int rcBusy)); 2469 DECLR3CALLBACKMEMBER(VBOXSTRICTRC, pfnTimerLockClock,(PPDMDEVINS pDevIns, TMTIMERHANDLE hTimer, int rcBusy)); 2470 /** Takes the clock lock then enters the specified critical section. */ 2471 DECLR3CALLBACKMEMBER(VBOXSTRICTRC, pfnTimerLockClock2,(PPDMDEVINS pDevIns, TMTIMERHANDLE hTimer, PPDMCRITSECT pCritSect, int rcBusy)); 2470 2472 DECLR3CALLBACKMEMBER(int, pfnTimerSet,(PPDMDEVINS pDevIns, TMTIMERHANDLE hTimer, uint64_t uExpire)); 2471 2473 DECLR3CALLBACKMEMBER(int, pfnTimerSetFrequencyHint,(PPDMDEVINS pDevIns, TMTIMERHANDLE hTimer, uint32_t uHz)); … … 2475 2477 DECLR3CALLBACKMEMBER(int, pfnTimerSetRelative,(PPDMDEVINS pDevIns, TMTIMERHANDLE hTimer, uint64_t cTicksToNext, uint64_t *pu64Now)); 2476 2478 DECLR3CALLBACKMEMBER(int, pfnTimerStop,(PPDMDEVINS pDevIns, TMTIMERHANDLE hTimer)); 2477 DECLR3CALLBACKMEMBER(void, pfnTimerUnlock,(PPDMDEVINS pDevIns, TMTIMERHANDLE hTimer)); 2479 DECLR3CALLBACKMEMBER(void, pfnTimerUnlockClock,(PPDMDEVINS pDevIns, TMTIMERHANDLE hTimer)); 2480 DECLR3CALLBACKMEMBER(void, pfnTimerUnlockClock2,(PPDMDEVINS pDevIns, TMTIMERHANDLE hTimer, PPDMCRITSECT pCritSect)); 2478 2481 DECLR3CALLBACKMEMBER(int, pfnTimerSetCritSect,(PPDMDEVINS pDevIns, TMTIMERHANDLE hTimer, PPDMCRITSECT pCritSect)); 2479 2482 DECLR3CALLBACKMEMBER(int, pfnTimerSave,(PPDMDEVINS pDevIns, TMTIMERHANDLE hTimer, PSSMHANDLE pSSM)); … … 4709 4712 DECLR0CALLBACKMEMBER(bool, pfnTimerIsActive,(PPDMDEVINS pDevIns, TMTIMERHANDLE hTimer)); 4710 4713 DECLR0CALLBACKMEMBER(bool, pfnTimerIsLockOwner,(PPDMDEVINS pDevIns, TMTIMERHANDLE hTimer)); 4711 DECLR0CALLBACKMEMBER(int, pfnTimerLock,(PPDMDEVINS pDevIns, TMTIMERHANDLE hTimer, int rcBusy)); 4714 DECLR0CALLBACKMEMBER(VBOXSTRICTRC, pfnTimerLockClock,(PPDMDEVINS pDevIns, TMTIMERHANDLE hTimer, int rcBusy)); 4715 /** Takes the clock lock then enters the specified critical section. */ 4716 DECLR0CALLBACKMEMBER(VBOXSTRICTRC, pfnTimerLockClock2,(PPDMDEVINS pDevIns, TMTIMERHANDLE hTimer, PPDMCRITSECT pCritSect, int rcBusy)); 4712 4717 DECLR0CALLBACKMEMBER(int, pfnTimerSet,(PPDMDEVINS pDevIns, TMTIMERHANDLE hTimer, uint64_t uExpire)); 4713 4718 DECLR0CALLBACKMEMBER(int, pfnTimerSetFrequencyHint,(PPDMDEVINS pDevIns, TMTIMERHANDLE hTimer, uint32_t uHz)); … … 4717 4722 DECLR0CALLBACKMEMBER(int, pfnTimerSetRelative,(PPDMDEVINS pDevIns, TMTIMERHANDLE hTimer, uint64_t cTicksToNext, uint64_t *pu64Now)); 4718 4723 DECLR0CALLBACKMEMBER(int, pfnTimerStop,(PPDMDEVINS pDevIns, TMTIMERHANDLE hTimer)); 4719 DECLR0CALLBACKMEMBER(void, pfnTimerUnlock,(PPDMDEVINS pDevIns, TMTIMERHANDLE hTimer)); 4724 DECLR0CALLBACKMEMBER(void, pfnTimerUnlockClock,(PPDMDEVINS pDevIns, TMTIMERHANDLE hTimer)); 4725 DECLR0CALLBACKMEMBER(void, pfnTimerUnlockClock2,(PPDMDEVINS pDevIns, TMTIMERHANDLE hTimer, PPDMCRITSECT pCritSect)); 4720 4726 /** @} */ 4721 4727 … … 4937 4943 4938 4944 /** Current PDMDEVHLP version number. */ 4939 #define PDM_DEVHLPR0_VERSION PDM_VERSION_MAKE(0xffe5, 1 5, 0)4945 #define PDM_DEVHLPR0_VERSION PDM_VERSION_MAKE(0xffe5, 16, 0) 4940 4946 4941 4947 … … 5862 5868 * @copydoc PDMDEVHLPR3::pfnTimerLock 5863 5869 */ 5864 DECLINLINE(int) PDMDevHlpTimerLock(PPDMDEVINS pDevIns, TMTIMERHANDLE hTimer, int rcBusy) 5865 { 5866 return pDevIns->CTX_SUFF(pHlp)->pfnTimerLock(pDevIns, hTimer, rcBusy); 5870 DECLINLINE(VBOXSTRICTRC) PDMDevHlpTimerLockClock(PPDMDEVINS pDevIns, TMTIMERHANDLE hTimer, int rcBusy) 5871 { 5872 return pDevIns->CTX_SUFF(pHlp)->pfnTimerLockClock(pDevIns, hTimer, rcBusy); 5873 } 5874 5875 /** 5876 * @copydoc PDMDEVHLPR3::pfnTimerLock2 5877 */ 5878 DECLINLINE(VBOXSTRICTRC) PDMDevHlpTimerLockClock2(PPDMDEVINS pDevIns, TMTIMERHANDLE hTimer, PPDMCRITSECT pCritSect, int rcBusy) 5879 { 5880 return pDevIns->CTX_SUFF(pHlp)->pfnTimerLockClock2(pDevIns, hTimer, pCritSect, rcBusy); 5867 5881 } 5868 5882 … … 5924 5938 5925 5939 /** 5926 * @copydoc PDMDEVHLPR3::pfnTimerUnlock 5927 */ 5928 DECLINLINE(void) PDMDevHlpTimerUnlock(PPDMDEVINS pDevIns, TMTIMERHANDLE hTimer) 5929 { 5930 pDevIns->CTX_SUFF(pHlp)->pfnTimerUnlock(pDevIns, hTimer); 5940 * @copydoc PDMDEVHLPR3::pfnTimerUnlockClock 5941 */ 5942 DECLINLINE(void) PDMDevHlpTimerUnlockClock(PPDMDEVINS pDevIns, TMTIMERHANDLE hTimer) 5943 { 5944 pDevIns->CTX_SUFF(pHlp)->pfnTimerUnlockClock(pDevIns, hTimer); 5945 } 5946 5947 /** 5948 * @copydoc PDMDEVHLPR3::pfnTimerUnlockClock2 5949 */ 5950 DECLINLINE(void) PDMDevHlpTimerUnlockClock2(PPDMDEVINS pDevIns, TMTIMERHANDLE hTimer, PPDMCRITSECT pCritSect) 5951 { 5952 pDevIns->CTX_SUFF(pHlp)->pfnTimerUnlockClock2(pDevIns, hTimer, pCritSect); 5931 5953 } 5932 5954 -
trunk/src/VBox/Devices/Audio/DevIchAc97.cpp
r82328 r82329 578 578 #define DEVAC97_LOCK_BOTH_RETURN(a_pDevIns, a_pThis, a_SD, a_rcBusy) \ 579 579 do { \ 580 int rcLock = PDMDevHlpTimerLock((a_pDevIns), RT_SAFE_SUBSCRIPT8((a_pThis)->ahTimers, (a_SD)), (a_rcBusy)); \ 581 if (rcLock == VINF_SUCCESS) \ 580 VBOXSTRICTRC rcLock = PDMDevHlpTimerLockClock2((a_pDevIns), RT_SAFE_SUBSCRIPT8((a_pThis)->ahTimers, (a_SD)), \ 581 &(a_pThis)->CritSect, (a_rcBusy)); \ 582 if (RT_LIKELY(rcLock == VINF_SUCCESS)) \ 583 { /* likely */ } \ 584 else \ 582 585 { \ 583 rcLock = PDMDevHlpCritSectEnter((a_pDevIns), &(a_pThis)->CritSect, (a_rcBusy)); \ 584 if (rcLock == VINF_SUCCESS) \ 585 break; \ 586 PDMDevHlpTimerUnlock((a_pDevIns), RT_SAFE_SUBSCRIPT8((a_pThis)->ahTimers, (a_SD))); \ 586 AssertRC(VBOXSTRICTRC_VAL(rcLock)); \ 587 return rcLock; \ 587 588 } \ 588 AssertRC(rcLock); \589 return rcLock; \590 589 } while (0) 591 590 … … 594 593 */ 595 594 #define DEVAC97_UNLOCK_BOTH(a_pDevIns, a_pThis, a_SD) \ 596 do { \ 597 PDMDevHlpCritSectLeave((a_pDevIns), &(a_pThis)->CritSect); \ 598 PDMDevHlpTimerUnlock((a_pDevIns), RT_SAFE_SUBSCRIPT8((a_pThis)->ahTimers, (a_SD))); \ 599 } while (0) 595 PDMDevHlpTimerUnlockClock2((a_pDevIns), RT_SAFE_SUBSCRIPT8((a_pThis)->ahTimers, (a_SD)), &(a_pThis)->CritSect) 600 596 601 597 #ifdef VBOX_WITH_STATISTICS -
trunk/src/VBox/Devices/PC/DevACPI.cpp
r82068 r82329 1801 1801 */ 1802 1802 PACPISTATE pThis = PDMDEVINS_2_DATA(pDevIns, PACPISTATE); 1803 VBOXSTRICTRC rc = PDMDevHlpTimerLock (pDevIns, pThis->hPmTimer, VINF_IOM_R3_IOPORT_READ);1803 VBOXSTRICTRC rc = PDMDevHlpTimerLockClock2(pDevIns, pThis->hPmTimer, &pThis->CritSect, VINF_IOM_R3_IOPORT_READ); 1804 1804 if (rc == VINF_SUCCESS) 1805 1805 { 1806 rc = PDMDevHlpCritSectEnter(pDevIns, &pThis->CritSect, VINF_IOM_R3_IOPORT_READ); 1807 if (rc == VINF_SUCCESS) 1806 uint64_t u64Now = PDMDevHlpTimerGet(pDevIns, pThis->hPmTimer); 1807 acpiPmTimerUpdate(pDevIns, pThis, u64Now); 1808 *pu32 = pThis->uPmTimerVal; 1809 1810 PDMDevHlpTimerUnlockClock2(pDevIns, pThis->hPmTimer, &pThis->CritSect); 1811 1812 DBGFTRACE_PDM_U64_TAG(pDevIns, u64Now, "acpi"); 1813 Log(("acpi: acpiPMTmrRead -> %#x\n", *pu32)); 1814 1815 #if 0 1816 /** @todo temporary: sanity check against running backwards */ 1817 uint32_t uOld = ASMAtomicXchgU32(&pThis->uPmTimeOld, *pu32); 1818 if (*pu32 - uOld >= 0x10000000) 1808 1819 { 1809 uint64_t u64Now = PDMDevHlpTimerGet(pDevIns, pThis->hPmTimer);1810 acpiPmTimerUpdate(pDevIns, pThis, u64Now);1811 *pu32 = pThis->uPmTimerVal;1812 1813 DEVACPI_UNLOCK(pDevIns, pThis);1814 PDMDevHlpTimerUnlock(pDevIns, pThis->hPmTimer);1815 1816 DBGFTRACE_PDM_U64_TAG(pDevIns, u64Now, "acpi");1817 Log(("acpi: acpiPMTmrRead -> %#x\n", *pu32));1818 1819 #if 01820 /** @todo temporary: sanity check against running backwards */1821 uint32_t uOld = ASMAtomicXchgU32(&pThis->uPmTimeOld, *pu32);1822 if (*pu32 - uOld >= 0x10000000)1823 {1824 1820 # if defined(IN_RING0) 1825 1826 1827 1821 pThis->uPmTimeA = uOld; 1822 pThis->uPmTimeB = *pu32; 1823 return VERR_TM_TIMER_BAD_CLOCK; 1828 1824 # elif defined(IN_RING3) 1829 1825 AssertReleaseMsgFailed(("acpiPMTmrRead: old=%08RX32, current=%08RX32\n", uOld, *pu32)); 1830 1826 # endif 1831 1827 } 1832 1828 #endif 1833 }1834 else1835 PDMDevHlpTimerUnlock(pDevIns, pThis->hPmTimer);1836 1829 } 1837 1830 return rc; … … 2607 2600 AssertRCReturn(rc, rc); 2608 2601 2609 PDMDevHlpTimerLock (pDevIns, pThis->hPmTimer, VERR_IGNORED);2602 PDMDevHlpTimerLockClock(pDevIns, pThis->hPmTimer, VERR_IGNORED); 2610 2603 DEVACPI_LOCK_R3(pDevIns, pThis); 2611 2604 uint64_t u64Now = PDMDevHlpTimerGet(pDevIns, pThis->hPmTimer); … … 2614 2607 acpiR3PmTimerReset(pDevIns, pThis, u64Now); 2615 2608 DEVACPI_UNLOCK(pDevIns, pThis); 2616 PDMDevHlpTimerUnlock (pDevIns, pThis->hPmTimer);2609 PDMDevHlpTimerUnlockClock(pDevIns, pThis->hPmTimer); 2617 2610 } 2618 2611 return rc; … … 3585 3578 acpiSetIrq(pDevIns, 0); 3586 3579 3587 PDMDevHlpTimerLock (pDevIns, pThis->hPmTimer, VERR_IGNORED);3580 PDMDevHlpTimerLockClock(pDevIns, pThis->hPmTimer, VERR_IGNORED); 3588 3581 pThis->pm1a_en = 0; 3589 3582 pThis->pm1a_sts = 0; … … 3598 3591 pThis->gpe0_sts = 0; 3599 3592 pThis->uSleepState = 0; 3600 PDMDevHlpTimerUnlock (pDevIns, pThis->hPmTimer);3593 PDMDevHlpTimerUnlockClock(pDevIns, pThis->hPmTimer); 3601 3594 3602 3595 /* Real device behavior is resetting only the PM controller state, … … 4093 4086 AssertRCReturn(rc, rc); 4094 4087 4095 rc = PDMDevHlpTimerLock(pDevIns, pThis->hPmTimer, VERR_IGNORED); 4096 AssertRCReturn(rc, rc); 4088 PDMDevHlpTimerLockClock(pDevIns, pThis->hPmTimer, VERR_IGNORED); 4097 4089 pThis->u64PmTimerInitial = PDMDevHlpTimerGet(pDevIns, pThis->hPmTimer); 4098 4090 acpiR3PmTimerReset(pDevIns, pThis, pThis->u64PmTimerInitial); 4099 PDMDevHlpTimerUnlock (pDevIns, pThis->hPmTimer);4091 PDMDevHlpTimerUnlockClock(pDevIns, pThis->hPmTimer); 4100 4092 4101 4093 /* -
trunk/src/VBox/Devices/PC/DevHPET.cpp
r81966 r82329 175 175 #define DEVHPET_LOCK_BOTH_RETURN(a_pDevIns, a_pThis, a_rcBusy) \ 176 176 do { \ 177 int rcLock = PDMDevHlpTimerLock((a_pDevIns), (a_pThis)->aTimers[0].hTimer, (a_rcBusy)); \177 VBOXSTRICTRC rcLock = PDMDevHlpTimerLockClock2((a_pDevIns), (a_pThis)->aTimers[0].hTimer, &(a_pThis)->CritSect, (a_rcBusy)); \ 178 178 if (RT_LIKELY(rcLock == VINF_SUCCESS)) \ 179 { \ 180 rcLock = PDMDevHlpCritSectEnter((a_pDevIns), &(a_pThis)->CritSect, (a_rcBusy)); \ 181 if (RT_LIKELY(rcLock == VINF_SUCCESS)) \ 182 break; /* likely */ \ 183 PDMDevHlpTimerUnlock((a_pDevIns), (a_pThis)->aTimers[0].hTimer); \ 184 } \ 185 return rcLock; \ 179 { /* likely */ } \ 180 else \ 181 return rcLock; \ 186 182 } while (0) 187 183 … … 191 187 */ 192 188 #define DEVHPET_UNLOCK_BOTH(a_pDevIns, a_pThis) \ 193 do { \ 194 PDMDevHlpCritSectLeave((a_pDevIns), &(a_pThis)->CritSect); \ 195 PDMDevHlpTimerUnlock((a_pDevIns), (a_pThis)->aTimers[0].hTimer); \ 196 } while (0) 189 PDMDevHlpTimerUnlockClock2((a_pDevIns), (a_pThis)->aTimers[0].hTimer, &(a_pThis)->CritSect) 197 190 198 191 … … 685 678 * @remarks The caller must not own the device lock if HPET_COUNTER is read. 686 679 */ 687 static inthpetConfigRegRead32(PPDMDEVINS pDevIns, PHPET pThis, uint32_t idxReg, uint32_t *pu32Value)680 static VBOXSTRICTRC hpetConfigRegRead32(PPDMDEVINS pDevIns, PHPET pThis, uint32_t idxReg, uint32_t *pu32Value) 688 681 { 689 682 Assert(!PDMDevHlpCritSectIsOwner(pDevIns, &pThis->CritSect) || (idxReg != HPET_COUNTER && idxReg != HPET_COUNTER + 4)); … … 1342 1335 * The timers first. 1343 1336 */ 1344 PDMDevHlpTimerLock (pDevIns, pThis->aTimers[0].hTimer, VERR_IGNORED);1337 PDMDevHlpTimerLockClock(pDevIns, pThis->aTimers[0].hTimer, VERR_IGNORED); 1345 1338 for (unsigned i = 0; i < RT_ELEMENTS(pThis->aTimers); i++) 1346 1339 { … … 1364 1357 pHpetTimer->u64Cmp = hpetInvalidValue(pHpetTimer); 1365 1358 } 1366 PDMDevHlpTimerUnlock (pDevIns, pThis->aTimers[0].hTimer);1359 PDMDevHlpTimerUnlockClock(pDevIns, pThis->aTimers[0].hTimer); 1367 1360 1368 1361 /* -
trunk/src/VBox/Devices/PC/DevPit-i8254.cpp
r81945 r82329 124 124 #define DEVPIT_LOCK_BOTH_RETURN(a_pDevIns, a_pThis, a_rcBusy) \ 125 125 do { \ 126 int rcLock = PDMDevHlpTimerLock((a_pDevIns), (a_pThis)->channels[0].hTimer, (a_rcBusy)); \ 127 if (rcLock != VINF_SUCCESS) \ 126 VBOXSTRICTRC rcLock = PDMDevHlpTimerLockClock2((a_pDevIns), (a_pThis)->channels[0].hTimer, \ 127 &(a_pThis)->CritSect, (a_rcBusy)); \ 128 if (RT_LIKELY(rcLock == VINF_SUCCESS)) \ 129 { /* likely */ } \ 130 else \ 128 131 return rcLock; \ 129 rcLock = PDMDevHlpCritSectEnter((a_pDevIns), &(a_pThis)->CritSect, (a_rcBusy)); \130 if (rcLock != VINF_SUCCESS) \131 { \132 PDMDevHlpTimerUnlock((a_pDevIns), (a_pThis)->channels[0].hTimer); \133 return rcLock; \134 } \135 132 } while (0) 136 133 … … 139 136 * Acquires the TM lock and PIT lock, ignores failures. 140 137 */ 141 # define DEVPIT_R3_LOCK_BOTH(a_pDevIns, a_pThis) \ 142 do { \ 143 PDMDevHlpTimerLock((a_pDevIns), (a_pThis)->channels[0].hTimer, VERR_IGNORED); \ 144 PDMDevHlpCritSectEnter((a_pDevIns), &(a_pThis)->CritSect, VERR_IGNORED); \ 145 } while (0) 138 # define DEVPIT_R3_LOCK_BOTH(a_pDevIns, a_pThis) \ 139 PDMDevHlpTimerLockClock2((a_pDevIns), (a_pThis)->channels[0].hTimer, &(a_pThis)->CritSect, VERR_IGNORED) 146 140 #endif /* IN_RING3 */ 147 141 … … 150 144 */ 151 145 #define DEVPIT_UNLOCK_BOTH(a_pDevIns, a_pThis) \ 152 do { \ 153 PDMDevHlpCritSectLeave((a_pDevIns), &(a_pThis)->CritSect); \ 154 PDMDevHlpTimerUnlock((a_pDevIns), (a_pThis)->channels[0].hTimer); \ 155 } while (0) 146 PDMDevHlpTimerUnlockClock2((a_pDevIns), (a_pThis)->channels[0].hTimer, &(a_pThis)->CritSect) 156 147 157 148 -
trunk/src/VBox/Devices/PC/DevRTC.cpp
r81896 r82329 450 450 holding the device lock.*/ 451 451 PDMDevHlpCritSectLeave(pDevIns, pDevIns->CTX_SUFF(pCritSectRo)); 452 int rc1 = PDMDevHlpTimerLock(pDevIns, pThis->hPeriodicTimer, VINF_SUCCESS /* must get it */); 453 int rc2 = PDMDevHlpCritSectEnter(pDevIns, pDevIns->CTX_SUFF(pCritSectRo), VINF_SUCCESS /* must get it */); 454 AssertRCReturn(rc1, rc1); 455 AssertRCReturnStmt(rc2, PDMDevHlpTimerUnlock(pDevIns, pThis->hPeriodicTimer), rc2); 452 VBOXSTRICTRC rc1 = PDMDevHlpTimerLockClock2(pDevIns, pThis->hPeriodicTimer, pDevIns->CTX_SUFF(pCritSectRo), 453 VINF_SUCCESS /* must get it */); 454 AssertRCReturn(VBOXSTRICTRC_VAL(rc1), rc1); 456 455 457 456 if (idx == RTC_REG_A) … … 482 481 rtc_timer_update(pDevIns, pThis, PDMDevHlpTimerGet(pDevIns, pThis->hPeriodicTimer)); 483 482 484 PDMDevHlpTimerUnlock (pDevIns, pThis->hPeriodicTimer);483 PDMDevHlpTimerUnlockClock(pDevIns, pThis->hPeriodicTimer); 485 484 /* the caller leaves the other lock. */ 486 485 break; … … 1175 1174 pThis->next_second_time = PDMDevHlpTimerGet(pDevIns, pThis->hSecondTimer2) 1176 1175 + (PDMDevHlpTimerGetFreq(pDevIns, pThis->hSecondTimer2) * 99) / 100; 1177 rc = PDMDevHlpTimerLock(pDevIns, pThis->hSecondTimer2, VERR_IGNORED); 1178 AssertRCReturn(rc, rc); 1176 PDMDevHlpTimerLockClock(pDevIns, pThis->hSecondTimer2, VERR_IGNORED); 1179 1177 rc = PDMDevHlpTimerSet(pDevIns, pThis->hSecondTimer2, pThis->next_second_time); 1180 PDMDevHlpTimerUnlock (pDevIns, pThis->hSecondTimer2);1178 PDMDevHlpTimerUnlockClock(pDevIns, pThis->hSecondTimer2); 1181 1179 AssertRCReturn(rc, rc); 1182 1180 -
trunk/src/VBox/VMM/VMMAll/APICAll.cpp
r82041 r82329 1415 1415 TMTIMERHANDLE hTimer = pApicCpu->hTimer; 1416 1416 1417 int rc = PDMDevHlpTimerLock(pDevIns, hTimer, rcBusy);1417 VBOXSTRICTRC rc = PDMDevHlpTimerLockClock(pDevIns, hTimer, rcBusy); 1418 1418 if (rc == VINF_SUCCESS) 1419 1419 { … … 1423 1423 { 1424 1424 uint64_t const cTicksElapsed = PDMDevHlpTimerGet(pDevIns, hTimer) - pApicCpu->u64TimerInitial; 1425 PDMDevHlpTimerUnlock (pDevIns, hTimer);1425 PDMDevHlpTimerUnlockClock(pDevIns, hTimer); 1426 1426 uint8_t const uTimerShift = apicGetTimerShift(pXApicPage); 1427 1427 uint64_t const uDelta = cTicksElapsed >> uTimerShift; … … 1430 1430 } 1431 1431 else 1432 PDMDevHlpTimerUnlock (pDevIns, hTimer);1432 PDMDevHlpTimerUnlockClock(pDevIns, hTimer); 1433 1433 } 1434 1434 return rc; … … 1467 1467 */ 1468 1468 TMTIMERHANDLE hTimer = pApicCpu->hTimer; 1469 int rc = PDMDevHlpTimerLock(pDevIns, hTimer, rcBusy);1469 VBOXSTRICTRC rc = PDMDevHlpTimerLockClock(pDevIns, hTimer, rcBusy); 1470 1470 if (rc == VINF_SUCCESS) 1471 1471 { … … 1476 1476 else 1477 1477 apicStopTimer(pVCpu); 1478 PDMDevHlpTimerUnlock (pDevIns, hTimer);1478 PDMDevHlpTimerUnlockClock(pDevIns, hTimer); 1479 1479 } 1480 1480 return rc; -
trunk/src/VBox/VMM/VMMR0/PDMR0Device.cpp
r82039 r82329 605 605 606 606 607 /** @interface_method_impl{PDMDEVHLPR0,pfnTimerLock } */608 static DECLCALLBACK( int) pdmR0DevHlp_TimerLock(PPDMDEVINS pDevIns, TMTIMERHANDLE hTimer, int rcBusy)607 /** @interface_method_impl{PDMDEVHLPR0,pfnTimerLockClock} */ 608 static DECLCALLBACK(VBOXSTRICTRC) pdmR0DevHlp_TimerLockClock(PPDMDEVINS pDevIns, TMTIMERHANDLE hTimer, int rcBusy) 609 609 { 610 610 return TMTimerLock(pdmR0DevHlp_TimerToPtr(pDevIns, hTimer), rcBusy); 611 } 612 613 614 /** @interface_method_impl{PDMDEVHLPR0,pfnTimerLockClock2} */ 615 static DECLCALLBACK(VBOXSTRICTRC) pdmR0DevHlp_TimerLockClock2(PPDMDEVINS pDevIns, TMTIMERHANDLE hTimer, 616 PPDMCRITSECT pCritSect, int rcBusy) 617 { 618 VBOXSTRICTRC rc = TMTimerLock(pdmR0DevHlp_TimerToPtr(pDevIns, hTimer), rcBusy); 619 if (rc == VINF_SUCCESS) 620 { 621 rc = PDMCritSectEnter(pCritSect, rcBusy); 622 if (rc == VINF_SUCCESS) 623 return rc; 624 AssertRC(VBOXSTRICTRC_VAL(rc)); 625 TMTimerUnlock(pdmR0DevHlp_TimerToPtr(pDevIns, hTimer)); 626 } 627 else 628 AssertRC(VBOXSTRICTRC_VAL(rc)); 629 return rc; 611 630 } 612 631 … … 661 680 662 681 663 /** @interface_method_impl{PDMDEVHLPR0,pfnTimerUnlock } */664 static DECLCALLBACK(void) pdmR0DevHlp_TimerUnlock (PPDMDEVINS pDevIns, TMTIMERHANDLE hTimer)682 /** @interface_method_impl{PDMDEVHLPR0,pfnTimerUnlockClock} */ 683 static DECLCALLBACK(void) pdmR0DevHlp_TimerUnlockClock(PPDMDEVINS pDevIns, TMTIMERHANDLE hTimer) 665 684 { 666 685 TMTimerUnlock(pdmR0DevHlp_TimerToPtr(pDevIns, hTimer)); 686 } 687 688 689 /** @interface_method_impl{PDMDEVHLPR0,pfnTimerUnlockClock2} */ 690 static DECLCALLBACK(void) pdmR0DevHlp_TimerUnlockClock2(PPDMDEVINS pDevIns, TMTIMERHANDLE hTimer, PPDMCRITSECT pCritSect) 691 { 692 TMTimerUnlock(pdmR0DevHlp_TimerToPtr(pDevIns, hTimer)); 693 int rc = PDMCritSectLeave(pCritSect); 694 AssertRC(rc); 667 695 } 668 696 … … 1299 1327 pdmR0DevHlp_TimerIsActive, 1300 1328 pdmR0DevHlp_TimerIsLockOwner, 1301 pdmR0DevHlp_TimerLock, 1329 pdmR0DevHlp_TimerLockClock, 1330 pdmR0DevHlp_TimerLockClock2, 1302 1331 pdmR0DevHlp_TimerSet, 1303 1332 pdmR0DevHlp_TimerSetFrequencyHint, … … 1307 1336 pdmR0DevHlp_TimerSetRelative, 1308 1337 pdmR0DevHlp_TimerStop, 1309 pdmR0DevHlp_TimerUnlock, 1338 pdmR0DevHlp_TimerUnlockClock, 1339 pdmR0DevHlp_TimerUnlockClock2, 1310 1340 pdmR0DevHlp_TMTimeVirtGet, 1311 1341 pdmR0DevHlp_TMTimeVirtGetFreq, -
trunk/src/VBox/VMM/VMMR3/PDMDevHlp.cpp
r82316 r82329 518 518 519 519 520 /** @interface_method_impl{PDMDEVHLPR3,pfnTimerLockClock} */ 521 static DECLCALLBACK(VBOXSTRICTRC) pdmR3DevHlp_TimerLockClock(PPDMDEVINS pDevIns, TMTIMERHANDLE hTimer, int rcBusy) 522 { 523 return TMTimerLock(pdmR3DevHlp_TimerToPtr(pDevIns, hTimer), rcBusy); 524 } 525 526 520 527 /** @interface_method_impl{PDMDEVHLPR3,pfnTimerLock} */ 521 static DECLCALLBACK(int) pdmR3DevHlp_TimerLock(PPDMDEVINS pDevIns, TMTIMERHANDLE hTimer, int rcBusy) 522 { 523 return TMTimerLock(pdmR3DevHlp_TimerToPtr(pDevIns, hTimer), rcBusy); 528 static DECLCALLBACK(VBOXSTRICTRC) pdmR3DevHlp_TimerLockClock2(PPDMDEVINS pDevIns, TMTIMERHANDLE hTimer, 529 PPDMCRITSECT pCritSect, int rcBusy) 530 { 531 VBOXSTRICTRC rc = TMTimerLock(pdmR3DevHlp_TimerToPtr(pDevIns, hTimer), rcBusy); 532 if (rc == VINF_SUCCESS) 533 { 534 rc = PDMCritSectEnter(pCritSect, rcBusy); 535 if (rc == VINF_SUCCESS) 536 return rc; 537 AssertRC(VBOXSTRICTRC_VAL(rc)); 538 TMTimerUnlock(pdmR3DevHlp_TimerToPtr(pDevIns, hTimer)); 539 } 540 else 541 AssertRC(VBOXSTRICTRC_VAL(rc)); 542 return rc; 524 543 } 525 544 … … 574 593 575 594 595 /** @interface_method_impl{PDMDEVHLPR3,pfnTimerUnlockClock} */ 596 static DECLCALLBACK(void) pdmR3DevHlp_TimerUnlockClock(PPDMDEVINS pDevIns, TMTIMERHANDLE hTimer) 597 { 598 TMTimerUnlock(pdmR3DevHlp_TimerToPtr(pDevIns, hTimer)); 599 } 600 601 576 602 /** @interface_method_impl{PDMDEVHLPR3,pfnTimerUnlock} */ 577 static DECLCALLBACK(void) pdmR3DevHlp_TimerUnlock (PPDMDEVINS pDevIns, TMTIMERHANDLE hTimer)603 static DECLCALLBACK(void) pdmR3DevHlp_TimerUnlockClock2(PPDMDEVINS pDevIns, TMTIMERHANDLE hTimer, PPDMCRITSECT pCritSect) 578 604 { 579 605 TMTimerUnlock(pdmR3DevHlp_TimerToPtr(pDevIns, hTimer)); 606 int rc = PDMCritSectLeave(pCritSect); 607 AssertRC(rc); 580 608 } 581 609 … … 3923 3951 pdmR3DevHlp_TimerIsActive, 3924 3952 pdmR3DevHlp_TimerIsLockOwner, 3925 pdmR3DevHlp_TimerLock, 3953 pdmR3DevHlp_TimerLockClock, 3954 pdmR3DevHlp_TimerLockClock2, 3926 3955 pdmR3DevHlp_TimerSet, 3927 3956 pdmR3DevHlp_TimerSetFrequencyHint, … … 3931 3960 pdmR3DevHlp_TimerSetRelative, 3932 3961 pdmR3DevHlp_TimerStop, 3933 pdmR3DevHlp_TimerUnlock, 3962 pdmR3DevHlp_TimerUnlockClock, 3963 pdmR3DevHlp_TimerUnlockClock2, 3934 3964 pdmR3DevHlp_TimerSetCritSect, 3935 3965 pdmR3DevHlp_TimerSave, … … 4405 4435 pdmR3DevHlp_TimerIsActive, 4406 4436 pdmR3DevHlp_TimerIsLockOwner, 4407 pdmR3DevHlp_TimerLock, 4437 pdmR3DevHlp_TimerLockClock, 4438 pdmR3DevHlp_TimerLockClock2, 4408 4439 pdmR3DevHlp_TimerSet, 4409 4440 pdmR3DevHlp_TimerSetFrequencyHint, … … 4413 4444 pdmR3DevHlp_TimerSetRelative, 4414 4445 pdmR3DevHlp_TimerStop, 4415 pdmR3DevHlp_TimerUnlock, 4446 pdmR3DevHlp_TimerUnlockClock, 4447 pdmR3DevHlp_TimerUnlockClock2, 4416 4448 pdmR3DevHlp_TimerSetCritSect, 4417 4449 pdmR3DevHlp_TimerSave,
Note:
See TracChangeset
for help on using the changeset viewer.