diff options
Diffstat (limited to 'mm/highmem.c')
-rw-r--r-- | mm/highmem.c | 30 |
1 files changed, 26 insertions, 4 deletions
diff --git a/mm/highmem.c b/mm/highmem.c index 35d47733cde4..7da4a7b6af11 100644 --- a/mm/highmem.c +++ b/mm/highmem.c | |||
@@ -104,8 +104,9 @@ static void flush_all_zero_pkmaps(void) | |||
104 | flush_tlb_kernel_range(PKMAP_ADDR(0), PKMAP_ADDR(LAST_PKMAP)); | 104 | flush_tlb_kernel_range(PKMAP_ADDR(0), PKMAP_ADDR(LAST_PKMAP)); |
105 | } | 105 | } |
106 | 106 | ||
107 | /* Flush all unused kmap mappings in order to remove stray | 107 | /** |
108 | mappings. */ | 108 | * kmap_flush_unused - flush all unused kmap mappings in order to remove stray mappings |
109 | */ | ||
109 | void kmap_flush_unused(void) | 110 | void kmap_flush_unused(void) |
110 | { | 111 | { |
111 | spin_lock(&kmap_lock); | 112 | spin_lock(&kmap_lock); |
@@ -163,6 +164,14 @@ start: | |||
163 | return vaddr; | 164 | return vaddr; |
164 | } | 165 | } |
165 | 166 | ||
167 | /** | ||
168 | * kmap_high - map a highmem page into memory | ||
169 | * @page: &struct page to map | ||
170 | * | ||
171 | * Returns the page's virtual memory address. | ||
172 | * | ||
173 | * We cannot call this from interrupts, as it may block. | ||
174 | */ | ||
166 | void *kmap_high(struct page *page) | 175 | void *kmap_high(struct page *page) |
167 | { | 176 | { |
168 | unsigned long vaddr; | 177 | unsigned long vaddr; |
@@ -170,8 +179,6 @@ void *kmap_high(struct page *page) | |||
170 | /* | 179 | /* |
171 | * For highmem pages, we can't trust "virtual" until | 180 | * For highmem pages, we can't trust "virtual" until |
172 | * after we have the lock. | 181 | * after we have the lock. |
173 | * | ||
174 | * We cannot call this from interrupts, as it may block | ||
175 | */ | 182 | */ |
176 | spin_lock(&kmap_lock); | 183 | spin_lock(&kmap_lock); |
177 | vaddr = (unsigned long)page_address(page); | 184 | vaddr = (unsigned long)page_address(page); |
@@ -185,6 +192,10 @@ void *kmap_high(struct page *page) | |||
185 | 192 | ||
186 | EXPORT_SYMBOL(kmap_high); | 193 | EXPORT_SYMBOL(kmap_high); |
187 | 194 | ||
195 | /** | ||
196 | * kunmap_high - map a highmem page into memory | ||
197 | * @page: &struct page to unmap | ||
198 | */ | ||
188 | void kunmap_high(struct page *page) | 199 | void kunmap_high(struct page *page) |
189 | { | 200 | { |
190 | unsigned long vaddr; | 201 | unsigned long vaddr; |
@@ -259,6 +270,12 @@ static struct page_address_slot *page_slot(struct page *page) | |||
259 | return &page_address_htable[hash_ptr(page, PA_HASH_ORDER)]; | 270 | return &page_address_htable[hash_ptr(page, PA_HASH_ORDER)]; |
260 | } | 271 | } |
261 | 272 | ||
273 | /** | ||
274 | * page_address - get the mapped virtual address of a page | ||
275 | * @page: &struct page to get the virtual address of | ||
276 | * | ||
277 | * Returns the page's virtual address. | ||
278 | */ | ||
262 | void *page_address(struct page *page) | 279 | void *page_address(struct page *page) |
263 | { | 280 | { |
264 | unsigned long flags; | 281 | unsigned long flags; |
@@ -288,6 +305,11 @@ done: | |||
288 | 305 | ||
289 | EXPORT_SYMBOL(page_address); | 306 | EXPORT_SYMBOL(page_address); |
290 | 307 | ||
308 | /** | ||
309 | * set_page_address - set a page's virtual address | ||
310 | * @page: &struct page to set | ||
311 | * @virtual: virtual address to use | ||
312 | */ | ||
291 | void set_page_address(struct page *page, void *virtual) | 313 | void set_page_address(struct page *page, void *virtual) |
292 | { | 314 | { |
293 | unsigned long flags; | 315 | unsigned long flags; |