Date: Fri, 1 Aug 2008 17:40:29 GMT From: Sam Leffler <sam@FreeBSD.org> To: Perforce Change Reviews <perforce@freebsd.org> Subject: PERFORCE change 146383 for review Message-ID: <200808011740.m71HeTjL035042@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=146383 Change 146383 by sam@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);
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200808011740.m71HeTjL035042>