STRUCT UIO_MEM(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

✨ struct uio_mem (9) ✨

okay so this page lives in the Kernel API Manual and it's literally all about struct uio_mem β€” the lil' description of a UIO memory region πŸŽ€ bestie, if you're touching UIO drivers, this is your girl.


🌸 SYNOPSIS 🌸

here's the whole struct, every field, no skips, copy it exactly pls:

struct uio_mem {
    const char              *name;
    phys_addr_t addr;
    dma_addr_t dma_addr;
    unsigned long           offs;
    resource_size_t size;
    int memtype;
    void __iomem            *internal_addr;
    struct device           *dma_device;
    struct uio_map          *map;
 };

πŸ’… Members πŸ’…

  • name β€” the name of the memory region, for identification. like a name tag but for memory 🏷️
  • addr β€” the address of the device's memory, rounded to page size. and note the vibe check here: phys_addr is used since addr can be logical, virtual, or physical & phys_addr_t should always be large enough to handle any of the address types. highkey sensible πŸ’œ
  • dma_addr β€” the DMA handle set by dma_alloc_coherent, used with UIO_MEM_DMA_COHERENT only (and addr should be the void * returned from the same dma_alloc_coherent call β€” same call, okay, not a different one, they're a package deal 🫢)
  • offs β€” offset of device memory within the page. tiny but mighty ✨
  • size β€” size of IO (multiple of page size). periodt.
  • memtype β€” the type of memory that addr points to πŸ”₯
  • internal_addr β€” the ioremap-ped version of addr, for driver internal use. like, driver's-only, no guests πŸ™ˆ
  • dma_device β€” the device struct that was passed to dma_alloc_coherent, used with UIO_MEM_DMA_COHERENT only. again: only with that one, bestie πŸ’€
  • map β€” for use by the UIO core only. not you. not me. the core. πŸ‘‘

ngl the map field is giving "do not touch" energy β€” leave it to the UIO core and nobody gets hurt πŸ’–

πŸ¦‹ SEE ALSO πŸ¦‹

go read these next, they're all connected iykyk:


okay that's the whole thing, no cap πŸŽ€ this page comes from ./include/linux and it's dated October 2026 β€” so yeah, mark your calendars, the Kernel API Manual said what it said, slay πŸ’…βœ¨πŸ¦‹

πŸ“¦ where this page comes from