Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit aa83a26a authored by Robert Reif's avatar Robert Reif Committed by David S. Miller
Browse files

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: default avatarRobert Reif <reif@earthlink.net>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 18cdae68
Loading
Loading
Loading
Loading
+26 −7
Original line number Original line Diff line number Diff line
#ifndef ___ASM_SPARC_SCATTERLIST_H
#ifndef _SPARC_SCATTERLIST_H
#define ___ASM_SPARC_SCATTERLIST_H
#define _SPARC_SCATTERLIST_H
#if defined(__sparc__) && defined(__arch64__)

#include <asm/scatterlist_64.h>
#include <asm/page.h>
#else
#include <asm/types.h>
#include <asm/scatterlist_32.h>

#endif
struct scatterlist {
#ifdef CONFIG_DEBUG_SG
	unsigned long	sg_magic;
#endif
#endif
	unsigned long	page_link;
	unsigned int	offset;

	unsigned int	length;

	dma_addr_t	dma_address;
	__u32		dma_length;
};

#define sg_dma_address(sg)	((sg)->dma_address)
#define sg_dma_len(sg)     	((sg)->dma_length)

#define ISA_DMA_THRESHOLD	(~0UL)

#define ARCH_HAS_SG_CHAIN

#endif /* !(_SPARC_SCATTERLIST_H) */
+0 −26
Original line number Original line Diff line number Diff line
#ifndef _SPARC_SCATTERLIST_H
#define _SPARC_SCATTERLIST_H

#include <linux/types.h>

struct scatterlist {
#ifdef CONFIG_DEBUG_SG
	unsigned long sg_magic;
#endif
	unsigned long page_link;
	unsigned int offset;

	unsigned int length;

	__u32 dvma_address; /* A place to hang host-specific addresses at. */
	__u32 dvma_length;
};

#define sg_dma_address(sg) ((sg)->dvma_address)
#define sg_dma_len(sg)     ((sg)->dvma_length)

#define ISA_DMA_THRESHOLD (~0UL)

#define ARCH_HAS_SG_CHAIN

#endif /* !(_SPARC_SCATTERLIST_H) */
+0 −27
Original line number Original line Diff line number Diff line
#ifndef _SPARC64_SCATTERLIST_H
#define _SPARC64_SCATTERLIST_H

#include <asm/page.h>
#include <asm/types.h>

struct scatterlist {
#ifdef CONFIG_DEBUG_SG
	unsigned long	sg_magic;
#endif
	unsigned long	page_link;
	unsigned int	offset;

	unsigned int	length;

	dma_addr_t	dma_address;
	__u32		dma_length;
};

#define sg_dma_address(sg)	((sg)->dma_address)
#define sg_dma_len(sg)     	((sg)->dma_length)

#define ISA_DMA_THRESHOLD	(~0UL)

#define ARCH_HAS_SG_CHAIN

#endif /* !(_SPARC64_SCATTERLIST_H) */
+2 −2
Original line number Original line Diff line number Diff line
@@ -552,8 +552,8 @@ int pci_map_sg(struct pci_dev *hwdev, struct scatterlist *sgl, int nents,
	/* IIep is write-through, not flushing. */
	/* IIep is write-through, not flushing. */
	for_each_sg(sgl, sg, nents, n) {
	for_each_sg(sgl, sg, nents, n) {
		BUG_ON(page_address(sg_page(sg)) == NULL);
		BUG_ON(page_address(sg_page(sg)) == NULL);
		sg->dvma_address = virt_to_phys(sg_virt(sg));
		sg->dma_address = virt_to_phys(sg_virt(sg));
		sg->dvma_length = sg->length;
		sg->dma_length = sg->length;
	}
	}
	return nents;
	return nents;
}
}
+4 −4
Original line number Original line Diff line number Diff line
@@ -156,8 +156,8 @@ static void iounit_get_scsi_sgl(struct device *dev, struct scatterlist *sg, int
	spin_lock_irqsave(&iounit->lock, flags);
	spin_lock_irqsave(&iounit->lock, flags);
	while (sz != 0) {
	while (sz != 0) {
		--sz;
		--sz;
		sg->dvma_address = iounit_get_area(iounit, (unsigned long) sg_virt(sg), sg->length);
		sg->dma_address = iounit_get_area(iounit, (unsigned long) sg_virt(sg), sg->length);
		sg->dvma_length = sg->length;
		sg->dma_length = sg->length;
		sg = sg_next(sg);
		sg = sg_next(sg);
	}
	}
	spin_unlock_irqrestore(&iounit->lock, flags);
	spin_unlock_irqrestore(&iounit->lock, flags);
@@ -186,8 +186,8 @@ static void iounit_release_scsi_sgl(struct device *dev, struct scatterlist *sg,
	spin_lock_irqsave(&iounit->lock, flags);
	spin_lock_irqsave(&iounit->lock, flags);
	while (sz != 0) {
	while (sz != 0) {
		--sz;
		--sz;
		len = ((sg->dvma_address & ~PAGE_MASK) + sg->length + (PAGE_SIZE-1)) >> PAGE_SHIFT;
		len = ((sg->dma_address & ~PAGE_MASK) + sg->length + (PAGE_SIZE-1)) >> PAGE_SHIFT;
		vaddr = (sg->dvma_address - IOUNIT_DMA_BASE) >> PAGE_SHIFT;
		vaddr = (sg->dma_address - IOUNIT_DMA_BASE) >> PAGE_SHIFT;
		IOD(("iounit_release %08lx-%08lx\n", (long)vaddr, (long)len+vaddr));
		IOD(("iounit_release %08lx-%08lx\n", (long)vaddr, (long)len+vaddr));
		for (len += vaddr; vaddr < len; vaddr++)
		for (len += vaddr; vaddr < len; vaddr++)
			clear_bit(vaddr, iounit->bmap);
			clear_bit(vaddr, iounit->bmap);
Loading