cregit-Linux how code gets into the kernel

Release 4.14 arch/ia64/mm/ioremap.c

Directory: arch/ia64/mm
/*
 * (c) Copyright 2006, 2007 Hewlett-Packard Development Company, L.P.
 *      Bjorn Helgaas <bjorn.helgaas@hp.com>
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 as
 * published by the Free Software Foundation.
 */

#include <linux/compiler.h>
#include <linux/module.h>
#include <linux/efi.h>
#include <linux/io.h>
#include <linux/vmalloc.h>
#include <asm/io.h>
#include <asm/meminit.h>


static inline void __iomem * __ioremap_uc(unsigned long phys_addr) { return (void __iomem *) (__IA64_UNCACHED_OFFSET | phys_addr); }

Contributors

PersonTokensPropCommitsCommitProp
Björn Helgaas2496.00%266.67%
Li, Zhen-Hua14.00%133.33%
Total25100.00%3100.00%


void __iomem * early_ioremap (unsigned long phys_addr, unsigned long size) { u64 attr; attr = kern_mem_attribute(phys_addr, size); if (attr & EFI_MEMORY_WB) return (void __iomem *) phys_to_virt(phys_addr); return __ioremap_uc(phys_addr); }

Contributors

PersonTokensPropCommitsCommitProp
Li, Zhen-Hua3060.00%133.33%
Tony Luck1734.00%133.33%
Björn Helgaas36.00%133.33%
Total50100.00%3100.00%


void __iomem * ioremap (unsigned long phys_addr, unsigned long size) { void __iomem *addr; struct vm_struct *area; unsigned long offset; pgprot_t prot; u64 attr; unsigned long gran_base, gran_size; unsigned long page_base; /* * For things in kern_memmap, we must use the same attribute * as the rest of the kernel. For more details, see * Documentation/ia64/aliasing.txt. */ attr = kern_mem_attribute(phys_addr, size); if (attr & EFI_MEMORY_WB) return (void __iomem *) phys_to_virt(phys_addr); else if (attr & EFI_MEMORY_UC) return __ioremap_uc(phys_addr); /* * Some chipsets don't support UC access to memory. If * WB is supported for the whole granule, we prefer that. */ gran_base = GRANULEROUNDDOWN(phys_addr); gran_size = GRANULEROUNDUP(phys_addr + size) - gran_base; if (efi_mem_attribute(gran_base, gran_size) & EFI_MEMORY_WB) return (void __iomem *) phys_to_virt(phys_addr); /* * WB is not supported for the whole granule, so we can't use * the region 7 identity mapping. If we can safely cover the * area with kernel page table mappings, we can use those * instead. */ page_base = phys_addr & PAGE_MASK; size = PAGE_ALIGN(phys_addr + size) - page_base; if (efi_mem_attribute(page_base, size) & EFI_MEMORY_WB) { prot = PAGE_KERNEL; /* * Mappings have to be page-aligned */ offset = phys_addr & ~PAGE_MASK; phys_addr &= PAGE_MASK; /* * Ok, go for it.. */ area = get_vm_area(size, VM_IOREMAP); if (!area) return NULL; area->phys_addr = phys_addr; addr = (void __iomem *) area->addr; if (ioremap_page_range((unsigned long) addr, (unsigned long) addr + size, phys_addr, prot)) { vunmap((void __force *) addr); return NULL; } return (void __iomem *) (offset + (char __iomem *)addr); } return __ioremap_uc(phys_addr); }

Contributors

PersonTokensPropCommitsCommitProp
Björn Helgaas25494.42%562.50%
Keith Owens103.72%112.50%
Tony Luck31.12%112.50%
Li, Zhen-Hua20.74%112.50%
Total269100.00%8100.00%

EXPORT_SYMBOL(ioremap);
void __iomem * ioremap_nocache (unsigned long phys_addr, unsigned long size) { if (kern_mem_attribute(phys_addr, size) & EFI_MEMORY_WB) return NULL; return __ioremap_uc(phys_addr); }

Contributors

PersonTokensPropCommitsCommitProp
Björn Helgaas3394.29%360.00%
Keith Owens12.86%120.00%
Li, Zhen-Hua12.86%120.00%
Total35100.00%5100.00%

EXPORT_SYMBOL(ioremap_nocache);
void early_iounmap (volatile void __iomem *addr, unsigned long size) { }

Contributors

PersonTokensPropCommitsCommitProp
Tony Luck1392.86%150.00%
Björn Helgaas17.14%150.00%
Total14100.00%2100.00%


void iounmap (volatile void __iomem *addr) { if (REGION_NUMBER(addr) == RGN_GATE) vunmap((void *) ((unsigned long) addr & PAGE_MASK)); }

Contributors

PersonTokensPropCommitsCommitProp
Björn Helgaas3697.30%150.00%
Tony Luck12.70%150.00%
Total37100.00%2100.00%

EXPORT_SYMBOL(iounmap);

Overall Contributors

PersonTokensPropCommitsCommitProp
Björn Helgaas38883.08%562.50%
Li, Zhen-Hua347.28%112.50%
Tony Luck347.28%112.50%
Keith Owens112.36%112.50%
Total467100.00%8100.00%
Directory: arch/ia64/mm
Information contained on this website is for historical information purposes only and does not indicate or represent copyright ownership.
Created with cregit.