atomic64_fetch_xor_acquire(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– atomic64_fetch_xor_acquire(9) β€” Kernel API Manual πŸ’–

okay so bestie, welcome to the Kernel API Manual, section 9, and today's main character is atomic64_fetch_xor_acquire. she's a 64-bit atomic XOR queen and honestly she ate. let's get into it 🫢


✨ NAME ✨

atomic64_fetch_xor_acquire β€” atomic bitwise XOR with acquire ordering πŸ’…

like yes, that's the whole vibe. atomic. bitwise. XOR. acquire ordering. iconic.


🌸 SYNOPSIS 🌸

s64 atomic64_fetch_xor_acquire (s64 i , atomic64_t *v );

that's literally it. two args, no drama, she returns an s64. slay.


πŸŽ€ ARGUMENTS πŸŽ€

  • i β€” an s64 value. yeah just a value, that's her whole job πŸ’œ
  • v β€” a pointer to atomic64_t. this is the thing getting xor'd, bestie πŸ¦‹

πŸ”₯ DESCRIPTION πŸ”₯

so what she does is: atomically update v to (v ^ i) with acquire ordering. atomically means nobody can slide in halfway through, no cap. the acquire ordering is the memory-barrier fairy dust ✨

⚠️ okay important, do NOT skip this: she is unsafe to use in noinstr code. if you're in noinstr land you use raw_atomic64_fetch_xor_acquire instead. periodt. that's the rule, i don't make them 😭

⭐ RETURN ⭐

she gives you back the original value of v β€” like the value before the XOR happened. a little time capsule. a souvenir. the pre-glow-up version πŸ’«


πŸ¦‹ SEE ALSO πŸ¦‹

first up, the home base β€” kernel file ./include/linux/atomic/atomic-instrumented.h. she lives there. say hi πŸ’–

🌈 the atomic_* girlies

🧚 the atomic64_* besties (our girl's homegirls)

πŸ‹ the atomic_long_* crew


okay that's everybody. mwah. go read them, they're all slaying in their own lanes πŸ’œ


little sign-off bestie πŸŽ€ β€” this page lives in ./include/linux/atomic, the version tag on it is October 2026, and the manual is atomic64_fetch_xor_acquire(9). that's it, that's the page. bye, ily, go write some atomics πŸ’–βœ¨

πŸ“¦ where this page comes from