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

Function parse_cbmem_ref

util/cbmem/devmem_drv.c:446–458  ·  view source on GitHub ↗

This is a work-around for a nasty problem introduced by initially having * pointer sized entries in the lb_cbmem_ref structures. This caused problems * on 64bit x86 systems because coreboot is 32bit on those systems. * When the problem was found, it was corrected, but there are a lot of * systems out there with a firmware that does not produce the right * lb_cbmem_ref structure. Hence we try

Source from the content-addressed store, hash-verified

444 * lb_cbmem_ref structure. Hence we try to autocorrect this issue here.
445 */
446static struct lb_cbmem_ref parse_cbmem_ref(const struct lb_cbmem_ref *cbmem_ref)
447{
448 struct lb_cbmem_ref ret;
449
450 aligned_memcpy(&ret, cbmem_ref, sizeof(ret));
451
452 if (cbmem_ref->size < sizeof(*cbmem_ref))
453 ret.cbmem_addr = (uint32_t)ret.cbmem_addr;
454
455 debug(" cbmem_addr = %" PRIx64 "\n", ret.cbmem_addr);
456
457 return ret;
458}
459
460static uint32_t cbmem_id_to_lb_tag(uint32_t tag)
461{

Callers 1

Calls 1

aligned_memcpyFunction · 0.85

Tested by

no test coverage detected