SYSTIMER(9) BSD Kernel Developer's Manual SYSTIMER(9)NAME
systimer_init_periodic, systimer_init_periodic_nq,
systimer_adjust_periodic, systimer_init_oneshot — periodic callbacks
SYNOPSIS
#include <sys/systimer.h>
void
systimer_init_periodic(systimer_t info, void *func, void *data, int hz);
void
systimer_init_periodic_nq(systimer_t info, void *func, void *data,
int hz);
void
systimer_adjust_periodic(systimer_t info, int hz);
void
systimer_init_oneshot(systimer_t info, void *func, void *data, int us);
DESCRIPTION
Systimers invoke callbacks at either fixed frequencies or after time
delays. The callbacks are invoked in an interrupt thread and should only
be used for limited work.
The systimer_init_periodic() function initializes a systimer callback
function to be called at frequency hz. The info argument is an allocated
systimer structure; the func argument is the function to call, with argu‐
ment data.
The systimer_init_periodic_nq() function initializes a systimer callback
function to be called at a frequency hz. Unlike the
systimer_init_periodic() function, the systimer_init_periodic_nq() func‐
tion's callback is only called once at a given time, even if delays
caused multiple time intervals to have occurred.
The systimer_adjust_periodic() function changes the frequency at which a
systimer's callback is invoked. The current time interval is not
affected. The hz argument specifies the new frequency.
The systimer_init_oneshot() function arranges for a systimer callback
function func to be invoked with argument data once, after at least us
microseconds.
EXAMPLE
A simple example of using a one-short systimer to call a function after a
short time:
...
static struct systimer short_st;
char *str = "goodbye!";
...
systimer_init_oneshot(&short_st, panic, str, 1000);
...
FILES
The systimer implementation is in /sys/kern/kern_systimer.c.
SEE ALSOcallout(9)HISTORY
Systimers first appeared in DragonFly 1.0.
BSD August 19, 2010 BSD