From c9a6f0f442846b0ed631ddceb062e632c1154da4 Mon Sep 17 00:00:00 2001 From: Patrick Georgi Date: Sun, 17 May 2009 20:36:45 +0000 Subject: Add type field to memranges, and fill it from the source data. type field contains e820 type ids, which are used by coreboot and multiboot (the two source formats), so they can be used as-is. The MEMMAP_RAM_ONLY define is a way to allow a payload to opt for only having CB_MEM_RAM type fields, which might be helpful to support older payloads easily (just add the define, and it won't encounter "weird" fields) Signed-off-by: Patrick Georgi Acked-by: Peter Stuge git-svn-id: svn://svn.coreboot.org/coreboot/trunk@4291 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1 --- payloads/libpayload/i386/multiboot.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'payloads/libpayload/i386/multiboot.c') diff --git a/payloads/libpayload/i386/multiboot.c b/payloads/libpayload/i386/multiboot.c index 290283e8ed..82736b14fe 100644 --- a/payloads/libpayload/i386/multiboot.c +++ b/payloads/libpayload/i386/multiboot.c @@ -45,15 +45,20 @@ static void mb_parse_mmap(struct multiboot_header *table, while(ptr < (start + table->mmap_length)) { struct multiboot_mmap *mmap = (struct multiboot_mmap *) ptr; +#if MEMMAP_RAM_ONLY /* 1 == normal RAM. Ignore everything else for now */ if (mmap->type == 1) { +#endif info->memrange[info->n_memranges].base = mmap->addr; info->memrange[info->n_memranges].size = mmap->length; + info->memrange[info->n_memranges].type = mmap->type; if (++info->n_memranges == SYSINFO_MAX_MEM_RANGES) return; +#if MEMMAP_RAM_ONLY } +#endif ptr += (mmap->size + sizeof(mmap->size)); } -- cgit v1.2.3