summaryrefslogtreecommitdiff
path: root/src/drivers
diff options
context:
space:
mode:
authorFelix Held <felix.held@amd.corp-partner.google.com>2021-10-20 20:50:58 +0200
committerFelix Held <felix-coreboot@felixheld.de>2021-10-22 01:26:30 +0000
commit82faefb339a0853dd49f10bafd2c4f5ca1723fb3 (patch)
treef53d53ffb151ab929b32dece690399d3d8e5f4a6 /src/drivers
parent250988d943c322ac1720ae7cd6f88592f82a08c0 (diff)
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>
Diffstat (limited to 'src/drivers')
-rw-r--r--src/drivers/intel/fsp2_0/ppi/mp_service_ppi.c8
-rw-r--r--src/drivers/ocp/dmi/smbios.c4
2 files changed, 8 insertions, 4 deletions
diff --git a/src/drivers/intel/fsp2_0/ppi/mp_service_ppi.c b/src/drivers/intel/fsp2_0/ppi/mp_service_ppi.c
index a795c722a6..3f1e83d541 100644
--- a/src/drivers/intel/fsp2_0/ppi/mp_service_ppi.c
+++ b/src/drivers/intel/fsp2_0/ppi/mp_service_ppi.c
@@ -9,6 +9,7 @@
#include <fsp/ppi/mp_service_ppi.h>
#include <intelblocks/cpulib.h>
#include <intelblocks/mp_init.h>
+#include <types.h>
#define BSP_CPU_SLOT 0
@@ -72,7 +73,8 @@ efi_return_status_t mp_startup_all_aps(efi_ap_procedure procedure,
if (procedure == NULL)
return FSP_INVALID_PARAMETER;
- if (mp_run_on_all_aps((void *)procedure, argument, timeout_usec, !run_serial)) {
+ if (mp_run_on_all_aps((void *)procedure, argument, timeout_usec, !run_serial) !=
+ CB_SUCCESS) {
printk(BIOS_DEBUG, "%s: Exit with Failure\n", __func__);
return FSP_NOT_STARTED;
}
@@ -94,7 +96,7 @@ efi_return_status_t mp_startup_all_cpus(efi_ap_procedure procedure,
/* Run on APs */
if (mp_run_on_aps((void *)procedure, argument,
- MP_RUN_ON_ALL_CPUS, timeout_usec)) {
+ MP_RUN_ON_ALL_CPUS, timeout_usec) != CB_SUCCESS) {
printk(BIOS_DEBUG, "%s: Exit with Failure\n", __func__);
return FSP_NOT_STARTED;
}
@@ -118,7 +120,7 @@ efi_return_status_t mp_startup_this_ap(efi_ap_procedure procedure,
return FSP_INVALID_PARAMETER;
if (mp_run_on_aps((void *)procedure, argument,
- processor_number, timeout_usec)) {
+ processor_number, timeout_usec) != CB_SUCCESS) {
printk(BIOS_DEBUG, "%s: Exit with Failure\n", __func__);
return FSP_NOT_STARTED;
}
diff --git a/src/drivers/ocp/dmi/smbios.c b/src/drivers/ocp/dmi/smbios.c
index d0ef11508d..51c008d405 100644
--- a/src/drivers/ocp/dmi/smbios.c
+++ b/src/drivers/ocp/dmi/smbios.c
@@ -11,6 +11,7 @@
#include <soc/soc_util.h>
#include <soc/util.h>
#include <smbios.h>
+#include <types.h>
#include "ocp_dmi.h"
@@ -244,7 +245,8 @@ void ocp_oem_smbios_strings(struct device *dev, struct smbios_type11 *t)
if (CONFIG_MAX_SOCKET == 2 && CONFIG(PARALLEL_MP_AP_WORK)) {
/* Read the last CPU MSR */
if (mp_run_on_aps(read_remote_ppin, (void *)&xeon_sp_ppin[1],
- get_platform_thread_count() - 1, 100 * USECS_PER_MSEC)) {
+ get_platform_thread_count() - 1, 100 * USECS_PER_MSEC) !=
+ CB_SUCCESS) {
printk(BIOS_ERR, "Failed to read remote PPIN.\n");
t->count = smbios_add_oem_string(t->eos, TBF);
} else {