diff options
author | Michael Ellerman <mpe@ellerman.id.au> | 2015-10-12 00:28:57 -0400 |
---|---|---|
committer | Michael Ellerman <mpe@ellerman.id.au> | 2015-10-13 00:08:37 -0400 |
commit | abb39bc792aa8e9143e78a39ec13d7de1391f4b4 (patch) | |
tree | 14473279e495bc74e1c89c2f0ba0c6291fffd871 /tools | |
parent | f2dd80ecca5f06b46134f2bd811f046c503c756c (diff) |
selftests/powerpc: Fix build failure of load_unaligned_zeropad test
Commit 7a5692e6e533 ("arch/powerpc: provide zero_bytemask() for
big-endian") added a call to __fls() in our word-at-a-time.h. That was
fine for the kernel build but missed the fact that we also use
word-at-a-time.h in a userspace test.
Pulling in the kernel version of __fls() gets messy, so just define our
own, it's unlikely to change often.
Fixes: 7a5692e6e533 ("arch/powerpc: provide zero_bytemask() for big-endian")
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
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; |