2 .\" Copyright (c) 2010, The DragonFly Project.
4 .\" This software is derived from software contributed to the DragonFly Project
5 .\" by Venkatesh Srinivas <me@endeavour.zapto.org>.
7 .\" Permission to use, copy, modify, or distribute this software for any
8 .\" purpose with or without fee is hereby granted, provided that the above
9 .\" copyright notice and this permission notice appear in all copies.
11 .\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
12 .\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
13 .\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
14 .\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR OTHER DAMAGES
15 .\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA, OR PROFITS, WHETHER IN AN
16 .\" ACTION OF CONTRACT, NEGLIGENCE, OR OTHER TORTIOUS ACTION, ARISING OUT OF
17 .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
23 .Nm systimer_init_periodic ,
24 .Nm systimer_init_periodic_nq ,
25 .Nm systimer_adjust_periodic ,
26 .Nm systimer_init_oneshot
27 .Nd periodic callbacks
31 .Fn systimer_init_periodic "systimer_t info" "void *func" "void *data" "int hz"
33 .Fn systimer_init_periodic_nq "systimer_t info" "void *func" "void *data" "int hz"
35 .Fn systimer_adjust_periodic "systimer_t info" "int hz"
37 .Fn systimer_init_oneshot "systimer_t info" "void *func" "void *data" "int us"
40 Systimers invoke callbacks at either fixed frequencies or after time delays.
41 The callbacks are invoked in an interrupt thread and should only be used
45 .Fn systimer_init_periodic
46 function initializes a systimer callback function to be called at frequency
50 argument is an allocated systimer structure; the
52 argument is the function to call, with argument
56 .Fn systimer_init_periodic_nq
57 function initializes a systimer callback function to be called at a frequency
60 .Fn systimer_init_periodic
62 .Fn systimer_init_periodic_nq
63 function's callback is only called once at a given time, even if delays caused
64 multiple time intervals to have occurred.
67 .Fn systimer_adjust_periodic
68 function changes the frequency at which a systimer's callback is invoked.
70 current time interval is not affected.
73 argument specifies the new frequency.
76 .Fn systimer_init_oneshot
77 function arranges for a systimer callback function
79 to be invoked with argument
85 A simple example of using a one-short systimer to call a function after a short
87 .Bd -literal -offset indent
89 static struct systimer short_st;
90 char *str = "goodbye!";
92 systimer_init_oneshot(&short_st, panic, str, 1000);
96 The systimer implementation is in
97 .Pa /sys/kern/kern_systimer.c .
101 Systimers first appeared in