Commit 012dcef3 authored by Christoph Hellwig's avatar Christoph Hellwig Committed by Dan Williams

mm: move __phys_to_pfn and __pfn_to_phys to asm/generic/memory_model.h

Three architectures already define these, and we'll need them genericly
soon.
Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
Signed-off-by: default avatarDan Williams <dan.j.williams@intel.com>
parent cb389b9c
...@@ -118,12 +118,6 @@ ...@@ -118,12 +118,6 @@
#define DTCM_OFFSET UL(0xfffe8000) #define DTCM_OFFSET UL(0xfffe8000)
#endif #endif
/*
* Convert a physical address to a Page Frame Number and back
*/
#define __phys_to_pfn(paddr) ((unsigned long)((paddr) >> PAGE_SHIFT))
#define __pfn_to_phys(pfn) ((phys_addr_t)(pfn) << PAGE_SHIFT)
/* /*
* Convert a page to/from a physical address * Convert a page to/from a physical address
*/ */
......
...@@ -80,12 +80,6 @@ ...@@ -80,12 +80,6 @@
#define __virt_to_phys(x) (((phys_addr_t)(x) - PAGE_OFFSET + PHYS_OFFSET)) #define __virt_to_phys(x) (((phys_addr_t)(x) - PAGE_OFFSET + PHYS_OFFSET))
#define __phys_to_virt(x) ((unsigned long)((x) - PHYS_OFFSET + PAGE_OFFSET)) #define __phys_to_virt(x) ((unsigned long)((x) - PHYS_OFFSET + PAGE_OFFSET))
/*
* Convert a physical address to a Page Frame Number and back
*/
#define __phys_to_pfn(paddr) ((unsigned long)((paddr) >> PAGE_SHIFT))
#define __pfn_to_phys(pfn) ((phys_addr_t)(pfn) << PAGE_SHIFT)
/* /*
* Convert a page to/from a physical address * Convert a page to/from a physical address
*/ */
......
...@@ -60,12 +60,6 @@ ...@@ -60,12 +60,6 @@
#define __phys_to_virt(x) ((x) - PHYS_OFFSET + PAGE_OFFSET) #define __phys_to_virt(x) ((x) - PHYS_OFFSET + PAGE_OFFSET)
#endif #endif
/*
* Convert a physical address to a Page Frame Number and back
*/
#define __phys_to_pfn(paddr) ((paddr) >> PAGE_SHIFT)
#define __pfn_to_phys(pfn) ((pfn) << PAGE_SHIFT)
/* /*
* Convert a page to/from a physical address * Convert a page to/from a physical address
*/ */
......
...@@ -69,6 +69,12 @@ ...@@ -69,6 +69,12 @@
}) })
#endif /* CONFIG_FLATMEM/DISCONTIGMEM/SPARSEMEM */ #endif /* CONFIG_FLATMEM/DISCONTIGMEM/SPARSEMEM */
/*
* Convert a physical address to a Page Frame Number and back
*/
#define __phys_to_pfn(paddr) ((unsigned long)((paddr) >> PAGE_SHIFT))
#define __pfn_to_phys(pfn) ((pfn) << PAGE_SHIFT)
#define page_to_pfn __page_to_pfn #define page_to_pfn __page_to_pfn
#define pfn_to_page __pfn_to_page #define pfn_to_page __pfn_to_page
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment