patch-2.1.106 linux/include/linux/timer.h
Next file: linux/include/linux/utsname.h
Previous file: linux/include/linux/sysctl.h
Back to the patch index
Back to the overall index
- Lines: 23
- Date:
Sat Jun 13 11:45:10 1998
- Orig file:
v2.1.105/linux/include/linux/timer.h
- Orig date:
Thu Mar 26 15:57:06 1998
diff -u --recursive --new-file v2.1.105/linux/include/linux/timer.h linux/include/linux/timer.h
@@ -71,4 +71,22 @@
timer->prev = NULL;
}
+/*
+ * These inlines deal with timer wrapping correctly. You are
+ * strongly encouraged to use them
+ * 1. Because people otherwise forget
+ * 2. Because if the timer wrap changes in future you wont have to
+ * alter your driver code.
+ */
+
+extern inline int time_before(unsigned long a, unsigned long b)
+{
+ return((long)((a) - (b)) < 0L);
+}
+
+extern inline int time_after(unsigned long a, unsigned long b)
+{
+ return((long)((a) - (b)) > 0L);
+}
+
#endif
FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov