projects
/
userspace-rcu.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
rculfhash: remove now unneeded gc flag (combine with removed)
[userspace-rcu.git]
/
urcu
/
arch
/
ppc.h
diff --git
a/urcu/arch/ppc.h
b/urcu/arch/ppc.h
index d7317bb327c72afa48f087f50251cbe311a2ff62..a03d688837344f0bb2d438c7161d43dcb208a5ef 100644
(file)
--- a/
urcu/arch/ppc.h
+++ b/
urcu/arch/ppc.h
@@
-48,11
+48,24
@@
extern "C" {
rval; \
})
rval; \
})
+#define mftb() \
+ ({ \
+ unsigned long long rval; \
+ asm volatile("mftb %0" : "=r" (rval)); \
+ rval; \
+ })
+
typedef unsigned long long cycles_t;
typedef unsigned long long cycles_t;
-static inline cycles_t caa_get_cycles (void)
+#ifdef __powerpc64__
+static inline cycles_t caa_get_cycles(void)
{
{
- long h, l;
+ return (cycles_t) mftb();
+}
+#else
+static inline cycles_t caa_get_cycles(void)
+{
+ unsigned long h, l;
for (;;) {
h = mftbu();
for (;;) {
h = mftbu();
@@
-63,6
+76,7
@@
static inline cycles_t caa_get_cycles (void)
return (((cycles_t) h) << 32) + l;
}
}
return (((cycles_t) h) << 32) + l;
}
}
+#endif
#ifdef __cplusplus
}
#ifdef __cplusplus
}
This page took
0.022948 seconds
and
4
git commands to generate.