Example #1
0
void *kmap(struct page *page)
{
	might_sleep();
	if (page < highmem_start_page)
		return page_address(page);
	return kmap_high(page);
}
Example #2
0
void *kmap(struct page *page)
{
	might_sleep();
	if (!PageHighMem(page))
		return page_address(page);
	return kmap_high(page);
}
Example #3
0
void *kmap(struct page *page)//½¨Á¢ÓÀ¾ÃÄÚºËÓ³Éä¡£
{
	might_sleep();
	if (!PageHighMem(page))
		return page_address(page);
	return kmap_high(page);
}
Example #4
0
void *kmap(struct page *page)
{
	might_sleep();
	//POS (Cheolhee Lee)
	if (!(PageHighMem(page) || PageNVRAM(page)))
		return page_address(page);
	return kmap_high(page);
}
Example #5
0
void *kmap(struct page *page)
{
	BUG_ON(in_interrupt());
	if (!PageHighMem(page))
		return page_address(page);

	return kmap_high(page);
}
Example #6
0
void *__kmap(struct page *page)
{
	void *addr;

	might_sleep();
	if (!PageHighMem(page))
		return page_address(page);
	addr = kmap_high(page);
	flush_tlb_one((unsigned long)addr);

	return addr;
}
Example #7
0
void *__kmap(struct page *page)
{
	void *addr;

	might_sleep();
	if (page < highmem_start_page)
		return page_address(page);
	addr = kmap_high(page);
	flush_tlb_one((unsigned long)addr);

	return addr;
}
Example #8
0
void *kmap(struct page *page)
{
	void *addr;

	if (in_interrupt())
		BUG();

	if (page < highmem_start_page)
		return page_address(page);
	addr = kmap_high(page);
	flush_tlb_one((unsigned long)addr);

	return addr;
}
/**
 * 建立永久内核映射。
 */
void *kmap(struct page *page)
{
	/**
	 * kmap是允许睡眠的,意思是说不能在中断和可延迟函数中调用。
	 * 如果试图在中断中调用,那么might_sleep会触发异常。
	 */
	might_sleep();
	/**
	 * 如果页框不属于高端内存,则调用page_address直接返回线性地址。
	 */
	if (!PageHighMem(page))
		return page_address(page);
	/**
	 * 否则调用kmap_high真正建立永久内核映射。
	 */
	return kmap_high(page);
}
Example #10
0
int __init kmap_high_init(void) 
{ 
	pages = alloc_pages(__GFP_HIGHMEM, 0); //从高端内存分配一个页 
	if(!pages) 
	{ 
		return -ENOMEM; 
	} 
	else 
	{		 
		printk("<0>alloc_pages Successfully!\npage = 0x%lx\n",(unsigned long)pages); 

        	/*调用函数kmap_high( ),将高端内存页映射到内核地址空间,返回映射的虚拟地址*/
		void * addr = kmap_high(pages);   
		printk("<0>addr = 0x%lx\n",(unsigned long)addr); 
	}	 
	return 0; 
}