arm64: provide run on all cpu but self semantics

In order to provide richer semantics for running code
on all CPUs add an all-but-self construct.

BUG=chrome-os-partner:32082
BRANCH=None
TEST=Built and booted to kernel.

Change-Id: If8dd28ff7f34d93592ab2025a65a2fd665e4e608
Signed-off-by: Patrick Georgi <pgeorgi@chromium.org>
Original-Commit-Id: 9a4622f63a065f620f0c92ef92eeb2aa5c2b441d
Original-Change-Id: Id18dc0423bcb0016ed36ace659b3f858e824c46c
Original-Signed-off-by: Aaron Durbin <adurbin@chromium.org>
Original-Reviewed-on: https://chromium-review.googlesource.com/218652
Original-Reviewed-by: Furquan Shaikh <furquan@chromium.org>
Reviewed-on: http://review.coreboot.org/9082
Tested-by: build bot (Jenkins)
Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
This commit is contained in:
Aaron Durbin 2014-09-17 12:00:57 -05:00 committed by Patrick Georgi
parent ae879bbecb
commit cf5b627725
2 changed files with 27 additions and 0 deletions

View File

@ -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();

View File

@ -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__ */