// SPDX-License-Identifier: GPL-2.0 /* * linux/arch/m68k/mm/kmap.c * * Copyright (C) 1997 Roman Hodek * * 10/01/99 cleaned up the code and changing to the same interface * used by other architectures /Roman Zippel
*/
/* * For 040/060 we can use the virtual memory area like other architectures, * but for 020/030 we want to use early termination page descriptors and we * can't mix this with normal page descriptors, so we have to copy that code * (mm/vmalloc.c) and return appropriately aligned addresses.
*/
/* * Unmap an ioremap()ed region again
*/ void iounmap(void __iomem *addr)
{ #ifdef CONFIG_AMIGA if (MACH_IS_AMIGA &&
((unsignedlong)addr >= 0x40000000) &&
((unsignedlong)addr < 0x60000000)) return; #endif #ifdef CONFIG_VIRT if (MACH_IS_VIRT && (unsignedlong)addr >= 0xff000000) return; #endif #ifdef CONFIG_COLDFIRE if (cf_internalio(addr)) return; #endif
free_io_area((__force void *)addr);
}
EXPORT_SYMBOL(iounmap);
/* * Set new cache mode for some kernel address space. * The caller must push data for that range itself, if such data may already * be in the cache.
*/ void kernel_set_cachemode(void *addr, unsignedlong size, int cmode)
{ unsignedlong virtaddr = (unsignedlong)addr;
pgd_t *pgd_dir;
p4d_t *p4d_dir;
pud_t *pud_dir;
pmd_t *pmd_dir;
pte_t *pte_dir;
if (CPU_IS_040_OR_060) { switch (cmode) { case IOMAP_FULL_CACHING:
cmode = _PAGE_CACHE040; break; case IOMAP_NOCACHE_SER: default:
cmode = _PAGE_NOCACHE_S; break; case IOMAP_NOCACHE_NONSER:
cmode = _PAGE_NOCACHE; break; case IOMAP_WRITETHROUGH:
cmode = _PAGE_CACHE040W; break;
}
} else { switch (cmode) { case IOMAP_NOCACHE_SER: case IOMAP_NOCACHE_NONSER: default:
cmode = _PAGE_NOCACHE030; break; case IOMAP_FULL_CACHING: case IOMAP_WRITETHROUGH:
cmode = 0;
}
}
while ((long)size > 0) {
pgd_dir = pgd_offset_k(virtaddr);
p4d_dir = p4d_offset(pgd_dir, virtaddr);
pud_dir = pud_offset(p4d_dir, virtaddr); if (pud_bad(*pud_dir)) {
printk("iocachemode: bad pud(%08lx)\n", pud_val(*pud_dir));
pud_clear(pud_dir); return;
}
pmd_dir = pmd_offset(pud_dir, virtaddr);
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.