mirror of
				https://github.com/torvalds/linux.git
				synced 2025-11-04 02:30:34 +02:00 
			
		
		
		
	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>
		
			
				
	
	
		
			32 lines
		
	
	
	
		
			627 B
		
	
	
	
		
			C
		
	
	
	
	
	
			
		
		
	
	
			32 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);
 |