atomic64_fetch_xor(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… atomic64_fetch_xor β€” like, the Kernel API Manual, but make it make sense

okay bestie, welcome to the <pink>Kernel API Manual</pink> ✨ page for atomic64_fetch_xor(9) β€” the tiny function that does a bitwise XOR and hands you back the old value, all atomically. she's giving main character energy and full ordering, no cap πŸ’–


πŸ¦‹ NAME

atomic64_fetch_xor β€” atomic bitwise XOR with full ordering. yes that's the whole pitch, and honestly? iconic.


✨ SYNOPSIS

s64 atomic64_fetch_xor (s64 i , atomic64_t *v );

like, that's it. two arguments. she's low maintenance πŸŽ€


🧚 ARGUMENTS

  • i β€” an s64 value. that's the number you're XOR-ing in, bestie.
  • v β€” pointer to an atomic64_t. this is the poor little guy getting updated.

πŸ”₯ DESCRIPTION

so the way this works: it atomically updates v to (v ^ i) with full ordering. atomically means nobody can sneak in halfway through and see a cursed in-between state β€” she's one clean operation, periodt πŸ’…

⚠️ no cap: it's unsafe to use in noinstr code. if you're in there, use raw_atomic64_fetch_xor instead. do not come for me if you ignore this πŸ™ˆ

πŸŽ€ RETURN

the original value of v β€” meaning the value before the XOR happened. so you get the past, and v gets the future. both of you ate πŸ’–


🌈 SEE ALSO

all her sisters and cousins, fr fr β€” the whole family lives in the kernel file ./include/linux/atomic/atomic-instrumented.h 🫢

the atomic_* girlies:

the atomic64_* squad (her actual sisters):

the atomic_long_* cousins (still family, still slay):


and that's the whole page, bestie!! 🌸 she lives in ./include/linux/atomic, the version vibes are from <blue>October 2026</blue>, and this lil group chat was brought to you by the Kernel API Manual. mwah, study her before your interview πŸ’–πŸ’…βœ¨

πŸ“¦ where this page comes from