Timer management services.
[Native Xenomai API.]

Collaboration diagram for Timer management services.:

Detailed Description

Timer-related services allow to control the Xenomai system timer which is used in all timed operations.


Files

file  timer.c
 This file is part of the Xenomai project.

Functions

int rt_timer_inquire (RT_TIMER_INFO *info)
 Inquire about the timer.
void rt_timer_spin (RTIME ns)
int rt_timer_set_mode (RTIME nstick)


Function Documentation

int rt_timer_inquire ( RT_TIMER_INFO *  info  ) 

Inquire about the timer.

Return various information about the status of the system timer.

Parameters:
info The address of a structure the timer information will be written to.
Returns:
This service always returns 0.
The information block returns the period and the current system date. The period can have the following values:

Environments:

This service can be called from:

Rescheduling: never.

int rt_timer_set_mode ( RTIME  nstick  ) 

Set the system clock rate.

This routine switches to periodic timing mode and sets the clock tick rate, or resets the current timing mode to aperiodic/oneshot mode depending on the value of the nstick parameter. Since the native skin automatically sets its time base according to the configured policy and period at load time (see CONFIG_XENO_OPT_NATIVE_PERIOD), calling rt_timer_set_mode() is not required from applications unless the pre-defined mode and period need to be changed dynamically.

This service sets the time unit which will be relevant when specifying time intervals to the services taking timeout or delays as input parameters. In periodic mode, clock ticks will represent periodic jiffies. In oneshot mode, clock ticks will represent nanoseconds.

Parameters:
nstick The time base period in nanoseconds. If this parameter is equal to the special TM_ONESHOT value, the time base is set to operate in a tick-less fashion (i.e. oneshot mode). Other values are interpreted as the time between two consecutive clock ticks in periodic timing mode (i.e. clock HZ = 1e9 / nstick).
Returns:
0 is returned on success. Otherwise:

Environments:

This service can be called from:

Rescheduling: never.

void rt_timer_spin ( RTIME  ns  ) 

Busy wait burning CPU cycles.

Enter a busy waiting loop for a count of nanoseconds. The precision of this service largely depends on the availability of a time stamp counter on the current CPU.

Since this service is usually called with interrupts enabled, the caller might be preempted by other real-time activities, therefore the actual delay might be longer than specified.

Parameters:
ns The time to wait expressed in nanoseconds.
Environments:

This service can be called from:

Rescheduling: never.


Generated on Mon Mar 24 18:02:42 2008 for Xenomai API by  doxygen 1.5.3