summaryrefslogtreecommitdiff
path: root/arch/powerpc/include/asm/word-at-a-time.h
diff options
context:
space:
mode:
authorMichael Ellerman <mpe@ellerman.id.au>2014-09-25 16:45:11 +1000
committerMichael Ellerman <mpe@ellerman.id.au>2014-09-30 14:59:12 +1000
commitfe2a1bb1dbff1bc7b8c24eb1f691a544488617fa (patch)
treea224f729189b0cb116be365eb13235de8679be57 /arch/powerpc/include/asm/word-at-a-time.h
parentde5946c03575fb8c222610a6ac6726a5deabad46 (diff)
selftests/powerpc: Add test of load_unaligned_zero_pad()
It is a rarely exercised case, so we want to have a test to ensure it works as required. Signed-off-by: Anton Blanchard <anton@samba.org> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Diffstat (limited to 'arch/powerpc/include/asm/word-at-a-time.h')
-rw-r--r--arch/powerpc/include/asm/word-at-a-time.h13
1 files changed, 12 insertions, 1 deletions
diff --git a/arch/powerpc/include/asm/word-at-a-time.h b/arch/powerpc/include/asm/word-at-a-time.h
index 07cc121e8a79..ea52b51be401 100644
--- a/arch/powerpc/include/asm/word-at-a-time.h
+++ b/arch/powerpc/include/asm/word-at-a-time.h
@@ -116,6 +116,15 @@ static inline unsigned long prep_zero_mask(unsigned long a, unsigned long bits,
#endif
+/*
+ * We use load_unaligned_zero() in a selftest, which builds a userspace
+ * program. Some linker scripts seem to discard the .fixup section, so allow
+ * the test code to use a different section name.
+ */
+#ifndef FIXUP_SECTION
+#define FIXUP_SECTION ".fixup"
+#endif
+
static inline unsigned long load_unaligned_zeropad(const void *addr)
{
unsigned long ret, offset, tmp;
@@ -123,7 +132,7 @@ static inline unsigned long load_unaligned_zeropad(const void *addr)
asm(
"1: " PPC_LL "%[ret], 0(%[addr])\n"
"2:\n"
- ".section .fixup,\"ax\"\n"
+ ".section " FIXUP_SECTION ",\"ax\"\n"
"3: "
#ifdef __powerpc64__
"clrrdi %[tmp], %[addr], 3\n\t"
@@ -156,4 +165,6 @@ static inline unsigned long load_unaligned_zeropad(const void *addr)
return ret;
}
+#undef FIXUP_SECTION
+
#endif /* _ASM_WORD_AT_A_TIME_H */