Skip to content

Commit

Permalink
ARM: provide phys_to_page() to complement page_to_phys()
Browse files Browse the repository at this point in the history
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Tested-By: Jamie Iles <jamie@jamieiles.com>
Reviewed-by: Catalin Marinas <catalin.marinas@arm.com>
  • Loading branch information
Russell King committed Nov 23, 2009
1 parent ac50e95 commit 719301f
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions arch/arm/include/asm/memory.h
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,12 @@
#define __phys_to_pfn(paddr) ((paddr) >> PAGE_SHIFT)
#define __pfn_to_phys(pfn) ((pfn) << PAGE_SHIFT)

/*
* Convert a page to/from a physical address
*/
#define page_to_phys(page) (__pfn_to_phys(page_to_pfn(page)))
#define phys_to_page(phys) (pfn_to_page(__phys_to_pfn(phys)))

#ifndef __ASSEMBLY__

/*
Expand Down Expand Up @@ -292,11 +298,6 @@ static inline __deprecated void *bus_to_virt(unsigned long x)

#endif /* !CONFIG_DISCONTIGMEM */

/*
* For BIO. "will die". Kill me when bio_to_phys() and bvec_to_phys() die.
*/
#define page_to_phys(page) (page_to_pfn(page) << PAGE_SHIFT)

/*
* Optional coherency support. Currently used only by selected
* Intel XSC3-based systems.
Expand Down

0 comments on commit 719301f

Please sign in to comment.