staticinlinebool __virt_addr_valid(unsignedlong x)
{ /* * high_memory does not get immediately defined, and there * are early callers of __pa() against PAGE_OFFSET
*/ if (!high_memory && x >= PAGE_OFFSET) returntrue;
if (high_memory && x >= PAGE_OFFSET && x < (unsignedlong)high_memory) returntrue;
/* * MAX_DMA_ADDRESS is a virtual address that may not correspond to an * actual physical address. Enough code relies on __pa(MAX_DMA_ADDRESS) * that we just need to work around it and always return true.
*/ if (x == MAX_DMA_ADDRESS) returntrue;
returnfalse;
}
phys_addr_t __virt_to_phys(unsignedlong x)
{
WARN(!__virt_addr_valid(x), "virt_to_phys used for non-linear address: %pK (%pS)\n",
(void *)x, (void *)x);
phys_addr_t __phys_addr_symbol(unsignedlong x)
{ /* This is bounds checking against the kernel image only. * __pa_symbol should only be used on kernel symbol addresses.
*/
VIRTUAL_BUG_ON(x < (unsignedlong)KERNEL_START ||
x > (unsignedlong)KERNEL_END);
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.