From owner-p4-projects@FreeBSD.ORG Fri Aug 1 17:40:39 2008 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 4C73F1065673; Fri, 1 Aug 2008 17:40:39 +0000 (UTC) Delivered-To: perforce@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0F3A2106566B for ; Fri, 1 Aug 2008 17:40:39 +0000 (UTC) (envelope-from sam@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id F09CF8FC16 for ; Fri, 1 Aug 2008 17:40:38 +0000 (UTC) (envelope-from sam@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.2/8.14.2) with ESMTP id m71HeW7L035044 for ; Fri, 1 Aug 2008 17:40:32 GMT (envelope-from sam@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.14.2/8.14.1/Submit) id m71HeTjL035042 for perforce@freebsd.org; Fri, 1 Aug 2008 17:40:29 GMT (envelope-from sam@freebsd.org) Date: Fri, 1 Aug 2008 17:40:29 GMT Message-Id: <200808011740.m71HeTjL035042@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to sam@freebsd.org using -f From: Sam Leffler To: Perforce Change Reviews Cc: Subject: PERFORCE change 146383 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 01 Aug 2008 17:40:39 -0000 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);