30#include <l4/sys/l4int.h>
175 ".byte 0x0f, 0x31 \n\t"
192 __asm__ __volatile__ (
193 ".byte 0x0f, 0x31\n\t"
206 __asm__ __volatile__ (
223 __asm__ __volatile__ (
239 "movl %%edx, %%ecx \n\t"
241 "movl %%ecx, %%eax \n\t"
242 "movl %%edx, %%ecx \n\t"
244 "addl %%ecx, %%eax \n\t"
245 "adcl $0, %%edx \n\t"
246 "shld $5, %%eax, %%edx \n\t"
247 "shll $5, %%eax \n\t"
251 "g" (l4_scaler_tsc_to_ns)
263 "movl %%edx, %%ecx \n\t"
265 "movl %%ecx, %%eax \n\t"
266 "movl %%edx, %%ecx \n\t"
268 "addl %%ecx, %%eax \n\t"
269 "adcl $0, %%edx \n\t"
273 "g" (l4_scaler_tsc_to_us)
284 "movl %%edx, %%ecx \n\t"
286 "movl %%ecx, %%eax \n\t"
287 "movl %%edx, %%ecx \n\t"
289 "addl %%ecx, %%eax \n\t"
290 "adcl $0, %%edx \n\t"
291 "movl $1000000000, %%ecx \n\t"
292 "shld $5, %%eax, %%edx \n\t"
293 "shll $5, %%eax \n\t"
295 :
"=a" (*s),
"=d" (*ns),
"=&c" (dummy)
296 :
"A" (tsc),
"g" (l4_scaler_tsc_to_ns)
307 "movl %%edx, %%ecx \n\t"
309 "movl %%ecx, %%eax \n\t"
310 "movl %%edx, %%ecx \n\t"
312 "addl %%ecx, %%eax \n\t"
313 "adcl $0, %%edx \n\t"
314 "shld $5, %%eax, %%edx \n\t"
315 "shll $5, %%eax \n\t"
319 "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 L4_CV
Define calling convention.
#define L4_INLINE
L4 Inline function attribute.
#define EXTERN_C_BEGIN
Start section with C types and functions.
#define EXTERN_C_END
End 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.