From: gilles.carry <gilles.carry>

Signed-off-by: Gilles Carry <[EMAIL PROTECTED]>
Cc: Tim Chavez <[EMAIL PROTECTED]>

---
 testcases/realtime/include/librttest.h |   13 ++++++++++---
 1 files changed, 10 insertions(+), 3 deletions(-)

diff --git a/testcases/realtime/include/librttest.h 
b/testcases/realtime/include/librttest.h
index 8f1b362..cf6c7fa 100644
--- a/testcases/realtime/include/librttest.h
+++ b/testcases/realtime/include/librttest.h
@@ -99,7 +99,7 @@ typedef struct { volatile int counter; } atomic_t;
 /* TSC macros */
 #define ULL_MAX 18446744073709551615ULL // (1 << 64) - 1
 #if defined(__i386__)
-#define rdtscll(val) __asm__ __volatile__("rdtsc" : "=A" (val))
+#define rdtscll(val)    __asm__ __volatile__("rdtsc" : "=A" (val))
 #elif defined(__x86_64__)
 #define rdtscll(val)                                   \
        do {                                            \
@@ -107,14 +107,21 @@ typedef struct { volatile int counter; } atomic_t;
                __asm__ __volatile__ ("rdtsc" : "=a" (low), "=d" (high)); \
                val = (uint64_t)high << 32 | low;       \
        } while(0)
-#elif defined(__powerpc__)     /* 32bit version */
+#elif defined(__powerpc__)
+#if defined(__powerpc64__)     /* 64 bit version */
+#define rdtscll(val)                                                   \
+       do {                                                            \
+                       __asm__ __volatile__ ("mfspr %0, 268" : "=r" (val));    
\
+       } while(0)
+#else  /* powerpc 32 bit version */
 #define rdtscll(val)                                                   \
         do {                                                           \
                uint32_t tbhi, tblo ;                                   \
                __asm__ __volatile__ ("mftbu %0" : "=r" (tbhi));        \
                __asm__ __volatile__ ("mftbl %0" : "=r" (tblo));        \
-               val = 1000 * ((uint64_t) tbhi << 32) | tblo;            \
+               val = 1000 * ((uint64_t) tbhi <<32) | tblo;             \
        } while(0)
+#endif
 #else
 #error
 #endif
-- 
1.5.5.GIT


-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list

Reply via email to