diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/arch/arm64/cpu.c | 25 | ||||
-rw-r--r-- | src/arch/arm64/include/armv8/arch/cpu.h | 2 |
2 files changed, 27 insertions, 0 deletions
diff --git a/src/arch/arm64/cpu.c b/src/arch/arm64/cpu.c index 396c5b7ce9..c0dc3c3fa2 100644 --- a/src/arch/arm64/cpu.c +++ b/src/arch/arm64/cpu.c @@ -297,6 +297,21 @@ static int __arch_run_on_all_cpus(struct cpu_action *action, int sync) return 0; } +static int __arch_run_on_all_cpus_but_self(struct cpu_action *action, int sync) +{ + int i; + struct cpu_info *me = cpu_info(); + + for (i = 0; i < CONFIG_MAX_CPUS; i++) { + struct cpu_info *ci = cpu_info_for_cpu(i); + if (ci == me) + continue; + action_run_on_cpu(ci, action, sync); + } + + return 0; +} + int arch_run_on_all_cpus(struct cpu_action *action) { return __arch_run_on_all_cpus(action, 1); @@ -307,6 +322,16 @@ int arch_run_on_all_cpus_async(struct cpu_action *action) return __arch_run_on_all_cpus(action, 0); } +int arch_run_on_all_cpus_but_self(struct cpu_action *action) +{ + return __arch_run_on_all_cpus_but_self(action, 1); +} + +int arch_run_on_all_cpus_but_self_async(struct cpu_action *action) +{ + return __arch_run_on_all_cpus_but_self(action, 0); +} + void arch_secondary_cpu_init(void) { struct cpu_info *ci = cpu_info(); diff --git a/src/arch/arm64/include/armv8/arch/cpu.h b/src/arch/arm64/include/armv8/arch/cpu.h index a5d20c49ac..d2623857aa 100644 --- a/src/arch/arm64/include/armv8/arch/cpu.h +++ b/src/arch/arm64/include/armv8/arch/cpu.h @@ -94,8 +94,10 @@ void arch_initialize_cpus(device_t cluster, struct cpu_control_ops *cntrl_ops); */ int arch_run_on_cpu(unsigned int cpu, struct cpu_action *action); int arch_run_on_all_cpus(struct cpu_action *action); +int arch_run_on_all_cpus_but_self(struct cpu_action *action); 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); #endif /* !__PRE_RAM__ */ |