summaryrefslogtreecommitdiff
path: root/util/spkmodem_recv
diff options
context:
space:
mode:
authorLeah Rowe <leah@libreboot.org>2025-01-29 03:41:55 +0000
committerLeah Rowe <leah@libreboot.org>2025-01-29 03:41:55 +0000
commitb1d8975959dc942bb8691253f3599e4ac99932eb (patch)
tree69683ab392ab850fab17db858fec42229e0fd7fe /util/spkmodem_recv
parent6821659bcb205c0c1fc796fd7a9543f42b7bacc7 (diff)
util/nvmutil: Only read up to 4KB on larger gbe
On the 16KB and 128KB files, we still only need to operate on 4KB at the start of each block, where the block size is larger than 4KB. The reason we deal with the entire 4KB block is because the nvm words (in the 128 byte section) can define an extended nvm area anywhere after 128 bytes, within the 128 byte block. We could systematically read where that is being handled, and handle it; we could then allocate less memory, and read/write fewer bytes, but many block devices like SSDs and flash drives have at least a 4KB erase block anyway, so it's kinda pointless. saving memory would be nice, but I don't really want to bloat the code. This is a nice easy optimisation, to avoid wasting an additional 8KB of memory when handling 16KB files, and additional 120KB if handling 128KB files, since nf is what determines how much memory will be allocated. the alternative would be to use an mmap, and then we could reasonably handle the idea above for only writing, surgically, what we need: nvm words and extended nvm words. Signed-off-by: Leah Rowe <leah@libreboot.org>
Diffstat (limited to 'util/spkmodem_recv')
0 files changed, 0 insertions, 0 deletions