1 // SPDX-License-Identifier: GPL-2.0
3 #include <linux/export.h>
4 #include <linux/types.h>
5 #include <linux/mmdebug.h>
8 #include <asm/memory.h>
10 phys_addr_t
__virt_to_phys(unsigned long x
)
12 WARN(!__is_lm_address(x
),
13 "virt_to_phys used for non-linear address: %pK (%pS)\n",
17 return __virt_to_phys_nodebug(x
);
19 EXPORT_SYMBOL(__virt_to_phys
);
21 phys_addr_t
__phys_addr_symbol(unsigned long x
)
24 * This is bounds checking against the kernel image only.
25 * __pa_symbol should only be used on kernel symbol addresses.
27 VIRTUAL_BUG_ON(x
< (unsigned long) KERNEL_START
||
28 x
> (unsigned long) KERNEL_END
);
29 return __pa_symbol_nodebug(x
);
31 EXPORT_SYMBOL(__phys_addr_symbol
);