1 /* SPDX-License-Identifier: GPL-2.0-only */
3 * Copyright (c) 2020 Western Digital Corporation or its affiliates.
4 * Based on arch/arm64/include/asm/cpu_ops.h
6 #ifndef __ASM_CPU_OPS_H
7 #define __ASM_CPU_OPS_H
9 #include <linux/init.h>
10 #include <linux/sched.h>
11 #include <linux/threads.h>
14 * struct cpu_operations - Callback operations for hotplugging CPUs.
16 * @cpu_start: Boots a cpu into the kernel.
17 * @cpu_stop: Makes a cpu leave the kernel. Must not fail. Called from
18 * the cpu being stopped.
19 * @cpu_is_stopped: Ensures a cpu has left the kernel. Called from another
22 struct cpu_operations
{
23 int (*cpu_start
)(unsigned int cpu
,
24 struct task_struct
*tidle
);
25 #ifdef CONFIG_HOTPLUG_CPU
26 void (*cpu_stop
)(void);
27 int (*cpu_is_stopped
)(unsigned int cpu
);
31 extern const struct cpu_operations cpu_ops_spinwait
;
32 extern const struct cpu_operations
*cpu_ops
;
33 void __init
cpu_set_ops(void);
35 #endif /* ifndef __ASM_CPU_OPS_H */