summaryrefslogtreecommitdiff
path: root/sys/arch/evbppc
diff options
context:
space:
mode:
authorriastradh <riastradh@NetBSD.org>2022-02-16 23:49:26 +0000
committerriastradh <riastradh@NetBSD.org>2022-02-16 23:49:26 +0000
commit44a1e0419d3095d553df2ca800914a4135f5ccf3 (patch)
tree51bd8c0d5663f245d07d3e89738d4fd976f17e14 /sys/arch/evbppc
parentcb449fb68865511ab3a8de7537647dd5cfc0d578 (diff)
powerpc: Sprinkle "memory" clobbers on eieio and nearby asm blocks.
Otherwise the compiler may reorder these around loads and stores, which mostly defeats the purpose. `asm volatile' just ensures the instruction isn't _deleted_; it may still move around.
Diffstat (limited to 'sys/arch/evbppc')
-rw-r--r--sys/arch/evbppc/pmppc/dev/if_cs_mainbus.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/sys/arch/evbppc/pmppc/dev/if_cs_mainbus.c b/sys/arch/evbppc/pmppc/dev/if_cs_mainbus.c
index 6b161126409..0efcc37d88e 100644
--- a/sys/arch/evbppc/pmppc/dev/if_cs_mainbus.c
+++ b/sys/arch/evbppc/pmppc/dev/if_cs_mainbus.c
@@ -1,4 +1,4 @@
-/* $NetBSD: if_cs_mainbus.c,v 1.8 2015/04/13 21:18:42 riastradh Exp $ */
+/* $NetBSD: if_cs_mainbus.c,v 1.9 2022/02/16 23:49:26 riastradh Exp $ */
/*
* Copyright (c) 2002 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_cs_mainbus.c,v 1.8 2015/04/13 21:18:42 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_cs_mainbus.c,v 1.9 2022/02/16 23:49:26 riastradh Exp $");
#include <sys/param.h>
#include <sys/device.h>
@@ -99,7 +99,7 @@ in64(uint a)
: "=m"(save), "=m"(*dp)
: "m"(u.d)
);
- __asm volatile ("eieio; sync");
+ __asm volatile("eieio; sync" ::: "memory");
__asm volatile("mtmsr %0" :: "r"(msr));
return (u.i);
}
@@ -130,7 +130,7 @@ out64(uint a, u_int64_t v)
: "=m"(save), "=m"(*dp)
: "m"(u.d)
);
- __asm volatile ("eieio; sync");
+ __asm volatile("eieio; sync" ::: "memory");
__asm volatile("mtmsr %0" :: "r"(msr));
splx(s);
}
@@ -208,7 +208,7 @@ cs_io_write_multi_2(struct cs_softc *sc, bus_size_t offs,
v = bswap16(v);
u.i = (u_int64_t)v << 48;
__asm volatile("lfd 0,%1\nstfd 0,%0" : "=m"(*dp) : "m"(u.d) );
- __asm volatile ("eieio; sync");
+ __asm volatile("eieio; sync" ::: "memory");
}
__asm volatile("lfd 0,%0" :: "m"(save));
__asm volatile("mtmsr %0" :: "r"(msr));