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
| 444 | * lb_cbmem_ref structure. Hence we try to autocorrect this issue here. |
| 445 | */ |
| 446 | static 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 | |
| 460 | static uint32_t cbmem_id_to_lb_tag(uint32_t tag) |
| 461 | { |
no test coverage detected