From b21e362e93993a8879906cf3fa56586b84226920 Mon Sep 17 00:00:00 2001 From: Aaron Durbin Date: Wed, 7 Dec 2016 00:32:19 -0600 Subject: cpu/x86: allow AP callbacks after MP init There are circumstances where the APs need to run a piece of code later in the boot flow. The current MP init just parks the APs after MP init is completed so there's not an opportunity to target running a piece of code on all the APs at a later time. Therefore, provide an option, PARALLEL_MP_AP_WORK, that allows the APs to perform callbacks. BUG=chrome-os-partner:60657 BRANCH=reef Change-Id: I849ecfdd6641dd9424943e246317cd1996ef1ba6 Signed-off-by: Aaron Durbin Reviewed-on: https://review.coreboot.org/17745 Tested-by: build bot (Jenkins) Reviewed-by: Furquan Shaikh Reviewed-by: Lijian Zhao --- src/include/cpu/x86/mp.h | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'src/include') diff --git a/src/include/cpu/x86/mp.h b/src/include/cpu/x86/mp.h index 6d51d7b005..b9b4d5772c 100644 --- a/src/include/cpu/x86/mp.h +++ b/src/include/cpu/x86/mp.h @@ -124,6 +124,24 @@ struct mp_ops { */ int mp_init_with_smm(struct bus *cpu_bus, const struct mp_ops *mp_ops); + +/* + * After APs are up and PARALLEL_MP_AP_WORK is enabled one can issue work + * to all the APs to perform. Currently the BSP is the only CPU that is allowed + * to issue work. i.e. the APs should not call any of these functions. + * All functions return < 0 on error, 0 on success. + */ +int mp_run_on_aps(void (*func)(void), long expire_us); + +/* Like mp_run_on_aps() but also runs func on BSP. */ +int mp_run_on_all_cpus(void (*func)(void), long expire_us); + +/* + * Park all APs to prepare for OS boot. This is handled automatically + * by the coreboot infrastructure. + */ +int mp_park_aps(void); + /* * SMM helpers to use with initializing CPUs. */ -- cgit v1.2.3