#include <IOKit/IOTimerEventSource.h>

IOKit/IOTimerEventSource.h Kernel.framework

2 macros · 2 enums · 1 class

macro_IOTIMEREVENTSOURCE

#define _IOTIMEREVENTSOURCE 

enum(anonymous)

@enum IOTimerEventSource constructor options @abstract Constants defining behavior of the IOTimerEventSource. @constant kIOTimerEventSourceOptionsPriorityHigh Importance above everything but realtime. Thread calls allocated with this priority execute at extremely high priority, above everything but realtime threads. They are generally executed in serial. Though they may execute concurrently under some circumstances, no fan-out is implied. These work items should do very small amounts of work or risk disrupting system responsiveness. @constant kIOTimerEventSourceOptionsPriorityKernelHigh Importance higher than most kernel threads. @constant kIOTimerEventSourceOptionsPriorityKernel Importance similar to that of normal kernel threads. @constant kIOTimerEventSourceOptionsPriorityUser Importance similar to that of normal user threads. @constant kIOTimerEventSourceOptionsPriorityLow Very low importance. @constant kIOTimerEventSourceOptionsPriorityWorkLoop Run the callout on the thread of the IOWorkLoop the event source has been added to. @constant kIOTimerEventSourceOptionsAllowReenter Allow the callout to be rescheduled and potentially re-entered, if the IOWorkLoop lock has been released (eg. with commandSleep) during its invocation. @constant kIOTimerEventSourceOptionsDefault Recommended default options.
underlying type unsigned int
kIOTimerEventSourceOptionsPriorityMask255
kIOTimerEventSourceOptionsPriorityHigh0
kIOTimerEventSourceOptionsPriorityKernelHigh1
kIOTimerEventSourceOptionsPriorityKernel2
kIOTimerEventSourceOptionsPriorityUser3
kIOTimerEventSourceOptionsPriorityLow4
kIOTimerEventSourceOptionsPriorityWorkLoop255
kIOTimerEventSourceOptionsAllowReenter256
kIOTimerEventSourceOptionsDefault1

macroIOTIMEREVENTSOURCEOPTIONS_DEFINED

#define IOTIMEREVENTSOURCEOPTIONS_DEFINED 1

enum(anonymous)

@enum IOTimerEventSource setTimeout/wakeAtTime options @abstract Constants defining behavior of a scheduled call from IOTimerEventSource. @constant kIOTimeOptionsWithLeeway Use the leeway parameter to the call. @constant kIOTimeOptionsContinuous Use mach_continuous_time() to generate the callback.
underlying type unsigned int
kIOTimeOptionsWithLeeway32
kIOTimeOptionsContinuous256

classIOTimerEventSource

: public IOEventSource
void *calloutEntry
AbsoluteTimeabstime
ExpansionData *reserved
static void timeout(void *self)static protected
@function timeout @abstract Function that routes the call from the OS' timeout mechanism into a work-loop context. @discussion timeout will normally not be called nor overridden by a subclass. If the event source is enabled then close the work-loop's gate and call the action routine. @param self This argument will be cast to an IOTimerEventSource.
virtual void setTimeoutFunc()virtual protected
@function setTimeoutFunc @abstract Set's timeout as the function of calloutEntry. @discussion IOTimerEventSource is based upon the kern/thread_call.h APIs currently. This function allocates the calloutEntry member variable by using thread_call_allocate(timeout, this). If you need to write your own subclass of IOTimerEventSource you probably should override this method to allocate an entry that points to your own timeout routine.
APPLE_KEXT_OVERRIDE
virtual void free()
virtual protected
@function free @abstract Sub-class implementation of free method, frees calloutEntry
APPLE_KEXT_OVERRIDE
virtual void setWorkLoop(IOWorkLoop *workLoop)
virtual protected
static OSPtr<IOTimerEventSource> timerEventSource(OSObject *owner, Action action = NULL)static
static OSPtr<IOTimerEventSource> timerEventSource(
	uint32_t options,
	OSObject *owner,
	Action action = NULL
)
static
@function timerEventSource @abstract Allocates and returns an initialized timer instance. @param options Mask of kIOTimerEventSourceOptions* options. @param owner The object that that will be passed to the Action callback. @param action 'C' Function pointer for the callout routine of this event source.
static OSPtr<IOTimerEventSource> timerEventSource(
	uint32_t options,
	OSObject *inOwner,
	ActionBlock action
)
static
@function timerEventSource @abstract Allocates and returns an initialized timer instance. @param options Mask of kIOTimerEventSourceOptions* options. @param inOwner The object that that will be passed to the Action callback. @param action Block for the callout routine of this event source.
virtual bool init(OSObject *owner, Action action = NULL)virtual
@function init @abstract Initializes the timer with an owner, and a handler to call when the timeout expires.
APPLE_KEXT_OVERRIDE
virtual void enable()
virtual
@function enable @abstract Enables a call to the action. @discussion Allows the action function to be called. If the timer event source was disabled while a call was outstanding and the call wasn't cancelled then it will be rescheduled. So a disable/enable pair will disable calls from this event source.
APPLE_KEXT_OVERRIDE
virtual void disable()
virtual
@function disable @abstract Disable a timed callout. @discussion When disable returns the action will not be called until the next time enable(qv) is called.
APPLE_KEXT_OVERRIDE
virtual bool checkForWork()
virtual
@function checkForWork @abstract Pure Virtual member function used by IOWorkLoop for issuing a client calls. @discussion This function called when the work-loop is ready to check for any work to do and then to call out the owner/action. @result Return true if this function needs to be called again before all its outstanding events have been processed.
virtual IOReturn setTimeoutTicks(UInt32 ticks)virtual
@function setTimeoutTicks @abstract Setup a callback at after the delay in scheduler ticks. See wakeAtTime(AbsoluteTime). @param ticks Delay from now to wake up, in scheduler ticks, whatever that may be. @result kIOReturnSuccess if everything is fine, kIOReturnNoResources if action hasn't been declared.
virtual IOReturn setTimeoutMS(UInt32 ms)virtual
@function setTimeoutMS @abstract Setup a callback at after the delay in milliseconds. See wakeAtTime(AbsoluteTime). @param ms Delay from now to wake up, time in milliseconds. @result kIOReturnSuccess if everything is fine, kIOReturnNoResources if action hasn't been declared.
virtual IOReturn setTimeoutUS(UInt32 us)virtual
@function setTimeoutUS @abstract Setup a callback at after the delay in microseconds. See wakeAtTime(AbsoluteTime). @param us Delay from now to wake up, time in microseconds. @result kIOReturnSuccess if everything is fine, kIOReturnNoResources if action hasn't been declared.
virtual IOReturn setTimeout(UInt32 interval, UInt32 scale_factor = kNanosecondScale)virtual
@function setTimeout @abstract Setup a callback at after the delay in some unit. See wakeAtTime(AbsoluteTime). @param interval Delay from now to wake up in some defined unit. @param scale_factor Define the unit of interval, default to nanoseconds. @result kIOReturnSuccess if everything is fine, kIOReturnNoResources if action hasn't been declared.
virtual IOReturn setTimeout(AbsoluteTime interval)virtual
@function setTimeout @abstract Setup a callback at after the delay in decrementer ticks. See wakeAtTime(AbsoluteTime). @param interval Delay from now to wake up in decrementer ticks. @result kIOReturnSuccess if everything is fine, kIOReturnNoResources if action hasn't been declared.
virtual IOReturn wakeAtTimeTicks(UInt32 ticks)virtual
@function wakeAtTimeTicks @abstract Setup a callback at this absolute time. See wakeAtTime(AbsoluteTime). @param ticks Time to wake up in scheduler quantums, whatever that is? @result kIOReturnSuccess if everything is fine, kIOReturnNoResources if action hasn't been declared.
virtual IOReturn wakeAtTimeMS(UInt32 ms)virtual
@function wakeAtTimeMS @abstract Setup a callback at this absolute time. See wakeAtTime(AbsoluteTime). @param ms Time to wake up in milliseconds. @result kIOReturnSuccess if everything is fine, kIOReturnNoResources if action hasn't been declared.
virtual IOReturn wakeAtTimeUS(UInt32 us)virtual
@function wakeAtTimeUS @abstract Setup a callback at this absolute time. See wakeAtTime(AbsoluteTime). @param us Time to wake up in microseconds. @result kIOReturnSuccess if everything is fine, kIOReturnNoResources if action hasn't been declared.
virtual IOReturn wakeAtTime(UInt32 abstime, UInt32 scale_factor = kNanosecondScale)virtual
@function wakeAtTime @abstract Setup a callback at this absolute time. See wakeAtTime(AbsoluteTime). @param abstime Time to wake up in some unit. @param scale_factor Define the unit of abstime, default to nanoseconds. @result kIOReturnSuccess if everything is fine, kIOReturnNoResources if action hasn't been declared.
virtual IOReturn wakeAtTime(AbsoluteTime abstime)virtual
@function wakeAtTime @abstract Setup a callback at this absolute time. @discussion Starts the timer, which will expire at abstime. After it expires, the timer will call the 'action' registered in the init() function. This timer is not periodic, a further call is needed to reset and restart the timer after it expires. @param abstime Absolute Time when to wake up, counted in 'decrementer' units and starts at zero when system boots. @result kIOReturnSuccess if everything is fine, kIOReturnNoResources if action hasn't been declared by init or IOEventSource::setAction (qqv).
virtual void cancelTimeout()virtual
@function cancelTimeout @abstract Disable any outstanding calls to this event source. @discussion Clear down any oustanding calls. By the time this function completes it is guaranteed that the action will not be called again.
virtual bool init(uint32_t options, OSObject *inOwner, Action inAction)virtual
@function init @abstract Initializes the timer with an owner, and a handler to call when the timeout expires.
virtual IOReturn setTimeout(uint32_t options, AbsoluteTime interval, AbsoluteTime leeway)virtual
@function setTimeout @abstract Setup a callback at after the delay in decrementer ticks. See wakeAtTime(AbsoluteTime). @param options see kIOTimeOptionsWithLeeway and kIOTimeOptionsContinuous @param interval Delay from now to wake up in decrementer ticks. @param leeway Allowable leeway to wake time, if the kIOTimeOptionsWithLeeway option is set @result kIOReturnSuccess if everything is fine, kIOReturnNoResources if action hasn't been declared.
virtual IOReturn wakeAtTime(uint32_t options, AbsoluteTime abstime, AbsoluteTime leeway)virtual
@function wakeAtTime @abstract Setup a callback at this absolute time. @discussion Starts the timer, which will expire at abstime. After it expires, the timer will call the 'action' registered in the init() function. This timer is not periodic, a further call is needed to reset and restart the timer after it expires. @param options see kIOTimeOptionsWithLeeway and kIOTimeOptionsContinuous @param abstime Absolute Time when to wake up, counted in 'decrementer' units and starts at zero when system boots. @param leeway Allowable leeway to wake time, if the kIOTimeOptionsWithLeeway option is set @result kIOReturnSuccess if everything is fine, kIOReturnNoResources if action hasn't been declared by init or IOEventSource::setAction (qqv).