2005-04-16 18:20:36 -04:00
|
|
|
/* highmem.c: arch-specific highmem stuff
|
|
|
|
*
|
|
|
|
* Copyright (C) 2004 Red Hat, Inc. All Rights Reserved.
|
|
|
|
* Written by David Howells (dhowells@redhat.com)
|
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU General Public License
|
|
|
|
* as published by the Free Software Foundation; either version
|
|
|
|
* 2 of the License, or (at your option) any later version.
|
|
|
|
*/
|
|
|
|
#include <linux/highmem.h>
|
2006-01-08 04:01:19 -05:00
|
|
|
#include <linux/module.h>
|
2005-04-16 18:20:36 -04:00
|
|
|
|
|
|
|
void *kmap(struct page *page)
|
|
|
|
{
|
|
|
|
might_sleep();
|
|
|
|
if (!PageHighMem(page))
|
|
|
|
return page_address(page);
|
|
|
|
return kmap_high(page);
|
|
|
|
}
|
|
|
|
|
2006-01-08 04:01:19 -05:00
|
|
|
EXPORT_SYMBOL(kmap);
|
|
|
|
|
2005-04-16 18:20:36 -04:00
|
|
|
void kunmap(struct page *page)
|
|
|
|
{
|
|
|
|
if (in_interrupt())
|
|
|
|
BUG();
|
|
|
|
if (!PageHighMem(page))
|
|
|
|
return;
|
|
|
|
kunmap_high(page);
|
|
|
|
}
|
|
|
|
|
2006-01-08 04:01:19 -05:00
|
|
|
EXPORT_SYMBOL(kunmap);
|
|
|
|
|
2005-04-16 18:20:36 -04:00
|
|
|
struct page *kmap_atomic_to_page(void *ptr)
|
|
|
|
{
|
|
|
|
return virt_to_page(ptr);
|
|
|
|
}
|