/* * psci_smp assumes that the following is true about PSCI: * * cpu_suspend Suspend the execution on a CPU * @state we don't currently describe affinity levels, so just pass 0. * @entry_point the first instruction to be executed on return * returns 0 success, < 0 on failure * * cpu_off Power down a CPU * @state we don't currently describe affinity levels, so just pass 0. * no return on successful call * * cpu_on Power up a CPU * @cpuid cpuid of target CPU, as from MPIDR * @entry_point the first instruction to be executed on return * returns 0 success, < 0 on failure * * migrate Migrate the context to a different CPU * @cpuid cpuid of target CPU, as from MPIDR * returns 0 success, < 0 on failure *
*/
#ifdef CONFIG_HOTPLUG_CPU staticint psci_cpu_disable(unsignedint cpu)
{ /* Fail early if we don't have CPU_OFF support */ if (!psci_ops.cpu_off) return -EOPNOTSUPP;
/* Trusted OS will deny CPU_OFF */ if (psci_tos_resident_on(cpu)) return -EPERM;
return 0;
}
staticvoid psci_cpu_die(unsignedint cpu)
{
u32 state = PSCI_POWER_STATE_TYPE_POWER_DOWN <<
PSCI_0_2_POWER_STATE_TYPE_SHIFT;
if (psci_ops.cpu_off)
psci_ops.cpu_off(state);
/* We should never return */
panic("psci: cpu %d failed to shutdown\n", cpu);
}
staticint psci_cpu_kill(unsignedint cpu)
{ int err, i;
if (!psci_ops.affinity_info) return 1; /* * cpu_kill could race with cpu_die and we can * potentially end up declaring this cpu undead * while it is dying. So, try again a few times.
*/
for (i = 0; i < 10; i++) {
err = psci_ops.affinity_info(cpu_logical_map(cpu), 0); if (err == PSCI_0_2_AFFINITY_LEVEL_OFF) {
pr_info("CPU%d killed.\n", cpu); return 1;
}
msleep(10);
pr_info("Retrying again to check for CPU kill\n");
}
pr_warn("CPU%d may not have shut down cleanly (AFFINITY_INFO reports %d)\n",
cpu, err); /* Make platform_cpu_kill() fail. */ return 0;
}
#endif
bool __init psci_smp_available(void)
{ /* is cpu_on available at least? */ return (psci_ops.cpu_on != NULL);
}
¤ Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.0.25Bemerkung:
(vorverarbeitet)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.