blob: 9687b02caf4bf0d09c152868ebec2793a80c81ea [file] [log] [blame]
Paul Mundt7a302a92007-05-14 12:50:43 +09001#include <linux/cpu.h>
2#include <linux/cpumask.h>
3#include <linux/init.h>
4#include <linux/percpu.h>
Paul Mundtd22d9b32007-06-01 14:21:13 +09005#include <linux/node.h>
6#include <linux/nodemask.h>
Paul Mundt7a302a92007-05-14 12:50:43 +09007
8static DEFINE_PER_CPU(struct cpu, cpu_devices);
9
10static int __init topology_init(void)
11{
12 int i, ret;
13
Paul Mundtd22d9b32007-06-01 14:21:13 +090014#ifdef CONFIG_NEED_MULTIPLE_NODES
15 for_each_online_node(i)
16 register_one_node(i);
17#endif
18
Paul Mundt7a302a92007-05-14 12:50:43 +090019 for_each_present_cpu(i) {
20 ret = register_cpu(&per_cpu(cpu_devices, i), i);
21 if (unlikely(ret))
22 printk(KERN_WARNING "%s: register_cpu %d failed (%d)\n",
23 __FUNCTION__, i, ret);
24 }
25
26 return 0;
27}
28subsys_initcall(topology_init);