Changeset 5d2ab23 in mainline for generic/src/mm/frame.c


Ignore:
Timestamp:
2006-01-17T20:52:33Z (19 years ago)
Author:
Ondrej Palkovsky <ondrap@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
64c44e8
Parents:
77147d6
Message:

Commit of the falloc_bad branch to trunk (719:723).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • generic/src/mm/frame.c

    r77147d6 r5d2ab23  
    134134        }
    135135               
    136 
    137136        /* Allocate frames from zone buddy system */
    138137        tmp = buddy_system_alloc(zone->buddy_system, order);
     
    161160                *status = FRAME_OK;
    162161        }
    163        
    164162        return v;
    165163}
     
    180178        zone_t *zone = NULL;
    181179        frame_t *frame;
     180        int order;
     181       
    182182        ASSERT(addr % FRAME_SIZE == 0);
    183183       
     
    210210       
    211211        frame = ADDR2FRAME(zone, addr);
     212       
     213        /* remember frame order */
     214        order = frame->buddy_order;
    212215
    213216        ASSERT(frame->refcount);
     
    218221
    219222        /* Update zone information. */
    220         zone->free_count += (1 << frame->buddy_order);
    221         zone->busy_count -= (1 << frame->buddy_order);
     223        zone->free_count += (1 << order);
     224        zone->busy_count -= (1 << order);
    222225       
    223226        spinlock_unlock(&zone->lock);
     
    322325       
    323326                z->base = start;
     327                z->base_index = start / FRAME_SIZE;
     328               
    324329                z->flags = flags;
    325330
     
    349354                        buddy_system_free(z->buddy_system, &z->frames[i].buddy_link);   
    350355                }
     356               
    351357        }
    352358        return z;
     
    401407        frame = list_get_instance(block, frame_t, buddy_link);
    402408        zone = (zone_t *) b->data;
    403        
    404         ASSERT(IS_BUDDY_ORDER_OK(FRAME_INDEX(zone, frame), frame->buddy_order));
    405        
    406         is_left = IS_BUDDY_LEFT_BLOCK(zone, frame);
    407         is_right = IS_BUDDY_RIGHT_BLOCK(zone, frame);
     409        ASSERT(IS_BUDDY_ORDER_OK(FRAME_INDEX_ABS(zone, frame), frame->buddy_order));
     410       
     411       
     412        is_left = IS_BUDDY_LEFT_BLOCK_ABS(zone, frame);
     413        is_right = IS_BUDDY_RIGHT_BLOCK_ABS(zone, frame);
    408414       
    409415        ASSERT(is_left ^ is_right);
Note: See TracChangeset for help on using the changeset viewer.