1 comment:
File payloads/libpayload/drivers/cbmem_console.c:
Patch Set #1, Line 64: cbmem_console_p
Yes, we're checking if the field in sysinfo was NULL. phys_to_virt() is not checking for NULL, so phys_to_virt(NULL) is just (void *)virt_offset. This code is correct because you're essentially checking (lib_sysinfo.cbmem_cons + virt_offset - virt_offset == NULL),
Naa, `cbmem_console_p` checked here is `lib_sysinfo.cbmem_cons - virt_offset`. However, it's the
equivalent of `cbtable.cbmem_cons + virt_offset - virt_offset`.
I'm just saying I find the whole thing pretty hard to follow.
Yes. That is what convinced me to follow your advice and have a closer look
at the pointers in `libsysinfo`.
It's a mess to be honest ;) we have pointers to cb table structs, replicated
cb table structs, pointers to cbmem entries... all virtual. However, inside
the structs, there may be more pointers and those have to be physical
(because we refer to the original tables).
Here is an idea how to clean it up:
To view, visit change 37478. To unsubscribe, or for help writing mail filters, visit settings.