CindyRabbit
CindyRabbit

Reputation: 369

Is there any kernel function to convert a physical page to its virtual address?

I get one huge page by struct page *page=alloc_pages(), and I want to verify if it is a 2MB page. Is there any kernel function that I can use to convert this page to its virtual address?

Upvotes: 1

Views: 994

Answers (1)

Eugene
Eugene

Reputation: 6097

For the pages allocated with alloc_page() or the like, you can use page_address() to obtain their virtual addresses (see <linux/mm.h>).

Upvotes: 5

Related Questions