aboutsummaryrefslogtreecommitdiffstats
path: root/xen/include/xen/timer.h
diff options
context:
space:
mode:
authorKeir Fraser <keir.fraser@citrix.com>2008-08-27 13:24:35 +0100
committerKeir Fraser <keir.fraser@citrix.com>2008-08-27 13:24:35 +0100
commitdafd59dde66529dd075ba20601df7a23cb99a41d (patch)
treed166c7e385d6cdc0a20d54c1f0c6a09787ebcf21 /xen/include/xen/timer.h
parentd1ef21b1ccbbbb048ae209c57865c960ceec2a24 (diff)
downloadxen-dafd59dde66529dd075ba20601df7a23cb99a41d.tar.gz
xen-dafd59dde66529dd075ba20601df7a23cb99a41d.tar.bz2
xen-dafd59dde66529dd075ba20601df7a23cb99a41d.zip
Fall back to a timer linked list when the timer heap overflows.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
Diffstat (limited to 'xen/include/xen/timer.h')
-rw-r--r--xen/include/xen/timer.h33
1 files changed, 23 insertions, 10 deletions
diff --git a/xen/include/xen/timer.h b/xen/include/xen/timer.h
index 4b882a123b..6d4c0fc4fb 100644
--- a/xen/include/xen/timer.h
+++ b/xen/include/xen/timer.h
@@ -14,16 +14,29 @@
struct timer {
/* System time expiry value (nanoseconds since boot). */
- s_time_t expires;
- /* CPU on which this timer will be installed and executed. */
- unsigned int cpu;
+ s_time_t expires;
+
+ /* Position in active-timer data structure. */
+ union {
+ /* Timer-heap offset. */
+ unsigned int heap_offset;
+ /* Overflow linked list. */
+ struct timer *list_next;
+ };
+
/* On expiry, '(*function)(data)' will be executed in softirq context. */
- void (*function)(void *);
- void *data;
- /* Timer-heap offset. */
- unsigned int heap_offset;
- /* Has this timer been killed (cannot be activated)? */
- int killed;
+ void (*function)(void *);
+ void *data;
+
+ /* CPU on which this timer will be installed and executed. */
+ uint16_t cpu;
+
+ /* Timer status. */
+#define TIMER_STATUS_inactive 0 /* Not in use; can be activated. */
+#define TIMER_STATUS_killed 1 /* Not in use; canot be activated. */
+#define TIMER_STATUS_in_heap 2 /* In use; on timer heap. */
+#define TIMER_STATUS_in_list 3 /* In use; on overflow linked list. */
+ uint8_t status;
};
/*
@@ -37,7 +50,7 @@ struct timer {
*/
static inline int active_timer(struct timer *timer)
{
- return (timer->heap_offset != 0);
+ return (timer->status >= TIMER_STATUS_in_heap);
}
/*