Changeset 20087 in vbox for trunk/src/VBox/Devices
- Timestamp:
- May 27, 2009 2:31:18 PM (16 years ago)
- svn:sync-xref-src-repo-rev:
- 47833
- Location:
- trunk/src/VBox/Devices
- Files:
-
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Audio/DevSB16.cpp
r18645 r20087 280 280 } 281 281 #else /* VBOX */ 282 static DECLCALLBACK(void) sb16Timer(PPDMDEVINS pDevIns, PTMTIMER pTimer )283 { 284 SB16State *s = PDMINS_2_DATA(pDevIns, SB16State *);282 static DECLCALLBACK(void) sb16Timer(PPDMDEVINS pDevIns, PTMTIMER pTimer, void *pvThis) 283 { 284 SB16State *s = (SB16State *)pvThis; 285 285 s->can_write = 1; 286 286 PDMDevHlpISASetIrq(s->pDevIns, s->irq, 1); … … 1795 1795 * Create timer, register & attach stuff. 1796 1796 */ 1797 rc = PDMDevHlpTMTimerCreate(pDevIns, TMCLOCK_VIRTUAL, sb16Timer, "SB16 timer", &s->pTimer); 1797 rc = PDMDevHlpTMTimerCreate(pDevIns, TMCLOCK_VIRTUAL, sb16Timer, s, 1798 TMTIMER_FLAGS_DEFAULT_CRIT_SECT, "SB16 timer", &s->pTimer); 1798 1799 if (RT_FAILURE(rc)) 1799 1800 AssertMsgFailedReturn(("pfnTMTimerCreate -> %Rrc\n", rc), rc); -
trunk/src/VBox/Devices/Graphics/DevVGA.cpp
r19844 r20087 5071 5071 5072 5072 5073 static DECLCALLBACK(void) vgaTimerRefresh(PPDMDEVINS pDevIns, PTMTIMER pTimer )5074 { 5075 PVGASTATE pThis = PDMINS_2_DATA(pDevIns, PVGASTATE);5073 static DECLCALLBACK(void) vgaTimerRefresh(PPDMDEVINS pDevIns, PTMTIMER pTimer, void *pvUser) 5074 { 5075 PVGASTATE pThis = (PVGASTATE)pvUser; 5076 5076 5077 5077 if (pThis->pDrv) … … 5783 5783 * Create the refresh timer. 5784 5784 */ 5785 rc = PDMDevHlpTMTimerCreate(pDevIns, TMCLOCK_REAL, vgaTimerRefresh, "VGA Refresh Timer", &pThis->RefreshTimer); 5785 rc = PDMDevHlpTMTimerCreate(pDevIns, TMCLOCK_REAL, vgaTimerRefresh, 5786 pThis, TMTIMER_FLAGS_DEFAULT_CRIT_SECT, /** @todo This needs to be fixed! We cannot take the I/O lock at this point! */ 5787 "VGA Refresh Timer", &pThis->RefreshTimer); 5786 5788 if (RT_FAILURE(rc)) 5787 5789 return rc; -
trunk/src/VBox/Devices/Network/DevE1000.cpp
r19840 r20087 2466 2466 * @param pDevIns Pointer to device instance structure. 2467 2467 * @param pTimer Pointer to the timer. 2468 * @thread EMT 2469 */ 2470 static DECLCALLBACK(void) e1kTxIntDelayTimer(PPDMDEVINS pDevIns, PTMTIMER pTimer) 2471 { 2472 E1KSTATE *pState = PDMINS_2_DATA(pDevIns, E1KSTATE *); 2468 * @param pvUser NULL. 2469 * @thread EMT 2470 */ 2471 static DECLCALLBACK(void) e1kTxIntDelayTimer(PPDMDEVINS pDevIns, PTMTIMER pTimer, void *pvUser) 2472 { 2473 E1KSTATE *pState = (E1KSTATE *)pvUser; 2473 2474 2474 2475 if (RT_LIKELY(e1kMutexAcquire(pState, VERR_SEM_BUSY, RT_SRC_POS) == VINF_SUCCESS)) … … 2491 2492 * @param pDevIns Pointer to device instance structure. 2492 2493 * @param pTimer Pointer to the timer. 2493 * @thread EMT 2494 */ 2495 static DECLCALLBACK(void) e1kTxAbsDelayTimer(PPDMDEVINS pDevIns, PTMTIMER pTimer) 2496 { 2497 E1KSTATE *pState = PDMINS_2_DATA(pDevIns, E1KSTATE *); 2494 * @param pvUser NULL. 2495 * @thread EMT 2496 */ 2497 static DECLCALLBACK(void) e1kTxAbsDelayTimer(PPDMDEVINS pDevIns, PTMTIMER pTimer, void *pvUser) 2498 { 2499 E1KSTATE *pState = (E1KSTATE *)pvUser; 2498 2500 2499 2501 if (RT_LIKELY(e1kMutexAcquire(pState, VERR_SEM_BUSY, RT_SRC_POS) == VINF_SUCCESS)) … … 2516 2518 * @param pDevIns Pointer to device instance structure. 2517 2519 * @param pTimer Pointer to the timer. 2518 * @thread EMT 2519 */ 2520 static DECLCALLBACK(void) e1kRxIntDelayTimer(PPDMDEVINS pDevIns, PTMTIMER pTimer) 2521 { 2522 E1KSTATE *pState = PDMINS_2_DATA(pDevIns, E1KSTATE *); 2520 * @param pvUser NULL. 2521 * @thread EMT 2522 */ 2523 static DECLCALLBACK(void) e1kRxIntDelayTimer(PPDMDEVINS pDevIns, PTMTIMER pTimer, void *pvUser) 2524 { 2525 E1KSTATE *pState = (E1KSTATE *)pvUser; 2523 2526 2524 2527 if (RT_LIKELY(e1kMutexAcquire(pState, VERR_SEM_BUSY, RT_SRC_POS) == VINF_SUCCESS)) … … 2539 2542 * @param pDevIns Pointer to device instance structure. 2540 2543 * @param pTimer Pointer to the timer. 2541 * @thread EMT 2542 */ 2543 static DECLCALLBACK(void) e1kRxAbsDelayTimer(PPDMDEVINS pDevIns, PTMTIMER pTimer) 2544 { 2545 E1KSTATE *pState = PDMINS_2_DATA(pDevIns, E1KSTATE *); 2544 * @param pvUser NULL. 2545 * @thread EMT 2546 */ 2547 static DECLCALLBACK(void) e1kRxAbsDelayTimer(PPDMDEVINS pDevIns, PTMTIMER pTimer, void *pvUser) 2548 { 2549 E1KSTATE *pState = (E1KSTATE *)pvUser; 2546 2550 2547 2551 if (RT_LIKELY(e1kMutexAcquire(pState, VERR_SEM_BUSY, RT_SRC_POS) == VINF_SUCCESS)) … … 2561 2565 * @param pDevIns Pointer to device instance structure. 2562 2566 * @param pTimer Pointer to the timer. 2563 * @thread EMT 2564 */ 2565 static DECLCALLBACK(void) e1kLateIntTimer(PPDMDEVINS pDevIns, PTMTIMER pTimer) 2566 { 2567 E1KSTATE *pState = PDMINS_2_DATA(pDevIns, E1KSTATE *); 2567 * @param pvUser NULL. 2568 * @thread EMT 2569 */ 2570 static DECLCALLBACK(void) e1kLateIntTimer(PPDMDEVINS pDevIns, PTMTIMER pTimer, void *pvUser) 2571 { 2572 E1KSTATE *pState = (E1KSTATE *)pvUser; 2568 2573 2569 2574 STAM_PROFILE_ADV_START(&pState->StatLateIntTimer, a); … … 2587 2592 * @param pDevIns Pointer to device instance structure. 2588 2593 * @param pTimer Pointer to the timer. 2589 * @thread EMT 2590 */ 2591 static DECLCALLBACK(void) e1kLinkUpTimer(PPDMDEVINS pDevIns, PTMTIMER pTimer) 2592 { 2593 E1KSTATE *pState = PDMINS_2_DATA(pDevIns, E1KSTATE *); 2594 * @param pvUser NULL. 2595 * @thread EMT 2596 */ 2597 static DECLCALLBACK(void) e1kLinkUpTimer(PPDMDEVINS pDevIns, PTMTIMER pTimer, void *pvUser) 2598 { 2599 E1KSTATE *pState = (E1KSTATE *)pvUser; 2594 2600 2595 2601 if (RT_LIKELY(e1kMutexAcquire(pState, VERR_SEM_BUSY, RT_SRC_POS) == VINF_SUCCESS)) … … 4812 4818 #ifdef E1K_USE_TX_TIMERS 4813 4819 /* Create Transmit Interrupt Delay Timer */ 4814 rc = PDMDevHlpTMTimerCreate(pDevIns, TMCLOCK_VIRTUAL, e1kTxIntDelayTimer, 4820 rc = PDMDevHlpTMTimerCreate(pDevIns, TMCLOCK_VIRTUAL, e1kTxIntDelayTimer, pState, 4821 TMTIMER_FLAGS_DEFAULT_CRIT_SECT, /** @todo check locking here. */ 4815 4822 "E1000 Transmit Interrupt Delay Timer", &pState->pTIDTimerR3); 4816 4823 if (RT_FAILURE(rc)) … … 4821 4828 # ifndef E1K_NO_TAD 4822 4829 /* Create Transmit Absolute Delay Timer */ 4823 rc = PDMDevHlpTMTimerCreate(pDevIns, TMCLOCK_VIRTUAL, e1kTxAbsDelayTimer, 4830 rc = PDMDevHlpTMTimerCreate(pDevIns, TMCLOCK_VIRTUAL, e1kTxAbsDelayTimer, pState, 4831 TMTIMER_FLAGS_DEFAULT_CRIT_SECT, /** @todo check locking here. */ 4824 4832 "E1000 Transmit Absolute Delay Timer", &pState->pTADTimerR3); 4825 4833 if (RT_FAILURE(rc)) … … 4832 4840 #ifdef E1K_USE_RX_TIMERS 4833 4841 /* Create Receive Interrupt Delay Timer */ 4834 rc = PDMDevHlpTMTimerCreate(pDevIns, TMCLOCK_VIRTUAL, e1kRxIntDelayTimer, 4842 rc = PDMDevHlpTMTimerCreate(pDevIns, TMCLOCK_VIRTUAL, e1kRxIntDelayTimer, pState, 4843 TMTIMER_FLAGS_DEFAULT_CRIT_SECT, /** @todo check locking here. */ 4835 4844 "E1000 Receive Interrupt Delay Timer", &pState->pRIDTimerR3); 4836 4845 if (RT_FAILURE(rc)) … … 4840 4849 4841 4850 /* Create Receive Absolute Delay Timer */ 4842 rc = PDMDevHlpTMTimerCreate(pDevIns, TMCLOCK_VIRTUAL, e1kRxAbsDelayTimer, 4851 rc = PDMDevHlpTMTimerCreate(pDevIns, TMCLOCK_VIRTUAL, e1kRxAbsDelayTimer, pState, 4852 TMTIMER_FLAGS_DEFAULT_CRIT_SECT, /** @todo check locking here. */ 4843 4853 "E1000 Receive Absolute Delay Timer", &pState->pRADTimerR3); 4844 4854 if (RT_FAILURE(rc)) … … 4849 4859 4850 4860 /* Create Late Interrupt Timer */ 4851 rc = PDMDevHlpTMTimerCreate(pDevIns, TMCLOCK_VIRTUAL, e1kLateIntTimer, 4861 rc = PDMDevHlpTMTimerCreate(pDevIns, TMCLOCK_VIRTUAL, e1kLateIntTimer, pState, 4862 TMTIMER_FLAGS_DEFAULT_CRIT_SECT, /** @todo check locking here. */ 4852 4863 "E1000 Late Interrupt Timer", &pState->pIntTimerR3); 4853 4864 if (RT_FAILURE(rc)) … … 4857 4868 4858 4869 /* Create Link Up Timer */ 4859 rc = PDMDevHlpTMTimerCreate(pDevIns, TMCLOCK_VIRTUAL, e1kLinkUpTimer, 4870 rc = PDMDevHlpTMTimerCreate(pDevIns, TMCLOCK_VIRTUAL, e1kLinkUpTimer, pState, 4871 TMTIMER_FLAGS_DEFAULT_CRIT_SECT, /** @todo check locking here. */ 4860 4872 "E1000 Link Up Timer", &pState->pLUTimer); 4861 4873 if (RT_FAILURE(rc)) -
trunk/src/VBox/Devices/Network/DevINIP.cpp
r17802 r20087 146 146 * @param pTimer Pointer to timer. 147 147 */ 148 static DECLCALLBACK(void) devINIPARPTimer(PPDMDEVINS pDevIns, PTMTIMER pTimer )149 { 150 PDEVINTNETIP pThis = PDMINS_2_DATA(pDevIns, PDEVINTNETIP);148 static DECLCALLBACK(void) devINIPARPTimer(PPDMDEVINS pDevIns, PTMTIMER pTimer, void *pvUser) 149 { 150 PDEVINTNETIP pThis = (PDEVINTNETIP)pvUser; 151 151 LogFlow(("%s: pDevIns=%p pTimer=%p\n", __FUNCTION__, pDevIns, pTimer)); 152 152 lwip_etharp_tmr(); … … 161 161 * @param pTimer Pointer to timer. 162 162 */ 163 static DECLCALLBACK(void) devINIPTCPFastTimer(PPDMDEVINS pDevIns, PTMTIMER pTimer )164 { 165 PDEVINTNETIP pThis = PDMINS_2_DATA(pDevIns, PDEVINTNETIP);163 static DECLCALLBACK(void) devINIPTCPFastTimer(PPDMDEVINS pDevIns, PTMTIMER pTimer, void *pvUser) 164 { 165 PDEVINTNETIP pThis = (PDEVINTNETIP)pvUser; 166 166 LogFlow(("%s: pDevIns=%p pTimer=%p\n", __FUNCTION__, pDevIns, pTimer)); 167 167 lwip_tcp_fasttmr(); … … 176 176 * @param pTimer Pointer to timer. 177 177 */ 178 static DECLCALLBACK(void) devINIPTCPSlowTimer(PPDMDEVINS pDevIns, PTMTIMER pTimer )179 { 180 PDEVINTNETIP pThis = PDMINS_2_DATA(pDevIns, PDEVINTNETIP);178 static DECLCALLBACK(void) devINIPTCPSlowTimer(PPDMDEVINS pDevIns, PTMTIMER pTimer, void *pvUser) 179 { 180 PDEVINTNETIP pThis = (PDEVINTNETIP)pvUser; 181 181 LogFlow(("%s: pDevIns=%p pTimer=%p\n", __FUNCTION__, pDevIns, pTimer)); 182 182 lwip_tcp_slowtmr(); … … 590 590 lwip_pbuf_init(); 591 591 lwip_netif_init(); 592 rc = PDMDevHlpTMTimerCreate(pDevIns, TMCLOCK_VIRTUAL, devINIPARPTimer, "lwIP ARP", &pThis->ARPTimer); 593 if (RT_FAILURE(rc)) 594 goto out; 595 rc = PDMDevHlpTMTimerCreate(pDevIns, TMCLOCK_VIRTUAL, devINIPTCPFastTimer, "lwIP fast TCP", &pThis->TCPFastTimer); 592 rc = PDMDevHlpTMTimerCreate(pDevIns, TMCLOCK_VIRTUAL, devINIPARPTimer, pThis, 593 TMTIMER_FLAGS_NO_CRIT_SECT, "lwIP ARP", &pThis->ARPTimer); 594 if (RT_FAILURE(rc)) 595 goto out; 596 rc = PDMDevHlpTMTimerCreate(pDevIns, TMCLOCK_VIRTUAL, devINIPTCPFastTimer, pThis, 597 TMTIMER_FLAGS_NO_CRIT_SECT, "lwIP fast TCP", &pThis->TCPFastTimer); 596 598 if (RT_FAILURE(rc)) 597 599 goto out; 598 600 TMTimerSetMillies(pThis->TCPFastTimer, TCP_FAST_INTERVAL); 599 rc = PDMDevHlpTMTimerCreate(pDevIns, TMCLOCK_VIRTUAL, devINIPTCPSlowTimer, "lwIP slow TCP", &pThis->TCPSlowTimer); 601 rc = PDMDevHlpTMTimerCreate(pDevIns, TMCLOCK_VIRTUAL, devINIPTCPSlowTimer, pThis, 602 TMTIMER_FLAGS_NO_CRIT_SECT, "lwIP slow TCP", &pThis->TCPSlowTimer); 600 603 if (RT_FAILURE(rc)) 601 604 goto out; -
trunk/src/VBox/Devices/Network/DevPCNet.cpp
r19113 r20087 3802 3802 * @thread EMT 3803 3803 */ 3804 static DECLCALLBACK(void) pcnetTimer(PPDMDEVINS pDevIns, PTMTIMER pTimer) 3805 { 3806 PCNetState *pThis = PDMINS_2_DATA(pDevIns, PCNetState *); 3807 int rc; 3808 3804 static DECLCALLBACK(void) pcnetTimer(PPDMDEVINS pDevIns, PTMTIMER pTimer, void *pvUser) 3805 { 3806 PCNetState *pThis = (PCNetState *)pvUser; 3809 3807 STAM_PROFILE_ADV_START(&pThis->StatTimer, a); 3810 rc = PDMCritSectEnter(&pThis->CritSect, VERR_SEM_BUSY);3811 AssertReleaseRC(rc);3812 3813 3808 pcnetPollTimer(pThis); 3814 3815 PDMCritSectLeave(&pThis->CritSect);3816 3809 STAM_PROFILE_ADV_STOP(&pThis->StatTimer, a); 3817 3810 } … … 3825 3818 * @thread EMT 3826 3819 */ 3827 static DECLCALLBACK(void) pcnetTimerSoftInt(PPDMDEVINS pDevIns, PTMTIMER pTimer) 3828 { 3829 PCNetState *pThis = PDMINS_2_DATA(pDevIns, PCNetState *); 3830 3820 static DECLCALLBACK(void) pcnetTimerSoftInt(PPDMDEVINS pDevIns, PTMTIMER pTimer, void *pvUser) 3821 { 3822 PCNetState *pThis = (PCNetState *)pvUser; 3823 3824 /** @todo why aren't we taking any critsect here?!? */ 3831 3825 pThis->aCSR[7] |= 0x0800; /* STINT */ 3832 3826 pcnetUpdateIrq(pThis); … … 3845 3839 * @param pTimer The timer handle. 3846 3840 */ 3847 static DECLCALLBACK(void) pcnetTimerRestore(PPDMDEVINS pDevIns, PTMTIMER pTimer )3841 static DECLCALLBACK(void) pcnetTimerRestore(PPDMDEVINS pDevIns, PTMTIMER pTimer, void *pvUser) 3848 3842 { 3849 3843 PCNetState *pThis = PDMINS_2_DATA(pDevIns, PCNetState *); 3850 int rc = PDMCritSectEnter(&pThis->CritSect, VERR_SEM_BUSY); 3851 AssertReleaseRC(rc); 3852 3853 rc = VERR_GENERAL_FAILURE; 3844 3845 int rc = VERR_GENERAL_FAILURE; 3854 3846 if (pThis->cLinkDownReported <= PCNET_MAX_LINKDOWN_REPORTED) 3855 3847 rc = TMTimerSetMillies(pThis->pTimerRestore, 1500); … … 3870 3862 Log(("#%d pcnetTimerRestore: cLinkDownReported=%d, wait another 1500ms...\n", 3871 3863 pDevIns->iInstance, pThis->cLinkDownReported)); 3872 3873 PDMCritSectLeave(&pThis->CritSect);3874 3864 } 3875 3865 … … 4678 4668 pThis->cLinkDownReported = 0x10000; 4679 4669 TMTimerStop(pThis->pTimerRestore); 4680 pcnetTimerRestore(pDevIns, pThis->pTimerRestore );4670 pcnetTimerRestore(pDevIns, pThis->pTimerRestore, pThis); 4681 4671 } 4682 4672 if (pThis->pSharedMMIOR3) … … 4919 4909 } 4920 4910 4911 /* 4912 * Initialize critical section. 4913 * This must be done before register the critsect with the timer code, and also before 4914 * attaching drivers or anything else that may call us back. 4915 */ 4916 char szName[24]; 4917 RTStrPrintf(szName, sizeof(szName), "PCNet#%d", iInstance); 4918 rc = PDMDevHlpCritSectInit(pDevIns, &pThis->CritSect, szName); 4919 if (RT_FAILURE(rc)) 4920 return rc; 4921 4922 rc = RTSemEventCreate(&pThis->hEventOutOfRxSpace); 4923 AssertRC(rc); 4924 4921 4925 #ifdef PCNET_NO_POLLING 4922 4926 /* … … 4928 4932 AssertLogRelMsgRCReturn(rc, ("PDMR3LdrGetSymbolRCLazy(EMInterpretInstruction) -> %Rrc\n", rc), rc); 4929 4933 #else 4930 rc = PDMDevHlpTMTimerCreate(pDevIns, TMCLOCK_VIRTUAL, pcnetTimer, 4931 "PCNet Poll Timer", &pThis->pTimerPollR3);4934 rc = PDMDevHlpTMTimerCreate(pDevIns, TMCLOCK_VIRTUAL, pcnetTimer, pThis, 4935 TMTIMER_FLAGS_NO_CRIT_SECT, "PCNet Poll Timer", &pThis->pTimerPollR3); 4932 4936 if (RT_FAILURE(rc)) 4933 4937 return rc; 4934 4938 pThis->pTimerPollR0 = TMTimerR0Ptr(pThis->pTimerPollR3); 4935 4939 pThis->pTimerPollRC = TMTimerRCPtr(pThis->pTimerPollR3); 4940 TMR3TimerSetCritSect(pThis->pTimerPollR3, &pThis->CritSect); 4936 4941 #endif 4937 4942 if (pThis->fAm79C973) 4938 4943 { 4939 4944 /* Software Interrupt timer */ 4940 rc = PDMDevHlpTMTimerCreate(pDevIns, TMCLOCK_VIRTUAL, pcnetTimerSoftInt, 4941 "PCNet SoftInt Timer", &pThis->pTimerSoftIntR3);4945 rc = PDMDevHlpTMTimerCreate(pDevIns, TMCLOCK_VIRTUAL, pcnetTimerSoftInt, pThis, /** @todo r=bird: the locking here looks bogus now with SMP... */ 4946 TMTIMER_FLAGS_DEFAULT_CRIT_SECT, "PCNet SoftInt Timer", &pThis->pTimerSoftIntR3); 4942 4947 if (RT_FAILURE(rc)) 4943 4948 return rc; … … 4945 4950 pThis->pTimerSoftIntRC = TMTimerRCPtr(pThis->pTimerSoftIntR3); 4946 4951 } 4947 rc = PDMDevHlpTMTimerCreate(pDevIns, TMCLOCK_VIRTUAL, pcnetTimerRestore, 4948 "PCNet Restore Timer", &pThis->pTimerRestore);4952 rc = PDMDevHlpTMTimerCreate(pDevIns, TMCLOCK_VIRTUAL, pcnetTimerRestore, pThis, 4953 TMTIMER_FLAGS_NO_CRIT_SECT, "PCNet Restore Timer", &pThis->pTimerRestore); 4949 4954 if (RT_FAILURE(rc)) 4950 4955 return rc; 4956 TMR3TimerSetCritSect(pThis->pTimerRestore, &pThis->CritSect); 4951 4957 4952 4958 rc = PDMDevHlpSSMRegister(pDevIns, pDevIns->pDevReg->szDeviceName, iInstance, … … 4956 4962 if (RT_FAILURE(rc)) 4957 4963 return rc; 4958 4959 /*4960 * Initialize critical section.4961 * This must of course be done before attaching drivers or anything else which can call us back.4962 */4963 char szName[24];4964 RTStrPrintf(szName, sizeof(szName), "PCNet#%d", iInstance);4965 rc = PDMDevHlpCritSectInit(pDevIns, &pThis->CritSect, szName);4966 if (RT_FAILURE(rc))4967 return rc;4968 4969 rc = RTSemEventCreate(&pThis->hEventOutOfRxSpace);4970 AssertRC(rc);4971 4964 4972 4965 /* -
trunk/src/VBox/Devices/PC/DevACPI.cpp
r19646 r20087 1068 1068 } 1069 1069 1070 static DECLCALLBACK(void) acpiTimer(PPDMDEVINS pDevIns, PTMTIMER pTimer )1071 { 1072 ACPIState *s = PDMINS_2_DATA(pDevIns, ACPIState *);1070 static DECLCALLBACK(void) acpiTimer(PPDMDEVINS pDevIns, PTMTIMER pTimer, void *pvUser) 1071 { 1072 ACPIState *s = (ACPIState *)pvUser; 1073 1073 1074 1074 Log(("acpi: pm timer sts %#x (%d), en %#x (%d)\n", … … 1320 1320 : 0; 1321 1321 break; 1322 1322 1323 1323 case SYSTEM_INFO_INDEX_CPU0_STATUS: 1324 1324 case SYSTEM_INFO_INDEX_CPU1_STATUS: … … 1933 1933 } 1934 1934 1935 rc = PDMDevHlpTMTimerCreate(pDevIns, TMCLOCK_VIRTUAL_SYNC, acpiTimer, "ACPI Timer", &s->tsR3); 1935 rc = PDMDevHlpTMTimerCreate(pDevIns, TMCLOCK_VIRTUAL_SYNC, acpiTimer, dev, 1936 TMTIMER_FLAGS_DEFAULT_CRIT_SECT, "ACPI Timer", &s->tsR3); 1936 1937 if (RT_FAILURE(rc)) 1937 1938 { -
trunk/src/VBox/Devices/PC/DevAPIC.cpp
r20056 r20087 1296 1296 1297 1297 #ifdef IN_RING3 1298 # ifndef VBOX1298 # ifndef VBOX 1299 1299 static void apic_timer(void *opaque) 1300 1300 { 1301 1301 APICState *s = opaque; 1302 # else /* VBOX */1303 static DECLCALLBACK(void) apicTimer(PPDMDEVINS pDevIns, PTMTIMER pTimer )1302 # else /* VBOX */ 1303 static DECLCALLBACK(void) apicTimer(PPDMDEVINS pDevIns, PTMTIMER pTimer, void *pvUser) 1304 1304 { 1305 1305 APICDeviceInfo *dev = PDMINS_2_DATA(pDevIns, APICDeviceInfo *); 1306 APICState *s = getLapic(dev); 1307 if (s->pTimerR3 != pTimer) 1308 { 1309 for (uint32_t iCpu = 0; iCpu < dev->cCpus; iCpu++) 1310 { 1311 s = getLapicById(dev, iCpu); 1312 if (s->pTimerR3 == pTimer) 1313 break; 1314 } 1315 Assert(s->pTimerR3 == pTimer); 1316 } 1306 APICState *s = (APICState *)pvUser; 1307 Assert(s->pTimerR3 == pTimer); 1317 1308 1318 1309 APIC_LOCK_VOID(dev, VERR_INTERNAL_ERROR); 1319 # endif /* VBOX */1310 # endif /* VBOX */ 1320 1311 1321 1312 if (!(s->lvt[APIC_LVT_TIMER] & APIC_LVT_MASKED)) { … … 1325 1316 apic_timer_update(dev, s, s->next_time); 1326 1317 1327 # ifdef VBOX1318 # ifdef VBOX 1328 1319 APIC_UNLOCK(dev); 1329 # endif1320 # endif 1330 1321 } 1331 1322 #endif /* IN_RING3 */ … … 2407 2398 for (i = 0, apic = LAPIC_BASE(pThis); i < cCpus; i++) 2408 2399 { 2409 rc = PDMDevHlpTMTimerCreate(pDevIns, TMCLOCK_VIRTUAL_SYNC, apicTimer, 2410 "APIC Timer", &apic->pTimerR3);2400 rc = PDMDevHlpTMTimerCreate(pDevIns, TMCLOCK_VIRTUAL_SYNC, apicTimer, apic, 2401 TMTIMER_FLAGS_NO_CRIT_SECT, "APIC Timer", &apic->pTimerR3); 2411 2402 if (RT_FAILURE(rc)) 2412 2403 return rc; 2413 2404 apic->pTimerR0 = TMTimerR0Ptr(apic->pTimerR3); 2414 2405 apic->pTimerRC = TMTimerRCPtr(apic->pTimerR3); 2406 /// @todo TMTimerSetCritSect(apic->pTimerR3, pThis->pApicHlpR3->pfnGetCritSect(..)); 2415 2407 apic++; 2416 2408 } -
trunk/src/VBox/Devices/PC/DevPit-i8254.cpp
r20049 r20087 809 809 * @param pDevIns Device instance of the device which registered the timer. 810 810 * @param pTimer The timer handle. 811 * /812 static DECLCALLBACK(void) pitTimer(PPDMDEVINS pDevIns, PTMTIMER pTimer) 813 { 814 PITState *pThis = PDMINS_2_DATA(pDevIns, PITState *); 815 PITChannelState *s = &pThis->channels[0];811 * @param pvUser Pointer to the PIT channel state. 812 */ 813 static DECLCALLBACK(void) pitTimer(PPDMDEVINS pDevIns, PTMTIMER pTimer, void *pvUser) 814 { 815 PITChannelState *s = (PITChannelState *)pvUser; 816 816 STAM_PROFILE_ADV_START(&s->CTX_SUFF(pPit)->StatPITHandler, a); 817 817 Log(("pitTimer\n")); … … 994 994 * Create timer, register I/O Ports and save state. 995 995 */ 996 rc = PDMDevHlpTMTimerCreate(pDevIns, TMCLOCK_VIRTUAL_SYNC, pitTimer, "i8254 Programmable Interval Timer", 996 rc = PDMDevHlpTMTimerCreate(pDevIns, TMCLOCK_VIRTUAL_SYNC, pitTimer, &pThis->channels[0], 997 TMTIMER_FLAGS_DEFAULT_CRIT_SECT, "i8254 Programmable Interval Timer", 997 998 &pThis->channels[0].pTimerR3); 998 999 if (RT_FAILURE(rc)) -
trunk/src/VBox/Devices/PC/DevRTC.cpp
r19706 r20087 73 73 PDMBOTHCBDECL(int) rtcIOPortRead(PPDMDEVINS pDevIns, void *pvUser, RTIOPORT Port, uint32_t *pu32, unsigned cb); 74 74 PDMBOTHCBDECL(int) rtcIOPortWrite(PPDMDEVINS pDevIns, void *pvUser, RTIOPORT Port, uint32_t u32, unsigned cb); 75 PDMBOTHCBDECL(void) rtcTimerPeriodic(PPDMDEVINS pDevIns, PTMTIMER pTimer );76 PDMBOTHCBDECL(void) rtcTimerSecond(PPDMDEVINS pDevIns, PTMTIMER pTimer );77 PDMBOTHCBDECL(void) rtcTimerSecond2(PPDMDEVINS pDevIns, PTMTIMER pTimer );75 PDMBOTHCBDECL(void) rtcTimerPeriodic(PPDMDEVINS pDevIns, PTMTIMER pTimer, void *pvUser); 76 PDMBOTHCBDECL(void) rtcTimerSecond(PPDMDEVINS pDevIns, PTMTIMER pTimer, void *pvUser); 77 PDMBOTHCBDECL(void) rtcTimerSecond2(PPDMDEVINS pDevIns, PTMTIMER pTimer, void *pvUser); 78 78 __END_DECLS 79 79 #endif /* !VBOX_DEVICE_STRUCT_TESTCASE */ … … 553 553 * @param pDevIns Device instance of the device which registered the timer. 554 554 * @param pTimer The timer handle. 555 */ 556 PDMBOTHCBDECL(void) rtcTimerPeriodic(PPDMDEVINS pDevIns, PTMTIMER pTimer) 557 { 558 rtc_periodic_timer(PDMINS_2_DATA(pDevIns, RTCState *)); 555 * @param pvUser Pointer to the RTC state. 556 */ 557 PDMBOTHCBDECL(void) rtcTimerPeriodic(PPDMDEVINS pDevIns, PTMTIMER pTimer, void *pvUser) 558 { 559 rtc_periodic_timer((RTCState *)pvUser); 559 560 } 560 561 … … 565 566 * @param pDevIns Device instance of the device which registered the timer. 566 567 * @param pTimer The timer handle. 567 */ 568 PDMBOTHCBDECL(void) rtcTimerSecond(PPDMDEVINS pDevIns, PTMTIMER pTimer) 569 { 570 rtc_update_second(PDMINS_2_DATA(pDevIns, RTCState *)); 568 * @param pvUser Pointer to the RTC state. 569 */ 570 PDMBOTHCBDECL(void) rtcTimerSecond(PPDMDEVINS pDevIns, PTMTIMER pTimer, void *pvUser) 571 { 572 rtc_update_second((RTCState *)pvUser); 571 573 } 572 574 … … 577 579 * @param pDevIns Device instance of the device which registered the timer. 578 580 * @param pTimer The timer handle. 579 */ 580 PDMBOTHCBDECL(void) rtcTimerSecond2(PPDMDEVINS pDevIns, PTMTIMER pTimer) 581 { 582 rtc_update_second2(PDMINS_2_DATA(pDevIns, RTCState *)); 581 * @param pvUser Pointer to the RTC state. 582 */ 583 PDMBOTHCBDECL(void) rtcTimerSecond2(PPDMDEVINS pDevIns, PTMTIMER pTimer, void *pvUser) 584 { 585 rtc_update_second2((RTCState *)pvUser); 583 586 } 584 587 … … 869 872 * Create timers, arm them, register I/O Ports and save state. 870 873 */ 871 rc = PDMDevHlpTMTimerCreate(pDevIns, TMCLOCK_VIRTUAL_SYNC, rtcTimerPeriodic, "MC146818 RTC/CMOS - Periodic", &pThis->pPeriodicTimerR3); 874 rc = PDMDevHlpTMTimerCreate(pDevIns, TMCLOCK_VIRTUAL_SYNC, rtcTimerPeriodic, pThis, 875 TMTIMER_FLAGS_DEFAULT_CRIT_SECT, "MC146818 RTC/CMOS - Periodic", 876 &pThis->pPeriodicTimerR3); 872 877 if (RT_FAILURE(rc)) 873 878 return rc; … … 875 880 pThis->pPeriodicTimerRC = TMTimerRCPtr(pThis->pPeriodicTimerR3); 876 881 877 rc = PDMDevHlpTMTimerCreate(pDevIns, TMCLOCK_VIRTUAL_SYNC, rtcTimerSecond, "MC146818 RTC/CMOS - Second", &pThis->pSecondTimerR3); 882 rc = PDMDevHlpTMTimerCreate(pDevIns, TMCLOCK_VIRTUAL_SYNC, rtcTimerSecond, pThis, 883 TMTIMER_FLAGS_DEFAULT_CRIT_SECT, "MC146818 RTC/CMOS - Second", 884 &pThis->pSecondTimerR3); 878 885 if (RT_FAILURE(rc)) 879 886 return rc; … … 881 888 pThis->pSecondTimerRC = TMTimerRCPtr(pThis->pSecondTimerR3); 882 889 883 rc = PDMDevHlpTMTimerCreate(pDevIns, TMCLOCK_VIRTUAL_SYNC, rtcTimerSecond2, "MC146818 RTC/CMOS - Second2", &pThis->pSecondTimer2R3); 890 rc = PDMDevHlpTMTimerCreate(pDevIns, TMCLOCK_VIRTUAL_SYNC, rtcTimerSecond2, pThis, 891 TMTIMER_FLAGS_DEFAULT_CRIT_SECT, "MC146818 RTC/CMOS - Second2", 892 &pThis->pSecondTimer2R3); 884 893 if (RT_FAILURE(rc)) 885 894 return rc; -
trunk/src/VBox/Devices/Storage/fdc.c
r13080 r20087 2343 2343 2344 2344 #ifdef VBOX 2345 static DECLCALLBACK(void) fdc_timer (PPDMDEVINS pDevIns, PTMTIMER pTimer )2346 { 2347 fdctrl_t *fdctrl = PDMINS_2_DATA (pDevIns, fdctrl_t *);2345 static DECLCALLBACK(void) fdc_timer (PPDMDEVINS pDevIns, PTMTIMER pTimer, void *pvUser) 2346 { 2347 fdctrl_t *fdctrl = (fdctrl_t *)pvUser; 2348 2348 fdctrl_result_timer (fdctrl); 2349 2349 } … … 2849 2849 * Create the FDC timer. 2850 2850 */ 2851 rc = PDMDevHlpTMTimerCreate(pDevIns, TMCLOCK_VIRTUAL, fdc_timer, "FDC Timer", &fdctrl->result_timer); 2851 rc = PDMDevHlpTMTimerCreate(pDevIns, TMCLOCK_VIRTUAL, fdc_timer, fdctrl, 2852 TMTIMER_FLAGS_DEFAULT_CRIT_SECT, "FDC Timer", &fdctrl->result_timer); 2852 2853 if (RT_FAILURE (rc)) 2853 2854 return rc;
Note:
See TracChangeset
for help on using the changeset viewer.