arch_test_and_clear_bit(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– arch_test_and_clear_bit(9) πŸ’–

okay so bestie, welcome to the Kernel API Manual β€” the main character is arch_test_and_clear_bit(9), and she is literally here to clear a bit and hand you back its old value. no cap. 🫢


🌸 NAME 🌸

arch_test_and_clear_bit β€” Clear a bit and return its old value. that's the whole vibe. ✨

✨ SYNOPSIS ✨

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

πŸŽ€ ARGUMENTS πŸŽ€

  • nr β€” the bit to clear. yes bestie, that one. πŸ’…
  • addr β€” the address to count from. (that's what the page says, i'm not gonna rewrite the lore.) πŸŽ€

πŸ’… DESCRIPTION πŸ’…

this is an atomic, fully-ordered operation with an implied full memory barrier. so like... it does the thing atomically, in full order, and the memory barrier is implied. periodt. πŸ”₯

πŸ¦‹ SEE ALSO πŸ¦‹

the receipts live in the Kernel file ./arch/riscv/include/asm/bitops.h, and the whole squad is:


kisses bestie πŸ’‹ β€” footer info: source/version ./arch/riscv/include/asm, date October 2026, page arch_test_and_clear_bit(9) πŸ«ΆπŸ’–

πŸ“¦ where this page comes from