Convert MemTxResult defines into an enum. This will allow bindgen to
generate a bitflag using the enum variants as its domain of values.
Signed-off-by: Manos Pitsidianakis <manos.pitsidianakis@linaro.org>
---
include/exec/memattrs.h | 11 ++++++-----
1 file changed, 6 insertions(+), 5 deletions(-)
diff --git a/include/exec/memattrs.h b/include/exec/memattrs.h
index 8db1d3046479c21a32928086ea8804a66a5d5ffa..dc99b456edb0d99eced6f6513c4e1c8013e84c3e 100644
--- a/include/exec/memattrs.h
+++ b/include/exec/memattrs.h
@@ -81,10 +81,11 @@ QEMU_BUILD_BUG_ON(sizeof(MemTxAttrs) > 8);
* of some kind. The memory subsystem will bitwise-OR together results
* if it is synthesizing an operation from multiple smaller accesses.
*/
-#define MEMTX_OK 0
-#define MEMTX_ERROR (1U << 0) /* device returned an error */
-#define MEMTX_DECODE_ERROR (1U << 1) /* nothing at that address */
-#define MEMTX_ACCESS_ERROR (1U << 2) /* access denied */
-typedef uint32_t MemTxResult;
+typedef enum MemTxResult {
+ MEMTX_OK = 0,
+ MEMTX_ERROR = (1U << 0), /* device returned an error */
+ MEMTX_DECODE_ERROR = (1U << 1), /* nothing at that address */
+ MEMTX_ACCESS_ERROR = (1U << 2), /* access denied */
+} MemTxResult;
#endif
--
2.47.2
On Thu, Jul 03, 2025 at 04:58:12PM +0300, Manos Pitsidianakis wrote: > Date: Thu, 03 Jul 2025 16:58:12 +0300 > From: Manos Pitsidianakis <manos.pitsidianakis@linaro.org> > Subject: [PATCH 2/3] memattrs.h: make MemTxAttrs into enum > X-Mailer: b4 0.14.2 > > Convert MemTxResult defines into an enum. This will allow bindgen to > generate a bitflag using the enum variants as its domain of values. > > Signed-off-by: Manos Pitsidianakis <manos.pitsidianakis@linaro.org> > --- > include/exec/memattrs.h | 11 ++++++----- > 1 file changed, 6 insertions(+), 5 deletions(-)> Reviewed-by: Zhao Liu <zhao1.liu@intel.com>
On Thu, Jul 03, 2025 at 04:58:12PM +0300, Manos Pitsidianakis wrote: > Date: Thu, 03 Jul 2025 16:58:12 +0300 > From: Manos Pitsidianakis <manos.pitsidianakis@linaro.org> > Subject: [PATCH 2/3] memattrs.h: make MemTxAttrs into enum > X-Mailer: b4 0.14.2 > > Convert MemTxResult defines into an enum. This will allow bindgen to > generate a bitflag using the enum variants as its domain of values. > > Signed-off-by: Manos Pitsidianakis <manos.pitsidianakis@linaro.org> > --- > include/exec/memattrs.h | 11 ++++++----- > 1 file changed, 6 insertions(+), 5 deletions(-) Reviewed-by: Zhao Liu <zhao1.liu@intel.com>
On 3/7/25 15:58, Manos Pitsidianakis wrote: > Convert MemTxResult defines into an enum. This will allow bindgen to > generate a bitflag using the enum variants as its domain of values. > > Signed-off-by: Manos Pitsidianakis <manos.pitsidianakis@linaro.org> > --- > include/exec/memattrs.h | 11 ++++++----- > 1 file changed, 6 insertions(+), 5 deletions(-) Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
© 2016 - 2025 Red Hat, Inc.