aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-msm
diff options
context:
space:
mode:
authorStephen Boyd <sboyd@codeaurora.org>2011-02-24 13:44:43 -0500
committerDavid Brown <davidb@codeaurora.org>2011-03-10 15:01:37 -0500
commit98d4ded60bda17a9ffecd902b03deac52922b788 (patch)
tree62cc7c393d8d560fbb7bcbe9d29071b3215107b8 /arch/arm/mach-msm
parent7e1a68abaef094d5927ffe76bce21d6d8aa87bcb (diff)
msm: scm: Fix improper register assignment
Assign the registers used in the inline assembly immediately before the inline assembly block. This ensures the compiler doesn't optimize away dead register assignments when it shouldn't. Signed-off-by: Stephen Boyd <sboyd@codeaurora.org> Acked-by: Nicolas Pitre <nico@fluxnic.net> Signed-off-by: David Brown <davidb@codeaurora.org>
Diffstat (limited to 'arch/arm/mach-msm')
-rw-r--r--arch/arm/mach-msm/scm.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/arch/arm/mach-msm/scm.c b/arch/arm/mach-msm/scm.c
index ba57b5adf873..5eddf549717a 100644
--- a/arch/arm/mach-msm/scm.c
+++ b/arch/arm/mach-msm/scm.c
@@ -264,13 +264,16 @@ u32 scm_get_version(void)
264{ 264{
265 int context_id; 265 int context_id;
266 static u32 version = -1; 266 static u32 version = -1;
267 register u32 r0 asm("r0") = 0x1 << 8; 267 register u32 r0 asm("r0");
268 register u32 r1 asm("r1") = (u32)&context_id; 268 register u32 r1 asm("r1");
269 269
270 if (version != -1) 270 if (version != -1)
271 return version; 271 return version;
272 272
273 mutex_lock(&scm_lock); 273 mutex_lock(&scm_lock);
274
275 r0 = 0x1 << 8;
276 r1 = (u32)&context_id;
274 asm volatile( 277 asm volatile(
275 __asmeq("%0", "r1") 278 __asmeq("%0", "r1")
276 __asmeq("%1", "r0") 279 __asmeq("%1", "r0")