From 8fbf913025659621e3686559570130f429caf517 Mon Sep 17 00:00:00 2001 From: Joerg Sonnenberger Date: Fri, 17 Sep 2004 01:29:45 +0000 Subject: [PATCH] timeout/untimeout ==> callout_* for p->p_ithandle --- sys/emulation/linux/linux_misc.c | 8 ++++---- sys/kern/kern_exit.c | 4 ++-- sys/kern/kern_fork.c | 3 ++- sys/kern/kern_time.c | 12 ++++++------ sys/sys/proc.h | 4 ++-- 5 files changed, 16 insertions(+), 15 deletions(-) diff --git a/sys/emulation/linux/linux_misc.c b/sys/emulation/linux/linux_misc.c index 0df4d71ff0..ea3bf961f3 100644 --- a/sys/emulation/linux/linux_misc.c +++ b/sys/emulation/linux/linux_misc.c @@ -26,7 +26,7 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * $FreeBSD: src/sys/compat/linux/linux_misc.c,v 1.85.2.9 2002/09/24 08:11:41 mdodd Exp $ - * $DragonFly: src/sys/emulation/linux/linux_misc.c,v 1.19 2004/03/01 06:33:15 dillon Exp $ + * $DragonFly: src/sys/emulation/linux/linux_misc.c,v 1.20 2004/09/17 01:29:45 joerg Exp $ */ #include "opt_compat.h" @@ -191,10 +191,10 @@ linux_alarm(struct linux_alarm_args *args) old_it = p->p_realtimer; getmicrouptime(&tv); if (timevalisset(&old_it.it_value)) - untimeout(realitexpire, (caddr_t)p, p->p_ithandle); + callout_stop(&p->p_ithandle); if (it.it_value.tv_sec != 0) { - p->p_ithandle = timeout(realitexpire, (caddr_t)p, - tvtohz_high(&it.it_value)); + callout_reset(&p->p_ithandle, tvtohz_high(&it.it_value), + realitexpire, p); timevaladd(&it.it_value, &tv); } p->p_realtimer = it; diff --git a/sys/kern/kern_exit.c b/sys/kern/kern_exit.c index ea726565eb..55330489e6 100644 --- a/sys/kern/kern_exit.c +++ b/sys/kern/kern_exit.c @@ -37,7 +37,7 @@ * * @(#)kern_exit.c 8.7 (Berkeley) 2/12/94 * $FreeBSD: src/sys/kern/kern_exit.c,v 1.92.2.11 2003/01/13 22:51:16 dillon Exp $ - * $DragonFly: src/sys/kern/kern_exit.c,v 1.37 2004/06/23 16:45:23 dillon Exp $ + * $DragonFly: src/sys/kern/kern_exit.c,v 1.38 2004/09/17 01:29:45 joerg Exp $ */ #include "opt_compat.h" @@ -173,7 +173,7 @@ exit1(int rv) p->p_flag |= P_WEXIT; SIGEMPTYSET(p->p_siglist); if (timevalisset(&p->p_realtimer.it_value)) - untimeout(realitexpire, (caddr_t)p, p->p_ithandle); + callout_stop(&p->p_ithandle); /* * Reset any sigio structures pointing to us as a result of diff --git a/sys/kern/kern_fork.c b/sys/kern/kern_fork.c index 72826b0410..0877dd743b 100644 --- a/sys/kern/kern_fork.c +++ b/sys/kern/kern_fork.c @@ -37,7 +37,7 @@ * * @(#)kern_fork.c 8.6 (Berkeley) 4/8/94 * $FreeBSD: src/sys/kern/kern_fork.c,v 1.72.2.14 2003/06/26 04:15:10 silby Exp $ - * $DragonFly: src/sys/kern/kern_fork.c,v 1.28 2004/07/24 20:21:35 dillon Exp $ + * $DragonFly: src/sys/kern/kern_fork.c,v 1.29 2004/09/17 01:29:45 joerg Exp $ */ #include "opt_ktrace.h" @@ -490,6 +490,7 @@ again: LIST_INSERT_HEAD(&pptr->p_children, p2, p_sibling); LIST_INIT(&p2->p_children); varsymset_init(&p2->p_varsymset, &p1->p_varsymset); + callout_init(&p2->p_ithandle); #ifdef KTRACE /* diff --git a/sys/kern/kern_time.c b/sys/kern/kern_time.c index faddeec5b9..3867753db4 100644 --- a/sys/kern/kern_time.c +++ b/sys/kern/kern_time.c @@ -32,7 +32,7 @@ * * @(#)kern_time.c 8.1 (Berkeley) 6/10/93 * $FreeBSD: src/sys/kern/kern_time.c,v 1.68.2.1 2002/10/01 08:00:41 bde Exp $ - * $DragonFly: src/sys/kern/kern_time.c,v 1.16 2004/06/04 20:35:36 dillon Exp $ + * $DragonFly: src/sys/kern/kern_time.c,v 1.17 2004/09/17 01:29:45 joerg Exp $ */ #include @@ -565,10 +565,10 @@ setitimer(struct setitimer_args *uap) crit_enter(); if (uap->which == ITIMER_REAL) { if (timevalisset(&p->p_realtimer.it_value)) - untimeout(realitexpire, (caddr_t)p, p->p_ithandle); + callout_stop(&p->p_ithandle); if (timevalisset(&aitv.it_value)) - p->p_ithandle = timeout(realitexpire, (caddr_t)p, - tvtohz_high(&aitv.it_value)); + callout_reset(&p->p_ithandle, + tvtohz_high(&aitv.it_value), realitexpire, p); getmicrouptime(&ctv); timevaladd(&aitv.it_value, &ctv); p->p_realtimer = aitv; @@ -612,8 +612,8 @@ realitexpire(arg) if (timevalcmp(&p->p_realtimer.it_value, &ctv, >)) { ntv = p->p_realtimer.it_value; timevalsub(&ntv, &ctv); - p->p_ithandle = timeout(realitexpire, (caddr_t)p, - tvtohz_low(&ntv)); + callout_reset(&p->p_ithandle, tvtohz_low(&ntv), + realitexpire, p); crit_exit(); return; } diff --git a/sys/sys/proc.h b/sys/sys/proc.h index eac7c488fe..5a1a2f1a64 100644 --- a/sys/sys/proc.h +++ b/sys/sys/proc.h @@ -37,7 +37,7 @@ * * @(#)proc.h 8.15 (Berkeley) 5/19/95 * $FreeBSD: src/sys/sys/proc.h,v 1.99.2.9 2003/06/06 20:21:32 tegge Exp $ - * $DragonFly: src/sys/sys/proc.h,v 1.55 2004/09/13 16:22:41 dillon Exp $ + * $DragonFly: src/sys/sys/proc.h,v 1.56 2004/09/17 01:29:45 joerg Exp $ */ #ifndef _SYS_PROC_H_ @@ -160,7 +160,7 @@ struct proc { struct proc *p_pptr; /* Pointer to parent process. */ LIST_ENTRY(proc) p_sibling; /* List of sibling processes. */ LIST_HEAD(, proc) p_children; /* Pointer to list of children. */ - struct callout_handle p_ithandle; /* for scheduling p_realtimer */ + struct callout p_ithandle; /* for scheduling p_realtimer */ struct varsymset p_varsymset; /* The following fields are all zeroed upon creation in fork. */ -- 2.41.0