Module Name: src
Committed By: skrll
Date: Tue Mar 2 08:16:53 UTC 2021
Modified Files:
src/sys/arch/mips/include: locore.h
Log Message:
Ensure the "memory" clobber is on inline assembly store operations
No binary change of note with this change in MALTA32
To generate a diff of this commit:
cvs rdiff -u -r1.116 -r1.117 src/sys/arch/mips/include/locore.h
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/sys/arch/mips/include/locore.h
diff -u src/sys/arch/mips/include/locore.h:1.116 src/sys/arch/mips/include/locore.h:1.117
--- src/sys/arch/mips/include/locore.h:1.116 Sat Aug 22 09:08:21 2020
+++ src/sys/arch/mips/include/locore.h Tue Mar 2 08:16:52 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: locore.h,v 1.116 2020/08/22 09:08:21 simonb Exp $ */
+/* $NetBSD: locore.h,v 1.117 2021/03/02 08:16:52 skrll Exp $ */
/*
* This file should not be included by MI code!!!
@@ -539,7 +539,7 @@ static inline void
mips_sb(register_t addr, uint8_t val)
{
#if defined(__mips_n32)
- __asm volatile("sb\t%1, 0(%0)" :: "d"(addr), "r"(val));
+ __asm volatile("sb\t%1, 0(%0)" :: "d"(addr), "r"(val) : "memory");
#else
*(volatile uint8_t *)addr = val;
#endif
@@ -549,7 +549,7 @@ static inline void
mips_sh(register_t addr, uint16_t val)
{
#if defined(__mips_n32)
- __asm volatile("sh\t%1, 0(%0)" :: "d"(addr), "r"(val));
+ __asm volatile("sh\t%1, 0(%0)" :: "d"(addr), "r"(val) : "memory");
#else
*(volatile uint16_t *)addr = val;
#endif
@@ -559,7 +559,7 @@ static inline void
mips_sw(register_t addr, uint32_t val)
{
#if defined(__mips_n32)
- __asm volatile("sw\t%1, 0(%0)" :: "d"(addr), "r"(val));
+ __asm volatile("sw\t%1, 0(%0)" :: "d"(addr), "r"(val) : "memory");
#else
*(volatile uint32_t *)addr = val;
#endif
@@ -570,7 +570,7 @@ static inline void
mips3_sd(register_t addr, uint64_t val)
{
#if defined(__mips_n32)
- __asm volatile("sd\t%1, 0(%0)" :: "d"(addr), "r"(val));
+ __asm volatile("sd\t%1, 0(%0)" :: "d"(addr), "r"(val) : "memory");
#else
*(volatile uint64_t *)addr = val;
#endif