summaryrefslogtreecommitdiffstats
path: root/src/cpu/x86
diff options
context:
space:
mode:
authorJulius Werner <jwerner@chromium.org>2020-09-03 21:17:20 -0700
committerPatrick Georgi <pgeorgi@google.com>2021-03-17 08:05:51 +0000
commit2e973942bc34ff2d7b110ba35bf3cda987838907 (patch)
tree95a3c6d99491ab15a4d2c677f17edcfb5005d54d /src/cpu/x86
parent8e15e91dc4f397371c5ce04a4945945468059953 (diff)
downloadcoreboot-2e973942bc34ff2d7b110ba35bf3cda987838907.tar.gz
coreboot-2e973942bc34ff2d7b110ba35bf3cda987838907.tar.bz2
coreboot-2e973942bc34ff2d7b110ba35bf3cda987838907.zip
program_loading: Replace prog_rdev() with raw start pointer and size
Since prog_locate() was eliminated, prog_rdev() only ever represents the loaded program in memory now. Using the rdev API for this is unnecessary if we know that the "device" is always just memory. This patch changes it to be represented by a simple pointer and size. Since some code still really wants this to be an rdev, introduce a prog_chain_rdev() helper to translate back to that if necessary. Signed-off-by: Julius Werner <jwerner@chromium.org> Change-Id: If7c0f1c5698fa0c326e23c553ea0fe928b25d202 Reviewed-on: https://review.coreboot.org/c/coreboot/+/46483 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Aaron Durbin <adurbin@chromium.org>
Diffstat (limited to 'src/cpu/x86')
-rw-r--r--src/cpu/x86/mtrr/xip_cache.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/cpu/x86/mtrr/xip_cache.c b/src/cpu/x86/mtrr/xip_cache.c
index d3fbfcb6b547..cd82e4fc713c 100644
--- a/src/cpu/x86/mtrr/xip_cache.c
+++ b/src/cpu/x86/mtrr/xip_cache.c
@@ -29,8 +29,8 @@ static uint32_t max_cache_used(void)
void platform_prog_run(struct prog *prog)
{
- const uint32_t base = region_device_offset(&prog->rdev);
- const uint32_t size = region_device_sz(&prog->rdev);
+ const uint32_t base = (uintptr_t)prog_start(prog);
+ const uint32_t size = prog_size(prog);
const uint32_t end = base + size;
const uint32_t cache_used = max_cache_used();
/* This will accumulate MTRR's as XIP stages are run.