diff options
Diffstat (limited to 'arch/x86/lib/e820.c')
-rw-r--r-- | arch/x86/lib/e820.c | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/arch/x86/lib/e820.c b/arch/x86/lib/e820.c index d478b7486e3..00ca94776d2 100644 --- a/arch/x86/lib/e820.c +++ b/arch/x86/lib/e820.c @@ -10,6 +10,29 @@ DECLARE_GLOBAL_DATA_PTR; +static const char *const e820_type_name[E820_COUNT] = { + [E820_RAM] = "RAM", + [E820_RESERVED] = "Reserved", + [E820_ACPI] = "ACPI", + [E820_NVS] = "ACPI NVS", + [E820_UNUSABLE] = "Unusable", +}; + +void e820_dump(struct e820_entry *entries, uint count) +{ + int i; + + printf("%12s %10s %s\n", "Addr", "Size", "Type"); + for (i = 0; i < count; i++) { + struct e820_entry *entry = &entries[i]; + + printf("%12llx %10llx %s\n", entry->addr, entry->size, + entry->type < E820_COUNT ? + e820_type_name[entry->type] : + simple_itoa(entry->type)); + } +} + /* * Install a default e820 table with 4 entries as follows: * |