MCPcopy Create free account
hub / github.com/coreboot/coreboot / cb_parse_memory

Function cb_parse_memory

payloads/libpayload/libc/coreboot.c:45–70  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

43/* This is the generic parsing code. */
44
45static void cb_parse_memory(void *ptr, struct sysinfo_t *info)
46{
47 struct cb_memory *mem = ptr;
48 int count = MEM_RANGE_COUNT(mem);
49 int i;
50
51 if (count > SYSINFO_MAX_MEM_RANGES)
52 count = SYSINFO_MAX_MEM_RANGES;
53
54 info->n_memranges = 0;
55
56 for (i = 0; i < count; i++) {
57 struct cb_memory_range *range = MEM_RANGE_PTR(mem, i);
58
59#if CONFIG(LP_MEMMAP_RAM_ONLY)
60 if (range->type != CB_MEM_RAM)
61 continue;
62#endif
63
64 info->memrange[info->n_memranges].base = range->start;
65 info->memrange[info->n_memranges].size = range->size;
66 info->memrange[info->n_memranges].type = range->type;
67
68 info->n_memranges++;
69 }
70}
71
72static void cb_parse_serial(void *ptr, struct sysinfo_t *info)
73{

Callers 1

cb_parse_headerFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected