difference between ioremap_page_range and vmap_page_range

This may be a very basic question but I am trying to understand the difference between ioremap_page_range() and vmap_page_range(). Both seem to map a physical address to a virtual address (in a newly allocated VM area).

Both functions take 4 argument each and 3 of them are same. ioremap_page_range takes a phys_addr_t and vmap_page_range takes an array of page (frame) pointers.

My question is can these functions be used interchangeably (assuming I take care of 4rth differing argument) or is there any difference in what these functions would achieve?

Any specific pointers to a text or link which explains these functions will be highly helpful.

Answers


The implementation are quite same, in theory you can use the both to create a memory mapping. However, ioremap is used to map a IO resource, which is not a physical page in linux kernel, vmap_page_range should be used to map a physical memory (RAM region) which is present in page pools. By the way, mapping property value usually are different when they are used. (for example, cached or uncached...)


Need Your Help

Errors with RSpec, Shouda, and Rails 3: undefined method `response_code'

rspec shoulda ruby-on-rails

I'm not sure why I am getting these errors, seemingly only on the Shoulda matcher tests. Any advice would be helpful.

How to add a signIn button in a website and update it based on user authentication

javascript jquery html ajax playframework

I am working on playframework but I believe this question is more about a general topic of web implementation. I am creating a website where I want to put my signin button on the top right corner o...