diff options
author | Glauber Costa <gcosta@redhat.com> | 2008-03-25 17:36:37 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2008-04-19 13:19:57 -0400 |
commit | c786df08f6df2833e34e78cee5ef62558e3b5346 (patch) | |
tree | a699d91f610f9e33092c59589afc7c1bc6e65ee8 /include/asm-x86 | |
parent | 7c18341665917b493fa40eeb3c7ff6c1a5ac47db (diff) |
x86: unify dma_mapping_error
We provide a map_error function in pci-base_32.c to make
sure i386 keeps with the same behaviour it used to.
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.h | 8 | ||||
-rw-r--r-- | include/asm-x86/dma-mapping_32.h | 6 | ||||
-rw-r--r-- | include/asm-x86/dma-mapping_64.h | 8 |
3 files changed, 8 insertions, 14 deletions
diff --git a/include/asm-x86/dma-mapping.h b/include/asm-x86/dma-mapping.h index 984935d86bbd..a7090bbb2a2d 100644 --- a/include/asm-x86/dma-mapping.h +++ b/include/asm-x86/dma-mapping.h | |||
@@ -54,6 +54,14 @@ struct dma_mapping_ops { | |||
54 | 54 | ||
55 | extern const struct dma_mapping_ops *dma_ops; | 55 | extern const struct dma_mapping_ops *dma_ops; |
56 | 56 | ||
57 | static inline int dma_mapping_error(dma_addr_t dma_addr) | ||
58 | { | ||
59 | if (dma_ops->mapping_error) | ||
60 | return dma_ops->mapping_error(dma_addr); | ||
61 | |||
62 | return (dma_addr == bad_dma_address); | ||
63 | } | ||
64 | |||
57 | #define dma_alloc_noncoherent(d, s, h, f) dma_alloc_coherent(d, s, h, f) | 65 | #define dma_alloc_noncoherent(d, s, h, f) dma_alloc_coherent(d, s, h, f) |
58 | #define dma_free_noncoherent(d, s, v, h) dma_free_coherent(d, s, v, h) | 66 | #define dma_free_noncoherent(d, s, v, h) dma_free_coherent(d, s, v, h) |
59 | 67 | ||
diff --git a/include/asm-x86/dma-mapping_32.h b/include/asm-x86/dma-mapping_32.h index d0512c9251b7..03a75f866534 100644 --- a/include/asm-x86/dma-mapping_32.h +++ b/include/asm-x86/dma-mapping_32.h | |||
@@ -8,12 +8,6 @@ | |||
8 | #include <asm/io.h> | 8 | #include <asm/io.h> |
9 | #include <asm/bug.h> | 9 | #include <asm/bug.h> |
10 | 10 | ||
11 | static inline int | ||
12 | dma_mapping_error(dma_addr_t dma_addr) | ||
13 | { | ||
14 | return 0; | ||
15 | } | ||
16 | |||
17 | extern int forbid_dac; | 11 | extern int forbid_dac; |
18 | 12 | ||
19 | static inline int | 13 | static inline int |
diff --git a/include/asm-x86/dma-mapping_64.h b/include/asm-x86/dma-mapping_64.h index 352bf4164a5e..8353025f052d 100644 --- a/include/asm-x86/dma-mapping_64.h +++ b/include/asm-x86/dma-mapping_64.h | |||
@@ -3,14 +3,6 @@ | |||
3 | 3 | ||
4 | extern int iommu_merge; | 4 | extern int iommu_merge; |
5 | 5 | ||
6 | static inline int dma_mapping_error(dma_addr_t dma_addr) | ||
7 | { | ||
8 | if (dma_ops->mapping_error) | ||
9 | return dma_ops->mapping_error(dma_addr); | ||
10 | |||
11 | return (dma_addr == bad_dma_address); | ||
12 | } | ||
13 | |||
14 | /* same for gart, swiotlb, and nommu */ | 6 | /* same for gart, swiotlb, and nommu */ |
15 | static inline int dma_get_cache_alignment(void) | 7 | static inline int dma_get_cache_alignment(void) |
16 | { | 8 | { |