From 977775b0acd19093de50847e8fa120058920b482 Mon Sep 17 00:00:00 2001 From: Jeremie Courreges-Anglas Date: Sun, 9 Jun 2024 21:15:30 +0000 Subject: 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@ --- sys/arch/sh/include/cpu.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'sys/arch/sh') diff --git a/sys/arch/sh/include/cpu.h b/sys/arch/sh/include/cpu.h index eeae150d812..e1bb2283c64 100644 --- a/sys/arch/sh/include/cpu.h +++ b/sys/arch/sh/include/cpu.h @@ -1,4 +1,4 @@ -/* $OpenBSD: cpu.h,v 1.38 2024/03/31 07:23:29 miod Exp $ */ +/* $OpenBSD: cpu.h,v 1.39 2024/06/09 21:15:29 jca Exp $ */ /* $NetBSD: cpu.h,v 1.41 2006/01/21 04:24:12 uwe Exp $ */ /*- @@ -90,7 +90,7 @@ extern struct cpu_info cpu_info_store; #define MAXCPUS 1 #define cpu_unidle(ci) -#define CPU_BUSY_CYCLE() do {} while (0) +#define CPU_BUSY_CYCLE() __asm volatile ("" ::: "memory") /* -- cgit v1.2.3