~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/arch/arm/mm/physaddr.c

Version: ~ [ linux-6.11.5 ] ~ [ linux-6.10.14 ] ~ [ linux-6.9.12 ] ~ [ linux-6.8.12 ] ~ [ linux-6.7.12 ] ~ [ linux-6.6.58 ] ~ [ linux-6.5.13 ] ~ [ linux-6.4.16 ] ~ [ linux-6.3.13 ] ~ [ linux-6.2.16 ] ~ [ linux-6.1.114 ] ~ [ linux-6.0.19 ] ~ [ linux-5.19.17 ] ~ [ linux-5.18.19 ] ~ [ linux-5.17.15 ] ~ [ linux-5.16.20 ] ~ [ linux-5.15.169 ] ~ [ linux-5.14.21 ] ~ [ linux-5.13.19 ] ~ [ linux-5.12.19 ] ~ [ linux-5.11.22 ] ~ [ linux-5.10.228 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.284 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.322 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.336 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.337 ] ~ [ linux-4.4.302 ] ~ [ linux-3.10.108 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.9 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  1 // SPDX-License-Identifier: GPL-2.0
  2 #include <linux/bug.h>
  3 #include <linux/export.h>
  4 #include <linux/types.h>
  5 #include <linux/mmdebug.h>
  6 #include <linux/mm.h>
  7 
  8 #include <asm/sections.h>
  9 #include <asm/page.h>
 10 #include <asm/fixmap.h>
 11 #include <asm/dma.h>
 12 
 13 #include "mm.h"
 14 
 15 static inline bool __virt_addr_valid(unsigned long x)
 16 {
 17         /*
 18          * high_memory does not get immediately defined, and there
 19          * are early callers of __pa() against PAGE_OFFSET
 20          */
 21         if (!high_memory && x >= PAGE_OFFSET)
 22                 return true;
 23 
 24         if (high_memory && x >= PAGE_OFFSET && x < (unsigned long)high_memory)
 25                 return true;
 26 
 27         /*
 28          * MAX_DMA_ADDRESS is a virtual address that may not correspond to an
 29          * actual physical address. Enough code relies on __pa(MAX_DMA_ADDRESS)
 30          * that we just need to work around it and always return true.
 31          */
 32         if (x == MAX_DMA_ADDRESS)
 33                 return true;
 34 
 35         return false;
 36 }
 37 
 38 phys_addr_t __virt_to_phys(unsigned long x)
 39 {
 40         WARN(!__virt_addr_valid(x),
 41              "virt_to_phys used for non-linear address: %pK (%pS)\n",
 42              (void *)x, (void *)x);
 43 
 44         return __virt_to_phys_nodebug(x);
 45 }
 46 EXPORT_SYMBOL(__virt_to_phys);
 47 
 48 phys_addr_t __phys_addr_symbol(unsigned long x)
 49 {
 50         /* This is bounds checking against the kernel image only.
 51          * __pa_symbol should only be used on kernel symbol addresses.
 52          */
 53         VIRTUAL_BUG_ON(x < (unsigned long)KERNEL_START ||
 54                        x > (unsigned long)KERNEL_END);
 55 
 56         return __pa_symbol_nodebug(x);
 57 }
 58 EXPORT_SYMBOL(__phys_addr_symbol);
 59 

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

sflogo.php