arch/arc/mm/ioremap.c
Source file repositories/reference/linux-study-clean/arch/arc/mm/ioremap.c
File Facts
- System
- Linux kernel
- Corpus path
arch/arc/mm/ioremap.c- Extension
.c- Size
- 1613 bytes
- Lines
- 63
- Domain
- Architecture Layer
- Bucket
- arch/arc
- Inferred role
- Architecture Layer: exported/initcall integration point
- Status
- integration implementation candidate
Why This File Exists
CPU and platform-specific kernel glue: boot entry, traps, syscall entry, interrupts, page tables, context switch, and low-level barriers.
- CPU and platform-specific kernel glue: boot entry, traps, syscall entry, interrupts, page tables, context switch, and low-level barriers.
- Exports symbols or registers init work; inspect boot/module ordering and who consumes the exported contract.
- Allocates kernel memory; connect allocation flags and lifetime to context constraints.
Dependency Surface
linux/vmalloc.hlinux/init.hlinux/module.hlinux/io.hlinux/mm.hlinux/cache.h
Detected Declarations
function Copyrightfunction controlfunction iounmapexport ioremapexport ioremap_protexport iounmap
Annotated Snippet
// SPDX-License-Identifier: GPL-2.0-only
/*
* Copyright (C) 2004, 2007-2010, 2011-2012 Synopsys, Inc. (www.synopsys.com)
*/
#include <linux/vmalloc.h>
#include <linux/init.h>
#include <linux/module.h>
#include <linux/io.h>
#include <linux/mm.h>
#include <linux/cache.h>
static inline bool arc_uncached_addr_space(phys_addr_t paddr)
{
if (is_isa_arcompact()) {
if (paddr >= ARC_UNCACHED_ADDR_SPACE)
return true;
} else if (paddr >= perip_base && paddr <= perip_end) {
return true;
}
return false;
}
void __iomem *ioremap(phys_addr_t paddr, unsigned long size)
{
/*
* If the region is h/w uncached, MMU mapping can be elided as optim
* The cast to u32 is fine as this region can only be inside 4GB
*/
if (arc_uncached_addr_space(paddr))
return (void __iomem *)(u32)paddr;
return ioremap_prot(paddr, size,
pgprot_noncached(PAGE_KERNEL));
}
EXPORT_SYMBOL(ioremap);
/*
* ioremap with access flags
* Cache semantics wise it is same as ioremap - "forced" uncached.
* However unlike vanilla ioremap which bypasses ARC MMU for addresses in
* ARC hardware uncached region, this one still goes thru the MMU as caller
* might need finer access control (R/W/X)
*/
void __iomem *ioremap_prot(phys_addr_t paddr, size_t size,
pgprot_t prot)
{
/* force uncached */
return generic_ioremap_prot(paddr, size, pgprot_noncached(prot));
}
EXPORT_SYMBOL(ioremap_prot);
void iounmap(volatile void __iomem *addr)
{
/* weird double cast to handle phys_addr_t > 32 bits */
if (arc_uncached_addr_space((phys_addr_t)(u32)addr))
return;
generic_iounmap(addr);
}
EXPORT_SYMBOL(iounmap);
Annotation
- Immediate include surface: `linux/vmalloc.h`, `linux/init.h`, `linux/module.h`, `linux/io.h`, `linux/mm.h`, `linux/cache.h`.
- Detected declarations: `function Copyright`, `function control`, `function iounmap`, `export ioremap`, `export ioremap_prot`, `export iounmap`.
- Atlas domain: Architecture Layer / arch/arc.
- Implementation status: integration implementation candidate.
Implementation Notes
- This generated page is the file-by-file coverage layer; curated subsystem chapters should link here when they synthesize a multi-file control flow.
- Core OS pages should be promoted from atlas-only to deep-reviewed when they explain data structures, invariants, locking, lifecycle, and C implementation snippets.
- Driver-family pages are intentionally pattern-oriented unless they are part of the selected PCIe/NVMe representative device path.