Module: xenomai-2.6
Branch: master
Commit: b967527100380eee6ca708e47b5c837d834c3ad9
URL:    
http://git.xenomai.org/?p=xenomai-2.6.git;a=commit;h=b967527100380eee6ca708e47b5c837d834c3ad9

Author: Charles Retailleau <charles.retaill...@axesseurope.com>
Date:   Fri Aug 17 20:23:15 2012 +0200

hal/powerpc: fix __xn_rdtsc for newer ppc cores

Where the mftb and mftbu instructions are not supported.
Replace them with mfspr.

---

 include/asm-powerpc/syscall.h |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/include/asm-powerpc/syscall.h b/include/asm-powerpc/syscall.h
index d5bb809..b116101 100644
--- a/include/asm-powerpc/syscall.h
+++ b/include/asm-powerpc/syscall.h
@@ -167,9 +167,9 @@ static inline unsigned long long __xn_rdtsc(void)
        } u;
        unsigned long __tbu;
 
-       __asm__ __volatile__("1: mftbu %0\n"
-                            "mftb %1\n"
-                            "mftbu %2\n"
+       __asm__ __volatile__("1: mfspr %0,269\n"
+                            "mfspr %1,268\n"
+                            "mfspr %2,269\n"
                             "cmpw %2,%0\n"
                             "bne- 1b\n":"=r"(u.v[0]),
                             "=r"(u.v[1]), "=r"(__tbu));


_______________________________________________
Xenomai-git mailing list
Xenomai-git@xenomai.org
http://www.xenomai.org/mailman/listinfo/xenomai-git

Reply via email to