diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2010-08-04 09:34:24 -0400 |
---|---|---|
committer | Dave Airlie <airlied@redhat.com> | 2010-08-04 18:48:53 -0400 |
commit | fca3ec01e0b40cab82cac7745e154b01969e6219 (patch) | |
tree | 731d6cdc321c8c1f8b2c4e8f0fdb0df59b5abbc9 /include/linux/io-mapping.h | |
parent | 430f70d59da643f1aa7c9cf3493423a76550b110 (diff) |
drm,io-mapping: Specify slot to use for atomic mappings
This is required should we ever attempt to use an io-mapping where
KM_USER0 is verboten, such as inside an IRQ context.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Eric Anholt <eric@anholt.net>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Diffstat (limited to 'include/linux/io-mapping.h')
-rw-r--r-- | include/linux/io-mapping.h | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/include/linux/io-mapping.h b/include/linux/io-mapping.h index 25085ddd955f..e0ea40f6c515 100644 --- a/include/linux/io-mapping.h +++ b/include/linux/io-mapping.h | |||
@@ -79,7 +79,9 @@ io_mapping_free(struct io_mapping *mapping) | |||
79 | 79 | ||
80 | /* Atomic map/unmap */ | 80 | /* Atomic map/unmap */ |
81 | static inline void * | 81 | static inline void * |
82 | io_mapping_map_atomic_wc(struct io_mapping *mapping, unsigned long offset) | 82 | io_mapping_map_atomic_wc(struct io_mapping *mapping, |
83 | unsigned long offset, | ||
84 | int slot) | ||
83 | { | 85 | { |
84 | resource_size_t phys_addr; | 86 | resource_size_t phys_addr; |
85 | unsigned long pfn; | 87 | unsigned long pfn; |
@@ -87,13 +89,13 @@ io_mapping_map_atomic_wc(struct io_mapping *mapping, unsigned long offset) | |||
87 | BUG_ON(offset >= mapping->size); | 89 | BUG_ON(offset >= mapping->size); |
88 | phys_addr = mapping->base + offset; | 90 | phys_addr = mapping->base + offset; |
89 | pfn = (unsigned long) (phys_addr >> PAGE_SHIFT); | 91 | pfn = (unsigned long) (phys_addr >> PAGE_SHIFT); |
90 | return iomap_atomic_prot_pfn(pfn, KM_USER0, mapping->prot); | 92 | return iomap_atomic_prot_pfn(pfn, slot, mapping->prot); |
91 | } | 93 | } |
92 | 94 | ||
93 | static inline void | 95 | static inline void |
94 | io_mapping_unmap_atomic(void *vaddr) | 96 | io_mapping_unmap_atomic(void *vaddr, int slot) |
95 | { | 97 | { |
96 | iounmap_atomic(vaddr, KM_USER0); | 98 | iounmap_atomic(vaddr, slot); |
97 | } | 99 | } |
98 | 100 | ||
99 | static inline void * | 101 | static inline void * |
@@ -133,13 +135,15 @@ io_mapping_free(struct io_mapping *mapping) | |||
133 | 135 | ||
134 | /* Atomic map/unmap */ | 136 | /* Atomic map/unmap */ |
135 | static inline void * | 137 | static inline void * |
136 | io_mapping_map_atomic_wc(struct io_mapping *mapping, unsigned long offset) | 138 | io_mapping_map_atomic_wc(struct io_mapping *mapping, |
139 | unsigned long offset, | ||
140 | int slot) | ||
137 | { | 141 | { |
138 | return ((char *) mapping) + offset; | 142 | return ((char *) mapping) + offset; |
139 | } | 143 | } |
140 | 144 | ||
141 | static inline void | 145 | static inline void |
142 | io_mapping_unmap_atomic(void *vaddr) | 146 | io_mapping_unmap_atomic(void *vaddr, int slot) |
143 | { | 147 | { |
144 | } | 148 | } |
145 | 149 | ||