L4Re - L4 Runtime Environment
rdtsc.h File Reference

time stamp counter related functions More...

#include <l4/sys/compiler.h>
#include <l4/sys/l4int.h>
#include <l4/sys/kip.h>
+ Include dependency graph for rdtsc.h:

Go to the source code of this file.

Macros

#define L4_TSC_INIT_AUTO   0
 Automatic init.
 
#define L4_TSC_INIT_KERNEL   1
 Initialized by kernel.
 
#define L4_TSC_INIT_CALIBRATE   2
 Initialized by user-level.
 

Functions

l4_cpu_time_t l4_rdtsc (void)
 Read current value of CPU-internal time stamp counter. More...
 
l4_uint32_t l4_rdtsc_32 (void)
 Read the lest significant 32 bit of the TSC. More...
 
l4_cpu_time_t l4_rdpmc (int nr)
 Return current value of CPU-internal performance measurement counter. More...
 
l4_uint32_t l4_rdpmc_32 (int nr)
 Return the least significant 32 bit of a performance counter. More...
 
l4_uint64_t l4_tsc_to_ns (l4_cpu_time_t tsc)
 Convert time stamp to ns value. More...
 
l4_uint64_t l4_tsc_to_us (l4_cpu_time_t tsc)
 Convert time stamp into micro seconds value. More...
 
void l4_tsc_to_s_and_ns (l4_cpu_time_t tsc, l4_uint32_t *s, l4_uint32_t *ns)
 Convert time stamp to s.ns value. More...
 
l4_cpu_time_t l4_ns_to_tsc (l4_uint64_t ns)
 Convert nano seconds into CPU ticks. More...
 
void l4_busy_wait_ns (l4_uint64_t ns)
 Wait busy for a small amount of time. More...
 
void l4_busy_wait_us (l4_uint64_t us)
 Wait busy for a small amount of time. More...
 
l4_uint32_t l4_calibrate_tsc (l4_kernel_info_t *kip)
 Calibrate scalers for time stamp calculations. More...
 
l4_uint32_t l4_tsc_init (int constraint, l4_kernel_info_t *kip)
 Initialitze scaler for TSC calicaltions. More...
 
l4_uint32_t l4_get_hz (void)
 Get CPU frequency in Hz. More...
 

Detailed Description

time stamp counter related functions

Author
Frank Mehnert fm3@o.nosp@m.s.in.nosp@m.f.tu-.nosp@m.dres.nosp@m.den.d.nosp@m.e

Definition in file rdtsc.h.