diff options
author | David S. Miller <davem@sunset.davemloft.net> | 2007-04-25 02:51:18 -0400 |
---|---|---|
committer | David S. Miller <davem@sunset.davemloft.net> | 2007-04-26 04:55:42 -0400 |
commit | 9b3627f389c07c5be9c86ac4d472a0d4fd47feac (patch) | |
tree | 4e00925c81102399ec57e4eefe647dc23710a66d /arch | |
parent | 711b360d64418e88ed45f812e0ebd202073d888d (diff) |
[SPARC64]: Consolidate {sbus,pci}_iommu_arena.
Move to asm-sparc64/iommu.h and rename to plain "iommu_arena".
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/sparc64/kernel/pci_iommu.c | 4 | ||||
-rw-r--r-- | arch/sparc64/kernel/pci_sun4v.c | 6 | ||||
-rw-r--r-- | arch/sparc64/kernel/sbus.c | 12 |
3 files changed, 8 insertions, 14 deletions
diff --git a/arch/sparc64/kernel/pci_iommu.c b/arch/sparc64/kernel/pci_iommu.c index aefdcc51045b..355ed0ba937a 100644 --- a/arch/sparc64/kernel/pci_iommu.c +++ b/arch/sparc64/kernel/pci_iommu.c | |||
@@ -77,7 +77,7 @@ static inline void iopte_make_dummy(struct pci_iommu *iommu, iopte_t *iopte) | |||
77 | /* Based largely upon the ppc64 iommu allocator. */ | 77 | /* Based largely upon the ppc64 iommu allocator. */ |
78 | static long pci_arena_alloc(struct pci_iommu *iommu, unsigned long npages) | 78 | static long pci_arena_alloc(struct pci_iommu *iommu, unsigned long npages) |
79 | { | 79 | { |
80 | struct pci_iommu_arena *arena = &iommu->arena; | 80 | struct iommu_arena *arena = &iommu->arena; |
81 | unsigned long n, i, start, end, limit; | 81 | unsigned long n, i, start, end, limit; |
82 | int pass; | 82 | int pass; |
83 | 83 | ||
@@ -116,7 +116,7 @@ again: | |||
116 | return n; | 116 | return n; |
117 | } | 117 | } |
118 | 118 | ||
119 | static void pci_arena_free(struct pci_iommu_arena *arena, unsigned long base, unsigned long npages) | 119 | static void pci_arena_free(struct iommu_arena *arena, unsigned long base, unsigned long npages) |
120 | { | 120 | { |
121 | unsigned long i; | 121 | unsigned long i; |
122 | 122 | ||
diff --git a/arch/sparc64/kernel/pci_sun4v.c b/arch/sparc64/kernel/pci_sun4v.c index 52bd4563492d..0e99808f2121 100644 --- a/arch/sparc64/kernel/pci_sun4v.c +++ b/arch/sparc64/kernel/pci_sun4v.c | |||
@@ -110,7 +110,7 @@ static inline long pci_iommu_batch_end(void) | |||
110 | return pci_iommu_batch_flush(p); | 110 | return pci_iommu_batch_flush(p); |
111 | } | 111 | } |
112 | 112 | ||
113 | static long pci_arena_alloc(struct pci_iommu_arena *arena, unsigned long npages) | 113 | static long pci_arena_alloc(struct iommu_arena *arena, unsigned long npages) |
114 | { | 114 | { |
115 | unsigned long n, i, start, end, limit; | 115 | unsigned long n, i, start, end, limit; |
116 | int pass; | 116 | int pass; |
@@ -149,7 +149,7 @@ again: | |||
149 | return n; | 149 | return n; |
150 | } | 150 | } |
151 | 151 | ||
152 | static void pci_arena_free(struct pci_iommu_arena *arena, unsigned long base, unsigned long npages) | 152 | static void pci_arena_free(struct iommu_arena *arena, unsigned long base, unsigned long npages) |
153 | { | 153 | { |
154 | unsigned long i; | 154 | unsigned long i; |
155 | 155 | ||
@@ -707,7 +707,7 @@ static void pci_sun4v_scan_bus(struct pci_controller_info *p) | |||
707 | static unsigned long probe_existing_entries(struct pci_pbm_info *pbm, | 707 | static unsigned long probe_existing_entries(struct pci_pbm_info *pbm, |
708 | struct pci_iommu *iommu) | 708 | struct pci_iommu *iommu) |
709 | { | 709 | { |
710 | struct pci_iommu_arena *arena = &iommu->arena; | 710 | struct iommu_arena *arena = &iommu->arena; |
711 | unsigned long i, cnt = 0; | 711 | unsigned long i, cnt = 0; |
712 | u32 devhandle; | 712 | u32 devhandle; |
713 | 713 | ||
diff --git a/arch/sparc64/kernel/sbus.c b/arch/sparc64/kernel/sbus.c index d403f3df2dc2..279758d56b29 100644 --- a/arch/sparc64/kernel/sbus.c +++ b/arch/sparc64/kernel/sbus.c | |||
@@ -26,16 +26,10 @@ | |||
26 | 26 | ||
27 | #define MAP_BASE ((u32)0xc0000000) | 27 | #define MAP_BASE ((u32)0xc0000000) |
28 | 28 | ||
29 | struct sbus_iommu_arena { | ||
30 | unsigned long *map; | ||
31 | unsigned int hint; | ||
32 | unsigned int limit; | ||
33 | }; | ||
34 | |||
35 | struct sbus_iommu { | 29 | struct sbus_iommu { |
36 | spinlock_t lock; | 30 | spinlock_t lock; |
37 | 31 | ||
38 | struct sbus_iommu_arena arena; | 32 | struct iommu_arena arena; |
39 | 33 | ||
40 | iopte_t *page_table; | 34 | iopte_t *page_table; |
41 | unsigned long strbuf_regs; | 35 | unsigned long strbuf_regs; |
@@ -123,7 +117,7 @@ static void sbus_strbuf_flush(struct sbus_iommu *iommu, u32 base, unsigned long | |||
123 | /* Based largely upon the ppc64 iommu allocator. */ | 117 | /* Based largely upon the ppc64 iommu allocator. */ |
124 | static long sbus_arena_alloc(struct sbus_iommu *iommu, unsigned long npages) | 118 | static long sbus_arena_alloc(struct sbus_iommu *iommu, unsigned long npages) |
125 | { | 119 | { |
126 | struct sbus_iommu_arena *arena = &iommu->arena; | 120 | struct iommu_arena *arena = &iommu->arena; |
127 | unsigned long n, i, start, end, limit; | 121 | unsigned long n, i, start, end, limit; |
128 | int pass; | 122 | int pass; |
129 | 123 | ||
@@ -162,7 +156,7 @@ again: | |||
162 | return n; | 156 | return n; |
163 | } | 157 | } |
164 | 158 | ||
165 | static void sbus_arena_free(struct sbus_iommu_arena *arena, unsigned long base, unsigned long npages) | 159 | static void sbus_arena_free(struct iommu_arena *arena, unsigned long base, unsigned long npages) |
166 | { | 160 | { |
167 | unsigned long i; | 161 | unsigned long i; |
168 | 162 | ||