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 | |
| 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>
| -rw-r--r-- | arch/x86/pci/Makefile | 1 | ||||
| -rw-r--r-- | arch/x86/pci/amd_bus.c | 32 | ||||
| -rw-r--r-- | arch/x86/pci/mp_bus_to_node.c | 23 |
3 files changed, 29 insertions, 27 deletions
diff --git a/arch/x86/pci/Makefile b/arch/x86/pci/Makefile index ed130a2ef671..f3643a7be85b 100644 --- a/arch/x86/pci/Makefile +++ b/arch/x86/pci/Makefile | |||
| @@ -14,7 +14,6 @@ pci-y := fixup.o | |||
| 14 | # legacy/irq.o | 14 | # legacy/irq.o |
| 15 | pci-$(CONFIG_ACPI) += acpi.o | 15 | pci-$(CONFIG_ACPI) += acpi.o |
| 16 | pci-y += legacy.o irq.o | 16 | pci-y += legacy.o irq.o |
| 17 | pci-$(CONFIG_NUMA) += mp_bus_to_node.o | ||
| 18 | 17 | ||
| 19 | # Careful: VISWS overrule the pci-y above. The colons are | 18 | # Careful: VISWS overrule the pci-y above. The colons are |
| 20 | # therefor correct. This needs a proper fix by distangling the code. | 19 | # therefor correct. This needs a proper fix by distangling the code. |
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, |
diff --git a/arch/x86/pci/mp_bus_to_node.c b/arch/x86/pci/mp_bus_to_node.c deleted file mode 100644 index 022943999b84..000000000000 --- a/arch/x86/pci/mp_bus_to_node.c +++ /dev/null | |||
| @@ -1,23 +0,0 @@ | |||
| 1 | #include <linux/pci.h> | ||
| 2 | #include <linux/init.h> | ||
| 3 | #include <linux/topology.h> | ||
| 4 | |||
| 5 | #define BUS_NR 256 | ||
| 6 | |||
| 7 | static unsigned char mp_bus_to_node[BUS_NR]; | ||
| 8 | |||
| 9 | void set_mp_bus_to_node(int busnum, int node) | ||
| 10 | { | ||
| 11 | if (busnum >= 0 && busnum < BUS_NR) | ||
| 12 | mp_bus_to_node[busnum] = (unsigned char) node; | ||
| 13 | } | ||
| 14 | |||
| 15 | int get_mp_bus_to_node(int busnum) | ||
| 16 | { | ||
| 17 | int node; | ||
| 18 | |||
| 19 | if (busnum < 0 || busnum > (BUS_NR - 1)) | ||
| 20 | return 0; | ||
| 21 | node = mp_bus_to_node[busnum]; | ||
| 22 | return node; | ||
| 23 | } | ||
