qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [PATCH v2 15/20] memory: Access MemoryRegion with MemOp sem


From: tony.nguyen
Subject: [Qemu-devel] [PATCH v2 15/20] memory: Access MemoryRegion with MemOp semantics
Date: Mon, 22 Jul 2019 15:50:41 +0000

To convert interfaces of MemoryRegion access, MEMOP_SIZE and
SIZE_MEMOP no-op stubs were introduced to change syntax while keeping
the existing semantics.

Now with interfaces converted, we fill the stubs and use MemOp
semantics.

Signed-off-by: Tony Nguyen <address@hidden>
---
 include/exec/memop.h | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/include/exec/memop.h b/include/exec/memop.h
index 73f1bf7..dff6da2 100644
--- a/include/exec/memop.h
+++ b/include/exec/memop.h
@@ -24,8 +24,7 @@ typedef enum MemOp {
     MO_BSWAP = 8,   /* Host reverse endian.  */
 } MemOp;

-/* No-op while memory_region_dispatch_[read|write] is converted to MemOp */
-#define MEMOP_SIZE(op)  (op)    /* MemOp to size.  */
-#define SIZE_MEMOP(ul)  (ul)    /* Size to MemOp.  */
+#define MEMOP_SIZE(op)  (1 << ((op) & MO_SIZE)) /* MemOp to size.  */
+#define SIZE_MEMOP(ul)  (ctzl(ul))              /* Size to MemOp.  */

 #endif
--
1.8.3.1





reply via email to

[Prev in Thread] Current Thread [Next in Thread]