Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 138888
b: refs/heads/master
c: 052aedb
h: refs/heads/master
v: v3
  • Loading branch information
FUJITA Tomonori authored and Ingo Molnar committed Jan 6, 2009
1 parent fe327d5 commit 80484b2
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 5 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 4cf37bb7d9dc6dfb5d5fca7f735ba65ba173dabc
refs/heads/master: 052aedbfb6cd4fd1a73010735da88a9dcc224673
27 changes: 23 additions & 4 deletions trunk/arch/x86/kernel/pci-gart_64.c
Original file line number Diff line number Diff line change
Expand Up @@ -255,10 +255,13 @@ static dma_addr_t dma_map_area(struct device *dev, dma_addr_t phys_mem,
}

/* Map a single area into the IOMMU */
static dma_addr_t
gart_map_single(struct device *dev, phys_addr_t paddr, size_t size, int dir)
static dma_addr_t gart_map_page(struct device *dev, struct page *page,
unsigned long offset, size_t size,
enum dma_data_direction dir,
struct dma_attrs *attrs)
{
unsigned long bus;
phys_addr_t paddr = page_to_phys(page) + offset;

if (!dev)
dev = &x86_dma_fallback_dev;
Expand All @@ -272,11 +275,19 @@ gart_map_single(struct device *dev, phys_addr_t paddr, size_t size, int dir)
return bus;
}

static dma_addr_t gart_map_single(struct device *dev, phys_addr_t paddr,
size_t size, int dir)
{
return gart_map_page(dev, pfn_to_page(paddr >> PAGE_SHIFT),
paddr & ~PAGE_MASK, size, dir, NULL);
}

/*
* Free a DMA mapping.
*/
static void gart_unmap_single(struct device *dev, dma_addr_t dma_addr,
size_t size, int direction)
static void gart_unmap_page(struct device *dev, dma_addr_t dma_addr,
size_t size, enum dma_data_direction dir,
struct dma_attrs *attrs)
{
unsigned long iommu_page;
int npages;
Expand All @@ -295,6 +306,12 @@ static void gart_unmap_single(struct device *dev, dma_addr_t dma_addr,
free_iommu(iommu_page, npages);
}

static void gart_unmap_single(struct device *dev, dma_addr_t dma_addr,
size_t size, int direction)
{
gart_unmap_page(dev, dma_addr, size, direction, NULL);
}

/*
* Wrapper for pci_unmap_single working with scatterlists.
*/
Expand Down Expand Up @@ -712,6 +729,8 @@ static struct dma_mapping_ops gart_dma_ops = {
.unmap_single = gart_unmap_single,
.map_sg = gart_map_sg,
.unmap_sg = gart_unmap_sg,
.map_page = gart_map_page,
.unmap_page = gart_unmap_page,
.alloc_coherent = gart_alloc_coherent,
.free_coherent = gart_free_coherent,
};
Expand Down

0 comments on commit 80484b2

Please sign in to comment.