hc
2024-10-16 50a212ec906f7524620675f0c57357691c26c81f
kernel/arch/arm64/kernel/cpu_ops.c
....@@ -1,19 +1,8 @@
1
+// SPDX-License-Identifier: GPL-2.0-only
12 /*
23 * CPU kernel entry/exit control
34 *
45 * Copyright (C) 2013 ARM Ltd.
5
- *
6
- * This program is free software; you can redistribute it and/or modify
7
- * it under the terms of the GNU General Public License version 2 as
8
- * published by the Free Software Foundation.
9
- *
10
- * This program is distributed in the hope that it will be useful,
11
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
12
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
- * GNU General Public License for more details.
14
- *
15
- * You should have received a copy of the GNU General Public License
16
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
176 */
187
198 #include <linux/acpi.h>
....@@ -26,10 +15,12 @@
2615 #include <asm/smp_plat.h>
2716
2817 extern const struct cpu_operations smp_spin_table_ops;
18
+#ifdef CONFIG_ARM64_ACPI_PARKING_PROTOCOL
2919 extern const struct cpu_operations acpi_parking_protocol_ops;
20
+#endif
3021 extern const struct cpu_operations cpu_psci_ops;
3122
32
-const struct cpu_operations *cpu_ops[NR_CPUS] __ro_after_init;
23
+static const struct cpu_operations *cpu_ops[NR_CPUS] __ro_after_init;
3324
3425 static const struct cpu_operations *const dt_supported_cpu_ops[] __initconst = {
3526 &smp_spin_table_ops,
....@@ -105,7 +96,7 @@
10596 /*
10697 * Read a cpu's enable method and record it in cpu_ops.
10798 */
108
-int __init cpu_read_ops(int cpu)
99
+int __init init_cpu_ops(int cpu)
109100 {
110101 const char *enable_method = cpu_read_enable_method(cpu);
111102
....@@ -120,3 +111,8 @@
120111
121112 return 0;
122113 }
114
+
115
+const struct cpu_operations *get_cpu_ops(int cpu)
116
+{
117
+ return cpu_ops[cpu];
118
+}