aboutsummaryrefslogtreecommitdiff
path: root/payloads/libpayload/i386/coreboot.c
diff options
context:
space:
mode:
authorPatrick Georgi <patrick.georgi@coresystems.de>2009-05-17 20:36:45 +0000
committerPatrick Georgi <patrick.georgi@coresystems.de>2009-05-17 20:36:45 +0000
commitc9a6f0f442846b0ed631ddceb062e632c1154da4 (patch)
treed38c38cb3458eedde489f5f6e35e4a6bf47f709d /payloads/libpayload/i386/coreboot.c
parent56ae8fcb6fe545557c6b5a3ffb72f54bd3b53ddc (diff)
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 <patrick.georgi@coresystems.de> Acked-by: Peter Stuge <peter@stuge.se> git-svn-id: svn://svn.coreboot.org/coreboot/trunk@4291 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
Diffstat (limited to 'payloads/libpayload/i386/coreboot.c')
-rw-r--r--payloads/libpayload/i386/coreboot.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/payloads/libpayload/i386/coreboot.c b/payloads/libpayload/i386/coreboot.c
index 66e02f11b7..95d8f16f76 100644
--- a/payloads/libpayload/i386/coreboot.c
+++ b/payloads/libpayload/i386/coreboot.c
@@ -57,8 +57,10 @@ static void cb_parse_memory(unsigned char *ptr, struct sysinfo_t *info)
struct cb_memory_range *range =
(struct cb_memory_range *)MEM_RANGE_PTR(mem, i);
+#if MEMMAP_RAM_ONLY
if (range->type != CB_MEM_RAM)
continue;
+#endif
info->memrange[info->n_memranges].base =
UNPACK_CB64(range->start);
@@ -66,6 +68,8 @@ static void cb_parse_memory(unsigned char *ptr, struct sysinfo_t *info)
info->memrange[info->n_memranges].size =
UNPACK_CB64(range->size);
+ info->memrange[info->n_memranges].type = range->type;
+
info->n_memranges++;
}
}