__swahw32p(9)
π __swahw32p β the Kernel API Manual, but make it make sense β¨
okay so bestie, you opened __swahw32p(9) from the Kernel API Manual and you're standing there like π§ββοΈ... don't worry, this one's short and honestly kinda iconic. it's the pointer-flavoured twin of __swahw32, and we're gonna get you through it. no cap. π«Ά
β¨ NAME β¨
__swahw32p β returns a wordswapped 32-bit value pulled straight from a pointer π
like, it's giving "dereference but make it byte-shuffled." main character energy fr fr.
πΈ SYNOPSIS πΈ
__u32 __swahw32p (const __u32 *p );
that's it. that's the whole vibe check. one function, one pointer, one __u32 coming back at you. π¦
π ARGUMENTS π
pβ a pointer to a naturally-aligned 32-bit value. ngl the "naturally-aligned" part is doing a lot of work here, so pls respect it π β don't be out here handing it some cursed misaligned address, bestie.
π DESCRIPTION π
so the actual wordswapping behaviour? that's __swahw32's whole storyline. this page is basically like "go read __swahw32 for details of wordswapping" β and honestly? valid. the lore lives over there. πβ¨
think of __swahw32p as the pointer-access version: it grabs the value through p and gives you the wordswapped result. the swapping semantics themselves are not re-explained here, so if you want the full breakdown you gotta slide into __swahw32's DMs. π
π« SEE ALSO π«
bestie the friend group is huge and we love them all. these all live in the kernel file ./include/uapi/linux/swab.h π:
__swab16(9)__swab32(9)__swab64(9)__swahw32(9)__swahb32(9)__swab16p(9)__swab32p(9)__swab64p(9)__swahb32p(9)__swab16s(9)__swab32s(9)__swab64s(9)__swahw32s(9)__swahb32s(9)
iykyk β the p girlies are pointers, the s girlies are the in-place squad, and the plain ones are just doing their thing. go read them all, you'll eat. π₯
lowkey reminder: this page only promises to return a wordswapped 32-bit value from a pointer, and it defers all the actual swapping details to __swahw32. don't invent extra behaviour, babe β that's not the assignment π
and that's the whole page, periodt. π sourced from ./include/uapi/linux, dated October 2026 β so yes, she's from the future, and yes, she still slays. bye bestie, go swap some words ππ
π¦ 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