PERFORCE change 146383 for review
Sam Leffler
sam at FreeBSD.org
Fri Aug 1 17:40:39 UTC 2008
http://perforce.freebsd.org/chv.cgi?CH=146383
Change 146383 by sam at sam_ebb on 2008/08/01 17:39:38
add callout_schedule & co
Affected files ...
.. //depot/projects/vap/sys/kern/kern_timeout.c#12 edit
.. //depot/projects/vap/sys/sys/callout.h#7 edit
Differences ...
==== //depot/projects/vap/sys/kern/kern_timeout.c#12 (text+ko) ====
@@ -616,6 +616,21 @@
return (cancelled);
}
+/*
+ * Common idioms that can be optimized in the future.
+ */
+int
+callout_schedule_on(struct callout *c, int to_ticks, int cpu)
+{
+ return callout_reset_on(c, to_ticks, c->c_func, c->c_arg, cpu);
+}
+
+int
+callout_schedule(struct callout *c, int to_ticks)
+{
+ return callout_reset_on(c, to_ticks, c->c_func, c->c_arg, c->c_cpu);
+}
+
int
_callout_stop_safe(c, safe)
struct callout *c;
==== //depot/projects/vap/sys/sys/callout.h#7 (text+ko) ====
@@ -89,6 +89,10 @@
callout_reset_on((c), (on_tick), (fn), (arg), (c)->c_cpu)
#define callout_reset_curcpu(c, on_tick, fn, arg) \
callout_reset_on((c), (on_tick), (fn), (arg), PCPU_GET(cpuid))
+int callout_schedule(struct callout *, int);
+int callout_schedule_on(struct callout *, int, int);
+#define callout_schedule_curcpu(c, on_tick) \
+ callout_schedule_on((c), (on_tick), PCPU_GET(cpuid))
#define callout_stop(c) _callout_stop_safe(c, 0)
int _callout_stop_safe(struct callout *, int);
void callout_tick(void);
More information about the p4-projects
mailing list