/* SPDX-License-Identifier: GPL-2.0 */ /* * ARM specific SMP header, this contains our implementation * details.
*/ #ifndef __ASMARM_SMP_PLAT_H #define __ASMARM_SMP_PLAT_H
#include <linux/cpumask.h> #include <linux/err.h>
#include <asm/cpu.h> #include <asm/cputype.h>
/* * Return true if we are running on a SMP platform
*/ staticinlinebool is_smp(void)
{ #ifndef CONFIG_SMP returnfalse; #elifdefined(CONFIG_SMP_ON_UP) externunsignedint smp_on_up; return !!smp_on_up; #else returntrue; #endif
}
/** * smp_cpuid_part() - return part id for a given cpu * @cpu: logical cpu id. * * Return: part id of logical cpu passed as argument.
*/ staticinlineunsignedint smp_cpuid_part(int cpu)
{ struct cpuinfo_arm *cpu_info = &per_cpu(cpu_data, cpu);
/* * Logical CPU mapping.
*/ extern u32 __cpu_logical_map[]; #define cpu_logical_map(cpu) __cpu_logical_map[cpu] /* * Retrieve logical cpu index corresponding to a given MPIDR[23:0] * - mpidr: MPIDR[23:0] to be used for the look-up * * Returns the cpu logical index or -EINVAL on look-up error
*/ staticinlineint get_logical_index(u32 mpidr)
{ int cpu; for (cpu = 0; cpu < nr_cpu_ids; cpu++) if (cpu_logical_map(cpu) == mpidr) return cpu; return -EINVAL;
}
/* * NOTE ! Assembly code relies on the following * structure memory layout in order to carry out load * multiple from its base address. For more * information check arch/arm/kernel/sleep.S
*/ struct mpidr_hash {
u32 mask; /* used by sleep.S */
u32 shift_aff[3]; /* used by sleep.S */
u32 bits;
};
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.