diff options
author | Tiejun Chen <tiejun.chen@windriver.com> | 2012-07-11 14:22:46 +1000 |
---|---|---|
committer | Ben Hutchings <ben@decadent.org.uk> | 2012-08-02 14:37:46 +0100 |
commit | 216fce53c4a85d012a5dc28eff803b9a28874ba8 (patch) | |
tree | dac7c763ab4224084352deb22f2cdb7cd8a21aca /arch/powerpc/include/asm/reg.h | |
parent | c17fcfb52422d098dde1ccdc4a3d24a7ceeb33e2 (diff) |
powerpc: Add "memory" attribute for mfmsr()
commit b416c9a10baae6a177b4f9ee858b8d309542fbef upstream.
Add "memory" attribute in inline assembly language as a compiler
barrier to make sure 4.6.x GCC don't reorder mfmsr().
Signed-off-by: Tiejun Chen <tiejun.chen@windriver.com>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
Diffstat (limited to 'arch/powerpc/include/asm/reg.h')
-rw-r--r-- | arch/powerpc/include/asm/reg.h | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/arch/powerpc/include/asm/reg.h b/arch/powerpc/include/asm/reg.h index 559da199edb5..578e5a0d116d 100644 --- a/arch/powerpc/include/asm/reg.h +++ b/arch/powerpc/include/asm/reg.h @@ -1016,7 +1016,8 @@ /* Macros for setting and retrieving special purpose registers */ #ifndef __ASSEMBLY__ #define mfmsr() ({unsigned long rval; \ - asm volatile("mfmsr %0" : "=r" (rval)); rval;}) + asm volatile("mfmsr %0" : "=r" (rval) : \ + : "memory"); rval;}) #ifdef CONFIG_PPC_BOOK3S_64 #define __mtmsrd(v, l) asm volatile("mtmsrd %0," __stringify(l) \ : : "r" (v) : "memory") |