Attention is currently required from: Thomas Heijligen, David Hendricks, Edward O'Callaghan. Nico Huber has posted comments on this change. ( https://review.coreboot.org/c/flashrom/+/31016 )
Change subject: hwaccess: add endianness converting deserialization functions ......................................................................
Patch Set 19: Code-Review+1
(3 comments)
Patchset:
PS8:
We should also align this with the mmio version of this functions.
MMIO access is usually done with some offset too, but when it's with specific endianness than we usually use pci_mmio_* functions. Maybe those are worth to adapt? If we start to make changes that need an update for a lot of calls, we probably should discuss that a little more. One thing that comes to mind is the backwards parameters of *mmio_write[bwl].
Is this more like what you think?
Yes that is what I had in mind :)
File platform.h:
https://review.coreboot.org/c/flashrom/+/31016/comment/c03b7e96_6c1a059f PS19, Line 111: const base, const size_t offset The latter 2 `const` are superfluous in a forward declaration. It's not meaningful to the callers, they shouldn't care if the callee can change its variables. Please drop them here (same applies to the commit message, I guess).
File platform/memaccess.c:
https://review.coreboot.org/c/flashrom/+/31016/comment/c8295ab7_203e2503 PS19, Line 26: base + offset Technically this is wrong because arithmetic is undefined for `void *`. So we should add another cast (to a pointer of some- thing with size 1), e.g.
return le_to_cpu8 (*(uint8_t *)((char *)base + offset));
Casting to `uintptr_t` should also work.