diff options
author | Will Deacon <will@kernel.org> | 2019-08-14 10:07:00 +0100 |
---|---|---|
committer | Will Deacon <will@kernel.org> | 2019-08-14 10:07:00 +0100 |
commit | d06fa5a118f17d00d0fb7efbe61e990266276792 (patch) | |
tree | 5f176ccff07535f90d811ea76f607d313b4ece6d /include/linux/arch_topology.h | |
parent | 98dc19902a0b2e5348e43d6a2c39a0a7d0fc639e (diff) | |
parent | f51edcec5288556069d27ab7040a4ce8ca55b74e (diff) | |
download | blackbird-op-linux-d06fa5a118f17d00d0fb7efbe61e990266276792.tar.gz blackbird-op-linux-d06fa5a118f17d00d0fb7efbe61e990266276792.zip |
Merge tag 'common/for-v5.4-rc1/cpu-topology' of git://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux into for-next/cpu-topology
Pull in generic CPU topology changes from Paul Walmsley (RISC-V).
* tag 'common/for-v5.4-rc1/cpu-topology' of git://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux:
MAINTAINERS: Add an entry for generic architecture topology
base: arch_topology: update Kconfig help description
RISC-V: Parse cpu topology during boot.
arm: Use common cpu_topology structure and functions.
cpu-topology: Move cpu topology code to common code.
dt-binding: cpu-topology: Move cpu-map to a common binding.
Documentation: DT: arm: add support for sockets defining package boundaries
Diffstat (limited to 'include/linux/arch_topology.h')
-rw-r--r-- | include/linux/arch_topology.h | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/include/linux/arch_topology.h b/include/linux/arch_topology.h index 1cfe05ea1d89..42f2b5126094 100644 --- a/include/linux/arch_topology.h +++ b/include/linux/arch_topology.h @@ -33,4 +33,30 @@ unsigned long topology_get_freq_scale(int cpu) return per_cpu(freq_scale, cpu); } +struct cpu_topology { + int thread_id; + int core_id; + int package_id; + int llc_id; + cpumask_t thread_sibling; + cpumask_t core_sibling; + cpumask_t llc_sibling; +}; + +#ifdef CONFIG_GENERIC_ARCH_TOPOLOGY +extern struct cpu_topology cpu_topology[NR_CPUS]; + +#define topology_physical_package_id(cpu) (cpu_topology[cpu].package_id) +#define topology_core_id(cpu) (cpu_topology[cpu].core_id) +#define topology_core_cpumask(cpu) (&cpu_topology[cpu].core_sibling) +#define topology_sibling_cpumask(cpu) (&cpu_topology[cpu].thread_sibling) +#define topology_llc_cpumask(cpu) (&cpu_topology[cpu].llc_sibling) +void init_cpu_topology(void); +void store_cpu_topology(unsigned int cpuid); +const struct cpumask *cpu_coregroup_mask(int cpu); +void update_siblings_masks(unsigned int cpu); +void remove_cpu_topology(unsigned int cpuid); +void reset_cpu_topology(void); +#endif + #endif /* _LINUX_ARCH_TOPOLOGY_H_ */ |