diff options
-rw-r--r-- | arch/arm64/Kconfig | 1 | ||||
-rw-r--r-- | arch/arm64/include/asm/word-at-a-time.h | 40 |
2 files changed, 41 insertions, 0 deletions
diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig index 295bf2de7128..435c9bc1c86c 100644 --- a/arch/arm64/Kconfig +++ b/arch/arm64/Kconfig | |||
@@ -11,6 +11,7 @@ config ARM64 | |||
11 | select BUILDTIME_EXTABLE_SORT | 11 | select BUILDTIME_EXTABLE_SORT |
12 | select CLONE_BACKWARDS | 12 | select CLONE_BACKWARDS |
13 | select COMMON_CLK | 13 | select COMMON_CLK |
14 | select DCACHE_WORD_ACCESS | ||
14 | select GENERIC_CLOCKEVENTS | 15 | select GENERIC_CLOCKEVENTS |
15 | select GENERIC_IOMAP | 16 | select GENERIC_IOMAP |
16 | select GENERIC_IRQ_PROBE | 17 | select GENERIC_IRQ_PROBE |
diff --git a/arch/arm64/include/asm/word-at-a-time.h b/arch/arm64/include/asm/word-at-a-time.h index 27a167d044d9..aab5bf09e9d9 100644 --- a/arch/arm64/include/asm/word-at-a-time.h +++ b/arch/arm64/include/asm/word-at-a-time.h | |||
@@ -47,8 +47,48 @@ static inline unsigned long find_zero(unsigned long mask) | |||
47 | return fls64(mask) >> 3; | 47 | return fls64(mask) >> 3; |
48 | } | 48 | } |
49 | 49 | ||
50 | #define zero_bytemask(mask) (mask) | ||
51 | |||
50 | #else /* __AARCH64EB__ */ | 52 | #else /* __AARCH64EB__ */ |
51 | #include <asm-generic/word-at-a-time.h> | 53 | #include <asm-generic/word-at-a-time.h> |
52 | #endif | 54 | #endif |
53 | 55 | ||
56 | /* | ||
57 | * Load an unaligned word from kernel space. | ||
58 | * | ||
59 | * In the (very unlikely) case of the word being a page-crosser | ||
60 | * and the next page not being mapped, take the exception and | ||
61 | * return zeroes in the non-existing part. | ||
62 | */ | ||
63 | static inline unsigned long load_unaligned_zeropad(const void *addr) | ||
64 | { | ||
65 | unsigned long ret, offset; | ||
66 | |||
67 | /* Load word from unaligned pointer addr */ | ||
68 | asm( | ||
69 | "1: ldr %0, %3\n" | ||
70 | "2:\n" | ||
71 | " .pushsection .fixup,\"ax\"\n" | ||
72 | " .align 2\n" | ||
73 | "3: and %1, %2, #0x7\n" | ||
74 | " bic %2, %2, #0x7\n" | ||
75 | " ldr %0, [%2]\n" | ||
76 | " lsl %1, %1, #0x3\n" | ||
77 | #ifndef __AARCH64EB__ | ||
78 | " lsr %0, %0, %1\n" | ||
79 | #else | ||
80 | " lsl %0, %0, %1\n" | ||
81 | #endif | ||
82 | " b 2b\n" | ||
83 | " .popsection\n" | ||
84 | " .pushsection __ex_table,\"a\"\n" | ||
85 | " .align 3\n" | ||
86 | " .quad 1b, 3b\n" | ||
87 | " .popsection" | ||
88 | : "=&r" (ret), "=&r" (offset) | ||
89 | : "r" (addr), "Q" (*(unsigned long *)addr)); | ||
90 | |||
91 | return ret; | ||
92 | } | ||
93 | |||
54 | #endif /* __ASM_WORD_AT_A_TIME_H */ | 94 | #endif /* __ASM_WORD_AT_A_TIME_H */ |