Functions | |
l4_cpu_time_t | l4_rdtsc (void) |
Return current value of CPU-internal time stamp counter. | |
l4_cpu_time_t | l4_rdpmc (int nr) |
Return current value of CPU-internal performance measurement counter. | |
l4_uint64_t | l4_tsc_to_ns (l4_cpu_time_t tsc) |
Convert time stamp counter into ns. | |
l4_uint64_t | l4_tsc_to_us (l4_cpu_time_t tsc) |
Convert time stamp counter into micro seconds. | |
void | l4_tsc_to_s_and_ns (l4_cpu_time_t tsc, l4_uint32_t *s, l4_uint32_t *ns) |
Convert time stamp counter into s.ns. | |
l4_cpu_time_t | l4_ns_to_tsc (l4_uint64_t ns) |
Convert nano seconds into CPU ticks. | |
void | l4_busy_wait_ns (l4_uint64_t ns) |
Wait busy for a small amount of time. | |
void | l4_busy_wait_us (l4_uint64_t us) |
Wait busy for a small amount of time. | |
l4_uint32_t | l4_calibrate_tsc (void) |
Determine some scalers to be able to convert between real time and CPU ticks. | |
L4_CV l4_uint32_t | l4_tsc_init (int constraint) |
Initialize the scalers needed by l4_tsc_to_ns()/l4_ns_to_tsc() and so on. | |
L4_CV l4_uint32_t | l4_get_hz (void) |
Get CPU frequency in Hz. |
l4_cpu_time_t l4_rdtsc | ( | void | ) | [inline] |
Return current value of CPU-internal time stamp counter.
Definition at line 151 of file ARCH-amd64/rdtsc.h.
Referenced by l4_busy_wait_ns(), and l4_busy_wait_us().
l4_cpu_time_t l4_rdpmc | ( | int | nr | ) | [inline] |
Return current value of CPU-internal performance measurement counter.
nr | Number of counter (0 or 1) |
Definition at line 171 of file ARCH-amd64/rdtsc.h.
l4_uint64_t l4_tsc_to_ns | ( | l4_cpu_time_t | tsc | ) | [inline] |
Convert time stamp counter into ns.
tsc | time value in CPU ticks |
Definition at line 226 of file ARCH-amd64/rdtsc.h.
l4_uint64_t l4_tsc_to_us | ( | l4_cpu_time_t | tsc | ) | [inline] |
Convert time stamp counter into micro seconds.
tsc | time value in CPU ticks |
Definition at line 240 of file ARCH-amd64/rdtsc.h.
void l4_tsc_to_s_and_ns | ( | l4_cpu_time_t | tsc, | |
l4_uint32_t * | s, | |||
l4_uint32_t * | ns | |||
) | [inline] |
Convert time stamp counter into s.ns.
tsc | time value in CPU ticks |
s | seconds | |
ns | nano seconds |
Definition at line 254 of file ARCH-amd64/rdtsc.h.
l4_cpu_time_t l4_ns_to_tsc | ( | l4_uint64_t | ns | ) | [inline] |
Convert nano seconds into CPU ticks.
ns | nano seconds |
Definition at line 269 of file ARCH-amd64/rdtsc.h.
Referenced by l4_busy_wait_ns(), and l4_busy_wait_us().
void l4_busy_wait_ns | ( | l4_uint64_t | ns | ) | [inline] |
Wait busy for a small amount of time.
ns | nano seconds to wait |
Definition at line 283 of file ARCH-amd64/rdtsc.h.
References l4_ns_to_tsc(), and l4_rdtsc().
void l4_busy_wait_us | ( | l4_uint64_t | us | ) | [inline] |
Wait busy for a small amount of time.
us | micro seconds to wait |
Definition at line 293 of file ARCH-amd64/rdtsc.h.
References l4_ns_to_tsc(), and l4_rdtsc().
l4_uint32_t l4_calibrate_tsc | ( | void | ) | [inline] |
Determine some scalers to be able to convert between real time and CPU ticks.
This test uses channel 0 of the PIT (i8254) or the kernel KIP, depending on availability. Just calls l4_tsc_init(L4_TSC_INIT_AUTO).
Definition at line 145 of file ARCH-amd64/rdtsc.h.
References l4_tsc_init().
L4_CV l4_uint32_t l4_tsc_init | ( | int | constraint | ) |
Initialize the scalers needed by l4_tsc_to_ns()/l4_ns_to_tsc() and so on.
Current versions of Fiasco export these scalers from kernel into userland. The programmer may decide whether he allows to use these scalers or if an calibration should be performed.
constraint | programmers constraint:
|
Referenced by l4_calibrate_tsc().
L4_CV l4_uint32_t l4_get_hz | ( | void | ) |
Get CPU frequency in Hz.