/fuchsia/zircon/system/ulib/bitmap/include/bitmap/ |
H A D | bitmap.h | 18 // Finds a run of |run_len| |is_set| bits, between |bitoff| and |bitmax|. 22 virtual zx_status_t Find(bool is_set, size_t bitoff, size_t bitmax, 25 // Returns true in the bit at bitoff is set. 26 virtual bool GetOne(size_t bitoff) const { 27 return Get(bitoff, bitoff + 1, nullptr); 30 // Returns true if all the bits in [*bitoff*, *bitmax*) are set. Afterwards, 32 // first unset bit after *bitoff*. 33 virtual bool Get(size_t bitoff, size_t bitmax, 36 // Sets the bit at bitoff 37 SetOne(size_t bitoff) argument 46 ClearOne(size_t bitoff) argument [all...] |
H A D | rle-bitmap.h | 46 zx_status_t Find(bool is_set, size_t bitoff, size_t bitmax, 49 // Returns true if all the bits in [*bitoff*, *bitmax*) are set. Afterwards, 51 // first unset bit after *bitoff*. 52 bool Get(size_t bitoff, size_t bitmax, size_t* first_unset = nullptr) const override; 54 // Sets all bits in the range [*bitoff*, *bitmax*). Only fails on allocation 55 // error or if bitmax < bitoff. 56 zx_status_t Set(size_t bitoff, size_t bitmax) override; 58 // Sets all bits in the range [*bitoff*, *bitmax*). Only fails if 59 // *bitmax* < *bitoff* or if an allocation is needed and *free_list* 66 zx_status_t SetNoAlloc(size_t bitoff, size_ 111 size_t bitoff; member in struct:bitmap::RleBitmapElement [all...] |
H A D | raw-bitmap.h | 48 // Returns true if all bits in the range [*bitoff*, *bitmax*) match 51 // empty region (i.e. *bitoff* is greater than *bitmax*, or *bitoff* is 53 bool Scan(size_t bitoff, size_t bitmax, bool is_set, 55 bool ReverseScan(size_t bitoff, size_t bitmax, bool is_set, 59 // *is_set* bits, in [*bitoff*, *bitmax*). Returns the start of the run in 62 zx_status_t Find(bool is_set, size_t bitoff, size_t bitmax, size_t run_len, 64 zx_status_t ReverseFind(bool is_set, size_t bitoff, size_t bitmax, 67 // Returns true if all the bits in [*bitoff*, *bitmax*) are set. Afterwards, 69 // first unset bit after *bitoff* [all...] |
/fuchsia/zircon/system/ulib/bitmap/ |
H A D | rle-bitmap.cpp | 43 zx_status_t RleBitmap::Find(bool is_set, size_t bitoff, size_t bitmax, size_t run_len, size_t* out) argument 48 // On each loop, |bitoff| is guaranteed to be either within the current elem, or in the range 50 // Therefore, we can check whether |run_len| bits between |bitmax| and |bitoff| exist before 53 if (bitoff >= elem.end()) { 55 } else if (bitmax - bitoff < run_len) { 59 size_t elem_min = fbl::max(bitoff, elem.bitoff); // Minimum valid bit within elem. 64 // which are between |bitoff| and |bitmax|. 69 if (!is_set && bitoff < elem.bitoff 97 Get(size_t bitoff, size_t bitmax, size_t* first_unset) const argument 123 Set(size_t bitoff, size_t bitmax) argument 127 SetNoAlloc(size_t bitoff, size_t bitmax, FreeList* free_list) argument 135 Clear(size_t bitoff, size_t bitmax) argument 139 ClearNoAlloc(size_t bitoff, size_t bitmax, FreeList* free_list) argument 147 SetInternal(size_t bitoff, size_t bitmax, FreeList* free_list) argument 210 ClearInternal(size_t bitoff, size_t bitmax, FreeList* free_list) argument [all...] |
H A D | raw-bitmap.cpp | 19 constexpr size_t FirstIdx(size_t bitoff) { argument 20 return bitoff / kBits; 46 size_t MaskBits(size_t data, size_t idx, size_t bitoff, size_t bitmax, argument 48 size_t mask = GetMask(idx == FirstIdx(bitoff), idx == LastIdx(bitmax), 49 bitoff, bitmax); 86 bool RawBitmapBase::Scan(size_t bitoff, size_t bitmax, bool is_set, argument 89 if (bitoff >= bitmax) { 92 size_t i = FirstIdx(bitoff); 94 size_t masked = MaskBits(data_[i], i, bitoff, bitmax, is_set); 108 bool RawBitmapBase::ReverseScan(size_t bitoff, size_ argument 130 Find(bool is_set, size_t bitoff, size_t bitmax, size_t run_len, size_t* out) const argument 148 ReverseFind(bool is_set, size_t bitoff, size_t bitmax, size_t run_len, size_t* out) const argument 170 Get(size_t bitoff, size_t bitmax, size_t* first) const argument 178 Set(size_t bitoff, size_t bitmax) argument 193 Clear(size_t bitoff, size_t bitmax) argument [all...] |
/fuchsia/zircon/system/utest/bitmap/ |
H A D | rle-bitmap-tests.cpp | 13 typedef bool(VerifyCallback)(size_t index, size_t bitoff, size_t bitlen); 21 EXPECT_TRUE(cb(rng_count, range.bitoff, range.bitlen)); 54 auto cb = [](size_t index, size_t bitoff, size_t bitlen) -> bool { 56 EXPECT_EQ(bitoff, 2U, "bitoff"); 83 auto cb = [](size_t index, size_t bitoff, size_t bitlen) -> bool { 85 EXPECT_EQ(bitoff, 2U, "bitoff"); 139 auto cb = [](size_t index, size_t bitoff, size_t bitlen) -> bool { 141 EXPECT_EQ(bitoff, 398 VerifyRange(const RleBitmap& bitmap, size_t bitoff, size_t bitmax, size_t min_val, size_t max_val) argument [all...] |
/fuchsia/zircon/kernel/arch/x86/ |
H A D | ioport.cpp | 39 DEBUG_ASSERT(extent.bitoff + extent.bitlen <= IO_BITMAP_BITS); 40 bitmap_set(tss_bitmap, static_cast<int>(extent.bitoff), static_cast<int>(extent.bitlen)); 58 DEBUG_ASSERT(extent.bitoff + extent.bitlen <= IO_BITMAP_BITS); 59 bitmap_clear(tss_bitmap, static_cast<int>(extent.bitoff), static_cast<int>(extent.bitlen));
|