arch_test_and_clear_bit(9)
π 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:
__ffs(9)__fls(9)ffs(9)fls(9)arch_test_and_set_bit(9)arch_test_and_change_bit(9)arch_set_bit(9)arch_clear_bit(9)arch_change_bit(9)arch_test_and_set_bit_lock(9)arch_clear_bit_unlock(9)arch___clear_bit_unlock(9)
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
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms