/* * If the address lies within the first 16 MB, assume it's in ISA * memory space
*/ if (addr < SZ_16M)
addr += _ISA_MEM_BASE;
/* * Choose an address to map it to. * Once the vmalloc system is running, we use it. * Before then, we use space going down from IOREMAP_TOP * (ioremap_bot records where we're up to).
*/
p = addr & PAGE_MASK;
offset = addr & ~PAGE_MASK;
size = PAGE_ALIGN(addr + size) - p;
#ifndef CONFIG_CRASH_DUMP /* * Don't allow anybody to remap normal RAM that we're using. * mem_init() sets high_memory so only do the check after that.
*/ if (slab_is_available() && p <= virt_to_phys(high_memory - 1) &&
page_is_ram(__phys_to_pfn(p))) {
pr_warn("%s(): phys addr 0x%llx is RAM lr %ps\n", __func__,
(unsignedlonglong)p, __builtin_return_address(0)); return NULL;
} #endif
if (size == 0) return NULL;
/* * Is it already mapped? Perhaps overlapped by a previous * mapping.
*/
v = p_block_mapped(p); if (v) return (void __iomem *)v + offset;
if (slab_is_available()) return generic_ioremap_prot(addr, size, prot);
/* * Should check if it is a candidate for a BAT mapping
*/
pr_warn("ioremap() called early from %pS. Use early_ioremap() instead\n", caller);
void iounmap(volatilevoid __iomem *addr)
{ /* * If mapped by BATs then there is nothing to do. * Calling vfree() generates a benign warning.
*/ if (v_block_mapped((unsignedlong)addr)) return;
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.