diff options
author | Robert Richter <robert.richter@amd.com> | 2008-07-02 16:50:26 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2008-07-09 05:44:40 -0400 |
commit | d199a0482791bdf2f052081aa212d8c83ccef88a (patch) | |
tree | cb640d0e59e3baa837a8ced075defb7c92874b63 /arch/x86/pci/amd_bus.c | |
parent | 42a4b427a8d7bff95d9622ffa2365cb56da8e7d6 (diff) |
x86/pci: merge: moving mp_bus_to_node.c to amd_bus.c
Signed-off-by: Robert Richter <robert.richter@amd.com>
Acked-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'arch/x86/pci/amd_bus.c')
-rw-r--r-- | arch/x86/pci/amd_bus.c | 32 |
1 files changed, 29 insertions, 3 deletions
diff --git a/arch/x86/pci/amd_bus.c b/arch/x86/pci/amd_bus.c index 465b3a6f1c12..a18141ae3f02 100644 --- a/arch/x86/pci/amd_bus.c +++ b/arch/x86/pci/amd_bus.c | |||
@@ -1,13 +1,13 @@ | |||
1 | #include <linux/init.h> | 1 | #include <linux/init.h> |
2 | #include <linux/pci.h> | 2 | #include <linux/pci.h> |
3 | #include <linux/topology.h> | ||
3 | #include "pci.h" | 4 | #include "pci.h" |
4 | 5 | ||
5 | #ifdef CONFIG_X86_64 | 6 | #ifdef CONFIG_X86_64 |
6 | |||
7 | #include <asm/pci-direct.h> | 7 | #include <asm/pci-direct.h> |
8 | #include <asm/mpspec.h> | 8 | #include <asm/mpspec.h> |
9 | #include <linux/cpumask.h> | 9 | #include <linux/cpumask.h> |
10 | #include <linux/topology.h> | 10 | #endif |
11 | 11 | ||
12 | /* | 12 | /* |
13 | * This discovers the pcibus <-> node mapping on AMD K8. | 13 | * This discovers the pcibus <-> node mapping on AMD K8. |
@@ -18,6 +18,8 @@ | |||
18 | 18 | ||
19 | #define BUS_NR 256 | 19 | #define BUS_NR 256 |
20 | 20 | ||
21 | #ifdef CONFIG_X86_64 | ||
22 | |||
21 | static int mp_bus_to_node[BUS_NR]; | 23 | static int mp_bus_to_node[BUS_NR]; |
22 | 24 | ||
23 | void set_mp_bus_to_node(int busnum, int node) | 25 | void set_mp_bus_to_node(int busnum, int node) |
@@ -45,7 +47,31 @@ int get_mp_bus_to_node(int busnum) | |||
45 | return node; | 47 | return node; |
46 | } | 48 | } |
47 | 49 | ||
48 | #endif | 50 | #else /* CONFIG_X86_32 */ |
51 | |||
52 | static unsigned char mp_bus_to_node[BUS_NR]; | ||
53 | |||
54 | void set_mp_bus_to_node(int busnum, int node) | ||
55 | { | ||
56 | if (busnum >= 0 && busnum < BUS_NR) | ||
57 | mp_bus_to_node[busnum] = (unsigned char) node; | ||
58 | } | ||
59 | |||
60 | int get_mp_bus_to_node(int busnum) | ||
61 | { | ||
62 | int node; | ||
63 | |||
64 | if (busnum < 0 || busnum > (BUS_NR - 1)) | ||
65 | return 0; | ||
66 | node = mp_bus_to_node[busnum]; | ||
67 | return node; | ||
68 | } | ||
69 | |||
70 | #endif /* CONFIG_X86_32 */ | ||
71 | |||
72 | #endif /* CONFIG_NUMA */ | ||
73 | |||
74 | #ifdef CONFIG_X86_64 | ||
49 | 75 | ||
50 | /* | 76 | /* |
51 | * sub bus (transparent) will use entres from 3 to store extra from root, | 77 | * sub bus (transparent) will use entres from 3 to store extra from root, |