arch_test_and_change_bit(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– NAME πŸ’–

Okay so this is arch_test_and_change_bit(9) from the Kernel API Manual, and her whole thing is: change a bit and return its old value. Bestie, it’s giving tiny atomic main-character energy. ✨


🌸 SYNOPSIS 🌸

int arch_test_and_change_bit (int nr , volatile unsigned long *addr );

πŸŽ€ ARGUMENTS πŸŽ€

  • nr β€” the bit to change. That’s the one, bestie. πŸ’…
  • addr β€” the address to count from. That’s the exact wording, don’t come for me 🫢.

✨ DESCRIPTION ✨

No cap: this operation is atomic and cannot be reordered. It also implies a memory barrier. Periodt. Those are the facts, and they’re the whole point β€” don’t skip them just because the section is short. πŸ’€πŸ”₯


πŸ¦‹ SEE ALSO πŸ¦‹

Kernel file ./arch/riscv/include/asm/bitops.h is where it lives. The whole friend group:


Source/version tea: ./arch/riscv/include/asm Β· date on the page: October 2026 β€” that’s the footer, bestie. Bye! πŸ’–πŸŽ€

πŸ“¦ where this page comes from