STRUCT IOSYS_MAP(9)
π struct iosys_map(9) β like, the Kernel API Manual, but make it fashion π
Okay so bestie, listen. This is from the Kernel API Manual (yes, that one), and we're talking about struct iosys_map which is literally the moment when you need a pointer that could be pointing at IO memory or system memory and you're just like "which one is it tho?" It's giving duality. It's giving "I contain multitudes." Periodt.
β¨ NAME β¨
struct iosys_map β Pointer to IO/system memory π«Ά
Like, it's a pointer, but make it ambiguous on purpose (but in a safe way, we love that for us).
πΈ SYNOPSIS πΈ
struct iosys_map {
union {
void __iomem *vaddr_iomem;
void *vaddr;
};
bool is_iomem;
};
No cap, that's the whole vibe right there. An anonymous union and a bool. Simple. Iconic. We stan a compact struct.
π Members π
{unnamed_union}β anonymous. Yep, that's it. It's an unnamed union. It has no name. It's mysterious. It's giving main character energy but make it lowkey invisible. πvaddr_iomemβ The buffer's address if it's in I/O memory. So like, this is the version of the pointer you use when the thing lives in IO-space. Don't mix it up with the other one, bestie, I'm begging. πvaddrβ The buffer's address if it's in system memory. This is the regular-memory flavor of the pointer. Same union, different energy. πis_iomemβtrueif the buffer is located in I/O memory, orfalseotherwise. This is literally the vibe check flag. It tells you which member of the union you should be looking at. Check it before you dereference anything, fr fr. β
π SEE ALSO π
Bestie, there is a whole squad of related functions and macros. Like, a whole friend group. You are not alone in this:
- The kernel file
./include/linux/iosys-map.hβ go read the overview(9), it's the origin story IOSYS_MAP_INIT_VADDR(9)IOSYS_MAP_INIT_VADDR_IOMEM(9)IOSYS_MAP_INIT_OFFSET(9)iosys_map_set_vaddr(9)iosys_map_set_vaddr_iomem(9)iosys_map_is_equal(9)iosys_map_is_null(9)iosys_map_is_set(9)iosys_map_clear(9)iosys_map_memcpy_to(9)iosys_map_memcpy_from(9)iosys_map_incr(9)iosys_map_memset(9)iosys_map_rd(9)iosys_map_wr(9)iosys_map_rd_field(9)iosys_map_wr_field(9)
That's the whole group chat. They all ate. π
Heads up, bestie: ifis_iomemistrue, you usevaddr_iomem. If it'sfalse, you usevaddr. Do not get it twisted. The struct is not gonna warn you. You gotta check the flag yourself. It's giving trust fall. π
Like, that's the whole page, and honestly? We love a tiny struct with big responsibilities. She's small but she's powerful. She's the moment. π
This has been the Kernel API Manual, struct iosys_map(9) β straight from ./include/linux, dated October 2026. Slay, bye! β¨ππ¦
π¦ 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