include/native/timer.h File Reference


Detailed Description

This file is part of the Xenomai project.

Note:
Copyright (C) 2004 Philippe Gerum <rpm@xenomai.org>
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.

Include dependency graph for timer.h:

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

SRTIME rt_timer_ns2tsc (SRTIME ns)
 Convert nanoseconds to local CPU clock ticks.
SRTIME rt_timer_tsc2ns (SRTIME ticks)
 Convert local CPU clock ticks to nanoseconds.
RTIME rt_timer_tsc (void)
 Return the current TSC value.
RTIME rt_timer_read (void)
 Return the current system time.
SRTIME rt_timer_ns2ticks (SRTIME ns)
 Convert nanoseconds to internal clock ticks.
SRTIME rt_timer_ticks2ns (SRTIME ticks)
 Convert internal clock ticks to nanoseconds.
int rt_timer_inquire (RT_TIMER_INFO *info)
 Inquire about the timer.
void rt_timer_spin (RTIME ns)
 Busy wait burning CPU cycles.
int rt_timer_set_mode (RTIME nstick)
 Set the system clock rate.


Function Documentation

SRTIME rt_timer_ns2ticks ( SRTIME  ns  ) 

Convert nanoseconds to internal clock ticks.

Convert a count of nanoseconds to internal clock ticks. This routine operates on signed nanosecond values.

Parameters:
ns The count of nanoseconds to convert.
Returns:
The corresponding value expressed in internal clock ticks.
Environments:

This service can be called from:

  • Kernel module initialization/cleanup code
  • Interrupt service routine
  • Kernel-based task
  • User-space task

Rescheduling: never.

Examples:
cross-link.c, and rtcansend.c.

References rt_timer_ns2ticks().

Referenced by rt_timer_ns2ticks().

SRTIME rt_timer_ns2tsc ( SRTIME  ns  ) 

Convert nanoseconds to local CPU clock ticks.

Convert a count of nanoseconds to local CPU clock ticks. This routine operates on signed nanosecond values.

Parameters:
ns The count of nanoseconds to convert.
Returns:
The corresponding value expressed in CPU clock ticks.
Environments:

This service can be called from:

  • Kernel module initialization/cleanup code
  • Interrupt service routine
  • Kernel-based task
  • User-space task

Rescheduling: never.

References rt_timer_ns2tsc().

Referenced by rt_timer_ns2tsc().

RTIME rt_timer_read ( void   ) 

Return the current system time.

Return the current time maintained by the master time base.

Returns:
The current time expressed in clock ticks (see note).
Environments:

This service can be called from:

  • Kernel module initialization/cleanup code
  • Interrupt service routine
  • Kernel-based task
  • User-space task

Rescheduling: never.

Note:
The value returned will represent a count of jiffies if the native skin is bound to a periodic time base (see CONFIG_XENO_OPT_NATIVE_PERIOD), or nanoseconds otherwise.
Examples:
cross-link.c, and trivial-periodic.c.

References rt_timer_read().

Referenced by rt_timer_read().

SRTIME rt_timer_ticks2ns ( SRTIME  ticks  ) 

Convert internal clock ticks to nanoseconds.

Convert a count of internal clock ticks to nanoseconds. This routine operates on signed tick values.

Parameters:
ticks The count of internal clock ticks to convert.
Returns:
The corresponding value expressed in nanoseconds.
Environments:

This service can be called from:

  • Kernel module initialization/cleanup code
  • Interrupt service routine
  • Kernel-based task
  • User-space task

Rescheduling: never.

References rt_timer_ticks2ns().

Referenced by rt_timer_ticks2ns().

RTIME rt_timer_tsc ( void   ) 

Return the current TSC value.

Return the value of the time stamp counter (TSC) maintained by the CPU of the underlying architecture.

Returns:
The current value of the TSC.
Environments:

This service can be called from:

  • Kernel module initialization/cleanup code
  • Interrupt service routine
  • Kernel-based task
  • User-space task

Rescheduling: never.

References rt_timer_tsc().

Referenced by rt_timer_tsc().

SRTIME rt_timer_tsc2ns ( SRTIME  ticks  ) 

Convert local CPU clock ticks to nanoseconds.

Convert a local CPU clock ticks to nanoseconds. This routine operates on signed tick values.

Parameters:
ticks The count of local CPU clock ticks to convert.
Returns:
The corresponding value expressed in nanoseconds.
Environments:

This service can be called from:

  • Kernel module initialization/cleanup code
  • Interrupt service routine
  • Kernel-based task
  • User-space task

Rescheduling: never.

References rt_timer_tsc2ns().

Referenced by rt_timer_tsc2ns().


Generated on Sun Jun 8 18:08:50 2008 for Xenomai API by  doxygen 1.5.5