VirtualBox

Changeset 20087 in vbox for trunk/include/VBox


Ignore:
Timestamp:
May 27, 2009 2:31:18 PM (16 years ago)
Author:
vboxsync
Message:

TM,*: Proper timer callback locking and pvUser for devices.

Location:
trunk/include/VBox
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/VBox/iom.h

    r19993 r20087  
    269269
    270270VMMR3DECL(void) IOMR3ReleaseOwnedLocks(PVM pVM);
     271VMMR3DECL(PPDMCRITSECT) IOMR3GetCritSect(PVM pVM);
    271272
    272273/** @} */
  • trunk/include/VBox/pdmcritsect.h

    r20008 r20087  
    5454#endif
    5555} PDMCRITSECT;
    56 /** Pointer to a PDM critical section. */
    57 typedef PDMCRITSECT *PPDMCRITSECT;
    58 /** Pointer to a const PDM critical section. */
    59 typedef const PDMCRITSECT *PCPDMCRITSECT;
    6056
    6157VMMR3DECL(int)      PDMR3CritSectInit(PVM pVM, PPDMCRITSECT pCritSect, const char *pszName);
     
    6965VMMDECL(bool)       PDMCritSectIsInitialized(PCPDMCRITSECT pCritSect);
    7066VMMDECL(uint32_t)   PDMCritSectGetRecursion(PCPDMCRITSECT pCritSect);
     67VMMR3DECL(const char *) PDMR3CritSectName(PCPDMCRITSECT pCritSect);
    7168VMMR3DECL(int)      PDMR3CritSectScheduleExitEvent(PPDMCRITSECT pCritSect, RTSEMEVENT EventToSignal);
    7269VMMR3DECL(int)      PDMR3CritSectDelete(PPDMCRITSECT pCritSect);
  • trunk/include/VBox/pdmdev.h

    r20056 r20087  
    13031303     */
    13041304    DECLR3CALLBACKMEMBER(void,    pfnSendSipi,(PPDMDEVINS pDevIns, VMCPUID idCpu, uint32_t uVector));
    1305    
    1306     /**
    1307      * Sends init IPI to given virtual CPU, should result in reset and 
     1305
     1306    /**
     1307     * Sends init IPI to given virtual CPU, should result in reset and
    13081308     * halting till SIPI.
    13091309     *
     
    19511951     * @param   enmClock            The clock to use on this timer.
    19521952     * @param   pfnCallback         Callback function.
     1953     * @param   pvUser              User argument for the callback.
     1954     * @param   fFlags              Flags, see TMTIMER_FLAGS_*.
    19531955     * @param   pszDesc             Pointer to description string which must stay around
    19541956     *                              until the timer is fully destroyed (i.e. a bit after TMTimerDestroy()).
    19551957     * @param   ppTimer             Where to store the timer on success.
    19561958     */
    1957     DECLR3CALLBACKMEMBER(int, pfnTMTimerCreate,(PPDMDEVINS pDevIns, TMCLOCK enmClock, PFNTMTIMERDEV pfnCallback, const char *pszDesc, PPTMTIMERR3 ppTimer));
     1959    DECLR3CALLBACKMEMBER(int, pfnTMTimerCreate,(PPDMDEVINS pDevIns, TMCLOCK enmClock, PFNTMTIMERDEV pfnCallback, void *pvUser, uint32_t fFlags, const char *pszDesc, PPTMTIMERR3 ppTimer));
    19581960
    19591961    /**
     
    34633465 * @copydoc PDMDEVHLPR3::pfnTMTimerCreate
    34643466 */
    3465 DECLINLINE(int) PDMDevHlpTMTimerCreate(PPDMDEVINS pDevIns, TMCLOCK enmClock, PFNTMTIMERDEV pfnCallback, const char *pszDesc, PPTMTIMERR3 ppTimer)
    3466 {
    3467     return pDevIns->pDevHlpR3->pfnTMTimerCreate(pDevIns, enmClock, pfnCallback, pszDesc, ppTimer);
     3467DECLINLINE(int) PDMDevHlpTMTimerCreate(PPDMDEVINS pDevIns, TMCLOCK enmClock, PFNTMTIMERDEV pfnCallback, void *pvUser, uint32_t fFlags,
     3468                                       const char *pszDesc, PPTMTIMERR3 ppTimer)
     3469{
     3470    return pDevIns->pDevHlpR3->pfnTMTimerCreate(pDevIns, enmClock, pfnCallback, pvUser, fFlags, pszDesc, ppTimer);
    34683471}
    34693472
  • trunk/include/VBox/tm.h

    r19821 r20087  
    7373
    7474
     75/** @defgroup grp_tm_timer_flags Timer flags.
     76 * @{ */
     77/** Use the default critical section for the class of timers.
     78 * Only devices have one at the moment. */
     79#define TMTIMER_FLAGS_DEFAULT_CRIT_SECT 0
     80/** No critical section needed or a custom one is set using
     81 *  TMR3TimerSetCritSect(). */
     82#define TMTIMER_FLAGS_NO_CRIT_SECT      RT_BIT_32(0)
     83/** @} */
     84
     85
    7586VMMDECL(void)     TMNotifyStartOfExecution(PVMCPU pVCpu);
    7687VMMDECL(void)     TMNotifyEndOfExecution(PVMCPU pVCpu);
     
    132143 * @param   pDevIns         Device instance of the device which registered the timer.
    133144 * @param   pTimer          The timer handle.
    134  */
    135 typedef DECLCALLBACK(void) FNTMTIMERDEV(PPDMDEVINS pDevIns, PTMTIMER pTimer);
     145 * @param   pvUser          User argument specified upon timer creation.
     146 */
     147typedef DECLCALLBACK(void) FNTMTIMERDEV(PPDMDEVINS pDevIns, PTMTIMER pTimer, void *pvUser);
    136148/** Pointer to a device timer callback function. */
    137149typedef FNTMTIMERDEV *PFNTMTIMERDEV;
     
    218230VMMR3DECL(void)   TMR3Reset(PVM pVM);
    219231VMMR3DECL(int)    TMR3GetImportRC(PVM pVM, const char *pszSymbol, PRTRCPTR pRCPtrValue);
    220 VMMR3DECL(int)    TMR3TimerCreateDevice(PVM pVM, PPDMDEVINS pDevIns, TMCLOCK enmClock, PFNTMTIMERDEV pfnCallback, const char *pszDesc, PPTMTIMERR3 ppTimer);
     232VMMR3DECL(int)    TMR3TimerCreateDevice(PVM pVM, PPDMDEVINS pDevIns, TMCLOCK enmClock, PFNTMTIMERDEV pfnCallback, void *pvUser, uint32_t fFlags, const char *pszDesc, PPTMTIMERR3 ppTimer);
    221233VMMR3DECL(int)    TMR3TimerCreateDriver(PVM pVM, PPDMDRVINS pDrvIns, TMCLOCK enmClock, PFNTMTIMERDRV pfnCallback, const char *pszDesc, PPTMTIMERR3 ppTimer);
    222234VMMR3DECL(int)    TMR3TimerCreateInternal(PVM pVM, TMCLOCK enmClock, PFNTMTIMERINT pfnCallback, void *pvUser, const char *pszDesc, PPTMTIMERR3 ppTimer);
     
    227239VMMR3DECL(int)    TMR3TimerSave(PTMTIMERR3 pTimer, PSSMHANDLE pSSM);
    228240VMMR3DECL(int)    TMR3TimerLoad(PTMTIMERR3 pTimer, PSSMHANDLE pSSM);
     241VMMR3DECL(int)    TMR3TimerSetCritSect(PTMTIMERR3 pTimer, PPDMCRITSECT pCritSect);
    229242VMMR3DECL(void)   TMR3TimerQueuesDo(PVM pVM);
    230243VMMR3DECL(void)   TMR3VirtualSyncFF(PVM pVM, PVMCPU pVCpu);
  • trunk/include/VBox/types.h

    r19405 r20087  
    203203/** Pointer to a pointer to a PDM Service Instance. */
    204204typedef PPDMSRVINS *PPPDMSRVINS;
     205
     206/** Pointer to a PDM critical section. */
     207typedef union PDMCRITSECT *PPDMCRITSECT;
     208/** Pointer to a const PDM critical section. */
     209typedef const union PDMCRITSECT *PCPDMCRITSECT;
    205210
    206211/** R3 pointer to a timer. */
  • trunk/include/VBox/vusb.h

    r15076 r20087  
    779779/**
    780780 * USB Timer Interface.
     781 * @todo r=bird: why is this code still here?
    781782 */
    782783typedef struct VUSBITIMER
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