Attention is currently required from: Jakub Czapiga. Julius Werner has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/59494 )
Change subject: libpayload/libc/fmap: Use libpayload_boot_device_read for media access ......................................................................
Patch Set 1:
(2 comments)
File payloads/libpayload/libc/fmap.c:
https://review.coreboot.org/c/coreboot/+/59494/comment/6840659c_e20a26da PS1, Line 36: int fmap_region_by_name(const uint32_t fmap_offset, const char * const name, I don't think we want to keep this API, it's also kinda crufty. There's no point in having to pass fmap_offset in here manually, we already know that's in lib_sysinfo.fmap_offset, libpayload should just use that directly. Let's just treat this the same as libcbfs where we implement a wholly new API on the side and eventually just get rid of the old one. (Maybe call it fmap_locate_area() for consistency with coreboot?)
File payloads/libpayload/tests/libc/fmap_region_by_name-test.c:
https://review.coreboot.org/c/coreboot/+/59494/comment/88c1457e_c57a02c9 PS1, Line 44: SETUP_LIBPAYLOAD_BOOT_DEVICE_READ_MOCK(&test_fmap, fmap_offset, sizeof(test_fmap)); I feel like this test is a bit too white-boxy (i.e. it specifies behavior of the unit under test too narrowly... like that you get exactly two calls here). Maybe doing this with a mock that allows multiple reads and writes for any offset within the specified range would be cleaner?