Skip to content

Commit

Permalink
parisc: Add memory barrier to asm pdc and sync instructions
Browse files Browse the repository at this point in the history
Add compiler memory barriers to ensure the compiler doesn't reorder memory
operations around these instructions.

Cc: [email protected] # v4.20+
Fixes: 3847dab ("parisc: Add alternative coding infrastructure")
Signed-off-by: Helge Deller <[email protected]>
  • Loading branch information
hdeller committed May 3, 2019
1 parent 44224bd commit 2d94a83
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions arch/parisc/include/asm/cache.h
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,10 @@ void parisc_setup_cache_timing(void);
#define asm_io_fdc(addr) asm volatile("fdc %%r0(%0)" \
ALTERNATIVE(ALT_COND_NO_DCACHE, INSN_NOP) \
ALTERNATIVE(ALT_COND_NO_IOC_FDC, INSN_NOP) \
: : "r" (addr))
: : "r" (addr) : "memory")
#define asm_io_sync() asm volatile("sync" \
ALTERNATIVE(ALT_COND_NO_DCACHE, INSN_NOP) \
ALTERNATIVE(ALT_COND_NO_IOC_FDC, INSN_NOP) :: )
ALTERNATIVE(ALT_COND_NO_IOC_FDC, INSN_NOP) :::"memory")

#endif /* ! __ASSEMBLY__ */

Expand Down

0 comments on commit 2d94a83

Please sign in to comment.