]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - include/linux/hrtimer.h
[PATCH] Fix comment to synchronize_sched()
[linux-2.6-omap-h63xx.git] / include / linux / hrtimer.h
index cf5cfdf8d61304b319486724f9e0ec7515b63148..6361544bb6ae5fef3ee1dcd84dc8788262bd7917 100644 (file)
@@ -40,6 +40,7 @@ enum hrtimer_restart {
 enum hrtimer_state {
        HRTIMER_INACTIVE,       /* Timer is inactive */
        HRTIMER_EXPIRED,                /* Timer is expired */
+       HRTIMER_RUNNING,                /* Timer is running the callback function */
        HRTIMER_PENDING,                /* Timer is pending */
 };
 
@@ -49,8 +50,6 @@ struct hrtimer_base;
  * struct hrtimer - the basic hrtimer structure
  *
  * @node:      red black tree node for time ordered insertion
- * @list:      list head for easier access to the time ordered list,
- *             without walking the red black tree.
  * @expires:   the absolute expiry time in the hrtimers internal
  *             representation. The time is related to the clock on
  *             which the timer is based.
@@ -63,7 +62,6 @@ struct hrtimer_base;
  */
 struct hrtimer {
        struct rb_node          node;
-       struct list_head        list;
        ktime_t                 expires;
        enum hrtimer_state      state;
        int                     (*function)(void *);
@@ -78,7 +76,7 @@ struct hrtimer {
  *             to a base on another cpu.
  * @lock:      lock protecting the base and associated timers
  * @active:    red black tree root node for the active timers
- * @pending:   list of pending timers for simple time ordered access
+ * @first:     pointer to the timer node which expires first
  * @resolution:        the resolution of the clock, in nanoseconds
  * @get_time:  function to retrieve the current time of the clock
  * @curr_timer:        the timer which is executing a callback right now
@@ -87,8 +85,8 @@ struct hrtimer_base {
        clockid_t               index;
        spinlock_t              lock;
        struct rb_root          active;
-       struct list_head        pending;
-       unsigned long           resolution;
+       struct rb_node          *first;
+       ktime_t                 resolution;
        ktime_t                 (*get_time)(void);
        struct hrtimer          *curr_timer;
 };
@@ -103,9 +101,8 @@ struct hrtimer_base {
 /* Exported timer functions: */
 
 /* Initialize timers: */
-extern void hrtimer_init(struct hrtimer *timer, const clockid_t which_clock);
-extern void hrtimer_rebase(struct hrtimer *timer, const clockid_t which_clock);
-
+extern void hrtimer_init(struct hrtimer *timer, clockid_t which_clock,
+                        enum hrtimer_mode mode);
 
 /* Basic timer operations: */
 extern int hrtimer_start(struct hrtimer *timer, ktime_t tim,
@@ -125,8 +122,7 @@ static inline int hrtimer_active(const struct hrtimer *timer)
 }
 
 /* Forward a hrtimer so it expires after now: */
-extern unsigned long hrtimer_forward(struct hrtimer *timer,
-                                    const ktime_t interval);
+extern unsigned long hrtimer_forward(struct hrtimer *timer, ktime_t interval);
 
 /* Precise sleep: */
 extern long hrtimer_nanosleep(struct timespec *rqtp,