aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm64/kernel/cpu_ops.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arm64/kernel/cpu_ops.c')
-rw-r--r--arch/arm64/kernel/cpu_ops.c47
1 files changed, 47 insertions, 0 deletions
diff --git a/arch/arm64/kernel/cpu_ops.c b/arch/arm64/kernel/cpu_ops.c
new file mode 100644
index 000000000000..e2652aadd9ea
--- /dev/null
+++ b/arch/arm64/kernel/cpu_ops.c
@@ -0,0 +1,47 @@
1/*
2 * CPU kernel entry/exit control
3 *
4 * 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/>.
17 */
18
19#include <asm/cpu_ops.h>
20#include <linux/string.h>
21
22extern const struct cpu_operations smp_spin_table_ops;
23extern const struct cpu_operations cpu_psci_ops;
24
25const struct cpu_operations *cpu_ops[NR_CPUS];
26
27static const struct cpu_operations *supported_cpu_ops[] __initconst = {
28#ifdef CONFIG_SMP
29 &smp_spin_table_ops,
30 &cpu_psci_ops,
31#endif
32 NULL,
33};
34
35const struct cpu_operations * __init cpu_get_ops(const char *name)
36{
37 const struct cpu_operations **ops = supported_cpu_ops;
38
39 while (*ops) {
40 if (!strcmp(name, (*ops)->name))
41 return *ops;
42
43 ops++;
44 }
45
46 return NULL;
47}