|
发表于 2007-6-6 13:45:11
|
显示全部楼层
The kmap( ) function establishes a permanent kernel mapping. It is essentially equivalent to the following code:
void * kmap(struct page * page)
{
if (!PageHighMem(page))
return page_address(page);
return kmap_high(page);
}
The kmap_high( ) function is invoked if the page frame really belongs to high memory. The function is essentially equivalent to the following code:
void * kmap_high(struct page * page)
{
unsigned long vaddr;
spin_lock(&kmap_lock);
vaddr = (unsigned long) page_address(page);
if (!vaddr)
vaddr = map_new_virtual(page);
pkmap_count[(vaddr-PKMAP_BASE) >> PAGE_SHIFT]++;
spin_unlock(&kmap_lock);
return (void *) vaddr;
} |
|