diff options
author | Tiejun Chen <tiejun.chen@windriver.com> | 2012-07-11 00:22:46 -0400 |
---|---|---|
committer | Benjamin Herrenschmidt <benh@kernel.crashing.org> | 2012-07-11 01:25:45 -0400 |
commit | b416c9a10baae6a177b4f9ee858b8d309542fbef (patch) | |
tree | b7e0ce85a57e83e19fccf8ce686ec4b41b00d2ec /arch/powerpc/include/asm/reg.h | |
parent | fd5a42980e1cf327b7240adf5e7b51ea41c23437 (diff) |
powerpc: Add "memory" attribute for mfmsr()
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>
CC: stable@vger.kernel.org
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 2baeb7c8764f..638608677e2a 100644 --- a/arch/powerpc/include/asm/reg.h +++ b/arch/powerpc/include/asm/reg.h | |||
@@ -1025,7 +1025,8 @@ | |||
1025 | /* Macros for setting and retrieving special purpose registers */ | 1025 | /* Macros for setting and retrieving special purpose registers */ |
1026 | #ifndef __ASSEMBLY__ | 1026 | #ifndef __ASSEMBLY__ |
1027 | #define mfmsr() ({unsigned long rval; \ | 1027 | #define mfmsr() ({unsigned long rval; \ |
1028 | asm volatile("mfmsr %0" : "=r" (rval)); rval;}) | 1028 | asm volatile("mfmsr %0" : "=r" (rval) : \ |
1029 | : "memory"); rval;}) | ||
1029 | #ifdef CONFIG_PPC_BOOK3S_64 | 1030 | #ifdef CONFIG_PPC_BOOK3S_64 |
1030 | #define __mtmsrd(v, l) asm volatile("mtmsrd %0," __stringify(l) \ | 1031 | #define __mtmsrd(v, l) asm volatile("mtmsrd %0," __stringify(l) \ |
1031 | : : "r" (v) : "memory") | 1032 | : : "r" (v) : "memory") |