// SPDX-License-Identifier: GPL-2.0 /* * Provide common bits of early_ioremap() support for architectures needing * temporary mappings during boot before ioremap() is available. * * This is mostly a direct copy of the x86 early_ioremap implementation. * * (C) Copyright 1995 1996, 2014 Linus Torvalds *
*/ #include <linux/kernel.h> #include <linux/init.h> #include <linux/io.h> #include <linux/module.h> #include <linux/slab.h> #include <linux/mm.h> #include <linux/vmalloc.h> #include <asm/fixmap.h> #include <asm/early_ioremap.h> #include"internal.h"
/* * Generally, ioremap() is available after paging_init() has been called. * Architectures wanting to allow early_ioremap after paging_init() can * define __late_set_fixmap and __late_clear_fixmap to do the right thing.
*/ #ifndef __late_set_fixmap staticinlinevoid __init __late_set_fixmap(enum fixed_addresses idx,
phys_addr_t phys, pgprot_t prot)
{
BUG();
} #endif
for (i = 0; i < FIX_BTMAPS_SLOTS; i++) {
WARN_ON_ONCE(prev_map[i]);
slot_virt[i] = __fix_to_virt(FIX_BTMAP_BEGIN - NR_FIX_BTMAPS*i);
}
}
staticint __init check_early_ioremap_leak(void)
{ int count = 0; int i;
for (i = 0; i < FIX_BTMAPS_SLOTS; i++) if (prev_map[i])
count++;
if (WARN(count, KERN_WARNING "Debug warning: early ioremap leak of %d areas detected.\n" "please boot with early_ioremap_debug and report the dmesg.\n",
count)) return 1; return 0;
}
late_initcall(check_early_ioremap_leak);
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.