staticint cpu_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;
return0;
}
staticvoid cpu_psci_cpu_die(unsignedint cpu)
{ /* * There are no known implementations of PSCI actually using the * power state field, pass a sensible default for now.
*/
u32 state = PSCI_POWER_STATE_TYPE_POWER_DOWN <<
PSCI_0_2_POWER_STATE_TYPE_SHIFT;
psci_ops.cpu_off(state);
}
staticint cpu_psci_cpu_kill(unsignedint cpu)
{ int err; unsignedlong start, end;
if (!psci_ops.affinity_info) return0; /* * 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.
*/
start = jiffies;
end = start + msecs_to_jiffies(100); do {
err = psci_ops.affinity_info(cpu_logical_map(cpu), 0); if (err == PSCI_0_2_AFFINITY_LEVEL_OFF) {
pr_info("CPU%d killed (polled %d ms)\n", cpu,
jiffies_to_msecs(jiffies - start)); return0;
}
usleep_range(100, 1000);
} while (time_before(jiffies, end));
pr_warn("CPU%d may not have shut down cleanly (AFFINITY_INFO reports %d)\n",
cpu, err); return -ETIMEDOUT;
} #endif
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.