Files
mckernel/lib/include/bitops-test_bit.h
Masamichi Takagi 33dd2e60b1 mcexec: memory policy control by environmental variable
Refs: #1470
Change-Id: I3d556cae90d31d81572b1c4e5c680e826577d428
2020-12-24 11:18:01 +09:00

12 lines
230 B
C

#ifndef INCLUDE_BITOPS_TEST_BIT_H
#define INCLUDE_BITOPS_TEST_BIT_H
static inline int test_bit(int nr, const void *addr)
{
const uint32_t *p = (const uint32_t *)addr;
return ((1UL << (nr & 31)) & (p[nr >> 5])) != 0;
}
#endif