summaryrefslogtreecommitdiffstats
path: root/src/include/cpu
diff options
context:
space:
mode:
authorFelix Held <felix.held@amd.corp-partner.google.com>2021-10-20 20:18:12 +0200
committerFelix Held <felix-coreboot@felixheld.de>2021-10-21 20:51:43 +0000
commitd27ef5bf6f5e444141dca6a89c46e667bca64652 (patch)
tree5625401e34f2a4f08175023de22172e4fa95589e /src/include/cpu
parente0e49c858bc603ac8216cd3d87c6a4a9996a8083 (diff)
downloadcoreboot-d27ef5bf6f5e444141dca6a89c46e667bca64652.tar.gz
coreboot-d27ef5bf6f5e444141dca6a89c46e667bca64652.tar.bz2
coreboot-d27ef5bf6f5e444141dca6a89c46e667bca64652.zip
cpu/x86/mp_init: use cb_err as mp_init_with_smm return type
Using cb_err as return type 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 mp_init_with_smm 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: Ibcd4a9a63cc87fe176ba885ced0f00832587d492 Reviewed-on: https://review.coreboot.org/c/coreboot/+/58491 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Tim Wawrzynczak <twawrzynczak@chromium.org>
Diffstat (limited to 'src/include/cpu')
-rw-r--r--src/include/cpu/x86/mp.h12
1 files changed, 5 insertions, 7 deletions
diff --git a/src/include/cpu/x86/mp.h b/src/include/cpu/x86/mp.h
index bc44415fdbf1..aa6289c18cbe 100644
--- a/src/include/cpu/x86/mp.h
+++ b/src/include/cpu/x86/mp.h
@@ -5,8 +5,7 @@
#include <arch/smp/atomic.h>
#include <cpu/x86/smm.h>
-#include <stddef.h>
-#include <stdint.h>
+#include <types.h>
#define CACHELINE_SIZE 64
@@ -86,10 +85,9 @@ struct mp_ops {
};
/*
- * mp_init_with_smm() returns < 0 on failure and 0 on success. The mp_ops
- * argument is used to drive the multiprocess initialization. Unless otherwise
- * stated each callback is called on the BSP only. The sequence of operations
- * is the following:
+ * The mp_ops argument is used to drive the multiprocess initialization. Unless
+ * otherwise stated each callback is called on the BSP only. The sequence of
+ * operations is the following:
* 1. pre_mp_init()
* 2. get_cpu_count()
* 3. get_smm_info()
@@ -103,7 +101,7 @@ struct mp_ops {
* 10. mp_initialize_cpu() for each cpu
* 11. post_mp_init()
*/
-int mp_init_with_smm(struct bus *cpu_bus, const struct mp_ops *mp_ops);
+enum cb_err mp_init_with_smm(struct bus *cpu_bus, const struct mp_ops *mp_ops);
enum {
/* Function runs on all cores (both BSP and APs) */