summaryrefslogtreecommitdiffstats
path: root/spice
diff options
context:
space:
mode:
Diffstat (limited to 'spice')
-rw-r--r--spice/ipc_ring.h36
1 files changed, 18 insertions, 18 deletions
diff --git a/spice/ipc_ring.h b/spice/ipc_ring.h
index 52c456f..404a577 100644
--- a/spice/ipc_ring.h
+++ b/spice/ipc_ring.h
@@ -34,37 +34,37 @@
#include <spice/types.h>
-#define MSB_MASK4(x) \
+#define _SPICE_MSB_MASK4(x) \
(((x) & 0x8) ? 0x8 : \
((x) & 0x4) ? 0x4 : \
((x) & 0x2) ? 0x2 : \
((x) & 0x1) ? 0x1 : 0)
-#define MSB_MASK8(x) \
- (((x) & 0xf0) ? MSB_MASK4((x) >> 4) << 4 : MSB_MASK4(x))
+#define _SPICE_MSB_MASK8(x) \
+ (((x) & 0xf0) ? _SPICE_MSB_MASK4((x) >> 4) << 4 : _SPICE_MSB_MASK4(x))
-#define MSB_MASK16(x) \
- (((x) & 0xff00) ? MSB_MASK8((x) >> 8) << 8 : MSB_MASK8(x))
+#define _SPICE_MSB_MASK16(x) \
+ (((x) & 0xff00) ? _SPICE_MSB_MASK8((x) >> 8) << 8 : _SPICE_MSB_MASK8(x))
-#define MSB_MASK(x) \
- (((x) & 0xffff0000) ? MSB_MASK16((x) >> 16) << 16 : MSB_MASK16(x))
+#define _SPICE_MSB_MASK(x) \
+ (((x) & 0xffff0000) ? _SPICE__SPICE_MSB_MASK16((x) >> 16) << 16 : _SPICE__SPICE_MSB_MASK16(x))
-#define POWER2_ALIGN(x) MSB_MASK((x) * 2 - 1)
+#define _SPICE_POWER2_ALIGN(x) _SPICE_MSB_MASK((x) * 2 - 1)
-#define _TOSHIFT_4(x) \
+#define _SPICE_TOSHIFT_4(x) \
(((x) & 0x8) ? 3 : \
((x) & 0x4) ? 2 : \
((x) & 0x2) ? 1 : 0)
-#define _TOSHIFT_8(x) \
- (((x) & 0xf0) ? _TOSHIFT_4((x) >> 4) + 4 : _TOSHIFT_4(x))
+#define _SPICE_TOSHIFT_8(x) \
+ (((x) & 0xf0) ? _SPICE_TOSHIFT_4((x) >> 4) + 4 : _SPICE_TOSHIFT_4(x))
-#define _TOSHIFT_16(x) \
- (((x) & 0xff00) ? _TOSHIFT_8((x) >> 8) + 8 : _TOSHIFT_8(x))
+#define _SPICE_TOSHIFT_16(x) \
+ (((x) & 0xff00) ? _SPICE_TOSHIFT_8((x) >> 8) + 8 : _SPICE_TOSHIFT_8(x))
-#define PAWER2_TO_SHIFT(x) \
- (((x) & 0xffff0000) ? _TOSHIFT_16((x) >> 16) + 16 : _TOSHIFT_16(x))
+#define _SPICE_POWER2_TO_SHIFT(x) \
+ (((x) & 0xffff0000) ? _SPICE_TOSHIFT_16((x) >> 16) + 16 : _SPICE_TOSHIFT_16(x))
@@ -72,7 +72,7 @@
typedef struct SPICE_ATTR_PACKED name##_ring_el { \
union { \
el_type el; \
- uint8_t data[POWER2_ALIGN(sizeof(el_type))]; \
+ uint8_t data[_SPICE_POWER2_ALIGN(sizeof(el_type))]; \
} ; \
} name##_ring_el; \
\
@@ -82,13 +82,13 @@ typedef struct SPICE_ATTR_PACKED name { \
uint32_t notify_on_prod; \
uint32_t cons; \
uint32_t notify_on_cons; \
- name##_ring_el items[POWER2_ALIGN(size)]; \
+ name##_ring_el items[_SPICE_POWER2_ALIGN(size)]; \
} name;
#define SPICE_RING_INIT(r) \
(r)->num_items = sizeof((r)->items) >> \
- PAWER2_TO_SHIFT(sizeof((r)->items[0])); \
+ _SPICE_POWER2_TO_SHIFT(sizeof((r)->items[0])); \
(r)->prod = (r)->cons = 0; \
(r)->notify_on_prod = 1; \
(r)->notify_on_cons = 0;