ioremap_uc(9)
okay bestie, welcome to ioremap_uc(9) from the Kernel API Manual β this is the one that maps bus memory into CPU space as strongly uncachable, no cap π
β¨
π NAME π
ioremap_uc β map bus memory into CPU space as strongly uncachable. Thatβs the whole vibe, and it ate.
β¨ SYNOPSIS β¨
void __iomem * ioremap_uc (resource_size_t phys_addr , unsigned long
size );
π ARGUMENTS π
phys_addrβ bus address of the memory. Yes bestie, the bus address.sizeβ size of the resource to map. The amount youβre mapping, periodt.
π¦ DESCRIPTION π¦
Okay so ioremap_uc performs a platform specific sequence of operations to make bus memory CPU accessible via the readb/readw/readl/writeb/writew/writel functions and the other mmio helpers. The returned address is not guaranteed to be usable directly as a virtual address. Thatβs a real caveat β donβt just assume itβs a normal virtual address, bestie π
This version of ioremap ensures that the memory is marked with a strong preference as completely uncachable on the CPU when possible. For non-PAT systems this ends up setting page-attribute flags PCD=1, PWT=1. For PAT systems this will set the PAT entry for the pages as strong UC. This call will honor existing caching rules from things like the PCI bus. Note that there are other caches and buffers on many busses. In particular driver authors should read up on PCI writes. Like, actually read up β this is important driver-author lore π
Itβs useful if some control registers are in such an area and write combining or read caching is not desirable:
Must be freed with iounmap. π«Ά Donβt forget, or the vibe check will not pass.
π SEE ALSO π
Kernel file ./arch/x86/mm/ioremap.c β plus these bestie references: ioremap(9), ioremap_wc(9), ioremap_wt(9), iounmap(9). Go read them, iykyk π
mwah π β this page comes from ./arch/x86/mm, dated October 2026, for ioremap_uc(9). Bye bestie! β¨π
π¦ where this page comes from
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms