aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/include/asm
diff options
context:
space:
mode:
authorRussell King <rmk+kernel@arm.linux.org.uk>2012-12-03 10:39:43 -0500
committerWill Deacon <will.deacon@arm.com>2013-01-10 16:09:31 -0500
commit8e9c24a2b2e00368262b974d6ea1ac5310570bbe (patch)
treef7ab7ace096b95a12c43f4bfc40c404e8b78a433 /arch/arm/include/asm
parent9931faca02c604c22335f5a935a501bb2ace6e20 (diff)
ARM: virt: avoid clobbering lr when forcing svc mode
The safe_svcmode_maskall macro is used to ensure that we are running in svc mode, causing an exception return from hvc mode if required. This patch removes the unneeded lr clobber from the macro and operates entirely on the temporary parameter register instead. Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk> [will: updated comment] Signed-off-by: Will Deacon <will.deacon@arm.com>
Diffstat (limited to 'arch/arm/include/asm')
-rw-r--r--arch/arm/include/asm/assembler.h10
1 files changed, 3 insertions, 7 deletions
diff --git a/arch/arm/include/asm/assembler.h b/arch/arm/include/asm/assembler.h
index eb87200aa4b5..05ee9eebad6b 100644
--- a/arch/arm/include/asm/assembler.h
+++ b/arch/arm/include/asm/assembler.h
@@ -246,18 +246,14 @@
246 * 246 *
247 * This macro is intended for forcing the CPU into SVC mode at boot time. 247 * This macro is intended for forcing the CPU into SVC mode at boot time.
248 * you cannot return to the original mode. 248 * you cannot return to the original mode.
249 *
250 * Beware, it also clobers LR.
251 */ 249 */
252.macro safe_svcmode_maskall reg:req 250.macro safe_svcmode_maskall reg:req
253#if __LINUX_ARM_ARCH__ >= 6 251#if __LINUX_ARM_ARCH__ >= 6
254 mrs \reg , cpsr 252 mrs \reg , cpsr
255 mov lr , \reg 253 eor \reg, \reg, #HYP_MODE
256 and lr , lr , #MODE_MASK 254 tst \reg, #MODE_MASK
257 cmp lr , #HYP_MODE
258 orr \reg , \reg , #PSR_I_BIT | PSR_F_BIT
259 bic \reg , \reg , #MODE_MASK 255 bic \reg , \reg , #MODE_MASK
260 orr \reg , \reg , #SVC_MODE 256 orr \reg , \reg , #PSR_I_BIT | PSR_F_BIT | SVC_MODE
261THUMB( orr \reg , \reg , #PSR_T_BIT ) 257THUMB( orr \reg , \reg , #PSR_T_BIT )
262 bne 1f 258 bne 1f
263 orr \reg, \reg, #PSR_A_BIT 259 orr \reg, \reg, #PSR_A_BIT