projects
/
fio.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
arch-ppc.h: Add ilog2 implementation for ppc64
[fio.git]
/
arch
/
arch-ppc.h
diff --git
a/arch/arch-ppc.h
b/arch/arch-ppc.h
index 0f043bce5348731a6c5ec3775ded5b027aa715c4..aed41f9bad6d53d6ee06978f95e8e1d131ce4a8a 100644
(file)
--- a/
arch/arch-ppc.h
+++ b/
arch/arch-ppc.h
@@
-33,18
+33,24
@@
#define write_barrier() __asm__ __volatile__ ("sync" : : : "memory")
#define write_barrier() __asm__ __volatile__ ("sync" : : : "memory")
+#ifdef __powerpc64__
+#define PPC_CNTLZL "cntlzd"
+#else
+#define PPC_CNTLZL "cntlzw"
+#endif
+
static inline int __ilog2(unsigned long bitmask)
{
int lz;
static inline int __ilog2(unsigned long bitmask)
{
int lz;
- asm (
"cntlzw
%0,%1" : "=r" (lz) : "r" (bitmask));
- return
3
1 - lz;
+ asm (
PPC_CNTLZL "
%0,%1" : "=r" (lz) : "r" (bitmask));
+ return
BITS_PER_LONG -
1 - lz;
}
static inline int arch_ffz(unsigned long bitmask)
{
if ((bitmask = ~bitmask) == 0)
}
static inline int arch_ffz(unsigned long bitmask)
{
if ((bitmask = ~bitmask) == 0)
- return
32
;
+ return
BITS_PER_LONG
;
return __ilog2(bitmask & -bitmask);
}
return __ilog2(bitmask & -bitmask);
}
@@
-82,6
+88,7
@@
static inline unsigned long long get_cpu_clock(void)
return ret;
}
return ret;
}
+#if 0
static void atb_child(void)
{
arch_flags |= ARCH_FLAG_1;
static void atb_child(void)
{
arch_flags |= ARCH_FLAG_1;
@@
-106,6
+113,7
@@
static void atb_clocktest(void)
arch_flags |= ARCH_FLAG_1;
}
}
arch_flags |= ARCH_FLAG_1;
}
}
+#endif
#define ARCH_HAVE_INIT
extern int tsc_reliable;
#define ARCH_HAVE_INIT
extern int tsc_reliable;