Inline function
Space | User/kernel |
Context | Sync/async/rt-irq |
May block | No |
SPL | Any |
Dynamic memory | No |
#include <ARCH/BT.H>
static __finline__ int __BT(const void *ptr, int bit);
Test a bit in a memory bitmap.
The exact layout of the bits in the bitmap is architecture-specific. The only specified fact is that bits with numbers up to number of bits in long int type (8 * sizeof(long)
) map into one long int value in memory. Bits with numbers up to 2 * 8 * sizeof(long)
map to the next long int and so on. Whether the mapping is big-endian or little-endian or from the most significant bit or from the least significant bit, depends on the architecture.
sizeof(long) * ((bit + (sizeof(long) * 8 - 1)) / sizeof(long) / 8)
bytes. 0 if the bit is clear, 1 if the bit is set.