diff options
Diffstat (limited to 'src/arch/arm64/include')
-rw-r--r-- | src/arch/arm64/include/armv8/arch/cpu.h | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/src/arch/arm64/include/armv8/arch/cpu.h b/src/arch/arm64/include/armv8/arch/cpu.h index 8d071adc61..fc31903f52 100644 --- a/src/arch/arm64/include/armv8/arch/cpu.h +++ b/src/arch/arm64/include/armv8/arch/cpu.h @@ -23,6 +23,7 @@ #define asmlinkage #if !defined(__PRE_RAM__) +#include <arch/barrier.h> #include <device/device.h> enum { @@ -67,6 +68,12 @@ struct cpu_info { struct cpu_info *cpu_info(void); extern struct cpu_info *bsp_cpu_info; +extern struct cpu_info cpu_infos[CONFIG_MAX_CPUS]; + +static inline struct cpu_info *cpu_info_for_cpu(unsigned int id) +{ + return &cpu_infos[id]; +} /* Ran only by BSP at initial boot strapping. */ static inline void cpu_set_bsp(void) @@ -79,6 +86,16 @@ static inline int cpu_is_bsp(void) return cpu_info() == bsp_cpu_info; } +static inline int cpu_online(struct cpu_info *ci) +{ + return load_acquire(&ci->online) != 0; +} + +static inline void cpu_mark_online(struct cpu_info *ci) +{ + store_release(&ci->online, 1); +} + /* Control routines for starting CPUs. */ struct cpu_control_ops { /* Return the maximum number of CPUs supported. */ @@ -112,6 +129,9 @@ int arch_run_on_cpu_async(unsigned int cpu, struct cpu_action *action); int arch_run_on_all_cpus_async(struct cpu_action *action); int arch_run_on_all_cpus_but_self_async(struct cpu_action *action); +/* Wait for actions to be perfomed. */ +void arch_cpu_wait_for_action(void); + #endif /* !__PRE_RAM__ */ /* |