summaryrefslogtreecommitdiff
path: root/include/linux/alarmtimer.h
diff options
context:
space:
mode:
authorJohn Stultz <john.stultz@linaro.org>2011-08-10 21:37:59 +0400
committerJohn Stultz <john.stultz@linaro.org>2011-08-11 01:55:20 +0400
commit4b41308d2d0398409620613c7eaaaf52c738b042 (patch)
tree47a6becae6272eb9c06e57a0a9d1698b8f1811c8 /include/linux/alarmtimer.h
parent6af7e471e5a7746b8024d70b4363d3dfe41d36b8 (diff)
downloadlinux-4b41308d2d0398409620613c7eaaaf52c738b042.tar.xz
alarmtimers: Change alarmtimer functions to return alarmtimer_restart values
In order to properly fix the denial of service issue with high freq periodic alarm timers, we need to push the re-arming logic into the alarm timer handler, much as the hrtimer code does. This patch introduces alarmtimer_restart enum and changes the alarmtimer handler declarations to use it as a return value. Further, to ease following changes, it extends the alarmtimer handler functions to also take the time at expiration. No logic is yet modified. CC: Thomas Gleixner <tglx@linutronix.de> Signed-off-by: John Stultz <john.stultz@linaro.org>
Diffstat (limited to 'include/linux/alarmtimer.h')
-rw-r--r--include/linux/alarmtimer.h9
1 files changed, 7 insertions, 2 deletions
diff --git a/include/linux/alarmtimer.h b/include/linux/alarmtimer.h
index c5d6095b46f8..0289eb29e794 100644
--- a/include/linux/alarmtimer.h
+++ b/include/linux/alarmtimer.h
@@ -13,6 +13,11 @@ enum alarmtimer_type {
ALARM_NUMTYPE,
};
+enum alarmtimer_restart {
+ ALARMTIMER_NORESTART,
+ ALARMTIMER_RESTART,
+};
+
/**
* struct alarm - Alarm timer structure
* @node: timerqueue node for adding to the event list this value
@@ -26,14 +31,14 @@ enum alarmtimer_type {
struct alarm {
struct timerqueue_node node;
ktime_t period;
- void (*function)(struct alarm *);
+ enum alarmtimer_restart (*function)(struct alarm *, ktime_t now);
enum alarmtimer_type type;
bool enabled;
void *data;
};
void alarm_init(struct alarm *alarm, enum alarmtimer_type type,
- void (*function)(struct alarm *));
+ enum alarmtimer_restart (*function)(struct alarm *, ktime_t));
void alarm_start(struct alarm *alarm, ktime_t start, ktime_t period);
void alarm_cancel(struct alarm *alarm);