The Design and Implementation of the FreeBSD Operating System, Second Edition
Now available: The Design and Implementation of the FreeBSD Operating System (Second Edition)


[ source navigation ] [ diff markup ] [ identifier search ] [ freetext search ] [ file search ] [ list types ] [ track identifier ]

FreeBSD/Linux Kernel Cross Reference
sys/kern/time_out.h

Version: -  FREEBSD  -  FREEBSD-12-STABLE  -  FREEBSD-12-0  -  FREEBSD-11-STABLE  -  FREEBSD-11-2  -  FREEBSD-11-1  -  FREEBSD-11-0  -  FREEBSD-10-STABLE  -  FREEBSD-10-4  -  FREEBSD-10-3  -  FREEBSD-10-2  -  FREEBSD-10-1  -  FREEBSD-10-0  -  FREEBSD-9-STABLE  -  FREEBSD-9-3  -  FREEBSD-9-2  -  FREEBSD-9-1  -  FREEBSD-9-0  -  FREEBSD-8-STABLE  -  FREEBSD-8-4  -  FREEBSD-8-3  -  FREEBSD-8-2  -  FREEBSD-8-1  -  FREEBSD-8-0  -  FREEBSD-7-STABLE  -  FREEBSD-7-4  -  FREEBSD-7-3  -  FREEBSD-7-2  -  FREEBSD-7-1  -  FREEBSD-7-0  -  FREEBSD-6-STABLE  -  FREEBSD-6-4  -  FREEBSD-6-3  -  FREEBSD-6-2  -  FREEBSD-6-1  -  FREEBSD-6-0  -  FREEBSD-5-STABLE  -  FREEBSD-5-5  -  FREEBSD-5-4  -  FREEBSD-5-3  -  FREEBSD-5-2  -  FREEBSD-5-1  -  FREEBSD-5-0  -  FREEBSD-4-STABLE  -  FREEBSD-3-STABLE  -  FREEBSD22  -  linux-2.6  -  linux-2.4.22  -  MK83  -  MK84  -  PLAN9  -  DFBSD  -  NETBSD  -  NETBSD5  -  NETBSD4  -  NETBSD3  -  NETBSD20  -  OPENBSD  -  xnu-517  -  xnu-792  -  xnu-792.6.70  -  xnu-1228  -  xnu-1456.1.26  -  xnu-1699.24.8  -  xnu-2050.18.24  -  OPENSOLARIS  -  minix-3-1-1 
SearchContext: -  none  -  3  -  10 

    1 /* 
    2  * Mach Operating System
    3  * Copyright (c) 1991,1990,1989,1988,1987 Carnegie Mellon University
    4  * All Rights Reserved.
    5  * 
    6  * Permission to use, copy, modify and distribute this software and its
    7  * documentation is hereby granted, provided that both the copyright
    8  * notice and this permission notice appear in all copies of the
    9  * software, derivative works or modified versions, and any portions
   10  * thereof, and that both notices appear in supporting documentation.
   11  * 
   12  * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
   13  * CONDITION.  CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR
   14  * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
   15  * 
   16  * Carnegie Mellon requests users of this software to return to
   17  * 
   18  *  Software Distribution Coordinator  or  Software.Distribution@CS.CMU.EDU
   19  *  School of Computer Science
   20  *  Carnegie Mellon University
   21  *  Pittsburgh PA 15213-3890
   22  * 
   23  * any improvements or extensions that they make and grant Carnegie Mellon
   24  * the rights to redistribute these changes.
   25  */
   26 /*
   27  * HISTORY
   28  * $Log:        time_out.h,v $
   29  * Revision 2.5  91/07/31  17:51:15  dbg
   30  *      Fix race condition.
   31  *      [91/07/30  17:08:00  dbg]
   32  * 
   33  * Revision 2.4  91/05/14  16:49:27  mrt
   34  *      Correcting copyright
   35  * 
   36  * Revision 2.3  91/02/05  17:30:51  mrt
   37  *      Changed to new Mach copyright
   38  *      [91/02/01  16:20:31  mrt]
   39  * 
   40  * Revision 2.2  90/11/05  14:32:00  rpd
   41  *      Changed untimeout to return boolean.
   42  *      [90/10/29            rpd]
   43  * 
   44  * Revision 2.1  89/08/03  15:57:24  rwd
   45  * Created.
   46  * 
   47  * 14-Jun-88  David Golub (dbg) at Carnegie-Mellon University
   48  *      Created.
   49  *
   50  */
   51 
   52 #ifndef _KERN_TIME_OUT_H_
   53 #define _KERN_TIME_OUT_H_
   54 
   55 /*
   56  * Mach time-out and time-of-day facility.
   57  */
   58 
   59 #include <mach/boolean.h>
   60 #include <kern/lock.h>
   61 #include <kern/queue.h>
   62 #include <kern/zalloc.h>
   63 
   64 /*
   65  *      Timers in kernel:
   66  */
   67 extern unsigned long elapsed_ticks; /* number of ticks elapsed since bootup */
   68 extern int      hz;             /* number of ticks per second */
   69 extern int      tick;           /* number of usec per tick */
   70 
   71 /*
   72  *      Time-out element.
   73  */
   74 struct timer_elt {
   75         queue_chain_t   chain;          /* chain in order of expiration */
   76         int             (*fcn)();       /* function to call */
   77         char *          param;          /* with this parameter */
   78         unsigned long   ticks;          /* expiration time, in ticks */
   79         int             set;            /* unset | set | allocated */
   80 };
   81 #define TELT_UNSET      0               /* timer not set */
   82 #define TELT_SET        1               /* timer set */
   83 #define TELT_ALLOC      2               /* timer allocated from pool */
   84 
   85 typedef struct timer_elt        timer_elt_data_t;
   86 typedef struct timer_elt        *timer_elt_t;
   87 
   88 /* for 'private' timer elements */
   89 extern void             set_timeout();
   90 extern boolean_t        reset_timeout();
   91 
   92 /* for public timer elements */
   93 extern void             timeout();
   94 extern boolean_t        untimeout();
   95 
   96 #define set_timeout_setup(telt,fcn,param,interval)      \
   97         ((telt)->fcn = (fcn),                           \
   98          (telt)->param = (param),                       \
   99          (telt)->private = TRUE,                        \
  100          set_timeout((telt), (interval)))
  101 
  102 #define reset_timeout_check(t) \
  103         MACRO_BEGIN \
  104         if ((t)->set) \
  105             reset_timeout((t)); \
  106         MACRO_END
  107 
  108 #endif  _KERN_TIME_OUT_H_

Cache object: 56013480e8296db025b296a98ad3373d


[ source navigation ] [ diff markup ] [ identifier search ] [ freetext search ] [ file search ] [ list types ] [ track identifier ]


This page is part of the FreeBSD/Linux Linux Kernel Cross-Reference, and was automatically generated using a modified version of the LXR engine.