diff options
author | Jonathan Gray <jsg@cvs.openbsd.org> | 2020-10-28 09:58:58 +0000 |
---|---|---|
committer | Jonathan Gray <jsg@cvs.openbsd.org> | 2020-10-28 09:58:58 +0000 |
commit | 62dd13ff144b3b58c716d2e678554197b924f59c (patch) | |
tree | 0beb079bc135c4695b1dc6d7dc6483ab8e8539ff /sys/arch/amd64/include | |
parent | 70a2e9f340996177079f31c00c7684bfa8ff7ed6 (diff) |
Use "memory" on inline fence instructions to suggest to the compiler
it shouldn't optimise across them.
ok kettenis@
Diffstat (limited to 'sys/arch/amd64/include')
-rw-r--r-- | sys/arch/amd64/include/bus.h | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/sys/arch/amd64/include/bus.h b/sys/arch/amd64/include/bus.h index 4706c73d013..33d6cd6eaeb 100644 --- a/sys/arch/amd64/include/bus.h +++ b/sys/arch/amd64/include/bus.h @@ -1,4 +1,4 @@ -/* $OpenBSD: bus.h,v 1.34 2017/06/04 06:21:37 sf Exp $ */ +/* $OpenBSD: bus.h,v 1.35 2020/10/28 09:58:57 jsg Exp $ */ /* $NetBSD: bus.h,v 1.6 1996/11/10 03:19:25 thorpej Exp $ */ /*- @@ -478,13 +478,13 @@ bus_space_barrier(bus_space_tag_t space, bus_space_handle_t { switch (flags) { case (BUS_SPACE_BARRIER_READ|BUS_SPACE_BARRIER_WRITE): - __asm volatile("mfence"); + __asm volatile("mfence" ::: "memory"); break; case BUS_SPACE_BARRIER_WRITE: - __asm volatile("sfence"); + __asm volatile("sfence" ::: "memory"); break; default: - __asm volatile("lfence"); + __asm volatile("lfence" ::: "memory"); break; } } |