Back to home page

OSCL-LXR

 
 

    


0001 // SPDX-License-Identifier: GPL-2.0
0002 #include <linux/bug.h>
0003 #include <linux/export.h>
0004 #include <linux/types.h>
0005 #include <linux/mmdebug.h>
0006 #include <linux/mm.h>
0007 
0008 #include <asm/memory.h>
0009 
0010 phys_addr_t __virt_to_phys(unsigned long x)
0011 {
0012     WARN(!__is_lm_address(__tag_reset(x)),
0013          "virt_to_phys used for non-linear address: %pK (%pS)\n",
0014           (void *)x,
0015           (void *)x);
0016 
0017     return __virt_to_phys_nodebug(x);
0018 }
0019 EXPORT_SYMBOL(__virt_to_phys);
0020 
0021 phys_addr_t __phys_addr_symbol(unsigned long x)
0022 {
0023     /*
0024      * This is bounds checking against the kernel image only.
0025      * __pa_symbol should only be used on kernel symbol addresses.
0026      */
0027     VIRTUAL_BUG_ON(x < (unsigned long) KERNEL_START ||
0028                x > (unsigned long) KERNEL_END);
0029     return __pa_symbol_nodebug(x);
0030 }
0031 EXPORT_SYMBOL(__phys_addr_symbol);