diff options
author | Ingo Molnar <mingo@elte.hu> | 2008-04-19 13:19:56 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2008-04-19 13:19:56 -0400 |
commit | 2be621498d461b63ca6124f86e3b9582e1a8e722 (patch) | |
tree | 5b2e3af9ca287c7742f59f909cbce0e7bca3f333 /include/asm-x86 | |
parent | 4d92fbf231fe23ec07d18820a141c573a7f5017a (diff) |
x86: dma-ops on highmem fix
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'include/asm-x86')
-rw-r--r-- | include/asm-x86/dma-mapping.h | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/include/asm-x86/dma-mapping.h b/include/asm-x86/dma-mapping.h index b5a413acac96..b331a8d3a7cf 100644 --- a/include/asm-x86/dma-mapping.h +++ b/include/asm-x86/dma-mapping.h | |||
@@ -16,10 +16,10 @@ struct dma_mapping_ops { | |||
16 | dma_addr_t *dma_handle, gfp_t gfp); | 16 | dma_addr_t *dma_handle, gfp_t gfp); |
17 | void (*free_coherent)(struct device *dev, size_t size, | 17 | void (*free_coherent)(struct device *dev, size_t size, |
18 | void *vaddr, dma_addr_t dma_handle); | 18 | void *vaddr, dma_addr_t dma_handle); |
19 | dma_addr_t (*map_single)(struct device *hwdev, void *ptr, | 19 | dma_addr_t (*map_single)(struct device *hwdev, phys_addr_t ptr, |
20 | size_t size, int direction); | 20 | size_t size, int direction); |
21 | /* like map_single, but doesn't check the device mask */ | 21 | /* like map_single, but doesn't check the device mask */ |
22 | dma_addr_t (*map_simple)(struct device *hwdev, char *ptr, | 22 | dma_addr_t (*map_simple)(struct device *hwdev, phys_addr_t ptr, |
23 | size_t size, int direction); | 23 | size_t size, int direction); |
24 | void (*unmap_single)(struct device *dev, dma_addr_t addr, | 24 | void (*unmap_single)(struct device *dev, dma_addr_t addr, |
25 | size_t size, int direction); | 25 | size_t size, int direction); |
@@ -73,7 +73,7 @@ dma_map_single(struct device *hwdev, void *ptr, size_t size, | |||
73 | int direction) | 73 | int direction) |
74 | { | 74 | { |
75 | BUG_ON(!valid_dma_direction(direction)); | 75 | BUG_ON(!valid_dma_direction(direction)); |
76 | return dma_ops->map_single(hwdev, ptr, size, direction); | 76 | return dma_ops->map_single(hwdev, virt_to_phys(ptr), size, direction); |
77 | } | 77 | } |
78 | 78 | ||
79 | static inline void | 79 | static inline void |
@@ -174,7 +174,9 @@ static inline dma_addr_t dma_map_page(struct device *dev, struct page *page, | |||
174 | size_t offset, size_t size, | 174 | size_t offset, size_t size, |
175 | int direction) | 175 | int direction) |
176 | { | 176 | { |
177 | return dma_map_single(dev, page_address(page)+offset, size, direction); | 177 | BUG_ON(!valid_dma_direction(direction)); |
178 | return dma_ops->map_single(dev, page_to_phys(page)+offset, | ||
179 | size, direction); | ||
178 | } | 180 | } |
179 | 181 | ||
180 | static inline void dma_unmap_page(struct device *dev, dma_addr_t addr, | 182 | static inline void dma_unmap_page(struct device *dev, dma_addr_t addr, |