PhoenixHardware
0.2.0
Tools to get hardware information
Loading...
Searching...
No Matches
phoenix_hardware_rdtsc.cpp
Go to the documentation of this file.
1
/***************************************
2
Auteur : Pierre Aubert
3
Mail : pierre.aubert@lapp.in2p3.fr
4
Licence : CeCILL-C
5
****************************************/
6
7
8
#include "
phoenix_hardware_rdtsc.h
"
9
10
#ifdef __i386
12
14
extern
long
unsigned
int
phoenix_hardware_rdtsc(
void
) {
15
long
unsigned
int
x;
16
__asm__
volatile
(
"rdtsc"
:
"=A"
(x));
17
return
x;
18
}
19
#elif defined __amd64
21
23
extern
long
unsigned
int
phoenix_hardware_rdtsc(
void
) {
24
long
unsigned
int
a, d;
25
__asm__
volatile
(
"rdtsc"
:
"=a"
(a),
"=d"
(d));
26
return
(d<<32) | a;
27
}
28
#endif
29
30
31
phoenix_hardware_rdtsc.h
src
phoenix_hardware_rdtsc.cpp
Generated by
1.13.2