mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2024-12-21 16:27:39 +07:00
1b2bc75c1b
Each platform has to add support for CPU hotplugging itself by providing suitable definitions for the cpu_disable and cpu_die of the smp_ops methods and setting SYS_SUPPORTS_HOTPLUG_CPU. A platform should only set SYS_SUPPORTS_HOTPLUG_CPU once all it's smp_ops definitions have the necessary changes. This patch contains the changes to the dummy smp_ops definition for uni-processor systems. Parts of the code contributed by Cavium Inc. Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
33 lines
627 B
C
33 lines
627 B
C
#include <linux/cpu.h>
|
|
#include <linux/cpumask.h>
|
|
#include <linux/init.h>
|
|
#include <linux/node.h>
|
|
#include <linux/nodemask.h>
|
|
#include <linux/percpu.h>
|
|
|
|
static DEFINE_PER_CPU(struct cpu, cpu_devices);
|
|
|
|
static int __init topology_init(void)
|
|
{
|
|
int i, ret;
|
|
|
|
#ifdef CONFIG_NUMA
|
|
for_each_online_node(i)
|
|
register_one_node(i);
|
|
#endif /* CONFIG_NUMA */
|
|
|
|
for_each_present_cpu(i) {
|
|
struct cpu *c = &per_cpu(cpu_devices, i);
|
|
|
|
c->hotpluggable = 1;
|
|
ret = register_cpu(c, i);
|
|
if (ret)
|
|
printk(KERN_WARNING "topology_init: register_cpu %d "
|
|
"failed (%d)\n", i, ret);
|
|
}
|
|
|
|
return 0;
|
|
}
|
|
|
|
subsys_initcall(topology_init);
|