raw_atomic64...xchg_relaxed(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… raw_atomic64...xchg_relaxed(9) β€” like, the Kernel API Manual bestie πŸŽ€

okay so first things first, the page header says raw_atomic64...xchg_relaxed(9) and the manual it lives in is the Kernel API Manual β€” that's the vibe, that's the house we're in ✨


🌸 NAME 🌸

raw_atomic64_cmpxchg_relaxed β€” atomic compare and exchange with relaxed ordering πŸ’«


πŸ¦‹ SYNOPSIS πŸ¦‹

s64 raw_atomic64_cmpxchg_relaxed (atomic64_t *v , s64 old , s64 new );

πŸŽ€ ARGUMENTS πŸŽ€

  • v β€” pointer to atomic64_t πŸ’– like, the thing we're poking at
  • old β€” s64 value to compare with πŸ‘€ the "are you who I think you are" check
  • new β€” s64 value to assign 🫢 the glow-up we're giving it

✨ DESCRIPTION ✨

So here's the tea, bestie: if (v == old), it atomically updates v to new with relaxed ordering πŸ”₯ Otherwise, v is not modified and relaxed ordering is provided. either way you get the relaxed ordering, no cap πŸ’…

Safe to use in noinstr code β€” but prefer atomic64_cmpxchg_relaxed elsewhere, okay? ikyk πŸ‘‘ That's literally the whole assignment.

πŸ’œ RETURN πŸ’œ

The original value of v 🌈 β€” like, what it was before you touched it, bestie πŸ“


🌟 SEE ALSO 🌟

Kernel file πŸ’Ύ ./include/linux/atomic/atomic-arch-fallback.h β€” go read it, it's giving source-of-truth

the 32-bit raw_atomic_* fam, in order:

and the 64-bit raw_atomic64_* besties, in order too:


and that's the page, bestie 🧚 no crumbs left, every single name kept πŸ’―

k bye, this came from the ./include/linux/atomic corner of the kernel and the date stamp on it is October 2026 β€” so yeah, future-coded and iconic πŸ‘‘πŸ’–

πŸ“¦ where this page comes from