#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
- */
-enum lmb_flags {
- LMB_NONE = 0,
- LMB_NOMAP = BIT(1),
- LMB_NOOVERWRITE = BIT(2),
- LMB_NONOTIFY = BIT(3),
-};
+ * 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
+ */
+#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
struct lmb_region {
phys_addr_t base;
phys_size_t size;
- enum lmb_flags flags;
+ u32 flags;
};
/**
* * %-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);
* * %-1 - Failure
*/
static long lmb_add_region_flags(struct alist *lmb_rgn_lst, phys_addr_t base,
- phys_size_t size, enum lmb_flags flags)
+ phys_size_t size, u32 flags)
{
unsigned long coalesced = 0;
long ret, i;
for (i = 0; i < lmb_rgn_lst->count; i++) {
phys_addr_t rgnbase = rgn[i].base;
phys_size_t rgnsize = rgn[i].size;
- enum lmb_flags rgnflags = rgn[i].flags;
+ u32 rgnflags = rgn[i].flags;
ret = lmb_addrs_adjacent(base, size, rgnbase, rgnsize);
if (ret > 0) {
static struct lmb lmb;
-static bool lmb_should_notify(enum lmb_flags flags)
+static bool lmb_should_notify(u32 flags)
{
return !lmb.test && !(flags & LMB_NONOTIFY) &&
CONFIG_IS_ENABLED(EFI_LOADER);
}
static int lmb_map_update_notify(phys_addr_t addr, phys_size_t size, u8 op,
- enum lmb_flags flags)
+ u32 flags)
{
u64 efi_addr;
u64 pages;
return 0;
}
-static void lmb_print_region_flags(enum lmb_flags flags)
+static void lmb_print_region_flags(u32 flags)
{
const char * const flag_str[] = { "none", "no-map", "no-overwrite",
"no-notify" };
{
struct lmb_region *rgn = lmb_rgn_lst->data;
unsigned long long base, size, end;
- enum lmb_flags flags;
+ u32 flags;
int i;
printf(" %s.count = %#x\n", name, lmb_rgn_lst->count);
return lmb_free_flags(base, size, LMB_NONE);
}
-long lmb_reserve_flags(phys_addr_t base, phys_size_t size, enum lmb_flags flags)
+long lmb_reserve_flags(phys_addr_t base, phys_size_t size, u32 flags)
{
long ret = 0;
struct alist *lmb_rgn_lst = &lmb.used_mem;
}
static phys_addr_t _lmb_alloc_base(phys_size_t size, ulong align,
- phys_addr_t max_addr, enum lmb_flags flags)
+ phys_addr_t max_addr, u32 flags)
{
int ret;
long i, rgn;
}
static phys_addr_t _lmb_alloc_addr(phys_addr_t base, phys_size_t size,
- enum lmb_flags flags)
+ u32 flags)
{
long rgn;
struct lmb_region *lmb_memory = lmb.free_mem.data;