aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mm/alignment.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arm/mm/alignment.c')
-rw-r--r--arch/arm/mm/alignment.c33
1 files changed, 16 insertions, 17 deletions
diff --git a/arch/arm/mm/alignment.c b/arch/arm/mm/alignment.c
index b270d6228fe2..a2ab51fa73e2 100644
--- a/arch/arm/mm/alignment.c
+++ b/arch/arm/mm/alignment.c
@@ -11,6 +11,7 @@
11 * it under the terms of the GNU General Public License version 2 as 11 * it under the terms of the GNU General Public License version 2 as
12 * published by the Free Software Foundation. 12 * published by the Free Software Foundation.
13 */ 13 */
14#include <linux/moduleparam.h>
14#include <linux/compiler.h> 15#include <linux/compiler.h>
15#include <linux/kernel.h> 16#include <linux/kernel.h>
16#include <linux/errno.h> 17#include <linux/errno.h>
@@ -77,6 +78,8 @@ static unsigned long ai_dword;
77static unsigned long ai_multi; 78static unsigned long ai_multi;
78static int ai_usermode; 79static int ai_usermode;
79 80
81core_param(alignment, ai_usermode, int, 0600);
82
80#define UM_WARN (1 << 0) 83#define UM_WARN (1 << 0)
81#define UM_FIXUP (1 << 1) 84#define UM_FIXUP (1 << 1)
82#define UM_SIGNAL (1 << 2) 85#define UM_SIGNAL (1 << 2)
@@ -163,15 +166,15 @@ union offset_union {
163 THUMB( "1: "ins" %1, [%2]\n" ) \ 166 THUMB( "1: "ins" %1, [%2]\n" ) \
164 THUMB( " add %2, %2, #1\n" ) \ 167 THUMB( " add %2, %2, #1\n" ) \
165 "2:\n" \ 168 "2:\n" \
166 " .section .fixup,\"ax\"\n" \ 169 " .pushsection .fixup,\"ax\"\n" \
167 " .align 2\n" \ 170 " .align 2\n" \
168 "3: mov %0, #1\n" \ 171 "3: mov %0, #1\n" \
169 " b 2b\n" \ 172 " b 2b\n" \
170 " .previous\n" \ 173 " .popsection\n" \
171 " .section __ex_table,\"a\"\n" \ 174 " .pushsection __ex_table,\"a\"\n" \
172 " .align 3\n" \ 175 " .align 3\n" \
173 " .long 1b, 3b\n" \ 176 " .long 1b, 3b\n" \
174 " .previous\n" \ 177 " .popsection\n" \
175 : "=r" (err), "=&r" (val), "=r" (addr) \ 178 : "=r" (err), "=&r" (val), "=r" (addr) \
176 : "0" (err), "2" (addr)) 179 : "0" (err), "2" (addr))
177 180
@@ -223,16 +226,16 @@ union offset_union {
223 " mov %1, %1, "NEXT_BYTE"\n" \ 226 " mov %1, %1, "NEXT_BYTE"\n" \
224 "2: "ins" %1, [%2]\n" \ 227 "2: "ins" %1, [%2]\n" \
225 "3:\n" \ 228 "3:\n" \
226 " .section .fixup,\"ax\"\n" \ 229 " .pushsection .fixup,\"ax\"\n" \
227 " .align 2\n" \ 230 " .align 2\n" \
228 "4: mov %0, #1\n" \ 231 "4: mov %0, #1\n" \
229 " b 3b\n" \ 232 " b 3b\n" \
230 " .previous\n" \ 233 " .popsection\n" \
231 " .section __ex_table,\"a\"\n" \ 234 " .pushsection __ex_table,\"a\"\n" \
232 " .align 3\n" \ 235 " .align 3\n" \
233 " .long 1b, 4b\n" \ 236 " .long 1b, 4b\n" \
234 " .long 2b, 4b\n" \ 237 " .long 2b, 4b\n" \
235 " .previous\n" \ 238 " .popsection\n" \
236 : "=r" (err), "=&r" (v), "=&r" (a) \ 239 : "=r" (err), "=&r" (v), "=&r" (a) \
237 : "0" (err), "1" (v), "2" (a)); \ 240 : "0" (err), "1" (v), "2" (a)); \
238 if (err) \ 241 if (err) \
@@ -263,18 +266,18 @@ union offset_union {
263 " mov %1, %1, "NEXT_BYTE"\n" \ 266 " mov %1, %1, "NEXT_BYTE"\n" \
264 "4: "ins" %1, [%2]\n" \ 267 "4: "ins" %1, [%2]\n" \
265 "5:\n" \ 268 "5:\n" \
266 " .section .fixup,\"ax\"\n" \ 269 " .pushsection .fixup,\"ax\"\n" \
267 " .align 2\n" \ 270 " .align 2\n" \
268 "6: mov %0, #1\n" \ 271 "6: mov %0, #1\n" \
269 " b 5b\n" \ 272 " b 5b\n" \
270 " .previous\n" \ 273 " .popsection\n" \
271 " .section __ex_table,\"a\"\n" \ 274 " .pushsection __ex_table,\"a\"\n" \
272 " .align 3\n" \ 275 " .align 3\n" \
273 " .long 1b, 6b\n" \ 276 " .long 1b, 6b\n" \
274 " .long 2b, 6b\n" \ 277 " .long 2b, 6b\n" \
275 " .long 3b, 6b\n" \ 278 " .long 3b, 6b\n" \
276 " .long 4b, 6b\n" \ 279 " .long 4b, 6b\n" \
277 " .previous\n" \ 280 " .popsection\n" \
278 : "=r" (err), "=&r" (v), "=&r" (a) \ 281 : "=r" (err), "=&r" (v), "=&r" (a) \
279 : "0" (err), "1" (v), "2" (a)); \ 282 : "0" (err), "1" (v), "2" (a)); \
280 if (err) \ 283 if (err) \
@@ -898,11 +901,7 @@ static int __init alignment_init(void)
898#ifdef CONFIG_PROC_FS 901#ifdef CONFIG_PROC_FS
899 struct proc_dir_entry *res; 902 struct proc_dir_entry *res;
900 903
901 res = proc_mkdir("cpu", NULL); 904 res = create_proc_entry("cpu/alignment", S_IWUSR | S_IRUGO, NULL);
902 if (!res)
903 return -ENOMEM;
904
905 res = create_proc_entry("alignment", S_IWUSR | S_IRUGO, res);
906 if (!res) 905 if (!res)
907 return -ENOMEM; 906 return -ENOMEM;
908 907