aboutsummaryrefslogtreecommitdiffstats
path: root/arch/sparc
diff options
context:
space:
mode:
authorRobert Reif <reif@earthlink.net>2008-12-11 23:24:58 -0500
committerDavid S. Miller <davem@davemloft.net>2008-12-11 23:24:58 -0500
commitaa83a26a193bf06ac6c822ccd881c62898a351c6 (patch)
tree5bd83b07c38ccc233261d1c5a907772750ce7e81 /arch/sparc
parent18cdae68e7bb24f33883e58f366cde38ea89ba17 (diff)
sparc: use sparc64 version of scatterlist.h
Use sparc64 version of scatterlist.h. There are three main differences: dma_addr_t replaces __u32 dma_address replaces dvma_address dma_length replaces dvma_length dma_addr_t is a u32 on sparc32. Boot tested on sparc32. Signed-off-by: Robert Reif <reif@earthlink.net> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'arch/sparc')
-rw-r--r--arch/sparc/include/asm/scatterlist.h33
-rw-r--r--arch/sparc/include/asm/scatterlist_32.h26
-rw-r--r--arch/sparc/include/asm/scatterlist_64.h27
-rw-r--r--arch/sparc/kernel/ioport.c4
-rw-r--r--arch/sparc/mm/io-unit.c8
-rw-r--r--arch/sparc/mm/iommu.c16
-rw-r--r--arch/sparc/mm/sun4c.c6
7 files changed, 43 insertions, 77 deletions
diff --git a/arch/sparc/include/asm/scatterlist.h b/arch/sparc/include/asm/scatterlist.h
index ec21a4517641..e580f5581c88 100644
--- a/arch/sparc/include/asm/scatterlist.h
+++ b/arch/sparc/include/asm/scatterlist.h
@@ -1,8 +1,27 @@
1#ifndef ___ASM_SPARC_SCATTERLIST_H 1#ifndef _SPARC_SCATTERLIST_H
2#define ___ASM_SPARC_SCATTERLIST_H 2#define _SPARC_SCATTERLIST_H
3#if defined(__sparc__) && defined(__arch64__) 3
4#include <asm/scatterlist_64.h> 4#include <asm/page.h>
5#else 5#include <asm/types.h>
6#include <asm/scatterlist_32.h> 6
7#endif 7struct scatterlist {
8#ifdef CONFIG_DEBUG_SG
9 unsigned long sg_magic;
8#endif 10#endif
11 unsigned long page_link;
12 unsigned int offset;
13
14 unsigned int length;
15
16 dma_addr_t dma_address;
17 __u32 dma_length;
18};
19
20#define sg_dma_address(sg) ((sg)->dma_address)
21#define sg_dma_len(sg) ((sg)->dma_length)
22
23#define ISA_DMA_THRESHOLD (~0UL)
24
25#define ARCH_HAS_SG_CHAIN
26
27#endif /* !(_SPARC_SCATTERLIST_H) */
diff --git a/arch/sparc/include/asm/scatterlist_32.h b/arch/sparc/include/asm/scatterlist_32.h
deleted file mode 100644
index c82609ca1d0f..000000000000
--- a/arch/sparc/include/asm/scatterlist_32.h
+++ /dev/null
@@ -1,26 +0,0 @@
1#ifndef _SPARC_SCATTERLIST_H
2#define _SPARC_SCATTERLIST_H
3
4#include <linux/types.h>
5
6struct scatterlist {
7#ifdef CONFIG_DEBUG_SG
8 unsigned long sg_magic;
9#endif
10 unsigned long page_link;
11 unsigned int offset;
12
13 unsigned int length;
14
15 __u32 dvma_address; /* A place to hang host-specific addresses at. */
16 __u32 dvma_length;
17};
18
19#define sg_dma_address(sg) ((sg)->dvma_address)
20#define sg_dma_len(sg) ((sg)->dvma_length)
21
22#define ISA_DMA_THRESHOLD (~0UL)
23
24#define ARCH_HAS_SG_CHAIN
25
26#endif /* !(_SPARC_SCATTERLIST_H) */
diff --git a/arch/sparc/include/asm/scatterlist_64.h b/arch/sparc/include/asm/scatterlist_64.h
deleted file mode 100644
index 81bd058f9382..000000000000
--- a/arch/sparc/include/asm/scatterlist_64.h
+++ /dev/null
@@ -1,27 +0,0 @@
1#ifndef _SPARC64_SCATTERLIST_H
2#define _SPARC64_SCATTERLIST_H
3
4#include <asm/page.h>
5#include <asm/types.h>
6
7struct scatterlist {
8#ifdef CONFIG_DEBUG_SG
9 unsigned long sg_magic;
10#endif
11 unsigned long page_link;
12 unsigned int offset;
13
14 unsigned int length;
15
16 dma_addr_t dma_address;
17 __u32 dma_length;
18};
19
20#define sg_dma_address(sg) ((sg)->dma_address)
21#define sg_dma_len(sg) ((sg)->dma_length)
22
23#define ISA_DMA_THRESHOLD (~0UL)
24
25#define ARCH_HAS_SG_CHAIN
26
27#endif /* !(_SPARC64_SCATTERLIST_H) */
diff --git a/arch/sparc/kernel/ioport.c b/arch/sparc/kernel/ioport.c
index 4f025b36934b..7ce14f05eb48 100644
--- a/arch/sparc/kernel/ioport.c
+++ b/arch/sparc/kernel/ioport.c
@@ -552,8 +552,8 @@ int pci_map_sg(struct pci_dev *hwdev, struct scatterlist *sgl, int nents,
552 /* IIep is write-through, not flushing. */ 552 /* IIep is write-through, not flushing. */
553 for_each_sg(sgl, sg, nents, n) { 553 for_each_sg(sgl, sg, nents, n) {
554 BUG_ON(page_address(sg_page(sg)) == NULL); 554 BUG_ON(page_address(sg_page(sg)) == NULL);
555 sg->dvma_address = virt_to_phys(sg_virt(sg)); 555 sg->dma_address = virt_to_phys(sg_virt(sg));
556 sg->dvma_length = sg->length; 556 sg->dma_length = sg->length;
557 } 557 }
558 return nents; 558 return nents;
559} 559}
diff --git a/arch/sparc/mm/io-unit.c b/arch/sparc/mm/io-unit.c
index daadf5f88050..005e758a4db7 100644
--- a/arch/sparc/mm/io-unit.c
+++ b/arch/sparc/mm/io-unit.c
@@ -156,8 +156,8 @@ static void iounit_get_scsi_sgl(struct device *dev, struct scatterlist *sg, int
156 spin_lock_irqsave(&iounit->lock, flags); 156 spin_lock_irqsave(&iounit->lock, flags);
157 while (sz != 0) { 157 while (sz != 0) {
158 --sz; 158 --sz;
159 sg->dvma_address = iounit_get_area(iounit, (unsigned long) sg_virt(sg), sg->length); 159 sg->dma_address = iounit_get_area(iounit, (unsigned long) sg_virt(sg), sg->length);
160 sg->dvma_length = sg->length; 160 sg->dma_length = sg->length;
161 sg = sg_next(sg); 161 sg = sg_next(sg);
162 } 162 }
163 spin_unlock_irqrestore(&iounit->lock, flags); 163 spin_unlock_irqrestore(&iounit->lock, flags);
@@ -186,8 +186,8 @@ static void iounit_release_scsi_sgl(struct device *dev, struct scatterlist *sg,
186 spin_lock_irqsave(&iounit->lock, flags); 186 spin_lock_irqsave(&iounit->lock, flags);
187 while (sz != 0) { 187 while (sz != 0) {
188 --sz; 188 --sz;
189 len = ((sg->dvma_address & ~PAGE_MASK) + sg->length + (PAGE_SIZE-1)) >> PAGE_SHIFT; 189 len = ((sg->dma_address & ~PAGE_MASK) + sg->length + (PAGE_SIZE-1)) >> PAGE_SHIFT;
190 vaddr = (sg->dvma_address - IOUNIT_DMA_BASE) >> PAGE_SHIFT; 190 vaddr = (sg->dma_address - IOUNIT_DMA_BASE) >> PAGE_SHIFT;
191 IOD(("iounit_release %08lx-%08lx\n", (long)vaddr, (long)len+vaddr)); 191 IOD(("iounit_release %08lx-%08lx\n", (long)vaddr, (long)len+vaddr));
192 for (len += vaddr; vaddr < len; vaddr++) 192 for (len += vaddr; vaddr < len; vaddr++)
193 clear_bit(vaddr, iounit->bmap); 193 clear_bit(vaddr, iounit->bmap);
diff --git a/arch/sparc/mm/iommu.c b/arch/sparc/mm/iommu.c
index e7a499e3aa3c..b2e6e73888b5 100644
--- a/arch/sparc/mm/iommu.c
+++ b/arch/sparc/mm/iommu.c
@@ -245,8 +245,8 @@ static void iommu_get_scsi_sgl_noflush(struct device *dev, struct scatterlist *s
245 while (sz != 0) { 245 while (sz != 0) {
246 --sz; 246 --sz;
247 n = (sg->length + sg->offset + PAGE_SIZE-1) >> PAGE_SHIFT; 247 n = (sg->length + sg->offset + PAGE_SIZE-1) >> PAGE_SHIFT;
248 sg->dvma_address = iommu_get_one(dev, sg_page(sg), n) + sg->offset; 248 sg->dma_address = iommu_get_one(dev, sg_page(sg), n) + sg->offset;
249 sg->dvma_length = (__u32) sg->length; 249 sg->dma_length = sg->length;
250 sg = sg_next(sg); 250 sg = sg_next(sg);
251 } 251 }
252} 252}
@@ -259,8 +259,8 @@ static void iommu_get_scsi_sgl_gflush(struct device *dev, struct scatterlist *sg
259 while (sz != 0) { 259 while (sz != 0) {
260 --sz; 260 --sz;
261 n = (sg->length + sg->offset + PAGE_SIZE-1) >> PAGE_SHIFT; 261 n = (sg->length + sg->offset + PAGE_SIZE-1) >> PAGE_SHIFT;
262 sg->dvma_address = iommu_get_one(dev, sg_page(sg), n) + sg->offset; 262 sg->dma_address = iommu_get_one(dev, sg_page(sg), n) + sg->offset;
263 sg->dvma_length = (__u32) sg->length; 263 sg->dma_length = sg->length;
264 sg = sg_next(sg); 264 sg = sg_next(sg);
265 } 265 }
266} 266}
@@ -290,8 +290,8 @@ static void iommu_get_scsi_sgl_pflush(struct device *dev, struct scatterlist *sg
290 } 290 }
291 } 291 }
292 292
293 sg->dvma_address = iommu_get_one(dev, sg_page(sg), n) + sg->offset; 293 sg->dma_address = iommu_get_one(dev, sg_page(sg), n) + sg->offset;
294 sg->dvma_length = (__u32) sg->length; 294 sg->dma_length = sg->length;
295 sg = sg_next(sg); 295 sg = sg_next(sg);
296 } 296 }
297} 297}
@@ -330,8 +330,8 @@ static void iommu_release_scsi_sgl(struct device *dev, struct scatterlist *sg, i
330 --sz; 330 --sz;
331 331
332 n = (sg->length + sg->offset + PAGE_SIZE-1) >> PAGE_SHIFT; 332 n = (sg->length + sg->offset + PAGE_SIZE-1) >> PAGE_SHIFT;
333 iommu_release_one(dev, sg->dvma_address & PAGE_MASK, n); 333 iommu_release_one(dev, sg->dma_address & PAGE_MASK, n);
334 sg->dvma_address = 0x21212121; 334 sg->dma_address = 0x21212121;
335 sg = sg_next(sg); 335 sg = sg_next(sg);
336 } 336 }
337} 337}
diff --git a/arch/sparc/mm/sun4c.c b/arch/sparc/mm/sun4c.c
index 6b0c49004ba6..ad0ce117f352 100644
--- a/arch/sparc/mm/sun4c.c
+++ b/arch/sparc/mm/sun4c.c
@@ -1122,8 +1122,8 @@ static void sun4c_get_scsi_sgl(struct device *dev, struct scatterlist *sg, int s
1122{ 1122{
1123 while (sz != 0) { 1123 while (sz != 0) {
1124 --sz; 1124 --sz;
1125 sg->dvma_address = (__u32)sun4c_lockarea(sg_virt(sg), sg->length); 1125 sg->dma_address = (__u32)sun4c_lockarea(sg_virt(sg), sg->length);
1126 sg->dvma_length = sg->length; 1126 sg->dma_length = sg->length;
1127 sg = sg_next(sg); 1127 sg = sg_next(sg);
1128 } 1128 }
1129} 1129}
@@ -1139,7 +1139,7 @@ static void sun4c_release_scsi_sgl(struct device *dev, struct scatterlist *sg, i
1139{ 1139{
1140 while (sz != 0) { 1140 while (sz != 0) {
1141 --sz; 1141 --sz;
1142 sun4c_unlockarea((char *)sg->dvma_address, sg->length); 1142 sun4c_unlockarea((char *)sg->dma_address, sg->length);
1143 sg = sg_next(sg); 1143 sg = sg_next(sg);
1144 } 1144 }
1145} 1145}