Defines | Functions | Variables

x86timer.c File Reference

API for x86 time funcs. More...

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "x86timer.h"

Go to the source code of this file.

Defines

#define rdtscll(val)   __asm__ __volatile__ ("rdtsc" : "=A" (val))

Functions

unsigned long long get_cpu_ticks (void)
unsigned long long get_cpu_usecs (void)
unsigned int get_cpu_clock_speed (void)
static unsigned long _get_elapsed_microseconds (int reset, unsigned long long *start)
unsigned long get_elapsed_microseconds (int reset)
void cpu_delay_awhile (unsigned int delay_microseconds)

Variables

static unsigned int CPU_CLOCK_SPEED = -1

Detailed Description

API for x86 time funcs.

thanks to Ben Penaflor

First run

. ./setup.clocks2 3 0 64 2 init_clocks_mbcb

telnet 192.5.166.179 /tmp/trigger_toggler

Definition in file x86timer.c.


Define Documentation

#define rdtscll (   val  )     __asm__ __volatile__ ("rdtsc" : "=A" (val))

Definition at line 22 of file x86timer.c.

Referenced by get_cpu_ticks(), and get_cpu_usecs().


Function Documentation

static unsigned long _get_elapsed_microseconds ( int  reset,
unsigned long long *  start 
) [static]

0x1234567890abcdefULL

Definition at line 114 of file x86timer.c.

References get_cpu_usecs().

Referenced by cpu_delay_awhile(), and get_elapsed_microseconds().

void cpu_delay_awhile ( unsigned int  delay_microseconds  ) 

Definition at line 143 of file x86timer.c.

References _get_elapsed_microseconds().

Referenced by main().

unsigned int get_cpu_clock_speed ( void   ) 

Definition at line 48 of file x86timer.c.

References CPU_CLOCK_SPEED, and fclose().

Referenced by initCardResource(), and main().

unsigned long long get_cpu_ticks ( void   ) 

Definition at line 26 of file x86timer.c.

References rdtscll.

Referenced by main().

unsigned long long get_cpu_usecs ( void   ) 

Definition at line 33 of file x86timer.c.

References CPU_CLOCK_SPEED, and rdtscll.

Referenced by _get_elapsed_microseconds().

unsigned long get_elapsed_microseconds ( int  reset  ) 

Definition at line 135 of file x86timer.c.

References _get_elapsed_microseconds().

Referenced by main(), measureBridge(), and measureBridgeStats().


Variable Documentation

unsigned int CPU_CLOCK_SPEED = -1 [static]

Definition at line 20 of file x86timer.c.

Referenced by get_cpu_clock_speed(), and get_cpu_usecs().