/* * Copyright (C) 2010 Tobias Klauser <tklauser@distanz.ch> * Copyright (C) 2009 Wind River Systems Inc * Implemented by fredrik.markstrom@gmail.com and ivarholmqvist@gmail.com * Copyright (C) 2004 Microtronix Datacom Ltd. * * This file is subject to the terms and conditions of the GNU General Public * License. See the file "COPYING" in the main directory of this archive * for more details.
*/
/* * Map uncached objects in the low part of address space to * CONFIG_NIOS2_IO_REGION_BASE
*/ if (IS_MAPPABLE_UNCACHEABLE(phys_addr) &&
IS_MAPPABLE_UNCACHEABLE(last_addr)) return (void __iomem *)(CONFIG_NIOS2_IO_REGION_BASE + phys_addr);
/* Mappings have to be page-aligned */
offset = phys_addr & ~PAGE_MASK;
phys_addr &= PAGE_MASK;
size = PAGE_ALIGN(last_addr + 1) - phys_addr;
/* Ok, go for it */
area = get_vm_area(size, VM_IOREMAP); if (!area) return NULL;
addr = area->addr; if (remap_area_pages((unsignedlong) addr, phys_addr, size, 0)) {
vunmap(addr); return NULL;
} return (void __iomem *) (offset + (char *)addr);
}
EXPORT_SYMBOL(ioremap);
/* * iounmap unmaps nearly everything, so be careful * it doesn't free currently pointer/page tables anymore but it * wasn't used anyway and might be added later.
*/ void iounmap(void __iomem *addr)
{ struct vm_struct *p;
if ((unsignedlong) addr > CONFIG_NIOS2_IO_REGION_BASE) return;
p = remove_vm_area((void *) (PAGE_MASK & (unsignedlong __force) addr)); if (!p)
pr_err("iounmap: bad address %p\n", addr);
kfree(p);
}
EXPORT_SYMBOL(iounmap);
Messung V0.5
¤ Dauer der Verarbeitung: 0.12 Sekunden
(vorverarbeitet)
¤
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.