Changeset 87760 in vbox for trunk/src/VBox/VMM/VMMR3
- Timestamp:
- Feb 15, 2021 10:45:27 PM (4 years ago)
- svn:sync-xref-src-repo-rev:
- 142814
- Location:
- trunk/src/VBox/VMM/VMMR3
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/VMMR3/APIC.cpp
r87519 r87760 1502 1502 PAPICCPU pApicCpu = VMCPU_TO_APICCPU(pVCpu); 1503 1503 RTStrPrintf(&pApicCpu->szTimerDesc[0], sizeof(pApicCpu->szTimerDesc), "APIC Timer %u", pVCpu->idCpu); 1504 rc = PDMDevHlpTimerCreate(pDevIns, TMCLOCK_VIRTUAL_SYNC, apicR3TimerCallback, pVCpu, TMTIMER_FLAGS_NO_CRIT_SECT,1505 pApicCpu->szTimerDesc, &pApicCpu->hTimer);1504 rc = PDMDevHlpTimerCreate(pDevIns, TMCLOCK_VIRTUAL_SYNC, apicR3TimerCallback, pVCpu, 1505 TMTIMER_FLAGS_NO_CRIT_SECT | TMTIMER_FLAGS_RING0, pApicCpu->szTimerDesc, &pApicCpu->hTimer); 1506 1506 AssertRCReturn(rc, rc); 1507 1507 } -
trunk/src/VBox/VMM/VMMR3/PDMDevHlp.cpp
r87494 r87760 412 412 413 413 414 /** @interface_method_impl{PDMDEVHLPR3,pfnTMTimerCreate} */ 415 static DECLCALLBACK(int) pdmR3DevHlp_TMTimerCreate(PPDMDEVINS pDevIns, TMCLOCK enmClock, PFNTMTIMERDEV pfnCallback, void *pvUser, uint32_t fFlags, const char *pszDesc, PPTMTIMERR3 ppTimer) 414 /** @interface_method_impl{PDMDEVHLPR3,pfnTimerCreate} */ 415 static DECLCALLBACK(int) pdmR3DevHlp_TimerCreate(PPDMDEVINS pDevIns, TMCLOCK enmClock, PFNTMTIMERDEV pfnCallback, 416 void *pvUser, uint32_t fFlags, const char *pszDesc, PTMTIMERHANDLE phTimer) 416 417 { 417 418 PDMDEV_ASSERT_DEVINS(pDevIns); 418 419 PVM pVM = pDevIns->Internal.s.pVMR3; 419 420 VM_ASSERT_EMT(pVM); 420 LogFlow(("pdmR3DevHlp_T MTimerCreate: caller='%s'/%d: enmClock=%d pfnCallback=%p pvUser=%p fFlags=%#x pszDesc=%p:{%s} ppTimer=%p\n",421 pDevIns->pReg->szName, pDevIns->iInstance, enmClock, pfnCallback, pvUser, fFlags, pszDesc, pszDesc, p pTimer));421 LogFlow(("pdmR3DevHlp_TimerCreate: caller='%s'/%d: enmClock=%d pfnCallback=%p pvUser=%p fFlags=%#x pszDesc=%p:{%s} phTimer=%p\n", 422 pDevIns->pReg->szName, pDevIns->iInstance, enmClock, pfnCallback, pvUser, fFlags, pszDesc, pszDesc, phTimer)); 422 423 423 424 if (pDevIns->iInstance > 0) /** @todo use a string cache here later. */ … … 428 429 } 429 430 430 int rc = TMR3TimerCreateDevice(pVM, pDevIns, enmClock, pfnCallback, pvUser, fFlags, pszDesc, ppTimer); 431 432 LogFlow(("pdmR3DevHlp_TMTimerCreate: caller='%s'/%d: returns %Rrc\n", pDevIns->pReg->szName, pDevIns->iInstance, rc)); 433 return rc; 434 } 435 436 437 438 /** @interface_method_impl{PDMDEVHLPR3,pfnTimerCreate} */ 439 static DECLCALLBACK(int) pdmR3DevHlp_TimerCreate(PPDMDEVINS pDevIns, TMCLOCK enmClock, PFNTMTIMERDEV pfnCallback, 440 void *pvUser, uint32_t fFlags, const char *pszDesc, PTMTIMERHANDLE phTimer) 441 { 442 PDMDEV_ASSERT_DEVINS(pDevIns); 443 PVM pVM = pDevIns->Internal.s.pVMR3; 444 VM_ASSERT_EMT(pVM); 445 LogFlow(("pdmR3DevHlp_TimerCreate: caller='%s'/%d: enmClock=%d pfnCallback=%p pvUser=%p fFlags=%#x pszDesc=%p:{%s} phTimer=%p\n", 446 pDevIns->pReg->szName, pDevIns->iInstance, enmClock, pfnCallback, pvUser, fFlags, pszDesc, pszDesc, phTimer)); 447 448 if (pDevIns->iInstance > 0) /** @todo use a string cache here later. */ 449 { 450 char *pszDesc2 = MMR3HeapAPrintf(pVM, MM_TAG_PDM_DEVICE_DESC, "%s[%u]", pszDesc, pDevIns->iInstance); 451 if (pszDesc2) 452 pszDesc = pszDesc2; 453 } 431 /* Clear the ring-0 flag if the device isn't configured for ring-0. */ 432 if (fFlags & TMTIMER_FLAGS_RING0) 433 { 434 Assert(pDevIns->Internal.s.pDevR3->pReg->fFlags & PDM_DEVREG_FLAGS_R0); 435 if (!(pDevIns->Internal.s.fIntFlags & PDMDEVINSINT_FLAGS_R0_ENABLED)) 436 fFlags &= ~TMTIMER_FLAGS_RING0; 437 } 438 else 439 Assert(fFlags & TMTIMER_FLAGS_NO_RING0 /* just to make sure all devices has been considered */); 454 440 455 441 PTMTIMER pTimer = NULL; … … 462 448 463 449 464 /** @interface_method_impl{PDMDEVHLPR3,pfnTimerToPtr}*/465 static DECLCALLBACK(PTMTIMERR3) pdmR3DevHlp_TimerToPtr(PPDMDEVINS pDevIns, TMTIMERHANDLE hTimer)450 /** Converts timer handle to pointer (used to exposed, will be replace soon.) */ 451 DECLINLINE(PTMTIMERR3) pdmR3DevHlp_TimerToPtr(PPDMDEVINS pDevIns, TMTIMERHANDLE hTimer) 466 452 { 467 453 PDMDEV_ASSERT_DEVINS(pDevIns); … … 4189 4175 SSMR3HandleVersion, 4190 4176 SSMR3HandleHostOSAndArch, 4191 pdmR3DevHlp_TMTimerCreate,4192 4177 pdmR3DevHlp_TimerCreate, 4193 pdmR3DevHlp_TimerToPtr,4194 4178 pdmR3DevHlp_TimerFromMicro, 4195 4179 pdmR3DevHlp_TimerFromMilli, … … 4538 4522 SSMR3HandleVersion, 4539 4523 SSMR3HandleHostOSAndArch, 4540 pdmR3DevHlp_TMTimerCreate,4541 4524 pdmR3DevHlp_TimerCreate, 4542 pdmR3DevHlp_TimerToPtr,4543 4525 pdmR3DevHlp_TimerFromMicro, 4544 4526 pdmR3DevHlp_TimerFromMilli, … … 4776 4758 PDM_DEVHLPR3_VERSION /* the end */ 4777 4759 }; 4778 #endif 4760 #endif /* VBOX_WITH_DBGF_TRACING */ 4779 4761 4780 4762 … … 5044 5026 SSMR3HandleVersion, 5045 5027 SSMR3HandleHostOSAndArch, 5046 pdmR3DevHlp_TMTimerCreate,5047 5028 pdmR3DevHlp_TimerCreate, 5048 pdmR3DevHlp_TimerToPtr,5049 5029 pdmR3DevHlp_TimerFromMicro, 5050 5030 pdmR3DevHlp_TimerFromMilli, -
trunk/src/VBox/VMM/VMMR3/PDMDriver.cpp
r82968 r87760 1324 1324 LogFlow(("pdmR3DrvHlp_TMTimerCreate: caller='%s'/%d: enmClock=%d pfnCallback=%p pvUser=%p fFlags=%#x pszDesc=%p:{%s} ppTimer=%p\n", 1325 1325 pDrvIns->pReg->szName, pDrvIns->iInstance, enmClock, pfnCallback, pvUser, fFlags, pszDesc, pszDesc, ppTimer)); 1326 1327 /* Clear the ring-0 flag if the driver isn't configured for ring-0. */ 1328 if (fFlags & TMTIMER_FLAGS_RING0) 1329 { 1330 Assert(pDrvIns->Internal.s.pDrv->pReg->fFlags & PDM_DRVREG_FLAGS_R0); 1331 /** @todo if (!(pDrvIns->Internal.s.fIntFlags & PDMDRVINSINT_FLAGS_R0_ENABLED)) */ 1332 fFlags &= ~TMTIMER_FLAGS_RING0; 1333 } 1326 1334 1327 1335 int rc = TMR3TimerCreateDriver(pDrvIns->Internal.s.pVMR3, pDrvIns, enmClock, pfnCallback, pvUser, fFlags, pszDesc, ppTimer); -
trunk/src/VBox/VMM/VMMR3/PDMUsb.cpp
r83196 r87760 1829 1829 if (pszDesc2) 1830 1830 pszDesc = pszDesc2; 1831 1832 AssertStmt(!(fFlags & TMTIMER_FLAGS_RING0), fFlags &= ~TMTIMER_FLAGS_RING0); 1831 1833 1832 1834 int rc = TMR3TimerCreateUsb(pVM, pUsbIns, enmClock, pfnCallback, pvUser, fFlags, pszDesc, ppTimer); -
trunk/src/VBox/VMM/VMMR3/TM.cpp
r87748 r87760 1508 1508 * @param pVM The cross context VM structure. 1509 1509 * @param enmClock The timer clock. 1510 * @param fFlags TMTIMER_FLAGS_XXX. 1510 1511 * @param pszDesc The timer description. 1511 1512 * @param ppTimer Where to store the timer pointer on success. 1512 1513 */ 1513 static int tmr3TimerCreate(PVM pVM, TMCLOCK enmClock, const char *pszDesc, PPTMTIMERR3 ppTimer)1514 static int tmr3TimerCreate(PVM pVM, TMCLOCK enmClock, uint32_t fFlags, const char *pszDesc, PPTMTIMERR3 ppTimer) 1514 1515 { 1515 1516 VM_ASSERT_EMT(pVM); … … 1549 1550 pTimer->pCritSect = NULL; 1550 1551 pTimer->pszDesc = pszDesc; 1552 pTimer->fFlags = fFlags; 1551 1553 1552 1554 /* insert into the list of created timers. */ … … 1604 1606 uint32_t fFlags, const char *pszDesc, PPTMTIMERR3 ppTimer) 1605 1607 { 1606 AssertReturn(!(fFlags & ~(TMTIMER_FLAGS_NO_CRIT_SECT)), VERR_INVALID_PARAMETER); 1608 AssertReturn(!(fFlags & ~(TMTIMER_FLAGS_NO_CRIT_SECT | TMTIMER_FLAGS_RING0 | TMTIMER_FLAGS_NO_RING0)), 1609 VERR_INVALID_FLAGS); 1607 1610 1608 1611 /* 1609 1612 * Allocate and init stuff. 1610 1613 */ 1611 int rc = tmr3TimerCreate(pVM, enmClock, pszDesc, ppTimer);1614 int rc = tmr3TimerCreate(pVM, enmClock, fFlags, pszDesc, ppTimer); 1612 1615 if (RT_SUCCESS(rc)) 1613 1616 { … … 1645 1648 uint32_t fFlags, const char *pszDesc, PPTMTIMERR3 ppTimer) 1646 1649 { 1647 AssertReturn(!(fFlags & ~(TMTIMER_FLAGS_NO_CRIT_SECT )), VERR_INVALID_PARAMETER);1650 AssertReturn(!(fFlags & ~(TMTIMER_FLAGS_NO_CRIT_SECT | TMTIMER_FLAGS_NO_RING0)), VERR_INVALID_PARAMETER); 1648 1651 1649 1652 /* 1650 1653 * Allocate and init stuff. 1651 1654 */ 1652 int rc = tmr3TimerCreate(pVM, enmClock, pszDesc, ppTimer);1655 int rc = tmr3TimerCreate(pVM, enmClock, fFlags, pszDesc, ppTimer); 1653 1656 if (RT_SUCCESS(rc)) 1654 1657 { … … 1688 1691 uint32_t fFlags, const char *pszDesc, PPTMTIMERR3 ppTimer) 1689 1692 { 1690 AssertReturn(!(fFlags & ~(TMTIMER_FLAGS_NO_CRIT_SECT)), VERR_INVALID_PARAMETER); 1693 AssertReturn(!(fFlags & ~(TMTIMER_FLAGS_NO_CRIT_SECT | TMTIMER_FLAGS_RING0 | TMTIMER_FLAGS_NO_RING0)), 1694 VERR_INVALID_FLAGS); 1691 1695 1692 1696 /* 1693 1697 * Allocate and init stuff. 1694 1698 */ 1695 int rc = tmr3TimerCreate(pVM, enmClock, pszDesc, ppTimer);1699 int rc = tmr3TimerCreate(pVM, enmClock, fFlags, pszDesc, ppTimer); 1696 1700 if (RT_SUCCESS(rc)) 1697 1701 { … … 1719 1723 * @param ppTimer Where to store the timer on success. 1720 1724 */ 1721 VMMR3DECL(int) TMR3TimerCreateInternal(PVM pVM, TMCLOCK enmClock, PFNTMTIMERINT pfnCallback, void *pvUser, const char *pszDesc, PPTMTIMERR3 ppTimer) 1725 VMMR3DECL(int) TMR3TimerCreateInternal(PVM pVM, TMCLOCK enmClock, 1726 PFNTMTIMERINT pfnCallback, void *pvUser, const char *pszDesc, PPTMTIMERR3 ppTimer) 1722 1727 { 1723 1728 /* … … 1725 1730 */ 1726 1731 PTMTIMER pTimer; 1727 int rc = tmr3TimerCreate(pVM, enmClock, pszDesc, &pTimer);1732 int rc = tmr3TimerCreate(pVM, enmClock, 0 /*fFlags*/, pszDesc, &pTimer); 1728 1733 if (RT_SUCCESS(rc)) 1729 1734 { … … 1750 1755 * until the timer is fully destroyed (i.e. a bit after TMTimerDestroy()). 1751 1756 */ 1752 VMMR3DECL(PTMTIMERR3) TMR3TimerCreateExternal(PVM pVM, TMCLOCK enmClock, PFNTMTIMEREXT pfnCallback, void *pvUser, const char *pszDesc) 1757 VMMR3DECL(PTMTIMERR3) TMR3TimerCreateExternal(PVM pVM, TMCLOCK enmClock, 1758 PFNTMTIMEREXT pfnCallback, void *pvUser, const char *pszDesc) 1753 1759 { 1754 1760 /* … … 1756 1762 */ 1757 1763 PTMTIMERR3 pTimer; 1758 int rc = tmr3TimerCreate(pVM, enmClock, pszDesc, &pTimer);1764 int rc = tmr3TimerCreate(pVM, enmClock, 0 /*fFlags*/, pszDesc, &pTimer); 1759 1765 if (RT_SUCCESS(rc)) 1760 1766 {
Note:
See TracChangeset
for help on using the changeset viewer.