arch/powerpc/mm/ioremap_32.c
Source file repositories/reference/linux-study-clean/arch/powerpc/mm/ioremap_32.c
File Facts
- System
- Linux kernel
- Corpus path
arch/powerpc/mm/ioremap_32.c- Extension
.c- Size
- 2207 bytes
- Lines
- 93
- Domain
- Architecture Layer
- Bucket
- arch/powerpc
- 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/io.hlinux/slab.hlinux/vmalloc.hmm/mmu_decl.h
Detected Declarations
function __ioremap_callerfunction mem_initfunction iounmapexport ioremap_wtexport iounmap
Annotated Snippet
page_is_ram(__phys_to_pfn(p))) {
pr_warn("%s(): phys addr 0x%llx is RAM lr %ps\n", __func__,
(unsigned long long)p, __builtin_return_address(0));
return NULL;
}
#endif
if (size == 0)
return NULL;
/*
* Is it already mapped? Perhaps overlapped by a previous
* mapping.
*/
v = p_block_mapped(p);
if (v)
return (void __iomem *)v + offset;
if (slab_is_available())
return generic_ioremap_prot(addr, size, prot);
/*
* Should check if it is a candidate for a BAT mapping
*/
pr_warn("ioremap() called early from %pS. Use early_ioremap() instead\n", caller);
err = early_ioremap_range(ioremap_bot - size - PAGE_SIZE, p, size, prot);
if (err)
return NULL;
ioremap_bot -= size + PAGE_SIZE;
return (void __iomem *)ioremap_bot + offset;
}
void iounmap(volatile void __iomem *addr)
{
/*
* If mapped by BATs then there is nothing to do.
* Calling vfree() generates a benign warning.
*/
if (v_block_mapped((unsigned long)addr))
return;
generic_iounmap(addr);
}
EXPORT_SYMBOL(iounmap);
Annotation
- Immediate include surface: `linux/io.h`, `linux/slab.h`, `linux/vmalloc.h`, `mm/mmu_decl.h`.
- Detected declarations: `function __ioremap_caller`, `function mem_init`, `function iounmap`, `export ioremap_wt`, `export iounmap`.
- Atlas domain: Architecture Layer / arch/powerpc.
- 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.