|
|
#include "dyn_misc.h" | #include "dyn_misc.h" |
#include "misc.h" | #include "misc.h" |
| |
|
#define rdtsc(low,high) \ |
|
__asm__ __volatile__("rdtsc" : "=a" (low), "=d" (high)) |
|
|
|
|
|
|
char *xStrdup (const char *t) {{{ | char *xStrdup (const char *t) {{{ |
char *ret; | char *ret; |
ret = strdup (t); | ret = strdup (t); |
|
|
| |
void getTimeStampCounter ( TimeStampCounter *t ) {{{ | void getTimeStampCounter ( TimeStampCounter *t ) {{{ |
#ifdef TIMER | #ifdef TIMER |
unsigned int h=t->high; |
unsigned long h=t->high; |
unsigned int l=t->low ; |
unsigned long l=t->low ; |
asm ( |
rdtsc(l,h); |
"push %%eax \n" |
|
"push %%edx \n" |
|
"rdtsc \n" |
|
"movl %%eax,%1 \n" |
|
"movl %%edx,%0 \n" |
|
"pop %%edx \n" |
|
"pop %%edx \n" |
|
: "=m" (h) , "=m" (l) |
|
); |
|
t->high = h; | t->high = h; |
t->low = l; | t->low = l; |
#else | #else |
|
|
| |
char *xStrdup (const char *t); | char *xStrdup (const char *t); |
| |
typedef struct { unsigned int high, low; } TimeStampCounter; |
typedef struct { unsigned long high, low; } TimeStampCounter; |
void getTimeStampCounter ( TimeStampCounter *t ); | void getTimeStampCounter ( TimeStampCounter *t ); |
void Start_Timer (unsigned int idx); | void Start_Timer (unsigned int idx); |
void Ende_Timer (unsigned int idx); | void Ende_Timer (unsigned int idx); |