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
9
10#ifdef __i386
12
14extern 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
23extern 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