summaryrefslogtreecommitdiff
path: root/arch/arm64/kernel/cpu_ops.c
diff options
context:
space:
mode:
authorGavin Shan <gshan@redhat.com>2020-03-19 10:01:44 +1100
committerCatalin Marinas <catalin.marinas@arm.com>2020-03-24 17:24:19 +0000
commitde58ed5e16e62f36c7ed05552f18b7f9c647dcaf (patch)
treeb92e5b00897604c1e1efd375cc1a27d51c2c3aa3 /arch/arm64/kernel/cpu_ops.c
parent6885fb129be30c627eb2f5b1498dba498ff6c037 (diff)
arm64: Introduce get_cpu_ops() helper function
This introduces get_cpu_ops() to return the CPU operations according to the given CPU index. For now, it simply returns the @cpu_ops[cpu] as before. Also, helper function __cpu_try_die() is introduced to be shared by cpu_die() and ipi_cpu_crash_stop(). So it shouldn't introduce any functional changes. Signed-off-by: Gavin Shan <gshan@redhat.com> Signed-off-by: Catalin Marinas <catalin.marinas@arm.com> Acked-by: Mark Rutland <mark.rutland@arm.com>
Diffstat (limited to 'arch/arm64/kernel/cpu_ops.c')
-rw-r--r--arch/arm64/kernel/cpu_ops.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/arch/arm64/kernel/cpu_ops.c b/arch/arm64/kernel/cpu_ops.c
index a6c3c816b618..e133011f64b5 100644
--- a/arch/arm64/kernel/cpu_ops.c
+++ b/arch/arm64/kernel/cpu_ops.c
@@ -20,7 +20,7 @@ extern const struct cpu_operations acpi_parking_protocol_ops;
#endif
extern const struct cpu_operations cpu_psci_ops;
-const struct cpu_operations *cpu_ops[NR_CPUS] __ro_after_init;
+static const struct cpu_operations *cpu_ops[NR_CPUS] __ro_after_init;
static const struct cpu_operations *const dt_supported_cpu_ops[] __initconst = {
&smp_spin_table_ops,
@@ -111,3 +111,8 @@ int __init init_cpu_ops(int cpu)
return 0;
}
+
+const struct cpu_operations *get_cpu_ops(int cpu)
+{
+ return cpu_ops[cpu];
+}