raw_atomic64..._xor_acquire(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… raw_atomic64..._xor_acquire(9) β€” Kernel API Manual πŸ¦‹

okay so bestie, welcome to the Kernel API Manual ✨ we're doing one (1) extremely specific function today and honestly? she's a vibe. it's raw_atomic64..._xor_acquire(9), which is the page title in case the tiny voice in your head was wondering πŸ’–


🌸 NAME 🌸

raw_atomic64_fetch_xor_acquire β€” atomic bitwise XOR with acquire ordering πŸŽ€

like, she XORs. she's atomic. she acquires. that's the whole personality. no cap.


✨ SYNOPSIS ✨

s64 raw_atomic64_fetch_xor_acquire (s64 i , atomic64_t *v );

that's it. that's the whole call. look at her go 🫢


πŸŽ€ ARGUMENTS πŸŽ€

  • i β€” an s64 value. just a number, living her life, minding her business πŸ’œ
  • v β€” a pointer to atomic64_t. this is the main character. the thing getting XORed. protect her at all costs πŸ‘‘

πŸ”₯ DESCRIPTION πŸ”₯

okay so here's the tea: she atomically updates v to (v ^ i) with acquire ordering. atomically, meaning nobody can catch her mid-XOR β€” no half-finished vibes, no race conditions sneaking in the group chat πŸ’…

and she's safe to use in noinstr code 🧚 β€” which is a whole thing, iykyk.

but ngl, the manpage is literally telling you: prefer atomic64_fetch_xor_acquire elsewhere πŸ’€ like, this one's for the noinstr corner of the universe specifically. everywhere else, go use the normal one, she's right there.


🌈 RETURN 🌈

she returns the original value of v β€” the "before" picture πŸ“Έ not the new XORed one. the original. the one before she touched it. iconic behaviour, honestly.


πŸ‘‘ SEE ALSO πŸ‘‘

bestie this list is LONG, hydrate before reading πŸ’€ but every single one of these is part of the family so we're showing them all respect:

and where does she live, you ask? kernel file ./include/linux/atomic/atomic-arch-fallback.h πŸ› go say hi.


that's the whole page bestie, you ate that πŸ’… stay atomic, stay ordered (acquire-ly, specifically), and remember: no half-XORs. periodt. πŸ¦‹βœ¨

mwah πŸ’– β€” this was the Kernel API Manual entry raw_atomic64..._xor_acquire(9), sourced from ./include/linux/atomic, dated October 2026. see u in the next manpage, love u, bye πŸŽ€

πŸ“¦ where this page comes from