VirtualBox

Changeset 87762 in vbox


Ignore:
Timestamp:
Feb 15, 2021 11:38:29 PM (4 years ago)
Author:
vboxsync
Message:

VMM/UsbHlp: Changed the timer interface to TMTIMERHANDLE, adding the same set of methods as DevHlp has. bugref:9943

Location:
trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/VBox/vmm/pdmusb.h

    r85121 r87762  
    615615     * @param   pszDesc             Pointer to description string which must stay around
    616616     *                              until the timer is fully destroyed (i.e. a bit after TMTimerDestroy()).
    617      * @param   ppTimer             Where to store the timer on success.
    618      */
    619     DECLR3CALLBACKMEMBER(int, pfnTMTimerCreate,(PPDMUSBINS pUsbIns, TMCLOCK enmClock, PFNTMTIMERUSB pfnCallback, void *pvUser,
    620                                                 uint32_t fFlags, const char *pszDesc, PPTMTIMERR3 ppTimer));
     617     * @param   phTimer             Where to store the timer handle on success.
     618     */
     619    DECLR3CALLBACKMEMBER(int, pfnTimerCreate,(PPDMUSBINS pUsbIns, TMCLOCK enmClock, PFNTMTIMERUSB pfnCallback, void *pvUser,
     620                                              uint32_t fFlags, const char *pszDesc, PTMTIMERHANDLE phTimer));
     621
     622    /** @name Timer handle method wrappers
     623     * @{ */
     624    DECLR3CALLBACKMEMBER(uint64_t, pfnTimerFromMicro,(PPDMUSBINS pUsbIns, TMTIMERHANDLE hTimer, uint64_t cMicroSecs));
     625    DECLR3CALLBACKMEMBER(uint64_t, pfnTimerFromMilli,(PPDMUSBINS pUsbIns, TMTIMERHANDLE hTimer, uint64_t cMilliSecs));
     626    DECLR3CALLBACKMEMBER(uint64_t, pfnTimerFromNano,(PPDMUSBINS pUsbIns, TMTIMERHANDLE hTimer, uint64_t cNanoSecs));
     627    DECLR3CALLBACKMEMBER(uint64_t, pfnTimerGet,(PPDMUSBINS pUsbIns, TMTIMERHANDLE hTimer));
     628    DECLR3CALLBACKMEMBER(uint64_t, pfnTimerGetFreq,(PPDMUSBINS pUsbIns, TMTIMERHANDLE hTimer));
     629    DECLR3CALLBACKMEMBER(uint64_t, pfnTimerGetNano,(PPDMUSBINS pUsbIns, TMTIMERHANDLE hTimer));
     630    DECLR3CALLBACKMEMBER(bool,     pfnTimerIsActive,(PPDMUSBINS pUsbIns, TMTIMERHANDLE hTimer));
     631    DECLR3CALLBACKMEMBER(bool,     pfnTimerIsLockOwner,(PPDMUSBINS pUsbIns, TMTIMERHANDLE hTimer));
     632    DECLR3CALLBACKMEMBER(int,      pfnTimerLockClock,(PPDMUSBINS pUsbIns, TMTIMERHANDLE hTimer));
     633    /** Takes the clock lock then enters the specified critical section. */
     634    DECLR3CALLBACKMEMBER(int,      pfnTimerLockClock2,(PPDMUSBINS pUsbIns, TMTIMERHANDLE hTimer, PPDMCRITSECT pCritSect));
     635    DECLR3CALLBACKMEMBER(int,      pfnTimerSet,(PPDMUSBINS pUsbIns, TMTIMERHANDLE hTimer, uint64_t uExpire));
     636    DECLR3CALLBACKMEMBER(int,      pfnTimerSetFrequencyHint,(PPDMUSBINS pUsbIns, TMTIMERHANDLE hTimer, uint32_t uHz));
     637    DECLR3CALLBACKMEMBER(int,      pfnTimerSetMicro,(PPDMUSBINS pUsbIns, TMTIMERHANDLE hTimer, uint64_t cMicrosToNext));
     638    DECLR3CALLBACKMEMBER(int,      pfnTimerSetMillies,(PPDMUSBINS pUsbIns, TMTIMERHANDLE hTimer, uint64_t cMilliesToNext));
     639    DECLR3CALLBACKMEMBER(int,      pfnTimerSetNano,(PPDMUSBINS pUsbIns, TMTIMERHANDLE hTimer, uint64_t cNanosToNext));
     640    DECLR3CALLBACKMEMBER(int,      pfnTimerSetRelative,(PPDMUSBINS pUsbIns, TMTIMERHANDLE hTimer, uint64_t cTicksToNext, uint64_t *pu64Now));
     641    DECLR3CALLBACKMEMBER(int,      pfnTimerStop,(PPDMUSBINS pUsbIns, TMTIMERHANDLE hTimer));
     642    DECLR3CALLBACKMEMBER(void,     pfnTimerUnlockClock,(PPDMUSBINS pUsbIns, TMTIMERHANDLE hTimer));
     643    DECLR3CALLBACKMEMBER(void,     pfnTimerUnlockClock2,(PPDMUSBINS pUsbIns, TMTIMERHANDLE hTimer, PPDMCRITSECT pCritSect));
     644    DECLR3CALLBACKMEMBER(int,      pfnTimerSetCritSect,(PPDMUSBINS pUsbIns, TMTIMERHANDLE hTimer, PPDMCRITSECT pCritSect));
     645    DECLR3CALLBACKMEMBER(int,      pfnTimerSave,(PPDMUSBINS pUsbIns, TMTIMERHANDLE hTimer, PSSMHANDLE pSSM));
     646    DECLR3CALLBACKMEMBER(int,      pfnTimerLoad,(PPDMUSBINS pUsbIns, TMTIMERHANDLE hTimer, PSSMHANDLE pSSM));
     647    DECLR3CALLBACKMEMBER(int,      pfnTimerDestroy,(PPDMUSBINS pUsbIns, TMTIMERHANDLE hTimer));
     648    /** @sa TMR3TimerSkip */
     649    DECLR3CALLBACKMEMBER(int,      pfnTimerSkipLoad,(PSSMHANDLE pSSM, bool *pfActive));
     650    /** @} */
    621651
    622652    /**
     
    740770
    741771/** Current USBHLP version number. */
    742 #define PDM_USBHLP_VERSION                      PDM_VERSION_MAKE(0xeefe, 3, 0)
     772#define PDM_USBHLP_VERSION                      PDM_VERSION_MAKE(0xeefe, 4, 0)
    743773
    744774#endif /* IN_RING3 */
     
    10101040
    10111041/**
    1012  * @copydoc PDMUSBHLP::pfnTMTimerCreate
    1013  */
    1014 DECLINLINE(int) PDMUsbHlpTMTimerCreate(PPDMUSBINS pUsbIns, TMCLOCK enmClock, PFNTMTIMERUSB pfnCallback, void *pvUser,
    1015                                        uint32_t fFlags, const char *pszDesc, PPTMTIMERR3 ppTimer)
    1016 {
    1017     return pUsbIns->pHlpR3->pfnTMTimerCreate(pUsbIns, enmClock, pfnCallback, pvUser, fFlags, pszDesc, ppTimer);
     1042 * @copydoc PDMUSBHLP::pfnTimerCreate
     1043 */
     1044DECLINLINE(int) PDMUsbHlpTimerCreate(PPDMUSBINS pUsbIns, TMCLOCK enmClock, PFNTMTIMERUSB pfnCallback, void *pvUser,
     1045                                     uint32_t fFlags, const char *pszDesc, PTMTIMERHANDLE phTimer)
     1046{
     1047    return pUsbIns->pHlpR3->pfnTimerCreate(pUsbIns, enmClock, pfnCallback, pvUser, fFlags, pszDesc, phTimer);
     1048}
     1049
     1050/**
     1051 * @copydoc PDMUSBHLP::pfnTimerFromMicro
     1052 */
     1053DECLINLINE(uint64_t) PDMUsbHlpTimerFromMicro(PPDMUSBINS pUsbIns, TMTIMERHANDLE hTimer, uint64_t cMicroSecs)
     1054{
     1055    return pUsbIns->pHlpR3->pfnTimerFromMicro(pUsbIns, hTimer, cMicroSecs);
     1056}
     1057
     1058/**
     1059 * @copydoc PDMUSBHLP::pfnTimerFromMilli
     1060 */
     1061DECLINLINE(uint64_t) PDMUsbHlpTimerFromMilli(PPDMUSBINS pUsbIns, TMTIMERHANDLE hTimer, uint64_t cMilliSecs)
     1062{
     1063    return pUsbIns->pHlpR3->pfnTimerFromMilli(pUsbIns, hTimer, cMilliSecs);
     1064}
     1065
     1066/**
     1067 * @copydoc PDMUSBHLP::pfnTimerFromNano
     1068 */
     1069DECLINLINE(uint64_t) PDMUsbHlpTimerFromNano(PPDMUSBINS pUsbIns, TMTIMERHANDLE hTimer, uint64_t cNanoSecs)
     1070{
     1071    return pUsbIns->pHlpR3->pfnTimerFromNano(pUsbIns, hTimer, cNanoSecs);
     1072}
     1073
     1074/**
     1075 * @copydoc PDMUSBHLP::pfnTimerGet
     1076 */
     1077DECLINLINE(uint64_t) PDMUsbHlpTimerGet(PPDMUSBINS pUsbIns, TMTIMERHANDLE hTimer)
     1078{
     1079    return pUsbIns->pHlpR3->pfnTimerGet(pUsbIns, hTimer);
     1080}
     1081
     1082/**
     1083 * @copydoc PDMUSBHLP::pfnTimerGetFreq
     1084 */
     1085DECLINLINE(uint64_t) PDMUsbHlpTimerGetFreq(PPDMUSBINS pUsbIns, TMTIMERHANDLE hTimer)
     1086{
     1087    return pUsbIns->pHlpR3->pfnTimerGetFreq(pUsbIns, hTimer);
     1088}
     1089
     1090/**
     1091 * @copydoc PDMUSBHLP::pfnTimerGetNano
     1092 */
     1093DECLINLINE(uint64_t) PDMUsbHlpTimerGetNano(PPDMUSBINS pUsbIns, TMTIMERHANDLE hTimer)
     1094{
     1095    return pUsbIns->pHlpR3->pfnTimerGetNano(pUsbIns, hTimer);
     1096}
     1097
     1098/**
     1099 * @copydoc PDMUSBHLP::pfnTimerIsActive
     1100 */
     1101DECLINLINE(bool)     PDMUsbHlpTimerIsActive(PPDMUSBINS pUsbIns, TMTIMERHANDLE hTimer)
     1102{
     1103    return pUsbIns->pHlpR3->pfnTimerIsActive(pUsbIns, hTimer);
     1104}
     1105
     1106/**
     1107 * @copydoc PDMUSBHLP::pfnTimerIsLockOwner
     1108 */
     1109DECLINLINE(bool)     PDMUsbHlpTimerIsLockOwner(PPDMUSBINS pUsbIns, TMTIMERHANDLE hTimer)
     1110{
     1111    return pUsbIns->pHlpR3->pfnTimerIsLockOwner(pUsbIns, hTimer);
     1112}
     1113
     1114/**
     1115 * @copydoc PDMUSBHLP::pfnTimerLockClock
     1116 */
     1117DECLINLINE(int) PDMUsbHlpTimerLockClock(PPDMUSBINS pUsbIns, TMTIMERHANDLE hTimer)
     1118{
     1119    return pUsbIns->pHlpR3->pfnTimerLockClock(pUsbIns, hTimer);
     1120}
     1121
     1122/**
     1123 * @copydoc PDMUSBHLP::pfnTimerLockClock2
     1124 */
     1125DECLINLINE(int) PDMUsbHlpTimerLockClock2(PPDMUSBINS pUsbIns, TMTIMERHANDLE hTimer, PPDMCRITSECT pCritSect)
     1126{
     1127    return pUsbIns->pHlpR3->pfnTimerLockClock2(pUsbIns, hTimer, pCritSect);
     1128}
     1129
     1130/**
     1131 * @copydoc PDMUSBHLP::pfnTimerSet
     1132 */
     1133DECLINLINE(int)      PDMUsbHlpTimerSet(PPDMUSBINS pUsbIns, TMTIMERHANDLE hTimer, uint64_t uExpire)
     1134{
     1135    return pUsbIns->pHlpR3->pfnTimerSet(pUsbIns, hTimer, uExpire);
     1136}
     1137
     1138/**
     1139 * @copydoc PDMUSBHLP::pfnTimerSetFrequencyHint
     1140 */
     1141DECLINLINE(int)      PDMUsbHlpTimerSetFrequencyHint(PPDMUSBINS pUsbIns, TMTIMERHANDLE hTimer, uint32_t uHz)
     1142{
     1143    return pUsbIns->pHlpR3->pfnTimerSetFrequencyHint(pUsbIns, hTimer, uHz);
     1144}
     1145
     1146/**
     1147 * @copydoc PDMUSBHLP::pfnTimerSetMicro
     1148 */
     1149DECLINLINE(int)      PDMUsbHlpTimerSetMicro(PPDMUSBINS pUsbIns, TMTIMERHANDLE hTimer, uint64_t cMicrosToNext)
     1150{
     1151    return pUsbIns->pHlpR3->pfnTimerSetMicro(pUsbIns, hTimer, cMicrosToNext);
     1152}
     1153
     1154/**
     1155 * @copydoc PDMUSBHLP::pfnTimerSetMillies
     1156 */
     1157DECLINLINE(int)      PDMUsbHlpTimerSetMillies(PPDMUSBINS pUsbIns, TMTIMERHANDLE hTimer, uint64_t cMilliesToNext)
     1158{
     1159    return pUsbIns->pHlpR3->pfnTimerSetMillies(pUsbIns, hTimer, cMilliesToNext);
     1160}
     1161
     1162/**
     1163 * @copydoc PDMUSBHLP::pfnTimerSetNano
     1164 */
     1165DECLINLINE(int)      PDMUsbHlpTimerSetNano(PPDMUSBINS pUsbIns, TMTIMERHANDLE hTimer, uint64_t cNanosToNext)
     1166{
     1167    return pUsbIns->pHlpR3->pfnTimerSetNano(pUsbIns, hTimer, cNanosToNext);
     1168}
     1169
     1170/**
     1171 * @copydoc PDMUSBHLP::pfnTimerSetRelative
     1172 */
     1173DECLINLINE(int)      PDMUsbHlpTimerSetRelative(PPDMUSBINS pUsbIns, TMTIMERHANDLE hTimer, uint64_t cTicksToNext, uint64_t *pu64Now)
     1174{
     1175    return pUsbIns->pHlpR3->pfnTimerSetRelative(pUsbIns, hTimer, cTicksToNext, pu64Now);
     1176}
     1177
     1178/**
     1179 * @copydoc PDMUSBHLP::pfnTimerStop
     1180 */
     1181DECLINLINE(int)      PDMUsbHlpTimerStop(PPDMUSBINS pUsbIns, TMTIMERHANDLE hTimer)
     1182{
     1183    return pUsbIns->pHlpR3->pfnTimerStop(pUsbIns, hTimer);
     1184}
     1185
     1186/**
     1187 * @copydoc PDMUSBHLP::pfnTimerUnlockClock
     1188 */
     1189DECLINLINE(void)     PDMUsbHlpTimerUnlockClock(PPDMUSBINS pUsbIns, TMTIMERHANDLE hTimer)
     1190{
     1191    pUsbIns->pHlpR3->pfnTimerUnlockClock(pUsbIns, hTimer);
     1192}
     1193
     1194/**
     1195 * @copydoc PDMUSBHLP::pfnTimerUnlockClock2
     1196 */
     1197DECLINLINE(void)     PDMUsbHlpTimerUnlockClock2(PPDMUSBINS pUsbIns, TMTIMERHANDLE hTimer, PPDMCRITSECT pCritSect)
     1198{
     1199    pUsbIns->pHlpR3->pfnTimerUnlockClock2(pUsbIns, hTimer, pCritSect);
     1200}
     1201
     1202/**
     1203 * @copydoc PDMUSBHLP::pfnTimerSetCritSect
     1204 */
     1205DECLINLINE(int) PDMUsbHlpTimerSetCritSect(PPDMUSBINS pUsbIns, TMTIMERHANDLE hTimer, PPDMCRITSECT pCritSect)
     1206{
     1207    return pUsbIns->pHlpR3->pfnTimerSetCritSect(pUsbIns, hTimer, pCritSect);
     1208}
     1209
     1210/**
     1211 * @copydoc PDMUSBHLP::pfnTimerSave
     1212 */
     1213DECLINLINE(int) PDMUsbHlpTimerSave(PPDMUSBINS pUsbIns, TMTIMERHANDLE hTimer, PSSMHANDLE pSSM)
     1214{
     1215    return pUsbIns->pHlpR3->pfnTimerSave(pUsbIns, hTimer, pSSM);
     1216}
     1217
     1218/**
     1219 * @copydoc PDMUSBHLP::pfnTimerLoad
     1220 */
     1221DECLINLINE(int) PDMUsbHlpTimerLoad(PPDMUSBINS pUsbIns, TMTIMERHANDLE hTimer, PSSMHANDLE pSSM)
     1222{
     1223    return pUsbIns->pHlpR3->pfnTimerLoad(pUsbIns, hTimer, pSSM);
     1224}
     1225
     1226/**
     1227 * @copydoc PDMUSBHLP::pfnTimerDestroy
     1228 */
     1229DECLINLINE(int) PDMUsbHlpTimerDestroy(PPDMUSBINS pUsbIns, TMTIMERHANDLE hTimer)
     1230{
     1231    return pUsbIns->pHlpR3->pfnTimerDestroy(pUsbIns, hTimer);
    10181232}
    10191233
  • trunk/src/VBox/Devices/USB/VUSBDevice.cpp

    r85121 r87762  
    13001300
    13011301    RTMemFree(pDev->paIfStates);
    1302     TMR3TimerDestroy(pDev->pResetTimer);
    1303     pDev->pResetTimer = NULL;
     1302
     1303    PDMUsbHlpTimerDestroy(pDev->pUsbIns, pDev->hResetTimer);
     1304    pDev->hResetTimer = NIL_TMTIMERHANDLE;
     1305
    13041306    for (unsigned i = 0; i < RT_ELEMENTS(pDev->aPipes); i++)
    13051307    {
     
    14021404static DECLCALLBACK(int) vusbDevResetWorker(PVUSBDEV pDev, bool fResetOnLinux, bool fUseTimer, PVUSBRESETARGS pArgs)
    14031405{
     1406    uint64_t const uTimerDeadline = !fUseTimer ? 0
     1407                                  :   PDMUsbHlpTimerGet(pDev->pUsbIns, pDev->hResetTimer)
     1408                                    + PDMUsbHlpTimerFromMilli(pDev->pUsbIns, pDev->hResetTimer, 10);
     1409
    14041410    int rc = VINF_SUCCESS;
    1405     uint64_t u64EndTS = TMTimerGet(pDev->pResetTimer) + TMTimerFromMilli(pDev->pResetTimer, 10);
    1406 
    14071411    if (pDev->pUsbIns->pReg->pfnUsbReset)
    14081412        rc = pDev->pUsbIns->pReg->pfnUsbReset(pDev->pUsbIns, fResetOnLinux);
     
    14211425         * us more accurate scheduling than making this thread sleep.
    14221426         */
    1423         int rc2 = TMTimerSet(pDev->pResetTimer, u64EndTS);
     1427        int rc2 = PDMUsbHlpTimerSet(pDev->pUsbIns, pDev->hResetTimer, uTimerDeadline);
    14241428        AssertReleaseRC(rc2);
    14251429    }
     
    17951799        AssertRCReturn(rc, rc);
    17961800    }
    1797     pDev->pResetTimer = NULL;
     1801    pDev->hResetTimer = NIL_TMTIMERHANDLE;
    17981802    pDev->hSniffer = VUSBSNIFFER_NIL;
    17991803
     
    18121816     * Create the reset timer.
    18131817     */
    1814     rc = PDMUsbHlpTMTimerCreate(pDev->pUsbIns, TMCLOCK_VIRTUAL, vusbDevResetDoneTimer, pDev, 0 /*fFlags*/,
    1815                                 "USB Device Reset Timer",  &pDev->pResetTimer);
     1818    rc = PDMUsbHlpTimerCreate(pDev->pUsbIns, TMCLOCK_VIRTUAL, vusbDevResetDoneTimer, pDev, 0 /*fFlags*/,
     1819                              "USB Device Reset Timer",  &pDev->hResetTimer);
    18161820    AssertRCReturn(rc, rc);
    18171821
  • trunk/src/VBox/Devices/USB/VUSBInternal.h

    r85121 r87762  
    271271
    272272    /** The reset timer handle. */
    273     PTMTIMER            pResetTimer;
     273    TMTIMERHANDLE       hResetTimer;
    274274    /** Reset handler arguments. */
    275275    void               *pvArgs;
  • trunk/src/VBox/VMM/VMMR3/PDMUsb.cpp

    r87760 r87762  
    18151815
    18161816
    1817 /** @interface_method_impl{PDMUSBHLP,pfnTMTimerCreate} */
    1818 static DECLCALLBACK(int) pdmR3UsbHlp_TMTimerCreate(PPDMUSBINS pUsbIns, TMCLOCK enmClock, PFNTMTIMERUSB pfnCallback, void *pvUser,
    1819                                                    uint32_t fFlags, const char *pszDesc, PPTMTIMERR3 ppTimer)
     1817/** @interface_method_impl{PDMUSBHLP,pfnTimerCreate} */
     1818static DECLCALLBACK(int) pdmR3UsbHlp_TimerCreate(PPDMUSBINS pUsbIns, TMCLOCK enmClock, PFNTMTIMERUSB pfnCallback, void *pvUser,
     1819                                                 uint32_t fFlags, const char *pszDesc, PTMTIMERHANDLE phTimer)
    18201820{
    18211821    PDMUSB_ASSERT_USBINS(pUsbIns);
    18221822    PVM pVM = pUsbIns->Internal.s.pVM;
    18231823    VM_ASSERT_EMT(pVM);
    1824     LogFlow(("pdmR3UsbHlp_TMTimerCreate: caller='%s'/%d: enmClock=%d pfnCallback=%p pvUser=%p fFlags=%#x pszDesc=%p:{%s} ppTimer=%p\n",
    1825              pUsbIns->pReg->szName, pUsbIns->iInstance, enmClock, pfnCallback, pvUser, fFlags, pszDesc, pszDesc, ppTimer));
     1824    LogFlow(("pdmR3UsbHlp_TMTimerCreate: caller='%s'/%d: enmClock=%d pfnCallback=%p pvUser=%p fFlags=%#x pszDesc=%p:{%s} phTimer=%p\n",
     1825             pUsbIns->pReg->szName, pUsbIns->iInstance, enmClock, pfnCallback, pvUser, fFlags, pszDesc, pszDesc, phTimer));
     1826
     1827    AssertReturn(!(fFlags & TMTIMER_FLAGS_RING0), VERR_INVALID_FLAGS);
     1828    fFlags |= TMTIMER_FLAGS_NO_RING0;
    18261829
    18271830    /** @todo use a string cache here later. */
     
    18301833        pszDesc = pszDesc2;
    18311834
    1832     AssertStmt(!(fFlags & TMTIMER_FLAGS_RING0), fFlags &= ~TMTIMER_FLAGS_RING0);
    1833 
    1834     int rc = TMR3TimerCreateUsb(pVM, pUsbIns, enmClock, pfnCallback, pvUser, fFlags, pszDesc, ppTimer);
    1835 
    1836     LogFlow(("pdmR3UsbHlp_TMTimerCreate: caller='%s'/%d: returns %Rrc\n", pUsbIns->pReg->szName, pUsbIns->iInstance, rc));
     1835    PTMTIMERR3 pTimer = NULL;
     1836    int rc = TMR3TimerCreateUsb(pVM, pUsbIns, enmClock, pfnCallback, pvUser, fFlags, pszDesc, &pTimer);
     1837    if (RT_SUCCESS(rc))
     1838        *phTimer = (TMTIMERHANDLE)pTimer;
     1839
     1840    LogFlow(("pdmR3UsbHlp_TMTimerCreate: caller='%s'/%d: returns %Rrc *phTimer=%p\n", pUsbIns->pReg->szName, pUsbIns->iInstance, rc, *phTimer));
    18371841    return rc;
     1842}
     1843
     1844
     1845/** Converts timer handle to pointer (will be replace soon.) */
     1846DECLINLINE(PTMTIMERR3) pdmR3UsbHlp_TimerToPtr(PPDMUSBINS pUsbIns, TMTIMERHANDLE hTimer)
     1847{
     1848    PDMUSB_ASSERT_USBINS(pUsbIns);
     1849    RT_NOREF(pUsbIns);
     1850    return (PTMTIMERR3)hTimer;
     1851}
     1852
     1853
     1854/** @interface_method_impl{PDMUSBHLP,pfnTimerFromMicro} */
     1855static DECLCALLBACK(uint64_t) pdmR3UsbHlp_TimerFromMicro(PPDMUSBINS pUsbIns, TMTIMERHANDLE hTimer, uint64_t cMicroSecs)
     1856{
     1857    return TMTimerFromMicro(pdmR3UsbHlp_TimerToPtr(pUsbIns, hTimer), cMicroSecs);
     1858}
     1859
     1860
     1861/** @interface_method_impl{PDMUSBHLP,pfnTimerFromMilli} */
     1862static DECLCALLBACK(uint64_t) pdmR3UsbHlp_TimerFromMilli(PPDMUSBINS pUsbIns, TMTIMERHANDLE hTimer, uint64_t cMilliSecs)
     1863{
     1864    return TMTimerFromMilli(pdmR3UsbHlp_TimerToPtr(pUsbIns, hTimer), cMilliSecs);
     1865}
     1866
     1867
     1868/** @interface_method_impl{PDMUSBHLP,pfnTimerFromNano} */
     1869static DECLCALLBACK(uint64_t) pdmR3UsbHlp_TimerFromNano(PPDMUSBINS pUsbIns, TMTIMERHANDLE hTimer, uint64_t cNanoSecs)
     1870{
     1871    return TMTimerFromNano(pdmR3UsbHlp_TimerToPtr(pUsbIns, hTimer), cNanoSecs);
     1872}
     1873
     1874/** @interface_method_impl{PDMUSBHLP,pfnTimerGet} */
     1875static DECLCALLBACK(uint64_t) pdmR3UsbHlp_TimerGet(PPDMUSBINS pUsbIns, TMTIMERHANDLE hTimer)
     1876{
     1877    return TMTimerGet(pdmR3UsbHlp_TimerToPtr(pUsbIns, hTimer));
     1878}
     1879
     1880
     1881/** @interface_method_impl{PDMUSBHLP,pfnTimerGetFreq} */
     1882static DECLCALLBACK(uint64_t) pdmR3UsbHlp_TimerGetFreq(PPDMUSBINS pUsbIns, TMTIMERHANDLE hTimer)
     1883{
     1884    return TMTimerGetFreq(pdmR3UsbHlp_TimerToPtr(pUsbIns, hTimer));
     1885}
     1886
     1887
     1888/** @interface_method_impl{PDMUSBHLP,pfnTimerGetNano} */
     1889static DECLCALLBACK(uint64_t) pdmR3UsbHlp_TimerGetNano(PPDMUSBINS pUsbIns, TMTIMERHANDLE hTimer)
     1890{
     1891    return TMTimerGetNano(pdmR3UsbHlp_TimerToPtr(pUsbIns, hTimer));
     1892}
     1893
     1894
     1895/** @interface_method_impl{PDMUSBHLP,pfnTimerIsActive} */
     1896static DECLCALLBACK(bool) pdmR3UsbHlp_TimerIsActive(PPDMUSBINS pUsbIns, TMTIMERHANDLE hTimer)
     1897{
     1898    return TMTimerIsActive(pdmR3UsbHlp_TimerToPtr(pUsbIns, hTimer));
     1899}
     1900
     1901
     1902/** @interface_method_impl{PDMUSBHLP,pfnTimerIsLockOwner} */
     1903static DECLCALLBACK(bool) pdmR3UsbHlp_TimerIsLockOwner(PPDMUSBINS pUsbIns, TMTIMERHANDLE hTimer)
     1904{
     1905    return TMTimerIsLockOwner(pdmR3UsbHlp_TimerToPtr(pUsbIns, hTimer));
     1906}
     1907
     1908
     1909/** @interface_method_impl{PDMUSBHLP,pfnTimerLockClock} */
     1910static DECLCALLBACK(int) pdmR3UsbHlp_TimerLockClock(PPDMUSBINS pUsbIns, TMTIMERHANDLE hTimer)
     1911{
     1912    return TMTimerLock(pdmR3UsbHlp_TimerToPtr(pUsbIns, hTimer), VERR_IGNORED);
     1913}
     1914
     1915
     1916/** @interface_method_impl{PDMUSBHLP,pfnTimerLockClock2} */
     1917static DECLCALLBACK(int) pdmR3UsbHlp_TimerLockClock2(PPDMUSBINS pUsbIns, TMTIMERHANDLE hTimer, PPDMCRITSECT pCritSect)
     1918{
     1919    int rc = TMTimerLock(pdmR3UsbHlp_TimerToPtr(pUsbIns, hTimer), VERR_IGNORED);
     1920    if (rc == VINF_SUCCESS)
     1921    {
     1922        rc = PDMCritSectEnter(pCritSect, VERR_IGNORED);
     1923        if (rc == VINF_SUCCESS)
     1924            return rc;
     1925        AssertRC(rc);
     1926        TMTimerUnlock(pdmR3UsbHlp_TimerToPtr(pUsbIns, hTimer));
     1927    }
     1928    else
     1929        AssertRC(rc);
     1930    return rc;
     1931}
     1932
     1933
     1934/** @interface_method_impl{PDMUSBHLP,pfnTimerSet} */
     1935static DECLCALLBACK(int) pdmR3UsbHlp_TimerSet(PPDMUSBINS pUsbIns, TMTIMERHANDLE hTimer, uint64_t uExpire)
     1936{
     1937    return TMTimerSet(pdmR3UsbHlp_TimerToPtr(pUsbIns, hTimer), uExpire);
     1938}
     1939
     1940
     1941/** @interface_method_impl{PDMUSBHLP,pfnTimerSetFrequencyHint} */
     1942static DECLCALLBACK(int) pdmR3UsbHlp_TimerSetFrequencyHint(PPDMUSBINS pUsbIns, TMTIMERHANDLE hTimer, uint32_t uHz)
     1943{
     1944    return TMTimerSetFrequencyHint(pdmR3UsbHlp_TimerToPtr(pUsbIns, hTimer), uHz);
     1945}
     1946
     1947
     1948/** @interface_method_impl{PDMUSBHLP,pfnTimerSetMicro} */
     1949static DECLCALLBACK(int) pdmR3UsbHlp_TimerSetMicro(PPDMUSBINS pUsbIns, TMTIMERHANDLE hTimer, uint64_t cMicrosToNext)
     1950{
     1951    return TMTimerSetMicro(pdmR3UsbHlp_TimerToPtr(pUsbIns, hTimer), cMicrosToNext);
     1952}
     1953
     1954
     1955/** @interface_method_impl{PDMUSBHLP,pfnTimerSetMillies} */
     1956static DECLCALLBACK(int) pdmR3UsbHlp_TimerSetMillies(PPDMUSBINS pUsbIns, TMTIMERHANDLE hTimer, uint64_t cMilliesToNext)
     1957{
     1958    return TMTimerSetMillies(pdmR3UsbHlp_TimerToPtr(pUsbIns, hTimer), cMilliesToNext);
     1959}
     1960
     1961
     1962/** @interface_method_impl{PDMUSBHLP,pfnTimerSetNano} */
     1963static DECLCALLBACK(int) pdmR3UsbHlp_TimerSetNano(PPDMUSBINS pUsbIns, TMTIMERHANDLE hTimer, uint64_t cNanosToNext)
     1964{
     1965    return TMTimerSetNano(pdmR3UsbHlp_TimerToPtr(pUsbIns, hTimer), cNanosToNext);
     1966}
     1967
     1968
     1969/** @interface_method_impl{PDMUSBHLP,pfnTimerSetRelative} */
     1970static DECLCALLBACK(int) pdmR3UsbHlp_TimerSetRelative(PPDMUSBINS pUsbIns, TMTIMERHANDLE hTimer, uint64_t cTicksToNext, uint64_t *pu64Now)
     1971{
     1972    return TMTimerSetRelative(pdmR3UsbHlp_TimerToPtr(pUsbIns, hTimer), cTicksToNext, pu64Now);
     1973}
     1974
     1975
     1976/** @interface_method_impl{PDMUSBHLP,pfnTimerStop} */
     1977static DECLCALLBACK(int) pdmR3UsbHlp_TimerStop(PPDMUSBINS pUsbIns, TMTIMERHANDLE hTimer)
     1978{
     1979    return TMTimerStop(pdmR3UsbHlp_TimerToPtr(pUsbIns, hTimer));
     1980}
     1981
     1982
     1983/** @interface_method_impl{PDMUSBHLP,pfnTimerUnlockClock} */
     1984static DECLCALLBACK(void) pdmR3UsbHlp_TimerUnlockClock(PPDMUSBINS pUsbIns, TMTIMERHANDLE hTimer)
     1985{
     1986    TMTimerUnlock(pdmR3UsbHlp_TimerToPtr(pUsbIns, hTimer));
     1987}
     1988
     1989
     1990/** @interface_method_impl{PDMUSBHLP,pfnTimerUnlockClock2} */
     1991static DECLCALLBACK(void) pdmR3UsbHlp_TimerUnlockClock2(PPDMUSBINS pUsbIns, TMTIMERHANDLE hTimer, PPDMCRITSECT pCritSect)
     1992{
     1993    TMTimerUnlock(pdmR3UsbHlp_TimerToPtr(pUsbIns, hTimer));
     1994    int rc = PDMCritSectLeave(pCritSect);
     1995    AssertRC(rc);
     1996}
     1997
     1998
     1999/** @interface_method_impl{PDMUSBHLP,pfnTimerSetCritSect} */
     2000static DECLCALLBACK(int) pdmR3UsbHlp_TimerSetCritSect(PPDMUSBINS pUsbIns, TMTIMERHANDLE hTimer, PPDMCRITSECT pCritSect)
     2001{
     2002    return TMR3TimerSetCritSect(pdmR3UsbHlp_TimerToPtr(pUsbIns, hTimer), pCritSect);
     2003}
     2004
     2005
     2006/** @interface_method_impl{PDMUSBHLP,pfnTimerSave} */
     2007static DECLCALLBACK(int) pdmR3UsbHlp_TimerSave(PPDMUSBINS pUsbIns, TMTIMERHANDLE hTimer, PSSMHANDLE pSSM)
     2008{
     2009    return TMR3TimerSave(pdmR3UsbHlp_TimerToPtr(pUsbIns, hTimer), pSSM);
     2010}
     2011
     2012
     2013/** @interface_method_impl{PDMUSBHLP,pfnTimerLoad} */
     2014static DECLCALLBACK(int) pdmR3UsbHlp_TimerLoad(PPDMUSBINS pUsbIns, TMTIMERHANDLE hTimer, PSSMHANDLE pSSM)
     2015{
     2016    return TMR3TimerLoad(pdmR3UsbHlp_TimerToPtr(pUsbIns, hTimer), pSSM);
     2017}
     2018
     2019
     2020/** @interface_method_impl{PDMUSBHLP,pfnTimerDestroy} */
     2021static DECLCALLBACK(int) pdmR3UsbHlp_TimerDestroy(PPDMUSBINS pUsbIns, TMTIMERHANDLE hTimer)
     2022{
     2023    return TMR3TimerDestroy(pdmR3UsbHlp_TimerToPtr(pUsbIns, hTimer));
    18382024}
    18392025
     
    19802166    pdmR3UsbHlp_SSMRegister,
    19812167    pdmR3UsbHlp_STAMRegisterV,
    1982     pdmR3UsbHlp_TMTimerCreate,
     2168    pdmR3UsbHlp_TimerCreate,
     2169    pdmR3UsbHlp_TimerFromMicro,
     2170    pdmR3UsbHlp_TimerFromMilli,
     2171    pdmR3UsbHlp_TimerFromNano,
     2172    pdmR3UsbHlp_TimerGet,
     2173    pdmR3UsbHlp_TimerGetFreq,
     2174    pdmR3UsbHlp_TimerGetNano,
     2175    pdmR3UsbHlp_TimerIsActive,
     2176    pdmR3UsbHlp_TimerIsLockOwner,
     2177    pdmR3UsbHlp_TimerLockClock,
     2178    pdmR3UsbHlp_TimerLockClock2,
     2179    pdmR3UsbHlp_TimerSet,
     2180    pdmR3UsbHlp_TimerSetFrequencyHint,
     2181    pdmR3UsbHlp_TimerSetMicro,
     2182    pdmR3UsbHlp_TimerSetMillies,
     2183    pdmR3UsbHlp_TimerSetNano,
     2184    pdmR3UsbHlp_TimerSetRelative,
     2185    pdmR3UsbHlp_TimerStop,
     2186    pdmR3UsbHlp_TimerUnlockClock,
     2187    pdmR3UsbHlp_TimerUnlockClock2,
     2188    pdmR3UsbHlp_TimerSetCritSect,
     2189    pdmR3UsbHlp_TimerSave,
     2190    pdmR3UsbHlp_TimerLoad,
     2191    pdmR3UsbHlp_TimerDestroy,
     2192    TMR3TimerSkip,
    19832193    pdmR3UsbHlp_VMSetErrorV,
    19842194    pdmR3UsbHlp_VMSetRuntimeErrorV,
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette