Lines Matching +full:8 +full:- +full:bit
4 * SPDX-License-Identifier: Apache-2.0
20 LOG_DBG("Setting %d bit in bitmap", index); in ext2_bitmap_set()
22 uint32_t idx = index / 8; in ext2_bitmap_set()
23 uint32_t off = index % 8; in ext2_bitmap_set()
27 return -EINVAL; in ext2_bitmap_set()
30 __ASSERT((bm[idx] & BIT(off)) == 0, "Bit %d set in bitmap", index); in ext2_bitmap_set()
33 bm[idx] |= BIT(off); in ext2_bitmap_set()
41 LOG_DBG("Unsetting %d bit in bitmap", index); in ext2_bitmap_unset()
43 uint32_t idx = index / 8; in ext2_bitmap_unset()
44 uint32_t off = index % 8; in ext2_bitmap_unset()
48 return -EINVAL; in ext2_bitmap_unset()
51 __ASSERT(bm[idx] & BIT(off), "Bit %d not set in bitmap", index); in ext2_bitmap_unset()
54 bm[idx] &= ~BIT(off); in ext2_bitmap_unset()
66 int off = find_lsb_set(~bm[i]) - 1; in ext2_bitmap_find_free()
69 return off + i * 8; in ext2_bitmap_find_free()
72 return -ENOSPC; in ext2_bitmap_find_free()
79 for (uint32_t i = 0; i < size; i += 8) { in ext2_bitmap_count_set()
80 uint8_t val = bm[i / 8]; in ext2_bitmap_count_set()
82 for (int b = 0; b < 8 && i + b < size; ++b) { in ext2_bitmap_count_set()
83 count += (val >> b) & BIT(0); in ext2_bitmap_count_set()