aboutsummaryrefslogtreecommitdiffstats
path: root/include/asm-x86
diff options
context:
space:
mode:
authorGlauber Costa <gcosta@redhat.com>2008-03-25 17:36:34 -0400
committerIngo Molnar <mingo@elte.hu>2008-04-19 13:19:56 -0400
commit802c1f6648aeb3eea670b4ef8b10014169b65699 (patch)
tree7bcb1c348086b01a4ecb4f01b3a910d9c9e2a101 /include/asm-x86
parent3cb6a91711a682adb3aa95da2ed8d47512cc3c41 (diff)
x86: move dma_supported and dma_set_mask to pci-dma_32.c
This is the way x86_64 does, so this make them equal. They have to be extern now in the header, and the extern definition is moved to the common dma-mapping.h header. Signed-off-by: Glauber Costa <gcosta@redhat.com> 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.h3
-rw-r--r--include/asm-x86/dma-mapping_32.h29
-rw-r--r--include/asm-x86/dma-mapping_64.h4
3 files changed, 3 insertions, 33 deletions
diff --git a/include/asm-x86/dma-mapping.h b/include/asm-x86/dma-mapping.h
index 51a79d71dab..c671a0aea59 100644
--- a/include/asm-x86/dma-mapping.h
+++ b/include/asm-x86/dma-mapping.h
@@ -62,6 +62,9 @@ void dma_free_coherent(struct device *dev, size_t size,
62 void *vaddr, dma_addr_t dma_handle); 62 void *vaddr, dma_addr_t dma_handle);
63 63
64 64
65extern int dma_supported(struct device *hwdev, u64 mask);
66extern int dma_set_mask(struct device *dev, u64 mask);
67
65#ifdef CONFIG_X86_32 68#ifdef CONFIG_X86_32
66# include "dma-mapping_32.h" 69# include "dma-mapping_32.h"
67#else 70#else
diff --git a/include/asm-x86/dma-mapping_32.h b/include/asm-x86/dma-mapping_32.h
index e60c30a8831..fd7246dddad 100644
--- a/include/asm-x86/dma-mapping_32.h
+++ b/include/asm-x86/dma-mapping_32.h
@@ -17,35 +17,6 @@ dma_mapping_error(dma_addr_t dma_addr)
17extern int forbid_dac; 17extern int forbid_dac;
18 18
19static inline int 19static inline int
20dma_supported(struct device *dev, u64 mask)
21{
22 /*
23 * we fall back to GFP_DMA when the mask isn't all 1s,
24 * so we can't guarantee allocations that must be
25 * within a tighter range than GFP_DMA..
26 */
27 if(mask < 0x00ffffff)
28 return 0;
29
30 /* Work around chipset bugs */
31 if (forbid_dac > 0 && mask > 0xffffffffULL)
32 return 0;
33
34 return 1;
35}
36
37static inline int
38dma_set_mask(struct device *dev, u64 mask)
39{
40 if(!dev->dma_mask || !dma_supported(dev, mask))
41 return -EIO;
42
43 *dev->dma_mask = mask;
44
45 return 0;
46}
47
48static inline int
49dma_get_cache_alignment(void) 20dma_get_cache_alignment(void)
50{ 21{
51 /* no easy way to get cache size on all x86, so return the 22 /* no easy way to get cache size on all x86, so return the
diff --git a/include/asm-x86/dma-mapping_64.h b/include/asm-x86/dma-mapping_64.h
index b1bc6ca7613..9674dac9fa3 100644
--- a/include/asm-x86/dma-mapping_64.h
+++ b/include/asm-x86/dma-mapping_64.h
@@ -12,8 +12,6 @@ static inline int dma_mapping_error(dma_addr_t dma_addr)
12 return (dma_addr == bad_dma_address); 12 return (dma_addr == bad_dma_address);
13} 13}
14 14
15extern int dma_supported(struct device *hwdev, u64 mask);
16
17/* same for gart, swiotlb, and nommu */ 15/* same for gart, swiotlb, and nommu */
18static inline int dma_get_cache_alignment(void) 16static inline int dma_get_cache_alignment(void)
19{ 17{
@@ -22,8 +20,6 @@ static inline int dma_get_cache_alignment(void)
22 20
23#define dma_is_consistent(d, h) 1 21#define dma_is_consistent(d, h) 1
24 22
25extern int dma_set_mask(struct device *dev, u64 mask);
26
27extern struct device fallback_dev; 23extern struct device fallback_dev;
28extern int panic_on_overflow; 24extern int panic_on_overflow;
29 25