Merge branch 'for-linus' of git://oss.sgi.com/xfs/xfs
[safe/jmp/linux-2.6] / arch / arm / mm / alignment.c
index 03cd27d..a2ab51f 100644 (file)
@@ -11,6 +11,7 @@
  * it under the terms of the GNU General Public License version 2 as
  * published by the Free Software Foundation.
  */
+#include <linux/moduleparam.h>
 #include <linux/compiler.h>
 #include <linux/kernel.h>
 #include <linux/errno.h>
@@ -77,6 +78,8 @@ static unsigned long ai_dword;
 static unsigned long ai_multi;
 static int ai_usermode;
 
+core_param(alignment, ai_usermode, int, 0600);
+
 #define UM_WARN                (1 << 0)
 #define UM_FIXUP       (1 << 1)
 #define UM_SIGNAL      (1 << 2)
@@ -159,17 +162,19 @@ union offset_union {
 
 #define __get8_unaligned_check(ins,val,addr,err)       \
        __asm__(                                        \
-       "1:     "ins"   %1, [%2], #1\n"                 \
+ ARM(  "1:     "ins"   %1, [%2], #1\n" )               \
+ THUMB(        "1:     "ins"   %1, [%2]\n"     )               \
+ THUMB(        "       add     %2, %2, #1\n"   )               \
        "2:\n"                                          \
-       "       .section .fixup,\"ax\"\n"               \
+       "       .pushsection .fixup,\"ax\"\n"           \
        "       .align  2\n"                            \
        "3:     mov     %0, #1\n"                       \
        "       b       2b\n"                           \
-       "       .previous\n"                            \
-       "       .section __ex_table,\"a\"\n"            \
+       "       .popsection\n"                          \
+       "       .pushsection __ex_table,\"a\"\n"        \
        "       .align  3\n"                            \
        "       .long   1b, 3b\n"                       \
-       "       .previous\n"                            \
+       "       .popsection\n"                          \
        : "=r" (err), "=&r" (val), "=r" (addr)          \
        : "0" (err), "2" (addr))
 
@@ -215,20 +220,22 @@ union offset_union {
        do {                                                    \
                unsigned int err = 0, v = val, a = addr;        \
                __asm__( FIRST_BYTE_16                          \
-               "1:     "ins"   %1, [%2], #1\n"                 \
+        ARM(   "1:     "ins"   %1, [%2], #1\n" )               \
+        THUMB( "1:     "ins"   %1, [%2]\n"     )               \
+        THUMB( "       add     %2, %2, #1\n"   )               \
                "       mov     %1, %1, "NEXT_BYTE"\n"          \
                "2:     "ins"   %1, [%2]\n"                     \
                "3:\n"                                          \
-               "       .section .fixup,\"ax\"\n"               \
+               "       .pushsection .fixup,\"ax\"\n"           \
                "       .align  2\n"                            \
                "4:     mov     %0, #1\n"                       \
                "       b       3b\n"                           \
-               "       .previous\n"                            \
-               "       .section __ex_table,\"a\"\n"            \
+               "       .popsection\n"                          \
+               "       .pushsection __ex_table,\"a\"\n"        \
                "       .align  3\n"                            \
                "       .long   1b, 4b\n"                       \
                "       .long   2b, 4b\n"                       \
-               "       .previous\n"                            \
+               "       .popsection\n"                          \
                : "=r" (err), "=&r" (v), "=&r" (a)              \
                : "0" (err), "1" (v), "2" (a));                 \
                if (err)                                        \
@@ -245,26 +252,32 @@ union offset_union {
        do {                                                    \
                unsigned int err = 0, v = val, a = addr;        \
                __asm__( FIRST_BYTE_32                          \
-               "1:     "ins"   %1, [%2], #1\n"                 \
+        ARM(   "1:     "ins"   %1, [%2], #1\n" )               \
+        THUMB( "1:     "ins"   %1, [%2]\n"     )               \
+        THUMB( "       add     %2, %2, #1\n"   )               \
                "       mov     %1, %1, "NEXT_BYTE"\n"          \
-               "2:     "ins"   %1, [%2], #1\n"                 \
+        ARM(   "2:     "ins"   %1, [%2], #1\n" )               \
+        THUMB( "2:     "ins"   %1, [%2]\n"     )               \
+        THUMB( "       add     %2, %2, #1\n"   )               \
                "       mov     %1, %1, "NEXT_BYTE"\n"          \
-               "3:     "ins"   %1, [%2], #1\n"                 \
+        ARM(   "3:     "ins"   %1, [%2], #1\n" )               \
+        THUMB( "3:     "ins"   %1, [%2]\n"     )               \
+        THUMB( "       add     %2, %2, #1\n"   )               \
                "       mov     %1, %1, "NEXT_BYTE"\n"          \
                "4:     "ins"   %1, [%2]\n"                     \
                "5:\n"                                          \
-               "       .section .fixup,\"ax\"\n"               \
+               "       .pushsection .fixup,\"ax\"\n"           \
                "       .align  2\n"                            \
                "6:     mov     %0, #1\n"                       \
                "       b       5b\n"                           \
-               "       .previous\n"                            \
-               "       .section __ex_table,\"a\"\n"            \
+               "       .popsection\n"                          \
+               "       .pushsection __ex_table,\"a\"\n"        \
                "       .align  3\n"                            \
                "       .long   1b, 6b\n"                       \
                "       .long   2b, 6b\n"                       \
                "       .long   3b, 6b\n"                       \
                "       .long   4b, 6b\n"                       \
-               "       .previous\n"                            \
+               "       .popsection\n"                          \
                : "=r" (err), "=&r" (v), "=&r" (a)              \
                : "0" (err), "1" (v), "2" (a));                 \
                if (err)                                        \
@@ -888,11 +901,7 @@ static int __init alignment_init(void)
 #ifdef CONFIG_PROC_FS
        struct proc_dir_entry *res;
 
-       res = proc_mkdir("cpu", NULL);
-       if (!res)
-               return -ENOMEM;
-
-       res = create_proc_entry("alignment", S_IWUSR | S_IRUGO, res);
+       res = create_proc_entry("cpu/alignment", S_IWUSR | S_IRUGO, NULL);
        if (!res)
                return -ENOMEM;