]> git.proxmox.com Git - mirror_ubuntu-focal-kernel.git/commit - arch/mips/kernel/smp-mt.c
MIPS: Abstract CPU core & VP(E) ID access through accessor functions
authorPaul Burton <paul.burton@imgtec.com>
Sun, 13 Aug 2017 02:49:35 +0000 (19:49 -0700)
committerRalf Baechle <ralf@linux-mips.org>
Tue, 29 Aug 2017 22:57:26 +0000 (00:57 +0200)
commitf875a832d2028523f9b53c261b67e05a359bab8b
treedb7934e092508a34db756e9906738ea4ab50e653
parent15e6529fc337309e699dbb71827362fcd9c616ae
MIPS: Abstract CPU core & VP(E) ID access through accessor functions

We currently have fields in struct cpuinfo_mips for the core & VP(E) ID
of a particular CPU, and various pieces of code directly access those
fields. This patch abstracts such access by introducing accessor
functions cpu_core(), cpu_set_core(), cpu_vpe_id() & cpu_set_vpe_id()
and having code that needs to access these values call those functions
rather than directly accessing the struct cpuinfo_mips fields. This
prepares us for changes to the way in which those values are stored in
later patches.

The cpu_vpe_id() function is introduced even though we already had a
cpu_vpe_id() macro for a couple of reasons:

  1) It's more consistent with the core, and future cluster, accessors.

  2) It ensures a sensible return type without explicit casts.

  3) It's generally preferable to use functions rather than macros.

Signed-off-by: Paul Burton <paul.burton@imgtec.com>
Cc: linux-mips@linux-mips.org
Patchwork: https://patchwork.linux-mips.org/patch/17009/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
16 files changed:
arch/mips/include/asm/cpu-info.h
arch/mips/include/asm/mips-cm.h
arch/mips/include/asm/topology.h
arch/mips/kernel/cpu-probe.c
arch/mips/kernel/mips-cm.c
arch/mips/kernel/mips-cpc.c
arch/mips/kernel/pm-cps.c
arch/mips/kernel/proc.c
arch/mips/kernel/smp-bmips.c
arch/mips/kernel/smp-cps.c
arch/mips/kernel/smp-mt.c
arch/mips/kernel/smp.c
arch/mips/loongson64/loongson-3/smp.c
arch/mips/netlogic/common/smp.c
arch/mips/oprofile/op_model_mipsxx.c
drivers/cpuidle/cpuidle-cps.c