summaryrefslogtreecommitdiff
path: root/src/arch/x86
diff options
context:
space:
mode:
authorArthur Heymans <arthur@aheymans.xyz>2022-02-15 11:06:10 +0100
committerArthur Heymans <arthur@aheymans.xyz>2022-05-16 07:05:59 +0000
commit876a1b48f87d0fe6d86ce22fb74b5c705bed6bcd (patch)
tree86c2410d21f5c0abacd5b1603c9e62f4165424b0 /src/arch/x86
parentba00d10c41d1df1ca8a5eadc95a40430fbd059c5 (diff)
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 <arthur@aheymans.xyz> Reviewed-on: https://review.coreboot.org/c/coreboot/+/61964 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Raul Rangel <rrangel@chromium.org>
Diffstat (limited to 'src/arch/x86')
-rw-r--r--src/arch/x86/include/arch/romstage.h2
-rw-r--r--src/arch/x86/postcar_loader.c14
2 files changed, 10 insertions, 6 deletions
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. */
}