Kane Chen has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/64428 )
Change subject: selfboot: Provide __weak cache_payload_destination ......................................................................
selfboot: Provide __weak cache_payload_destination
This commit provides a __weak function for mainboards, SoCs...etc to implement function to speed up LZMA decompression.
BUG=b:225766934
Change-Id: Ia0d7d15faacadd520226d88a705a1e517c0ae908 Signed-off-by: Kane Chen kane.chen@intel.corp-partner.google.com --- M src/include/program_loading.h M src/lib/selfboot.c 2 files changed, 9 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/28/64428/1
diff --git a/src/include/program_loading.h b/src/include/program_loading.h index 7ff55fc..a9d83e3 100644 --- a/src/include/program_loading.h +++ b/src/include/program_loading.h @@ -159,6 +159,7 @@ ***********************/
int payload_arch_usable_ram_quirk(uint64_t start, uint64_t size); +void cache_payload_destination(void *dest, size_t memsz);
/* * Asynchronously preloads the payload. diff --git a/src/lib/selfboot.c b/src/lib/selfboot.c index 637ad13..a9b4cca 100644 --- a/src/lib/selfboot.c +++ b/src/lib/selfboot.c @@ -53,6 +53,11 @@ return 0; }
+__weak void cache_payload_destination(void *dest, size_t memsz) +{ + return; +} + static int load_one_segment(uint8_t *dest, uint8_t *src, size_t len, @@ -67,6 +72,9 @@ /* Compute the boundaries of the segment */ end = dest + memsz;
+ /* cache the mem address where payload is loaded if possible */ + cache_payload_destination(dest, memsz); + /* Copy data from the initial buffer */ switch (compression) { case CBFS_COMPRESS_LZMA: {