generic___change_bit(9)
π« generic___change_bit(9) π«
okay so bestie, welcome to the Kernel API Manual β this is the page for generic___change_bit, and yes the triple underscore is on purpose, don't come for me π«Ά
β¨ NAME β¨
generic___change_bit β toggles a bit in memory, that's the whole job, she's simple and she slays π
πΈ SYNOPSIS πΈ
void generic___change_bit (unsigned long nr , volatile unsigned long
*addr );
literally that's it. void return, so she gives you nothing back β she just does the thing. main character energy fr fr π
π ARGUMENTS π
nrβ the bit you want to change. like, which bit, bestie β point at it. π―addrβ the address to start counting from. this is where the counting begins, so to speak. π
π¦ DESCRIPTION π¦
okay so here's the tea β β unlike change_bit, this function is non-atomic and may be reordered. and the way that matters: if it's called on the same region of memory simultaneously, the effect may be that only one operation succeeds.
π no cap, that's a real caveat β simultaneous calls on the same memory and only one of them may actually land. so maybe don't do that unless you know exactly what you're doing, iykyk.
π SEE ALSO π
- Kernel file
./include/asm-generic/bitops/generic-non-atomic.hβ go read it, she's iconic β¨ generic___set_bit(9)generic___test_and_set_bit(9)generic___test_and_clear_bit(9)generic_test_bit(9)generic_test_bit_acquire(9)const_test_bit(9)
like a whole friend group of bit ops honestly, obsessed π§π
mmkay that's the whole page π this came out of ./include/asm-generic/bitops, dated October 2026, and it's generic___change_bit(9) from the Kernel API Manual β k bye, ily, go toggle a bit responsibly ππΈ
π¦ 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