/* * Copyright (C) 2014 Stefan Kristiansson <stefan.kristiansson@saunalahti.fi> * Copyright (C) 2017 Stafford Horne <shorne@gmail.com> * * Based on arm64 and arc implementations * Copyright (C) 2013 ARM Ltd. * Copyright (C) 2004, 2007-2010, 2011-2012 Synopsys, Inc. (www.synopsys.com) * * This file is licensed under the terms of the GNU General Public License * version 2. This program is licensed "as is" without any warranty of any * kind, whether express or implied.
*/
staticvoid boot_secondary(unsignedint cpu, struct task_struct *idle)
{ /* * set synchronisation state between this boot processor * and the secondary one
*/
spin_lock(&boot_lock);
/* * Initialise the present map, which describes the set of CPUs * actually populated at the present time.
*/
for_each_possible_cpu(cpu) { if (cpu < max_cpus)
set_cpu_present(cpu, true);
}
}
boot_secondary(cpu, idle); if (!wait_for_completion_timeout(&cpu_running,
msecs_to_jiffies(1000))) {
pr_crit("CPU%u: failed to start\n", cpu); return -EIO;
}
synchronise_count_master(cpu);
return 0;
}
asmlinkage __init void secondary_start_kernel(void)
{ struct mm_struct *mm = &init_mm; unsignedint cpu = smp_processor_id(); /* * All kernel threads share the same mm context; grab a * reference and switch to it.
*/
mmgrab(mm);
current->active_mm = mm;
cpumask_set_cpu(cpu, mm_cpumask(mm));
staticvoid stop_this_cpu(void *dummy)
{ /* Remove this CPU */
set_cpu_online(smp_processor_id(), false);
local_irq_disable(); /* CPU Doze */ if (mfspr(SPR_UPR) & SPR_UPR_PMP)
mtspr(SPR_PMR, mfspr(SPR_PMR) | SPR_PMR_DME); /* If that didn't work, infinite loop */ while (1)
;
}
if (cpumask_any_but(cmask, cpuid) >= nr_cpu_ids) { /* local cpu is the only cpu present in cpumask */
local_flush_tlb_mm(mm);
} else {
on_each_cpu_mask(cmask, ipi_flush_tlb_mm, mm, 1);
}
put_cpu();
}
if (cpumask_any_but(cmask, cpuid) >= nr_cpu_ids) { /* local cpu is the only cpu present in cpumask */ if ((end - start) <= PAGE_SIZE)
local_flush_tlb_page(NULL, start); else
local_flush_tlb_range(NULL, start, end);
} else { struct flush_tlb_data fd;
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.