Introduce virt_to_phys()
virt_to_phys() returns the physical address given a virtual. In most cases this will be just the input value as the vast majority of systems run in a 1:1 mode. However in systems that are not running this way it should report the physical address or ~0 if no mapping exists for the given virtual address. Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
This commit is contained in:
committed by
Wolfgang Denk
parent
45845301af
commit
65e43a1063
@@ -118,7 +118,7 @@ static inline void set_io_port_base(unsigned long base)
|
||||
* Change virtual addresses to physical addresses and vv.
|
||||
* These are trivial on the 1:1 Linux/MIPS mapping
|
||||
*/
|
||||
extern inline unsigned long virt_to_phys(volatile void * address)
|
||||
extern inline phys_addr_t virt_to_phys(void * address)
|
||||
{
|
||||
return CPHYSADDR(address);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user