2007-05-13 23:50:43 -04:00
|
|
|
#include <linux/cpu.h>
|
|
|
|
#include <linux/cpumask.h>
|
|
|
|
#include <linux/init.h>
|
|
|
|
#include <linux/percpu.h>
|
2007-06-01 01:21:13 -04:00
|
|
|
#include <linux/node.h>
|
|
|
|
#include <linux/nodemask.h>
|
2007-05-13 23:50:43 -04:00
|
|
|
|
|
|
|
static DEFINE_PER_CPU(struct cpu, cpu_devices);
|
|
|
|
|
|
|
|
static int __init topology_init(void)
|
|
|
|
{
|
|
|
|
int i, ret;
|
|
|
|
|
2007-06-01 01:21:13 -04:00
|
|
|
#ifdef CONFIG_NEED_MULTIPLE_NODES
|
|
|
|
for_each_online_node(i)
|
|
|
|
register_one_node(i);
|
|
|
|
#endif
|
|
|
|
|
2007-05-13 23:50:43 -04:00
|
|
|
for_each_present_cpu(i) {
|
|
|
|
ret = register_cpu(&per_cpu(cpu_devices, i), i);
|
|
|
|
if (unlikely(ret))
|
|
|
|
printk(KERN_WARNING "%s: register_cpu %d failed (%d)\n",
|
|
|
|
__FUNCTION__, i, ret);
|
|
|
|
}
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
subsys_initcall(topology_init);
|