aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDave Young <hidave.darkstar@gmail.com>2008-04-18 16:38:57 -0400
committerThomas Gleixner <tglx@linutronix.de>2008-04-21 01:59:51 -0400
commit3f34d024c12e49fbce4009d094ae1d287084e511 (patch)
tree106ee9f75c0b2c279fc4152643fe5dedf90e3ed5
parent3925e6fc1f774048404fdd910b0345b06c699eb4 (diff)
jiffies: add time_is_after_jiffies and others which compare with jiffies
Most of time_after like macros usages just compare jiffies and another number, so here add some time_is_* macros for convenience. Signed-off-by: Dave Young <hidave.darkstar@gmail.com> Cc: Alan Cox <alan@lxorguk.ukuu.org.uk> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
-rw-r--r--include/linux/jiffies.h16
1 files changed, 16 insertions, 0 deletions
diff --git a/include/linux/jiffies.h b/include/linux/jiffies.h
index e0b5b684d83f..e377e34e589e 100644
--- a/include/linux/jiffies.h
+++ b/include/linux/jiffies.h
@@ -135,6 +135,22 @@ static inline u64 get_jiffies_64(void)
135#define time_before_eq64(a,b) time_after_eq64(b,a) 135#define time_before_eq64(a,b) time_after_eq64(b,a)
136 136
137/* 137/*
138 * These four macros compare jiffies and 'a' for convenience.
139 */
140
141/* time_is_before_jiffies(a) return true if a is before jiffies */
142#define time_is_before_jiffies(a) time_after(jiffies, a)
143
144/* time_is_after_jiffies(a) return true if a is after jiffies */
145#define time_is_after_jiffies(a) time_before(jiffies, a)
146
147/* time_is_before_eq_jiffies(a) return true if a is before or equal to jiffies*/
148#define time_is_before_eq_jiffies(a) time_after_eq(jiffies, a)
149
150/* time_is_after_eq_jiffies(a) return true if a is after or equal to jiffies*/
151#define time_is_after_eq_jiffies(a) time_before_eq(jiffies, a)
152
153/*
138 * Have the 32 bit jiffies value wrap 5 minutes after boot 154 * Have the 32 bit jiffies value wrap 5 minutes after boot
139 * so jiffies wrap bugs show up earlier. 155 * so jiffies wrap bugs show up earlier.
140 */ 156 */