diff options
Diffstat (limited to 'tools')
-rw-r--r-- | tools/testing/selftests/powerpc/primitives/load_unaligned_zeropad.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/tools/testing/selftests/powerpc/primitives/load_unaligned_zeropad.c b/tools/testing/selftests/powerpc/primitives/load_unaligned_zeropad.c index d1b647509596..6cae06117b55 100644 --- a/tools/testing/selftests/powerpc/primitives/load_unaligned_zeropad.c +++ b/tools/testing/selftests/powerpc/primitives/load_unaligned_zeropad.c | |||
@@ -25,10 +25,19 @@ | |||
25 | 25 | ||
26 | #define FIXUP_SECTION ".ex_fixup" | 26 | #define FIXUP_SECTION ".ex_fixup" |
27 | 27 | ||
28 | static inline unsigned long __fls(unsigned long x); | ||
29 | |||
28 | #include "word-at-a-time.h" | 30 | #include "word-at-a-time.h" |
29 | 31 | ||
30 | #include "utils.h" | 32 | #include "utils.h" |
31 | 33 | ||
34 | static inline unsigned long __fls(unsigned long x) | ||
35 | { | ||
36 | int lz; | ||
37 | |||
38 | asm (PPC_CNTLZL "%0,%1" : "=r" (lz) : "r" (x)); | ||
39 | return sizeof(unsigned long) - 1 - lz; | ||
40 | } | ||
32 | 41 | ||
33 | static int page_size; | 42 | static int page_size; |
34 | static char *mem_region; | 43 | static char *mem_region; |