arm64: add cpu_is_bsp() concept
It's helpful to know if the current running CPU is the BSP. Therefore, provide that semantic. BUG=chrome-os-partner:32082 BRANCH=None TEST=Built and booted to kernel. Change-Id: I18cb8ab5149c3337e22b1f6046b1af266be7e47c Signed-off-by: Patrick Georgi <pgeorgi@chromium.org> Original-Commit-Id: b390dc70b658c207cd3b64408713ec4cddab3172 Original-Change-Id: I3d5518d1f6d6a78b14f25bb7ef79727605064561 Original-Signed-off-by: Aaron Durbin <adurbin@chromium.org> Original-Reviewed-on: https://chromium-review.googlesource.com/218653 Original-Reviewed-by: Furquan Shaikh <furquan@chromium.org> Reviewed-on: http://review.coreboot.org/9083 Tested-by: build bot (Jenkins) Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
This commit is contained in:
parent
cf5b627725
commit
74ff69feef
|
@ -56,6 +56,7 @@ static void seed_stack(void)
|
||||||
|
|
||||||
void arm64_init(void)
|
void arm64_init(void)
|
||||||
{
|
{
|
||||||
|
cpu_set_bsp();
|
||||||
seed_stack();
|
seed_stack();
|
||||||
arm64_soc_init();
|
arm64_soc_init();
|
||||||
main();
|
main();
|
||||||
|
|
|
@ -27,6 +27,7 @@
|
||||||
#include "cpu-internal.h"
|
#include "cpu-internal.h"
|
||||||
|
|
||||||
static struct cpu_info cpu_infos[CONFIG_MAX_CPUS];
|
static struct cpu_info cpu_infos[CONFIG_MAX_CPUS];
|
||||||
|
struct cpu_info *bsp_cpu_info;
|
||||||
|
|
||||||
static inline struct cpu_info *cpu_info_for_cpu(unsigned int id)
|
static inline struct cpu_info *cpu_info_for_cpu(unsigned int id)
|
||||||
{
|
{
|
||||||
|
|
|
@ -66,6 +66,19 @@ struct cpu_info {
|
||||||
/* Obtain cpu_info for current executing CPU. */
|
/* Obtain cpu_info for current executing CPU. */
|
||||||
struct cpu_info *cpu_info(void);
|
struct cpu_info *cpu_info(void);
|
||||||
|
|
||||||
|
extern struct cpu_info *bsp_cpu_info;
|
||||||
|
|
||||||
|
/* Ran only by BSP at initial boot strapping. */
|
||||||
|
static inline void cpu_set_bsp(void)
|
||||||
|
{
|
||||||
|
bsp_cpu_info = cpu_info();
|
||||||
|
}
|
||||||
|
|
||||||
|
static inline int cpu_is_bsp(void)
|
||||||
|
{
|
||||||
|
return cpu_info() == bsp_cpu_info;
|
||||||
|
}
|
||||||
|
|
||||||
/* Control routines for starting CPUs. */
|
/* Control routines for starting CPUs. */
|
||||||
struct cpu_control_ops {
|
struct cpu_control_ops {
|
||||||
/* Return the maximum number of CPUs supported. */
|
/* Return the maximum number of CPUs supported. */
|
||||||
|
|
Loading…
Reference in New Issue