Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix for compiling on ppc64le, bug #69744 at https://bugs.php.net/bug.php?id=69744 #97

Open
wants to merge 12 commits into
base: master
Choose a base branch
from
11 changes: 11 additions & 0 deletions extension/xhprof.c
Original file line number Diff line number Diff line change
Expand Up @@ -1232,7 +1232,18 @@ void hp_sample_check(hp_entry_t **entries TSRMLS_DC) {
static inline uint64 cycle_timer() {
uint32 __a,__d;
uint64 val;
#ifdef _ARCH_PPC64
asm volatile(
"0: mftbu %0\n\t"
" mftb %1\n\t"
" mftbu 0\n\t"
" cmpw %0,0\n\t"
" bne 0b\n\t"
: "=r" (__d), "=r" (__a)
: : "r0", "cc");
#else
asm volatile("rdtsc" : "=a" (__a), "=d" (__d));
#endif
(val) = ((uint64)__a) | (((uint64)__d)<<32);
return val;
}
Expand Down