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>
This commit is contained in:
parent
42a4b427a8
commit
d199a04827
|
@ -14,7 +14,6 @@ pci-y := fixup.o
|
||||||
# legacy/irq.o
|
# legacy/irq.o
|
||||||
pci-$(CONFIG_ACPI) += acpi.o
|
pci-$(CONFIG_ACPI) += acpi.o
|
||||||
pci-y += legacy.o irq.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
|
# Careful: VISWS overrule the pci-y above. The colons are
|
||||||
# therefor correct. This needs a proper fix by distangling the code.
|
# therefor correct. This needs a proper fix by distangling the code.
|
||||||
|
|
|
@ -1,13 +1,13 @@
|
||||||
#include <linux/init.h>
|
#include <linux/init.h>
|
||||||
#include <linux/pci.h>
|
#include <linux/pci.h>
|
||||||
|
#include <linux/topology.h>
|
||||||
#include "pci.h"
|
#include "pci.h"
|
||||||
|
|
||||||
#ifdef CONFIG_X86_64
|
#ifdef CONFIG_X86_64
|
||||||
|
|
||||||
#include <asm/pci-direct.h>
|
#include <asm/pci-direct.h>
|
||||||
#include <asm/mpspec.h>
|
#include <asm/mpspec.h>
|
||||||
#include <linux/cpumask.h>
|
#include <linux/cpumask.h>
|
||||||
#include <linux/topology.h>
|
#endif
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* This discovers the pcibus <-> node mapping on AMD K8.
|
* This discovers the pcibus <-> node mapping on AMD K8.
|
||||||
|
@ -18,6 +18,8 @@
|
||||||
|
|
||||||
#define BUS_NR 256
|
#define BUS_NR 256
|
||||||
|
|
||||||
|
#ifdef CONFIG_X86_64
|
||||||
|
|
||||||
static int mp_bus_to_node[BUS_NR];
|
static int mp_bus_to_node[BUS_NR];
|
||||||
|
|
||||||
void set_mp_bus_to_node(int busnum, int node)
|
void set_mp_bus_to_node(int busnum, int node)
|
||||||
|
@ -45,7 +47,31 @@ int get_mp_bus_to_node(int busnum)
|
||||||
return node;
|
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,
|
* sub bus (transparent) will use entres from 3 to store extra from root,
|
||||||
|
|
|
@ -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;
|
|
||||||
}
|
|
Reference in New Issue