[PATCH] Misc minor fixes
[fio.git] / arch-ppc.h
CommitLineData
ebac4655
JA
1#ifndef ARCH_PPC_H
2#define ARCH_PPH_H
3
4#define ARCH (arch_ppc)
5
6#ifndef __NR_ioprio_set
7#define __NR_ioprio_set 273
8#define __NR_ioprio_get 274
9#endif
10
11#ifndef __NR_fadvise64
12#define __NR_fadvise64 233
13#endif
14
15#define nop do { } while (0)
16
17static inline int __ilog2(unsigned long bitmask)
18{
19 int lz;
20
21 asm ("cntlzw %0,%1" : "=r" (lz) : "r" (bitmask));
22 return 31 - lz;
23}
24
25static inline int ffz(unsigned long bitmask)
26{
27 if ((bitmask = ~bitmask) == 0)
28 return 32;
29 return __ilog2(bitmask & -bitmask);
30}
31
32#endif