2 #include <linux/export.h>
3 #include <linux/types.h>
4 #include <linux/mmdebug.h>
7 #include <asm/memory.h>
9 phys_addr_t
__virt_to_phys(unsigned long x
)
11 WARN(!__is_lm_address(x
),
12 "virt_to_phys used for non-linear address: %pK (%pS)\n",
16 return __virt_to_phys_nodebug(x
);
18 EXPORT_SYMBOL(__virt_to_phys
);
20 phys_addr_t
__phys_addr_symbol(unsigned long x
)
23 * This is bounds checking against the kernel image only.
24 * __pa_symbol should only be used on kernel symbol addresses.
26 VIRTUAL_BUG_ON(x
< (unsigned long) KERNEL_START
||
27 x
> (unsigned long) KERNEL_END
);
28 return __pa_symbol_nodebug(x
);
30 EXPORT_SYMBOL(__phys_addr_symbol
);