blob: 91371daf397c558232b80f2e14afda9827a2d006 [file] [log] [blame]
Laura Abbottec6d06e2017-01-10 13:35:50 -08001#include <linux/bug.h>
2#include <linux/export.h>
3#include <linux/types.h>
4#include <linux/mmdebug.h>
5#include <linux/mm.h>
6
7#include <asm/memory.h>
8
9phys_addr_t __virt_to_phys(unsigned long x)
10{
11 WARN(!__is_lm_address(x),
12 "virt_to_phys used for non-linear address: %pK (%pS)\n",
13 (void *)x,
14 (void *)x);
15
16 return __virt_to_phys_nodebug(x);
17}
18EXPORT_SYMBOL(__virt_to_phys);
19
20phys_addr_t __phys_addr_symbol(unsigned long x)
21{
22 /*
23 * This is bounds checking against the kernel image only.
24 * __pa_symbol should only be used on kernel symbol addresses.
25 */
26 VIRTUAL_BUG_ON(x < (unsigned long) KERNEL_START ||
27 x > (unsigned long) KERNEL_END);
28 return __pa_symbol_nodebug(x);
29}
30EXPORT_SYMBOL(__phys_addr_symbol);