summaryrefslogtreecommitdiff
path: root/sys/arch/alpha/include
diff options
context:
space:
mode:
authorJeremie Courreges-Anglas <jca@cvs.openbsd.org>2024-06-09 21:15:30 +0000
committerJeremie Courreges-Anglas <jca@cvs.openbsd.org>2024-06-09 21:15:30 +0000
commit977775b0acd19093de50847e8fa120058920b482 (patch)
tree66e016bafdba6cbc7b249007fd2ed238d874197a /sys/arch/alpha/include
parenta2ef373f1bb8aae51b1708be19723283553a0a6d (diff)
Add a compiler barrier where missing in CPU_BUSY_CYCLE() implems
Having differences between architectures is asking for problems. And adding a barrier here just makes sense in most cases. This is also what cpu_relax() provides in Linux land. ok kettenis@ claudio@
Diffstat (limited to 'sys/arch/alpha/include')
-rw-r--r--sys/arch/alpha/include/cpu.h6
1 files changed, 4 insertions, 2 deletions
diff --git a/sys/arch/alpha/include/cpu.h b/sys/arch/alpha/include/cpu.h
index f91536fe066..04997fd8272 100644
--- a/sys/arch/alpha/include/cpu.h
+++ b/sys/arch/alpha/include/cpu.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: cpu.h,v 1.74 2024/05/21 23:16:06 jsg Exp $ */
+/* $OpenBSD: cpu.h,v 1.75 2024/06/09 21:15:29 jca Exp $ */
/* $NetBSD: cpu.h,v 1.45 2000/08/21 02:03:12 thorpej Exp $ */
/*-
@@ -264,6 +264,8 @@ do { \
struct cpu_info *__ci = curcpu(); \
int __s; \
\
+ __asm volatile ("" ::: "memory"); \
+ \
if (__ci->ci_ipis != 0) { \
__s = splipi(); \
alpha_ipi_process_with_frame(__ci); \
@@ -277,7 +279,7 @@ do { \
#define CPU_IS_PRIMARY(ci) 1
#define CPU_IS_RUNNING(ci) 1
#define cpu_unidle(ci) do { /* nothing */ } while (0)
-#define CPU_BUSY_CYCLE() do {} while (0)
+#define CPU_BUSY_CYCLE() __asm volatile ("" ::: "memory")
#endif /* MULTIPROCESSOR */