From 876a1b48f87d0fe6d86ce22fb74b5c705bed6bcd Mon Sep 17 00:00:00 2001 From: Arthur Heymans Date: Tue, 15 Feb 2022 11:06:10 +0100 Subject: arch/x86/postcar_loader.c: Change prepare_and_run_postcar signature The postcar frame can now be a local variable to that function. Change-Id: I873298970fff76b9ee1cae7da156613eb557ffbc Signed-off-by: Arthur Heymans Reviewed-on: https://review.coreboot.org/c/coreboot/+/61964 Tested-by: build bot (Jenkins) Reviewed-by: Raul Rangel --- src/arch/x86/include/arch/romstage.h | 2 +- src/arch/x86/postcar_loader.c | 14 +++++++++----- 2 files changed, 10 insertions(+), 6 deletions(-) (limited to 'src/arch/x86') diff --git a/src/arch/x86/include/arch/romstage.h b/src/arch/x86/include/arch/romstage.h index 5951766a3c..d637d19b8a 100644 --- a/src/arch/x86/include/arch/romstage.h +++ b/src/arch/x86/include/arch/romstage.h @@ -43,7 +43,7 @@ void fill_postcar_frame(struct postcar_frame *pcf); * prepare_and_run_postcar() determines the stack to use after * cache-as-ram is torn down as well as the MTRR settings to use. */ -void prepare_and_run_postcar(struct postcar_frame *pcf); +void prepare_and_run_postcar(void); /* * Systems without a native coreboot cache-as-ram teardown may implement diff --git a/src/arch/x86/postcar_loader.c b/src/arch/x86/postcar_loader.c index b5bfe3e6c9..af8152d72b 100644 --- a/src/arch/x86/postcar_loader.c +++ b/src/arch/x86/postcar_loader.c @@ -21,6 +21,8 @@ static size_t var_mtrr_ctx_size(void) static int postcar_frame_init(struct postcar_frame *pcf) { + memset(pcf, 0, sizeof(*pcf)); + struct var_mtrr_context *ctx; ctx = cbmem_add(CBMEM_ID_ROMSTAGE_RAM_STACK, var_mtrr_ctx_size()); @@ -61,16 +63,18 @@ static void run_postcar_phase(struct postcar_frame *pcf); /* prepare_and_run_postcar() determines the stack to use after * cache-as-ram is torn down as well as the MTRR settings to use. */ -void prepare_and_run_postcar(struct postcar_frame *pcf) +void prepare_and_run_postcar(void) { - if (postcar_frame_init(pcf)) + struct postcar_frame pcf; + + if (postcar_frame_init(&pcf)) die("Unable to initialize postcar frame.\n"); - fill_postcar_frame(pcf); + fill_postcar_frame(&pcf); - postcar_frame_common_mtrrs(pcf); + postcar_frame_common_mtrrs(&pcf); - run_postcar_phase(pcf); + run_postcar_phase(&pcf); /* We do not return here. */ } -- cgit v1.2.3