/* Some of this is x86 specific, and the rest of it is generic. Right now, since we only support x86, we'll avoid trying to make lots of infrastructure we don't need. If in the future, we want to use coreboot on some other architecture, then take out the generic parsing code and move it elsewhere.  */
static void cb_parse_memory(unsigned char *ptr, struct sysinfo_t *info)
/* Some of this is x86 specific, and the rest of it is generic. Right now, since we only support x86, we'll avoid trying to make lots of infrastructure we don't need. If in the future, we want to use coreboot on some other architecture, then take out the generic parsing code and move it elsewhere.  */
static void cb_parse_memory(unsigned char *ptr, struct sysinfo_t *info)
{
	struct cb_memory *mem = (struct cb_memory *)ptr;
	int count = MEM_RANGE_COUNT(mem);
	int i;
	if (count > SYSINFO_MAX_MEM_RANGES)
		count = SYSINFO_MAX_MEM_RANGES;
	info->n_memranges = 0;
	for (i = 0; i < count; i++) {
		struct cb_memory_range *range =
		    (struct cb_memory_range *)MEM_RANGE_PTR(mem, i);
		info->memrange[info->n_memranges].base =
		    UNPACK_CB64(range->start);
		info->memrange[info->n_memranges].size =
		    UNPACK_CB64(range->size);
		info->memrange[info->n_memranges].type = range->type;
		info->n_memranges++;
	}
}