lmb: Move enum lmb_flags to a u32
LMB flags is not an enum anymore. It's currently used as a bitmask
in various places of our code. So make it a u32 which is more
appropriate when dealing with masks.
Reviewed-by: Sam Protsenko <semen.protsenko@linaro.org>
Tested-by: Sam Protsenko <semen.protsenko@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
diff --git a/include/lmb.h b/include/lmb.h
index 03d5fac..3b911d5 100644
--- a/include/lmb.h
+++ b/include/lmb.h
@@ -19,18 +19,17 @@
#define LMB_ALIST_INITIAL_SIZE 4
/**
- * enum lmb_flags - Definition of memory region attributes
- * @LMB_NONE: No special request
- * @LMB_NOMAP: Don't add to MMU configuration
- * @LMB_NOOVERWRITE: The memory region cannot be overwritten/re-reserved
- * @LMB_NONOTIFY: Do not notify other modules of changes to this memory region
+ * DOC: Memory region attribute flags.
+ *
+ * %LMB_NONE: No special request
+ * %LMB_NOMAP: Don't add to MMU configuration
+ * %LMB_NOOVERWRITE: The memory region cannot be overwritten/re-reserved
+ * %LMB_NONOTIFY: Do not notify other modules of changes to this memory region
*/
-enum lmb_flags {
- LMB_NONE = 0,
- LMB_NOMAP = BIT(1),
- LMB_NOOVERWRITE = BIT(2),
- LMB_NONOTIFY = BIT(3),
-};
+#define LMB_NONE 0
+#define LMB_NOMAP BIT(0)
+#define LMB_NOOVERWRITE BIT(1)
+#define LMB_NONOTIFY BIT(2)
/**
* struct lmb_region - Description of one region
@@ -41,7 +40,7 @@
struct lmb_region {
phys_addr_t base;
phys_size_t size;
- enum lmb_flags flags;
+ u32 flags;
};
/**
@@ -101,7 +100,7 @@
* * %-1 - Failure
*/
long lmb_reserve_flags(phys_addr_t base, phys_size_t size,
- enum lmb_flags flags);
+ u32 flags);
phys_addr_t lmb_alloc(phys_size_t size, ulong align);
phys_addr_t lmb_alloc_base(phys_size_t size, ulong align, phys_addr_t max_addr);