diff options
Diffstat (limited to 'arch/arm/include/asm/memory.h')
-rw-r--r-- | arch/arm/include/asm/memory.h | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/arch/arm/include/asm/memory.h b/arch/arm/include/asm/memory.h index cefedf062138..5421d82a2572 100644 --- a/arch/arm/include/asm/memory.h +++ b/arch/arm/include/asm/memory.h | |||
@@ -125,8 +125,10 @@ | |||
125 | * private definitions which should NOT be used outside memory.h | 125 | * private definitions which should NOT be used outside memory.h |
126 | * files. Use virt_to_phys/phys_to_virt/__pa/__va instead. | 126 | * files. Use virt_to_phys/phys_to_virt/__pa/__va instead. |
127 | */ | 127 | */ |
128 | #ifndef __virt_to_phys | ||
128 | #define __virt_to_phys(x) ((x) - PAGE_OFFSET + PHYS_OFFSET) | 129 | #define __virt_to_phys(x) ((x) - PAGE_OFFSET + PHYS_OFFSET) |
129 | #define __phys_to_virt(x) ((x) - PHYS_OFFSET + PAGE_OFFSET) | 130 | #define __phys_to_virt(x) ((x) - PHYS_OFFSET + PAGE_OFFSET) |
131 | #endif | ||
130 | 132 | ||
131 | /* | 133 | /* |
132 | * Convert a physical address to a Page Frame Number and back | 134 | * Convert a physical address to a Page Frame Number and back |
@@ -134,6 +136,12 @@ | |||
134 | #define __phys_to_pfn(paddr) ((paddr) >> PAGE_SHIFT) | 136 | #define __phys_to_pfn(paddr) ((paddr) >> PAGE_SHIFT) |
135 | #define __pfn_to_phys(pfn) ((pfn) << PAGE_SHIFT) | 137 | #define __pfn_to_phys(pfn) ((pfn) << PAGE_SHIFT) |
136 | 138 | ||
139 | /* | ||
140 | * Convert a page to/from a physical address | ||
141 | */ | ||
142 | #define page_to_phys(page) (__pfn_to_phys(page_to_pfn(page))) | ||
143 | #define phys_to_page(phys) (pfn_to_page(__phys_to_pfn(phys))) | ||
144 | |||
137 | #ifndef __ASSEMBLY__ | 145 | #ifndef __ASSEMBLY__ |
138 | 146 | ||
139 | /* | 147 | /* |
@@ -194,7 +202,8 @@ static inline void *phys_to_virt(unsigned long x) | |||
194 | #ifndef __virt_to_bus | 202 | #ifndef __virt_to_bus |
195 | #define __virt_to_bus __virt_to_phys | 203 | #define __virt_to_bus __virt_to_phys |
196 | #define __bus_to_virt __phys_to_virt | 204 | #define __bus_to_virt __phys_to_virt |
197 | #define __pfn_to_bus(x) ((x) << PAGE_SHIFT) | 205 | #define __pfn_to_bus(x) __pfn_to_phys(x) |
206 | #define __bus_to_pfn(x) __phys_to_pfn(x) | ||
198 | #endif | 207 | #endif |
199 | 208 | ||
200 | static inline __deprecated unsigned long virt_to_bus(void *x) | 209 | static inline __deprecated unsigned long virt_to_bus(void *x) |
@@ -293,11 +302,6 @@ static inline __deprecated void *bus_to_virt(unsigned long x) | |||
293 | #endif /* !CONFIG_DISCONTIGMEM */ | 302 | #endif /* !CONFIG_DISCONTIGMEM */ |
294 | 303 | ||
295 | /* | 304 | /* |
296 | * For BIO. "will die". Kill me when bio_to_phys() and bvec_to_phys() die. | ||
297 | */ | ||
298 | #define page_to_phys(page) (page_to_pfn(page) << PAGE_SHIFT) | ||
299 | |||
300 | /* | ||
301 | * Optional coherency support. Currently used only by selected | 305 | * Optional coherency support. Currently used only by selected |
302 | * Intel XSC3-based systems. | 306 | * Intel XSC3-based systems. |
303 | */ | 307 | */ |