projects
/
fio.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
rewrote libhdfs engine
[fio.git]
/
arch
/
arch-ppc.h
diff --git
a/arch/arch-ppc.h
b/arch/arch-ppc.h
index aed41f9bad6d53d6ee06978f95e8e1d131ce4a8a..161c39c511937c9a0d4604a69fa3f63da1825f26 100644
(file)
--- a/
arch/arch-ppc.h
+++ b/
arch/arch-ppc.h
@@
-67,6
+67,21
@@
static inline unsigned int mfspr(unsigned int reg)
#define SPRN_ATBL 0x20E /* Alternate Time Base Lower */
#define SPRN_ATBU 0x20F /* Alternate Time Base Upper */
#define SPRN_ATBL 0x20E /* Alternate Time Base Lower */
#define SPRN_ATBU 0x20F /* Alternate Time Base Upper */
+#ifdef __powerpc64__
+static inline unsigned long long get_cpu_clock(void)
+{
+ unsigned long long rval;
+
+ asm volatile(
+ "90: mfspr %0, %1;\n"
+ " cmpwi %0,0;\n"
+ " beq- 90b;\n"
+ : "=r" (rval)
+ : "i" (SPRN_TBRL));
+
+ return rval;
+}
+#else
static inline unsigned long long get_cpu_clock(void)
{
unsigned int tbl, tbu0, tbu1;
static inline unsigned long long get_cpu_clock(void)
{
unsigned int tbl, tbu0, tbu1;
@@
-87,6
+102,7
@@
static inline unsigned long long get_cpu_clock(void)
ret = (((unsigned long long)tbu0) << 32) | tbl;
return ret;
}
ret = (((unsigned long long)tbu0) << 32) | tbl;
return ret;
}
+#endif
#if 0
static void atb_child(void)
#if 0
static void atb_child(void)
@@
-136,4
+152,12
@@
static inline int arch_init(char *envp[])
* #define ARCH_HAVE_CPU_CLOCK
*/
* #define ARCH_HAVE_CPU_CLOCK
*/
+/*
+ * Let's have it defined for ppc64
+ */
+
+#ifdef __powerpc64__
+#define ARCH_HAVE_CPU_CLOCK
+#endif
+
#endif
#endif