aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/asm-i386/pci.h5
-rw-r--r--include/asm-i386/topology.h2
-rw-r--r--include/asm-x86_64/pci.h19
-rw-r--r--include/asm-x86_64/topology.h2
4 files changed, 26 insertions, 2 deletions
diff --git a/include/asm-i386/pci.h b/include/asm-i386/pci.h
index 392d3fe5d45e..d790343e9982 100644
--- a/include/asm-i386/pci.h
+++ b/include/asm-i386/pci.h
@@ -3,6 +3,11 @@
3 3
4 4
5#ifdef __KERNEL__ 5#ifdef __KERNEL__
6
7struct pci_sysdata {
8 int node; /* NUMA node */
9};
10
6#include <linux/mm.h> /* for struct page */ 11#include <linux/mm.h> /* for struct page */
7 12
8/* Can be used to override the logic in pci_scan_bus for skipping 13/* Can be used to override the logic in pci_scan_bus for skipping
diff --git a/include/asm-i386/topology.h b/include/asm-i386/topology.h
index 7fc512d90ea8..19b2dafd0c81 100644
--- a/include/asm-i386/topology.h
+++ b/include/asm-i386/topology.h
@@ -67,7 +67,7 @@ static inline int node_to_first_cpu(int node)
67 return first_cpu(mask); 67 return first_cpu(mask);
68} 68}
69 69
70#define pcibus_to_node(bus) ((long) (bus)->sysdata) 70#define pcibus_to_node(bus) ((struct pci_sysdata *)((bus)->sysdata))->node
71#define pcibus_to_cpumask(bus) node_to_cpumask(pcibus_to_node(bus)) 71#define pcibus_to_cpumask(bus) node_to_cpumask(pcibus_to_node(bus))
72 72
73/* sched_domains SD_NODE_INIT for NUMAQ machines */ 73/* sched_domains SD_NODE_INIT for NUMAQ machines */
diff --git a/include/asm-x86_64/pci.h b/include/asm-x86_64/pci.h
index bda94fd5176f..88926eb44f5c 100644
--- a/include/asm-x86_64/pci.h
+++ b/include/asm-x86_64/pci.h
@@ -5,6 +5,25 @@
5 5
6#ifdef __KERNEL__ 6#ifdef __KERNEL__
7 7
8struct pci_sysdata {
9 int node; /* NUMA node */
10 void* iommu; /* IOMMU private data */
11};
12
13#ifdef CONFIG_CALGARY_IOMMU
14static inline void* pci_iommu(struct pci_bus *bus)
15{
16 struct pci_sysdata *sd = bus->sysdata;
17 return sd->iommu;
18}
19
20static inline void set_pci_iommu(struct pci_bus *bus, void *val)
21{
22 struct pci_sysdata *sd = bus->sysdata;
23 sd->iommu = val;
24}
25#endif /* CONFIG_CALGARY_IOMMU */
26
8#include <linux/mm.h> /* for struct page */ 27#include <linux/mm.h> /* for struct page */
9 28
10/* Can be used to override the logic in pci_scan_bus for skipping 29/* Can be used to override the logic in pci_scan_bus for skipping
diff --git a/include/asm-x86_64/topology.h b/include/asm-x86_64/topology.h
index 4fd6fb23953e..36e52fba7960 100644
--- a/include/asm-x86_64/topology.h
+++ b/include/asm-x86_64/topology.h
@@ -22,7 +22,7 @@ extern int __node_distance(int, int);
22#define parent_node(node) (node) 22#define parent_node(node) (node)
23#define node_to_first_cpu(node) (first_cpu(node_to_cpumask[node])) 23#define node_to_first_cpu(node) (first_cpu(node_to_cpumask[node]))
24#define node_to_cpumask(node) (node_to_cpumask[node]) 24#define node_to_cpumask(node) (node_to_cpumask[node])
25#define pcibus_to_node(bus) ((long)(bus->sysdata)) 25#define pcibus_to_node(bus) ((struct pci_sysdata *)((bus)->sysdata))->node
26#define pcibus_to_cpumask(bus) node_to_cpumask(pcibus_to_node(bus)); 26#define pcibus_to_cpumask(bus) node_to_cpumask(pcibus_to_node(bus));
27 27
28#define numa_node_id() read_pda(nodenumber) 28#define numa_node_id() read_pda(nodenumber)