summaryrefslogtreecommitdiff
path: root/arch
diff options
context:
space:
mode:
authorRobert Richter <robert.richter@amd.com>2008-07-02 22:50:26 +0200
committerIngo Molnar <mingo@elte.hu>2008-07-09 11:44:40 +0200
commitd199a0482791bdf2f052081aa212d8c83ccef88a (patch)
treecb640d0e59e3baa837a8ced075defb7c92874b63 /arch
parent42a4b427a8d7bff95d9622ffa2365cb56da8e7d6 (diff)
downloadlinux-3.10-d199a0482791bdf2f052081aa212d8c83ccef88a.tar.gz
linux-3.10-d199a0482791bdf2f052081aa212d8c83ccef88a.tar.bz2
linux-3.10-d199a0482791bdf2f052081aa212d8c83ccef88a.zip
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')
-rw-r--r--arch/x86/pci/Makefile1
-rw-r--r--arch/x86/pci/amd_bus.c32
-rw-r--r--arch/x86/pci/mp_bus_to_node.c23
3 files changed, 29 insertions, 27 deletions
diff --git a/arch/x86/pci/Makefile b/arch/x86/pci/Makefile
index ed130a2ef67..f3643a7be85 100644
--- a/arch/x86/pci/Makefile
+++ b/arch/x86/pci/Makefile
@@ -14,7 +14,6 @@ pci-y := fixup.o
# legacy/irq.o
pci-$(CONFIG_ACPI) += acpi.o
pci-y += legacy.o irq.o
-pci-$(CONFIG_NUMA) += mp_bus_to_node.o
# Careful: VISWS overrule the pci-y above. The colons are
# 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 465b3a6f1c1..a18141ae3f0 100644
--- a/arch/x86/pci/amd_bus.c
+++ b/arch/x86/pci/amd_bus.c
@@ -1,13 +1,13 @@
#include <linux/init.h>
#include <linux/pci.h>
+#include <linux/topology.h>
#include "pci.h"
#ifdef CONFIG_X86_64
-
#include <asm/pci-direct.h>
#include <asm/mpspec.h>
#include <linux/cpumask.h>
-#include <linux/topology.h>
+#endif
/*
* This discovers the pcibus <-> node mapping on AMD K8.
@@ -18,6 +18,8 @@
#define BUS_NR 256
+#ifdef CONFIG_X86_64
+
static int mp_bus_to_node[BUS_NR];
void set_mp_bus_to_node(int busnum, int node)
@@ -45,7 +47,31 @@ int get_mp_bus_to_node(int busnum)
return node;
}
-#endif
+#else /* CONFIG_X86_32 */
+
+static unsigned char mp_bus_to_node[BUS_NR];
+
+void set_mp_bus_to_node(int busnum, int node)
+{
+ if (busnum >= 0 && busnum < BUS_NR)
+ mp_bus_to_node[busnum] = (unsigned char) node;
+}
+
+int get_mp_bus_to_node(int busnum)
+{
+ int node;
+
+ if (busnum < 0 || busnum > (BUS_NR - 1))
+ return 0;
+ node = mp_bus_to_node[busnum];
+ return node;
+}
+
+#endif /* CONFIG_X86_32 */
+
+#endif /* CONFIG_NUMA */
+
+#ifdef CONFIG_X86_64
/*
* 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 022943999b8..00000000000
--- a/arch/x86/pci/mp_bus_to_node.c
+++ /dev/null
@@ -1,23 +0,0 @@
-#include <linux/pci.h>
-#include <linux/init.h>
-#include <linux/topology.h>
-
-#define BUS_NR 256
-
-static unsigned char mp_bus_to_node[BUS_NR];
-
-void set_mp_bus_to_node(int busnum, int node)
-{
- if (busnum >= 0 && busnum < BUS_NR)
- mp_bus_to_node[busnum] = (unsigned char) node;
-}
-
-int get_mp_bus_to_node(int busnum)
-{
- int node;
-
- if (busnum < 0 || busnum > (BUS_NR - 1))
- return 0;
- node = mp_bus_to_node[busnum];
- return node;
-}