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/mm/alignment.c | |
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/mm/alignment.c')
-rw-r--r-- | arch/arm/mm/alignment.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/arch/arm/mm/alignment.c b/arch/arm/mm/alignment.c index b820edaf3184..feeb3eaccb1c 100644 --- a/arch/arm/mm/alignment.c +++ b/arch/arm/mm/alignment.c | |||
@@ -964,12 +964,14 @@ static int __init alignment_init(void) | |||
964 | return -ENOMEM; | 964 | return -ENOMEM; |
965 | #endif | 965 | #endif |
966 | 966 | ||
967 | #ifdef CONFIG_CPU_CP15 | ||
967 | if (cpu_is_v6_unaligned()) { | 968 | if (cpu_is_v6_unaligned()) { |
968 | cr_alignment &= ~CR_A; | 969 | cr_alignment &= ~CR_A; |
969 | cr_no_alignment &= ~CR_A; | 970 | cr_no_alignment &= ~CR_A; |
970 | set_cr(cr_alignment); | 971 | set_cr(cr_alignment); |
971 | ai_usermode = safe_usermode(ai_usermode, false); | 972 | ai_usermode = safe_usermode(ai_usermode, false); |
972 | } | 973 | } |
974 | #endif | ||
973 | 975 | ||
974 | hook_fault_code(FAULT_CODE_ALIGNMENT, do_alignment, SIGBUS, BUS_ADRALN, | 976 | hook_fault_code(FAULT_CODE_ALIGNMENT, do_alignment, SIGBUS, BUS_ADRALN, |
975 | "alignment exception"); | 977 | "alignment exception"); |