summaryrefslogtreecommitdiff
path: root/config
diff options
context:
space:
mode:
authorpieterpalmers <pieterpalmers@0c269be4-1314-0410-8aa9-9f06e86f4224>2008-05-12 01:14:30 +0000
committerpieterpalmers <pieterpalmers@0c269be4-1314-0410-8aa9-9f06e86f4224>2008-05-12 01:14:30 +0000
commitb72e4f2da79925ba14f691c5a974f294e2595e64 (patch)
tree3363dd297ed86dfc20f90a4cef74e8254b2f7a9b /config
parent9f619ce3905f2850312d3dd3cc2d363176a43126 (diff)
downloadjack1-b72e4f2da79925ba14f691c5a974f294e2595e64.tar.gz
Fix powerpc64 issues (patch by Heikki Lindholm). closes ticket #51
git-svn-id: svn+ssh://jackaudio.org/trunk/jack@1181 0c269be4-1314-0410-8aa9-9f06e86f4224
Diffstat (limited to 'config')
-rw-r--r--config/cpu/powerpc/cycles.h24
1 files changed, 24 insertions, 0 deletions
diff --git a/config/cpu/powerpc/cycles.h b/config/cpu/powerpc/cycles.h
index 45c874b..bdf9908 100644
--- a/config/cpu/powerpc/cycles.h
+++ b/config/cpu/powerpc/cycles.h
@@ -24,6 +24,9 @@
/* PowerPC */
#define CPU_FTR_601 0x00000100
+#ifdef __powerpc64__
+#define CPU_FTR_CELL_TB_BUG 0x0000800000000000UL
+#endif /* __powerpc64__ */
typedef unsigned long cycles_t;
@@ -35,6 +38,26 @@ static inline cycles_t get_cycles(void)
{
cycles_t ret = 0;
+#ifdef __powerpc64__
+#ifdef ENABLE_CELLBE
+ asm volatile( \
+ "90: mftb %0;\n" \
+ "97: cmpwi %0,0;\n" \
+ " beq- 90b;\n" \
+ "99:\n" \
+ ".section __ftr_fixup,\"a\"\n" \
+ ".align 3\n" \
+ "98:\n" \
+ " .llong %1\n" \
+ " .llong %1\n" \
+ " .llong 97b-98b\n" \
+ " .llong 99b-98b\n" \
+ ".previous" \
+ : "=r" (ret) : "i" (CPU_FTR_CELL_TB_BUG));
+#else /* !ENABLE_CELLBE */
+ __asm__ __volatile__("mftb %0" : "=r" (ret));
+#endif /* !ENABLE_CELLBE */
+#else /* !__powerpc64__ */
__asm__ __volatile__(
"98: mftb %0\n"
"99:\n"
@@ -45,6 +68,7 @@ static inline cycles_t get_cycles(void)
" .long 99b\n"
".previous"
: "=r" (ret) : "i" (CPU_FTR_601));
+#endif /* !__powerpc64__ */
return ret;
}