diff options
author | Uwe Kleine-König <u.kleine-koenig@pengutronix.de> | 2012-01-16 04:34:31 -0500 |
---|---|---|
committer | Uwe Kleine-König <u.kleine-koenig@pengutronix.de> | 2013-01-31 15:44:45 -0500 |
commit | b849a60e0903b1c5430c3859864554662e127a8d (patch) | |
tree | fe441d30362531fa204b52661a3d20a7f836fb19 /arch/arm/kernel/head-common.S | |
parent | 949db153b6466c6f7cad5a427ecea94985927311 (diff) |
ARM: make cr_alignment read-only #ifndef CONFIG_CPU_CP15
This makes cr_alignment a constant 0 to break code that tries to modify
the value as it's likely that it's built on wrong assumption when
CONFIG_CPU_CP15 isn't defined. For code that is only reading the value 0
is more or less a fine value to report.
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Message-Id: 1358413196-5609-2-git-send-email-u.kleine-koenig@pengutronix.de (v8)
Diffstat (limited to 'arch/arm/kernel/head-common.S')
-rw-r--r-- | arch/arm/kernel/head-common.S | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/arch/arm/kernel/head-common.S b/arch/arm/kernel/head-common.S index 854bd22380d3..5b391a689b47 100644 --- a/arch/arm/kernel/head-common.S +++ b/arch/arm/kernel/head-common.S | |||
@@ -98,8 +98,9 @@ __mmap_switched: | |||
98 | str r9, [r4] @ Save processor ID | 98 | str r9, [r4] @ Save processor ID |
99 | str r1, [r5] @ Save machine type | 99 | str r1, [r5] @ Save machine type |
100 | str r2, [r6] @ Save atags pointer | 100 | str r2, [r6] @ Save atags pointer |
101 | bic r4, r0, #CR_A @ Clear 'A' bit | 101 | cmp r7, #0 |
102 | stmia r7, {r0, r4} @ Save control register values | 102 | bicne r4, r0, #CR_A @ Clear 'A' bit |
103 | stmneia r7, {r0, r4} @ Save control register values | ||
103 | b start_kernel | 104 | b start_kernel |
104 | ENDPROC(__mmap_switched) | 105 | ENDPROC(__mmap_switched) |
105 | 106 | ||
@@ -113,7 +114,11 @@ __mmap_switched_data: | |||
113 | .long processor_id @ r4 | 114 | .long processor_id @ r4 |
114 | .long __machine_arch_type @ r5 | 115 | .long __machine_arch_type @ r5 |
115 | .long __atags_pointer @ r6 | 116 | .long __atags_pointer @ r6 |
117 | #ifdef CONFIG_CPU_CP15 | ||
116 | .long cr_alignment @ r7 | 118 | .long cr_alignment @ r7 |
119 | #else | ||
120 | .long 0 @ r7 | ||
121 | #endif | ||
117 | .long init_thread_union + THREAD_START_SP @ sp | 122 | .long init_thread_union + THREAD_START_SP @ sp |
118 | .size __mmap_switched_data, . - __mmap_switched_data | 123 | .size __mmap_switched_data, . - __mmap_switched_data |
119 | 124 | ||