]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
ARM: remove global cr_no_alignment
authorRussell King <rmk+kernel@arm.linux.org.uk>
Sun, 13 Apr 2014 18:43:26 +0000 (19:43 +0100)
committerRussell King <rmk+kernel@arm.linux.org.uk>
Mon, 2 Jun 2014 08:20:18 +0000 (09:20 +0100)
cr_no_alignment is really only used by the alignment code.  Since we no
longer change the setting of cr_alignment after boot, we can localise
this to alignment.c

Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
arch/arm/include/asm/cp15.h
arch/arm/kernel/entry-armv.S
arch/arm/kernel/head-common.S
arch/arm/mm/alignment.c
arch/arm/mm/init.c

index ebae45d7f01750edee100e417c6ed56eb7edc7ce..c3f11524f10c4c594fb6e5a03f97f286824ee5be 100644 (file)
@@ -49,7 +49,6 @@
 
 #ifdef CONFIG_CPU_CP15
 
-extern unsigned long cr_no_alignment;  /* defined in entry-armv.S */
 extern unsigned long cr_alignment;     /* defined in entry-armv.S */
 
 static inline unsigned long get_cr(void)
@@ -102,11 +101,10 @@ static inline void set_copro_access(unsigned int val)
 #else /* ifdef CONFIG_CPU_CP15 */
 
 /*
- * cr_alignment and cr_no_alignment are tightly coupled to cp15 (at least in the
- * minds of the developers). Yielding 0 for machines without a cp15 (and making
- * it read-only) is fine for most cases and saves quite some #ifdeffery.
+ * cr_alignment is tightly coupled to cp15 (at least in the minds of the
+ * developers). Yielding 0 for machines without a cp15 (and making it
+ * read-only) is fine for most cases and saves quite some #ifdeffery.
  */
-#define cr_no_alignment        UL(0)
 #define cr_alignment   UL(0)
 
 static inline unsigned long get_cr(void)
index 1879e8dd2acc18a7837f0eee71beb8241c1aa9c0..cac5b88216e68464a2bc41e83be8bd0255b83e8e 100644 (file)
@@ -1143,11 +1143,8 @@ __vectors_start:
        .data
 
        .globl  cr_alignment
-       .globl  cr_no_alignment
 cr_alignment:
        .space  4
-cr_no_alignment:
-       .space  4
 
 #ifdef CONFIG_MULTI_IRQ_HANDLER
        .globl  handle_arch_irq
index c96ecacb2021222936844a4807f39ef474965879..572a38335c9627a81307c4a88f7ab0981332af0f 100644 (file)
@@ -99,8 +99,7 @@ __mmap_switched:
        str     r1, [r5]                        @ Save machine type
        str     r2, [r6]                        @ Save atags pointer
        cmp     r7, #0
-       bicne   r4, r0, #CR_A                   @ Clear 'A' bit
-       stmneia r7, {r0, r4}                    @ Save control register values
+       strne   r0, [r7]                        @ Save control register values
        b       start_kernel
 ENDPROC(__mmap_switched)
 
index 054e995d2f5b290dcb903828e15b17b4a1f8e95f..b8cb1a2688a08bd46b3ac2426c82f37e3902e8e6 100644 (file)
@@ -82,6 +82,7 @@ static unsigned long ai_word;
 static unsigned long ai_dword;
 static unsigned long ai_multi;
 static int ai_usermode;
+static unsigned long cr_no_alignment;
 
 core_param(alignment, ai_usermode, int, 0600);
 
@@ -979,6 +980,8 @@ static int __init alignment_init(void)
                ai_usermode = safe_usermode(ai_usermode, false);
        }
 
+       cr_no_alignment = get_cr() & ~CR_A;
+
        hook_fault_code(FAULT_CODE_ALIGNMENT, do_alignment, SIGBUS, BUS_ADRALN,
                        "alignment exception");
 
index 94332b1ad4bc2c86efd4041a8e60138fc1ddd378..13ce33e096b5a3378aa2ed3c001b0c0efcbefb63 100644 (file)
@@ -40,7 +40,6 @@
 #ifdef CONFIG_CPU_CP15_MMU
 unsigned long __init __clear_cr(unsigned long mask)
 {
-       cr_no_alignment = cr_no_alignment & ~mask;
        cr_alignment = cr_alignment & ~mask;
        return cr_alignment;
 }