Release 4.14 arch/ia64/mm/ioremap.c
/*
* (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
Person | Tokens | Prop | Commits | CommitProp |
Björn Helgaas | 24 | 96.00% | 2 | 66.67% |
Li, Zhen-Hua | 1 | 4.00% | 1 | 33.33% |
Total | 25 | 100.00% | 3 | 100.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
Person | Tokens | Prop | Commits | CommitProp |
Li, Zhen-Hua | 30 | 60.00% | 1 | 33.33% |
Tony Luck | 17 | 34.00% | 1 | 33.33% |
Björn Helgaas | 3 | 6.00% | 1 | 33.33% |
Total | 50 | 100.00% | 3 | 100.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
Person | Tokens | Prop | Commits | CommitProp |
Björn Helgaas | 254 | 94.42% | 5 | 62.50% |
Keith Owens | 10 | 3.72% | 1 | 12.50% |
Tony Luck | 3 | 1.12% | 1 | 12.50% |
Li, Zhen-Hua | 2 | 0.74% | 1 | 12.50% |
Total | 269 | 100.00% | 8 | 100.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
Person | Tokens | Prop | Commits | CommitProp |
Björn Helgaas | 33 | 94.29% | 3 | 60.00% |
Keith Owens | 1 | 2.86% | 1 | 20.00% |
Li, Zhen-Hua | 1 | 2.86% | 1 | 20.00% |
Total | 35 | 100.00% | 5 | 100.00% |
EXPORT_SYMBOL(ioremap_nocache);
void
early_iounmap (volatile void __iomem *addr, unsigned long size)
{
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Tony Luck | 13 | 92.86% | 1 | 50.00% |
Björn Helgaas | 1 | 7.14% | 1 | 50.00% |
Total | 14 | 100.00% | 2 | 100.00% |
void
iounmap (volatile void __iomem *addr)
{
if (REGION_NUMBER(addr) == RGN_GATE)
vunmap((void *) ((unsigned long) addr & PAGE_MASK));
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Björn Helgaas | 36 | 97.30% | 1 | 50.00% |
Tony Luck | 1 | 2.70% | 1 | 50.00% |
Total | 37 | 100.00% | 2 | 100.00% |
EXPORT_SYMBOL(iounmap);
Overall Contributors
Person | Tokens | Prop | Commits | CommitProp |
Björn Helgaas | 388 | 83.08% | 5 | 62.50% |
Li, Zhen-Hua | 34 | 7.28% | 1 | 12.50% |
Tony Luck | 34 | 7.28% | 1 | 12.50% |
Keith Owens | 11 | 2.36% | 1 | 12.50% |
Total | 467 | 100.00% | 8 | 100.00% |
Information contained on this website is for historical information purposes only and does not indicate or represent copyright ownership.