From 733a71f28069d61a1e7dae105f19709f786611da Mon Sep 17 00:00:00 2001 From: jsg Date: Sun, 28 Aug 2022 02:54:43 +0000 Subject: [PATCH] directly use ansi volatile keyword in local drm files --- sys/dev/pci/drm/i915/gt/agp_intel_gtt.c | 4 ++-- sys/dev/pci/drm/include/linux/atomic.h | 12 ++++++------ sys/dev/pci/drm/include/linux/compiler.h | 2 +- sys/dev/pci/drm/include/linux/rcupdate.h | 2 +- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/sys/dev/pci/drm/i915/gt/agp_intel_gtt.c b/sys/dev/pci/drm/i915/gt/agp_intel_gtt.c index a7f059ba920..b4ed8fc5668 100644 --- a/sys/dev/pci/drm/i915/gt/agp_intel_gtt.c +++ b/sys/dev/pci/drm/i915/gt/agp_intel_gtt.c @@ -25,9 +25,9 @@ extern struct cfdriver inteldrm_cd; #ifdef __amd64__ -#define membar_producer_wc() __asm __volatile("sfence":::"memory") +#define membar_producer_wc() __asm volatile("sfence":::"memory") #else -#define membar_producer_wc() __asm __volatile(\ +#define membar_producer_wc() __asm volatile(\ "lock; addl $0,0(%%esp)":::"memory") #endif diff --git a/sys/dev/pci/drm/include/linux/atomic.h b/sys/dev/pci/drm/include/linux/atomic.h index 4050fdf8fa9..821a620b3a7 100644 --- a/sys/dev/pci/drm/include/linux/atomic.h +++ b/sys/dev/pci/drm/include/linux/atomic.h @@ -1,4 +1,4 @@ -/* $OpenBSD: atomic.h,v 1.18 2022/01/14 15:00:16 kettenis Exp $ */ +/* $OpenBSD: atomic.h,v 1.19 2022/08/28 02:54:43 jsg Exp $ */ /** * \file drm_atomic.h * Atomic operations used in the DRM which may or may not be provided by the OS. @@ -400,10 +400,10 @@ find_next_bit(volatile void *p, int max, int b) (b) = find_next_zero_bit((p), (max), (b) + 1)) #if defined(__i386__) -#define rmb() __asm __volatile("lock; addl $0,-4(%%esp)" : : : "memory", "cc") -#define wmb() __asm __volatile("lock; addl $0,-4(%%esp)" : : : "memory", "cc") -#define mb() __asm __volatile("lock; addl $0,-4(%%esp)" : : : "memory", "cc") -#define smp_mb() __asm __volatile("lock; addl $0,-4(%%esp)" : : : "memory", "cc") +#define rmb() __asm volatile("lock; addl $0,-4(%%esp)" : : : "memory", "cc") +#define wmb() __asm volatile("lock; addl $0,-4(%%esp)" : : : "memory", "cc") +#define mb() __asm volatile("lock; addl $0,-4(%%esp)" : : : "memory", "cc") +#define smp_mb() __asm volatile("lock; addl $0,-4(%%esp)" : : : "memory", "cc") #define smp_rmb() __membar("") #define smp_wmb() __membar("") #define __smp_store_mb(var, value) do { (void)xchg(&var, value); } while (0) @@ -413,7 +413,7 @@ find_next_bit(volatile void *p, int max, int b) #define rmb() __membar("lfence") #define wmb() __membar("sfence") #define mb() __membar("mfence") -#define smp_mb() __asm __volatile("lock; addl $0,-4(%%rsp)" : : : "memory", "cc") +#define smp_mb() __asm volatile("lock; addl $0,-4(%%rsp)" : : : "memory", "cc") #define smp_rmb() __membar("") #define smp_wmb() __membar("") #define __smp_store_mb(var, value) do { (void)xchg(&var, value); } while (0) diff --git a/sys/dev/pci/drm/include/linux/compiler.h b/sys/dev/pci/drm/include/linux/compiler.h index 9500e29e2e1..48dbb483251 100644 --- a/sys/dev/pci/drm/include/linux/compiler.h +++ b/sys/dev/pci/drm/include/linux/compiler.h @@ -28,7 +28,7 @@ #define __user #endif -#define barrier() __asm __volatile("" : : : "memory") +#define barrier() __asm volatile("" : : : "memory") #define __printf(x, y) __attribute__((__format__(__kprintf__,x,y))) diff --git a/sys/dev/pci/drm/include/linux/rcupdate.h b/sys/dev/pci/drm/include/linux/rcupdate.h index bc711a03aa5..b15924ab697 100644 --- a/sys/dev/pci/drm/include/linux/rcupdate.h +++ b/sys/dev/pci/drm/include/linux/rcupdate.h @@ -31,7 +31,7 @@ struct rcu_head { #define kfree_rcu(objp, name) do { free((void *)objp, M_DRM, 0); } while(0) -#define rcu_barrier() __asm __volatile("" : : : "memory") +#define rcu_barrier() __asm volatile("" : : : "memory") typedef void (*rcu_callback_t)(struct rcu_head *head); -- 2.20.1