equal
deleted
inserted
replaced
33 # pragma aux ottd_rdtsc = 0x0F 0x31 value [edx eax] parm nomemory modify exact [edx eax] nomemory; |
33 # pragma aux ottd_rdtsc = 0x0F 0x31 value [edx eax] parm nomemory modify exact [edx eax] nomemory; |
34 # define RDTSC_AVAILABLE |
34 # define RDTSC_AVAILABLE |
35 #endif |
35 #endif |
36 |
36 |
37 /* rdtsc for all other *nix-en (hopefully). Use GCC syntax */ |
37 /* rdtsc for all other *nix-en (hopefully). Use GCC syntax */ |
38 #if defined(__i386__) || defined(__x86_64__) && !defined(RDTSC_AVAILABLE) |
38 #if (defined(__i386__) || defined(__x86_64__)) && !defined(__DJGPP__) && !defined(RDTSC_AVAILABLE) |
39 uint64 ottd_rdtsc() |
39 uint64 ottd_rdtsc() |
40 { |
40 { |
41 uint32 high, low; |
41 uint32 high, low; |
42 __asm__ __volatile__ ("rdtsc" : "=a" (low), "=d" (high)); |
42 __asm__ __volatile__ ("rdtsc" : "=a" (low), "=d" (high)); |
43 return ((uint64)high << 32) | low; |
43 return ((uint64)high << 32) | low; |