diff options
author | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-07-16 13:32:02 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-07-16 13:32:02 -0400 |
commit | b91cba52e9b7b3f1c0037908a192d93a869ca9e5 (patch) | |
tree | bbce7f323c8f52b308af5a152673a75b3e445360 /arch/sh/kernel/topology.c | |
parent | 98283bb49c6c8c070ebde9f47489d3e9a83c1323 (diff) | |
parent | e509ac4bbc661052dc73a2e8138800ba77d4ecb9 (diff) |
Merge master.kernel.org:/pub/scm/linux/kernel/git/lethal/sh-2.6
* master.kernel.org:/pub/scm/linux/kernel/git/lethal/sh-2.6: (68 commits)
sh: sh-rtc support for SH7709.
sh: Revert __xdiv64_32 size change.
sh: Update r7785rp defconfig.
sh: Export div symbols for GCC 4.2 and ST GCC.
sh: fix race in parallel out-of-tree build
sh: Kill off dead mach.c for hp6xx.
sh: hd64461.h cleanup and added comments.
sh: Update the alignment when 4K stacks are used.
sh: Add a .bss.page_aligned section for 4K stacks.
sh: Don't let SH-4A clobber SH-4 CFLAGS.
sh: Add parport stub for SuperIO ports.
sh: Drop -Wa,-dsp for DSP tuning.
sh: Update dreamcast defconfig.
fb: pvr2fb: A few more __devinit annotations for PCI.
fb: pvr2fb: Fix up section mismatch warnings.
sh: Select IPR-IRQ for SH7091.
sh: Correct __xdiv64_32/div64_32 return value size.
sh: Fix timer-tmu build for SH-3.
sh: Add cpu and mach links to CLEAN_FILES.
sh: Preliminary support for the SH-X3 CPU.
...
Diffstat (limited to 'arch/sh/kernel/topology.c')
-rw-r--r-- | arch/sh/kernel/topology.c | 49 |
1 files changed, 49 insertions, 0 deletions
diff --git a/arch/sh/kernel/topology.c b/arch/sh/kernel/topology.c new file mode 100644 index 000000000000..9b5844a1bdaa --- /dev/null +++ b/arch/sh/kernel/topology.c | |||
@@ -0,0 +1,49 @@ | |||
1 | /* | ||
2 | * arch/sh/kernel/topology.c | ||
3 | * | ||
4 | * Copyright (C) 2007 Paul Mundt | ||
5 | * | ||
6 | * This file is subject to the terms and conditions of the GNU General Public | ||
7 | * License. See the file "COPYING" in the main directory of this archive | ||
8 | * for more details. | ||
9 | */ | ||
10 | #include <linux/cpu.h> | ||
11 | #include <linux/cpumask.h> | ||
12 | #include <linux/init.h> | ||
13 | #include <linux/percpu.h> | ||
14 | #include <linux/node.h> | ||
15 | #include <linux/nodemask.h> | ||
16 | |||
17 | static DEFINE_PER_CPU(struct cpu, cpu_devices); | ||
18 | |||
19 | static int __init topology_init(void) | ||
20 | { | ||
21 | int i, ret; | ||
22 | |||
23 | #ifdef CONFIG_NEED_MULTIPLE_NODES | ||
24 | for_each_online_node(i) | ||
25 | register_one_node(i); | ||
26 | #endif | ||
27 | |||
28 | for_each_present_cpu(i) { | ||
29 | ret = register_cpu(&per_cpu(cpu_devices, i), i); | ||
30 | if (unlikely(ret)) | ||
31 | printk(KERN_WARNING "%s: register_cpu %d failed (%d)\n", | ||
32 | __FUNCTION__, i, ret); | ||
33 | } | ||
34 | |||
35 | #if defined(CONFIG_NUMA) && !defined(CONFIG_SMP) | ||
36 | /* | ||
37 | * In the UP case, make sure the CPU association is still | ||
38 | * registered under each node. Without this, sysfs fails | ||
39 | * to make the connection between nodes other than node0 | ||
40 | * and cpu0. | ||
41 | */ | ||
42 | for_each_online_node(i) | ||
43 | if (i != numa_node_id()) | ||
44 | register_cpu_under_node(raw_smp_processor_id(), i); | ||
45 | #endif | ||
46 | |||
47 | return 0; | ||
48 | } | ||
49 | subsys_initcall(topology_init); | ||