forked from torvalds/linux
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'timers-core-for-linus' of git://git.kernel.org/pub/scm/…
…linux/kernel/git/tip/linux-2.6-tip * 'timers-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip: hrtimer: Make lookup table const RTC: Disable CONFIG_RTC_CLASS from being built as a module timers: Fix alarmtimer build issues when CONFIG_RTC_CLASS=n timers: Remove delayed irqwork from alarmtimers implementation timers: Improve alarmtimer comments and minor fixes timers: Posix interface for alarm-timers timers: Introduce in-kernel alarm-timer interface timers: Add rb_init_node() to allow for stack allocated rb nodes time: Add timekeeping_inject_sleeptime
- Loading branch information
Showing
12 changed files
with
820 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
#ifndef _LINUX_ALARMTIMER_H | ||
#define _LINUX_ALARMTIMER_H | ||
|
||
#include <linux/time.h> | ||
#include <linux/hrtimer.h> | ||
#include <linux/timerqueue.h> | ||
#include <linux/rtc.h> | ||
|
||
enum alarmtimer_type { | ||
ALARM_REALTIME, | ||
ALARM_BOOTTIME, | ||
|
||
ALARM_NUMTYPE, | ||
}; | ||
|
||
/** | ||
* struct alarm - Alarm timer structure | ||
* @node: timerqueue node for adding to the event list this value | ||
* also includes the expiration time. | ||
* @period: Period for recuring alarms | ||
* @function: Function pointer to be executed when the timer fires. | ||
* @type: Alarm type (BOOTTIME/REALTIME) | ||
* @enabled: Flag that represents if the alarm is set to fire or not | ||
* @data: Internal data value. | ||
*/ | ||
struct alarm { | ||
struct timerqueue_node node; | ||
ktime_t period; | ||
void (*function)(struct alarm *); | ||
enum alarmtimer_type type; | ||
bool enabled; | ||
void *data; | ||
}; | ||
|
||
void alarm_init(struct alarm *alarm, enum alarmtimer_type type, | ||
void (*function)(struct alarm *)); | ||
void alarm_start(struct alarm *alarm, ktime_t start, ktime_t period); | ||
void alarm_cancel(struct alarm *alarm); | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.