diff options
author | Christoph Hellwig <hch@lst.de> | 2015-08-07 23:41:01 +0200 |
---|---|---|
committer | Dan Williams <dan.j.williams@intel.com> | 2015-08-28 01:40:58 +0200 |
commit | 012dcef3f058385268630c0003e9b7f8dcafbeb4 (patch) | |
tree | 11009c91175cbb15149259fc5c6c7722f98a25b1 /include/asm-generic/memory_model.h | |
parent | dax: drop size parameter to ->direct_access() (diff) | |
download | linux-012dcef3f058385268630c0003e9b7f8dcafbeb4.tar.xz linux-012dcef3f058385268630c0003e9b7f8dcafbeb4.zip |
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: Christoph Hellwig <hch@lst.de>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Diffstat (limited to 'include/asm-generic/memory_model.h')
-rw-r--r-- | include/asm-generic/memory_model.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/include/asm-generic/memory_model.h b/include/asm-generic/memory_model.h index 14909b0b9cae..f20f407ce45d 100644 --- a/include/asm-generic/memory_model.h +++ b/include/asm-generic/memory_model.h @@ -69,6 +69,12 @@ }) #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 pfn_to_page __pfn_to_page |