aboutsummaryrefslogtreecommitdiffstats
path: root/mm/highmem.c
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2008-04-03 17:33:42 -0400
committerDavid S. Miller <davem@davemloft.net>2008-04-03 17:33:42 -0400
commit3bb5da3837cc1aa17736b05139c9a22c3794851a (patch)
treec92d5684a866542b1cb20641607ac1643ce03a47 /mm/highmem.c
parent7feb49c82a74bc7c091b8ab2a3f96baa33d08ece (diff)
parent9597362d354f8655ece324b01d0c640a0e99c077 (diff)
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6
Diffstat (limited to 'mm/highmem.c')
-rw-r--r--mm/highmem.c30
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 */
109void kmap_flush_unused(void) 110void 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 */
166void *kmap_high(struct page *page) 175void *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
186EXPORT_SYMBOL(kmap_high); 193EXPORT_SYMBOL(kmap_high);
187 194
195/**
196 * kunmap_high - map a highmem page into memory
197 * @page: &struct page to unmap
198 */
188void kunmap_high(struct page *page) 199void 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 */
262void *page_address(struct page *page) 279void *page_address(struct page *page)
263{ 280{
264 unsigned long flags; 281 unsigned long flags;
@@ -288,6 +305,11 @@ done:
288 305
289EXPORT_SYMBOL(page_address); 306EXPORT_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 */
291void set_page_address(struct page *page, void *virtual) 313void set_page_address(struct page *page, void *virtual)
292{ 314{
293 unsigned long flags; 315 unsigned long flags;