提交 f934af05 编写于 作者: M Mark Salter

add memory barrier to arch_local_irq_restore

arch_local_irq_save() and friends are required to act as compiler
memory barriers. This patch adds a "memory" clobber to the inline
asm code in arch_local_irq_restore() which is used as the building
block for other functions needing to set/clear the interrupt enable
in the CSR register.
Signed-off-by: NMark Salter <msalter@redhat.com>
上级 31880c37
...@@ -27,7 +27,7 @@ static inline unsigned long arch_local_save_flags(void) ...@@ -27,7 +27,7 @@ static inline unsigned long arch_local_save_flags(void)
/* set interrupt enabled status */ /* set interrupt enabled status */
static inline void arch_local_irq_restore(unsigned long flags) static inline void arch_local_irq_restore(unsigned long flags)
{ {
asm volatile (" mvc .s2 %0,CSR\n" : : "b"(flags)); asm volatile (" mvc .s2 %0,CSR\n" : : "b"(flags) : "memory");
} }
/* unconditionally enable interrupts */ /* unconditionally enable interrupts */
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册