memory map.
+2013-03-25 Vladimir Serbinenko <phcoder@gmail.com>
+
+ Replace the region at 0 from coreboot tables to available in BSD
+ memory map.
+
2013-03-24 Vladimir Serbinenko <phcoder@gmail.com>
* util/grub.d/20_linux_xen.in: Automatically add no-real-mode edd=off on
is required to save accross hibernations. */
[GRUB_MEMORY_NVS] = N_("ACPI non-volatile storage RAM"),
[GRUB_MEMORY_BADRAM] = N_("faulty RAM (BadRAM)"),
+ [GRUB_MEMORY_COREBOOT_TABLES] = N_("RAM holding coreboot tables"),
[GRUB_MEMORY_CODE] = N_("RAM holding firmware code"),
[GRUB_MEMORY_HOLE] = N_("Address range not associated with RAM")
};
void *hook_data;
};
+#define GRUB_MACHINE_MEMORY_BADRAM 5
+
/* Helper for grub_machine_mmap_iterate. */
static int
iterate_linuxbios_table (grub_linuxbios_table_item_t table_item, void *data)
/* Multiboot mmaps match with the coreboot mmap
definition. Therefore, we can just pass type
through. */
- mem_region->type, ctx->hook_data))
+ (((mem_region->type <= GRUB_MACHINE_MEMORY_BADRAM) && (mem_region->type >= GRUB_MACHINE_MEMORY_AVAILABLE))
+ || mem_region->type == GRUB_MEMORY_COREBOOT_TABLES) ? mem_region->type : GRUB_MEMORY_RESERVED,
+ ctx->hook_data))
return 1;
mem_region++;
#define GRUB_E820_ACPI 3
#define GRUB_E820_NVS 4
#define GRUB_E820_BADRAM 5
+#define GRUB_E820_COREBOOT_TABLES 0x10
/* Context for generate_e820_mmap. */
struct generate_e820_mmap_ctx
case GRUB_MEMORY_NVS:
ctx->cur.type = GRUB_E820_NVS;
break;
-
+ case GRUB_MEMORY_COREBOOT_TABLES:
+ /* Nowadays the tables at 0 don't contain anything important but
+ *BSD needs the memory at 0 for own needs.
+ */
+ if (addr == 0)
+ ctx->cur.type = GRUB_E820_RAM;
+ else
+ ctx->cur.type = GRUB_E820_COREBOOT_TABLES;
+ break;
default:
case GRUB_MEMORY_CODE:
case GRUB_MEMORY_RESERVED:
ctx->cur.type = GRUB_E820_RESERVED;
break;
- }
+ }
/* Merge regions if possible. */
if (ctx->count && ctx->cur.type == ctx->prev.type
[GRUB_MEMORY_AVAILABLE] = 1,
[GRUB_MEMORY_RESERVED] = 3,
[GRUB_MEMORY_ACPI] = 2,
+ [GRUB_MEMORY_COREBOOT_TABLES] = 2,
[GRUB_MEMORY_CODE] = 3,
[GRUB_MEMORY_NVS] = 3,
[GRUB_MEMORY_HOLE] = 4,
GRUB_MEMORY_ACPI = 3,
GRUB_MEMORY_NVS = 4,
GRUB_MEMORY_BADRAM = 5,
+ GRUB_MEMORY_COREBOOT_TABLES = 16,
GRUB_MEMORY_CODE = 20,
/* This one is special: it's used internally but is never reported
by firmware. */