Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • kernel/generic/src/adt/bitmap.c

    rf72906c r6e75f2d  
    258258 * @param count      Number of continuous zero bits to find.
    259259 * @param base       Address of the first bit in the bitmap.
    260  * @param prefered   Prefered address to start searching from.
    261260 * @param constraint Constraint for the address of the first zero bit.
    262261 * @param index      Place to store the index of the first zero
     
    270269 */
    271270int bitmap_allocate_range(bitmap_t *bitmap, size_t count, size_t base,
    272     size_t prefered, size_t constraint, size_t *index)
     271    size_t constraint, size_t *index)
    273272{
    274273        if (count == 0)
     
    276275       
    277276        size_t size = bitmap_size(bitmap->elements);
    278         size_t next_fit = bitmap->next_fit;
    279        
    280         /*
    281          * Adjust the next-fit value according to the address
    282          * the caller prefers to start the search at.
    283          */
    284         if ((prefered > base) && (prefered < base + bitmap->elements)) {
    285                 size_t prefered_fit = (prefered - base) / BITMAP_ELEMENT;
    286                
    287                 if (prefered_fit > next_fit)
    288                         next_fit = prefered_fit;
    289         }
    290277       
    291278        for (size_t pos = 0; pos < size; pos++) {
    292                 size_t byte = (next_fit + pos) % size;
     279                size_t byte = (bitmap->next_fit + pos) % size;
    293280               
    294281                /* Skip if the current byte has all bits set */
Note: See TracChangeset for help on using the changeset viewer.