aboutsummaryrefslogtreecommitdiffstats
path: root/include/asm-x86/page.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/asm-x86/page.h')
-rw-r--r--include/asm-x86/page.h8
1 files changed, 7 insertions, 1 deletions
diff --git a/include/asm-x86/page.h b/include/asm-x86/page.h
index c91574776751..d4f1d5791fc1 100644
--- a/include/asm-x86/page.h
+++ b/include/asm-x86/page.h
@@ -179,6 +179,7 @@ static inline pteval_t native_pte_flags(pte_t pte)
179#endif /* CONFIG_PARAVIRT */ 179#endif /* CONFIG_PARAVIRT */
180 180
181#define __pa(x) __phys_addr((unsigned long)(x)) 181#define __pa(x) __phys_addr((unsigned long)(x))
182#define __pa_nodebug(x) __phys_addr_nodebug((unsigned long)(x))
182/* __pa_symbol should be used for C visible symbols. 183/* __pa_symbol should be used for C visible symbols.
183 This seems to be the official gcc blessed way to do such arithmetic. */ 184 This seems to be the official gcc blessed way to do such arithmetic. */
184#define __pa_symbol(x) __pa(__phys_reloc_hide((unsigned long)(x))) 185#define __pa_symbol(x) __pa(__phys_reloc_hide((unsigned long)(x)))
@@ -188,9 +189,14 @@ static inline pteval_t native_pte_flags(pte_t pte)
188#define __boot_va(x) __va(x) 189#define __boot_va(x) __va(x)
189#define __boot_pa(x) __pa(x) 190#define __boot_pa(x) __pa(x)
190 191
192/*
193 * virt_to_page(kaddr) returns a valid pointer if and only if
194 * virt_addr_valid(kaddr) returns true.
195 */
191#define virt_to_page(kaddr) pfn_to_page(__pa(kaddr) >> PAGE_SHIFT) 196#define virt_to_page(kaddr) pfn_to_page(__pa(kaddr) >> PAGE_SHIFT)
192#define pfn_to_kaddr(pfn) __va((pfn) << PAGE_SHIFT) 197#define pfn_to_kaddr(pfn) __va((pfn) << PAGE_SHIFT)
193#define virt_addr_valid(kaddr) pfn_valid(__pa(kaddr) >> PAGE_SHIFT) 198extern bool __virt_addr_valid(unsigned long kaddr);
199#define virt_addr_valid(kaddr) __virt_addr_valid((unsigned long) (kaddr))
194 200
195#endif /* __ASSEMBLY__ */ 201#endif /* __ASSEMBLY__ */
196 202