cpu/x86/mp_init: use cb_err as status return type in remaining functions
Using cb_err as return type of mp_run_on_aps, mp_run_on_all_aps, mp_run_on_all_cpus and mp_park_aps clarifies the meaning of the different return values. This patch also adds the types.h include that provides the definition of the cb_err enum and checks the return value of all 4 functions listed above against the enum values instead of either checking if it's non-zero or less than zero to handle the error case. Signed-off-by: Felix Held <felix-coreboot@felixheld.de> Change-Id: I4b3f03415a041d3ec9cd0e102980e53868b004b0 Reviewed-on: https://review.coreboot.org/c/coreboot/+/58494 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Raul Rangel <rrangel@chromium.org>
This commit is contained in:
@@ -117,26 +117,25 @@ enum {
|
||||
* Input parameter expire_us <= 0 to specify an infinite timeout.
|
||||
* logical_cpu_num = MP_RUN_ON_ALL_CPUS to execute function over all cores (BSP
|
||||
* + APs) else specified AP number using logical_cpu_num.
|
||||
*
|
||||
* All functions return < 0 on error, 0 on success.
|
||||
*/
|
||||
int mp_run_on_aps(void (*func)(void *), void *arg, int logical_cpu_num,
|
||||
enum cb_err mp_run_on_aps(void (*func)(void *), void *arg, int logical_cpu_num,
|
||||
long expire_us);
|
||||
|
||||
/*
|
||||
* Runs func on all APs excluding BSP, with a provision to run calls in parallel
|
||||
* or serially per AP.
|
||||
*/
|
||||
int mp_run_on_all_aps(void (*func)(void *), void *arg, long expire_us, bool run_parallel);
|
||||
enum cb_err mp_run_on_all_aps(void (*func)(void *), void *arg, long expire_us,
|
||||
bool run_parallel);
|
||||
|
||||
/* Like mp_run_on_aps() but also runs func on BSP. */
|
||||
int mp_run_on_all_cpus(void (*func)(void *), void *arg);
|
||||
enum cb_err mp_run_on_all_cpus(void (*func)(void *), void *arg);
|
||||
|
||||
/*
|
||||
* Park all APs to prepare for OS boot. This is handled automatically
|
||||
* by the coreboot infrastructure.
|
||||
*/
|
||||
int mp_park_aps(void);
|
||||
enum cb_err mp_park_aps(void);
|
||||
|
||||
/*
|
||||
* SMM helpers to use with initializing CPUs.
|
||||
|
||||
Reference in New Issue
Block a user