/* SPDX-License-Identifier: GPL-2.0-only */1/*2* Copyright (C) 2013 ARM Ltd.3*/4#ifndef __ASM_CPU_OPS_H5#define __ASM_CPU_OPS_H67#include <linux/init.h>8#include <linux/threads.h>910/**11* struct cpu_operations - Callback operations for hotplugging CPUs.12*13* @name: Name of the property as appears in a devicetree cpu node's14* enable-method property. On systems booting with ACPI, @name15* identifies the struct cpu_operations entry corresponding to16* the boot protocol specified in the ACPI MADT table.17* @cpu_init: Reads any data necessary for a specific enable-method for a18* proposed logical id.19* @cpu_prepare: Early one-time preparation step for a cpu. If there is a20* mechanism for doing so, tests whether it is possible to boot21* the given CPU.22* @cpu_boot: Boots a cpu into the kernel.23* @cpu_postboot: Optionally, perform any post-boot cleanup or necessary24* synchronisation. Called from the cpu being booted.25* @cpu_can_disable: Determines whether a CPU can be disabled based on26* mechanism-specific information.27* @cpu_disable: Prepares a cpu to die. May fail for some mechanism-specific28* reason, which will cause the hot unplug to be aborted. Called29* from the cpu to be killed.30* @cpu_die: Makes a cpu leave the kernel. Must not fail. Called from the31* cpu being killed.32* @cpu_kill: Ensures a cpu has left the kernel. Called from another cpu.33*/34struct cpu_operations {35const char *name;36int (*cpu_init)(unsigned int);37int (*cpu_prepare)(unsigned int);38int (*cpu_boot)(unsigned int);39void (*cpu_postboot)(void);40#ifdef CONFIG_HOTPLUG_CPU41bool (*cpu_can_disable)(unsigned int cpu);42int (*cpu_disable)(unsigned int cpu);43void (*cpu_die)(unsigned int cpu);44int (*cpu_kill)(unsigned int cpu);45#endif46};4748int __init init_cpu_ops(int cpu);49extern const struct cpu_operations *get_cpu_ops(int cpu);5051static inline void __init init_bootcpu_ops(void)52{53init_cpu_ops(0);54}5556#endif /* ifndef __ASM_CPU_OPS_H */575859