All of lore.kernel.org
 help / color / mirror / Atom feed
From: Julia Suvorova <jusual@redhat.com>
To: Jens Axboe <axboe@kernel.dk>
Cc: linux-block@vger.kernel.org, Stefan Hajnoczi <stefanha@gmail.com>,
	Aarushi Mehta <mehta.aaru20@gmail.com>,
	Julia Suvorova <jusual@redhat.com>
Subject: [PATCH] liburing/barrier.h: Add prefix to arm barriers
Date: Tue, 20 Aug 2019 14:42:36 +0200	[thread overview]
Message-ID: <20190820124236.19608-1-jusual@redhat.com> (raw)

Rename the newly added arm barriers and READ/WRITE_ONCE
to avoid using popular names.

Signed-off-by: Julia Suvorova <jusual@redhat.com>
---
 src/include/liburing/barrier.h | 46 +++++++++++++++++-----------------
 1 file changed, 23 insertions(+), 23 deletions(-)

diff --git a/src/include/liburing/barrier.h b/src/include/liburing/barrier.h
index 8efa6dd..fc40a8a 100644
--- a/src/include/liburing/barrier.h
+++ b/src/include/liburing/barrier.h
@@ -26,9 +26,9 @@ after the acquire operation executes. This is implemented using
 #define io_uring_barrier()	__asm__ __volatile__("": : :"memory")
 
 /* From tools/virtio/linux/compiler.h */
-#define WRITE_ONCE(var, val) \
+#define IO_URING_WRITE_ONCE(var, val) \
 	(*((volatile __typeof(val) *)(&(var))) = (val))
-#define READ_ONCE(var) (*((volatile __typeof(var) *)(&(var))))
+#define IO_URING_READ_ONCE(var) (*((volatile __typeof(var) *)(&(var))))
 
 
 #if defined(__x86_64__) || defined(__i386__)
@@ -49,27 +49,27 @@ after the acquire operation executes. This is implemented using
 #define io_uring_smp_store_release(p, v)	\
 do {						\
 	io_uring_barrier();			\
-	WRITE_ONCE(*(p), (v));			\
+	IO_URING_WRITE_ONCE(*(p), (v));		\
 } while (0)
 
-#define io_uring_smp_load_acquire(p)		\
-({						\
-	__typeof(*p) ___p1 = READ_ONCE(*(p));	\
-	io_uring_barrier();			\
-	___p1;					\
+#define io_uring_smp_load_acquire(p)			\
+({							\
+	__typeof(*p) ___p1 = IO_URING_READ_ONCE(*(p));	\
+	io_uring_barrier();				\
+	___p1;						\
 })
 
 #elif defined(__aarch64__)
 /* Adapted from arch/arm64/include/asm/barrier.h */
-#define dmb(opt)	asm volatile("dmb " #opt : : : "memory")
-#define dsb(opt)	asm volatile("dsb " #opt : : : "memory")
+#define io_uring_dmb(opt)	asm volatile("dmb " #opt : : : "memory")
+#define io_uring_dsb(opt)	asm volatile("dsb " #opt : : : "memory")
 
-#define mb()		dsb(sy)
-#define rmb()		dsb(ld)
-#define wmb()		dsb(st)
-#define smp_mb()	dmb(ish)
-#define smp_rmb()	dmb(ishld)
-#define smp_wmb()	dmb(ishst)
+#define io_uring_mb()		io_uring_dsb(sy)
+#define io_uring_rmb()		io_uring_dsb(ld)
+#define io_uring_wmb()		io_uring_dsb(st)
+#define io_uring_smp_mb()	io_uring_dmb(ish)
+#define io_uring_smp_rmb()	io_uring_dmb(ishld)
+#define io_uring_smp_wmb()	io_uring_dmb(ishst)
 
 #else /* defined(__x86_64__) || defined(__i386__) || defined(__aarch64__) */
 /*
@@ -83,19 +83,19 @@ do {						\
 /* From tools/include/asm/barrier.h */
 
 #ifndef io_uring_smp_store_release
-# define io_uring_smp_store_release(p, v)	\
+#define io_uring_smp_store_release(p, v)	\
 do {						\
 	io_uring_smp_mb();			\
-	WRITE_ONCE(*p, v);			\
+	IO_URING_WRITE_ONCE(*p, v);		\
 } while (0)
 #endif
 
 #ifndef io_uring_smp_load_acquire
-# define io_uring_smp_load_acquire(p)		\
-({						\
-	__typeof(*p) ___p1 = READ_ONCE(*p);	\
-	io_uring_smp_mb();			\
-	___p1;					\
+#define io_uring_smp_load_acquire(p)			\
+({							\
+	__typeof(*p) ___p1 = IO_URING_READ_ONCE(*p);	\
+	io_uring_smp_mb();				\
+	___p1;						\
 })
 #endif
 
-- 
2.21.0


             reply	other threads:[~2019-08-20 12:42 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-08-20 12:42 Julia Suvorova [this message]
2019-08-20 13:46 ` [PATCH] liburing/barrier.h: Add prefix to arm barriers Jens Axboe

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190820124236.19608-1-jusual@redhat.com \
    --to=jusual@redhat.com \
    --cc=axboe@kernel.dk \
    --cc=linux-block@vger.kernel.org \
    --cc=mehta.aaru20@gmail.com \
    --cc=stefanha@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.