timeout/untimeout ==> callout_* for p->p_ithandle
authorJoerg Sonnenberger <joerg@dragonflybsd.org>
Fri, 17 Sep 2004 01:29:45 +0000 (01:29 +0000)
committerJoerg Sonnenberger <joerg@dragonflybsd.org>
Fri, 17 Sep 2004 01:29:45 +0000 (01:29 +0000)
sys/emulation/linux/linux_misc.c
sys/kern/kern_exit.c
sys/kern/kern_fork.c
sys/kern/kern_time.c
sys/sys/proc.h

index 0df4d71..ea3bf96 100644 (file)
@@ -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;
index ea72656..5533048 100644 (file)
@@ -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
index 72826b0..0877dd7 100644 (file)
@@ -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
        /*
index faddeec..3867753 100644 (file)
@@ -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 <sys/param.h>
@@ -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;
                }
index eac7c48..5a1a2f1 100644 (file)
@@ -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. */