diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/include/program_loading.h | 7 | ||||
-rw-r--r-- | src/lib/prog_loaders.c | 8 |
2 files changed, 15 insertions, 0 deletions
diff --git a/src/include/program_loading.h b/src/include/program_loading.h index 5b9a94df06..ba42465046 100644 --- a/src/include/program_loading.h +++ b/src/include/program_loading.h @@ -145,6 +145,13 @@ int legacy_romstage_select_and_load(struct prog *romstage); * RAMSTAGE LOADING * ************************/ +/* + * Asynchronously preloads ramstage. + * + * This should be called early on to allow ramstage to load before + * `run_ramstage` is called. + */ +void preload_ramstage(void); /* Run ramstage from romstage. */ void run_ramstage(void); diff --git a/src/lib/prog_loaders.c b/src/lib/prog_loaders.c index 8ad646a10c..878f729ef9 100644 --- a/src/lib/prog_loaders.c +++ b/src/lib/prog_loaders.c @@ -75,7 +75,15 @@ static int load_relocatable_ramstage(struct prog *ramstage) return rmodule_stage_load(&rmod_ram); } +void preload_ramstage(void) +{ + if (!CONFIG(CBFS_PRELOAD)) + return; + printk(BIOS_DEBUG, "Preloading ramstage\n"); + + cbfs_preload(CONFIG_CBFS_PREFIX "/ramstage"); +} void run_ramstage(void) { struct prog ramstage = |