28#include <l4/sys/l4int.h>
173 ".byte 0x0f, 0x31 \n\t"
190 __asm__ __volatile__ (
191 ".byte 0x0f, 0x31\n\t"
204 __asm__ __volatile__ (
221 __asm__ __volatile__ (
237 "movl %%edx, %%ecx \n\t"
239 "movl %%ecx, %%eax \n\t"
240 "movl %%edx, %%ecx \n\t"
242 "addl %%ecx, %%eax \n\t"
243 "adcl $0, %%edx \n\t"
244 "shld $5, %%eax, %%edx \n\t"
245 "shll $5, %%eax \n\t"
249 "g" (l4_scaler_tsc_to_ns)
261 "movl %%edx, %%ecx \n\t"
263 "movl %%ecx, %%eax \n\t"
264 "movl %%edx, %%ecx \n\t"
266 "addl %%ecx, %%eax \n\t"
267 "adcl $0, %%edx \n\t"
271 "g" (l4_scaler_tsc_to_us)
282 "movl %%edx, %%ecx \n\t"
284 "movl %%ecx, %%eax \n\t"
285 "movl %%edx, %%ecx \n\t"
287 "addl %%ecx, %%eax \n\t"
288 "adcl $0, %%edx \n\t"
289 "movl $1000000000, %%ecx \n\t"
290 "shld $5, %%eax, %%edx \n\t"
291 "shll $5, %%eax \n\t"
293 :
"=a" (*s),
"=d" (*ns),
"=&c" (dummy)
294 :
"A" (tsc),
"g" (l4_scaler_tsc_to_ns)
305 "movl %%edx, %%ecx \n\t"
307 "movl %%ecx, %%eax \n\t"
308 "movl %%edx, %%ecx \n\t"
310 "addl %%ecx, %%eax \n\t"
311 "adcl $0, %%edx \n\t"
312 "shld $5, %%eax, %%edx \n\t"
313 "shll $5, %%eax \n\t"
317 "g" (l4_scaler_ns_to_tsc)
L4 compiler related defines.
l4_uint64_t l4_cpu_time_t
CPU clock type.
unsigned int l4_uint32_t
Unsigned 32bit value.
unsigned long long l4_uint64_t
Unsigned 64bit value.
#define __END_DECLS
End section with C types and functions.
#define L4_CV
Define calling convention.
#define L4_INLINE
L4 Inline function attribute.
#define __BEGIN_DECLS
Start section with C types and functions.
void l4_tsc_to_s_and_ns(l4_cpu_time_t tsc, l4_uint32_t *s, l4_uint32_t *ns)
Convert timestamp to s.ns value.
l4_uint32_t l4_get_hz(void)
Get CPU frequency in Hz.
l4_uint32_t l4_tsc_init(l4_kernel_info_t const *kip)
Initialize scaler for TSC calibrations from the kernel.
l4_uint64_t l4_tsc_to_ns(l4_cpu_time_t tsc)
Convert timestamp to ns value.
l4_uint64_t l4_tsc_to_us(l4_cpu_time_t tsc)
Convert timestamp into micro seconds value.
l4_uint32_t l4_calibrate_tsc(l4_kernel_info_t const *kip)
Determine scalers for timestamp calculations.
l4_cpu_time_t l4_rdtsc(void)
Read current value of CPU-internal timestamp counter.
l4_cpu_time_t l4_ns_to_tsc(l4_uint64_t ns)
Convert nano seconds into CPU ticks.
void l4_busy_wait_us(l4_uint64_t us)
Wait busy for a small amount of time.
l4_uint32_t l4_rdpmc_32(int ecx)
Return the least significant 32 bit of a performance counter.
l4_uint64_t l4_rdpmc(int ecx)
Return current value of CPU-internal performance measurement counter.
void l4_busy_wait_ns(l4_uint64_t ns)
Wait busy for a small amount of time.
l4_uint32_t l4_rdtsc_32(void)
Read the lest significant 32 bit of the TSC.
L4 Kernel Interface Page.
Kernel Info Page access functions.