diff options
author | Catalin Marinas <catalin.marinas@arm.com> | 2010-05-21 13:06:41 -0400 |
---|---|---|
committer | Uwe Kleine-König <u.kleine-koenig@pengutronix.de> | 2013-04-17 15:38:10 -0400 |
commit | 55bdd694116597d2f16510b121463cd579ba78da (patch) | |
tree | c8a31f06f746700a1f9b8418602a43c3ea42627e /arch/arm/include/asm/assembler.h | |
parent | 73a09d212ec65b7068a283e6034fa05649d3d075 (diff) |
ARM: Add base support for ARMv7-M
This patch adds the base support for the ARMv7-M
architecture. It consists of the corresponding arch/arm/mm/ files and
various #ifdef's around the kernel. Exception handling is implemented by
a subsequent patch.
[ukleinek: squash in some changes originating from commit
b5717ba (Cortex-M3: Add support for the Microcontroller Prototyping System)
from the v2.6.33-arm1 patch stack, port to post 3.6, drop zImage
support, drop reorganisation of pt_regs, assert CONFIG_CPU_V7M doesn't
leak into installed headers and a few cosmetic changes]
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
Reviewed-by: Jonathan Austin <jonathan.austin@arm.com>
Tested-by: Jonathan Austin <jonathan.austin@arm.com>
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Diffstat (limited to 'arch/arm/include/asm/assembler.h')
-rw-r--r-- | arch/arm/include/asm/assembler.h | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/arch/arm/include/asm/assembler.h b/arch/arm/include/asm/assembler.h index 05ee9eebad6b..a5fef710af32 100644 --- a/arch/arm/include/asm/assembler.h +++ b/arch/arm/include/asm/assembler.h | |||
@@ -136,7 +136,11 @@ | |||
136 | * assumes FIQs are enabled, and that the processor is in SVC mode. | 136 | * assumes FIQs are enabled, and that the processor is in SVC mode. |
137 | */ | 137 | */ |
138 | .macro save_and_disable_irqs, oldcpsr | 138 | .macro save_and_disable_irqs, oldcpsr |
139 | #ifdef CONFIG_CPU_V7M | ||
140 | mrs \oldcpsr, primask | ||
141 | #else | ||
139 | mrs \oldcpsr, cpsr | 142 | mrs \oldcpsr, cpsr |
143 | #endif | ||
140 | disable_irq | 144 | disable_irq |
141 | .endm | 145 | .endm |
142 | 146 | ||
@@ -150,7 +154,11 @@ | |||
150 | * guarantee that this will preserve the flags. | 154 | * guarantee that this will preserve the flags. |
151 | */ | 155 | */ |
152 | .macro restore_irqs_notrace, oldcpsr | 156 | .macro restore_irqs_notrace, oldcpsr |
157 | #ifdef CONFIG_CPU_V7M | ||
158 | msr primask, \oldcpsr | ||
159 | #else | ||
153 | msr cpsr_c, \oldcpsr | 160 | msr cpsr_c, \oldcpsr |
161 | #endif | ||
154 | .endm | 162 | .endm |
155 | 163 | ||
156 | .macro restore_irqs, oldcpsr | 164 | .macro restore_irqs, oldcpsr |
@@ -229,7 +237,14 @@ | |||
229 | #endif | 237 | #endif |
230 | .endm | 238 | .endm |
231 | 239 | ||
232 | #ifdef CONFIG_THUMB2_KERNEL | 240 | #if defined(CONFIG_CPU_V7M) |
241 | /* | ||
242 | * setmode is used to assert to be in svc mode during boot. For v7-M | ||
243 | * this is done in __v7m_setup, so setmode can be empty here. | ||
244 | */ | ||
245 | .macro setmode, mode, reg | ||
246 | .endm | ||
247 | #elif defined(CONFIG_THUMB2_KERNEL) | ||
233 | .macro setmode, mode, reg | 248 | .macro setmode, mode, reg |
234 | mov \reg, #\mode | 249 | mov \reg, #\mode |
235 | msr cpsr_c, \reg | 250 | msr cpsr_c, \reg |