Rev 762 | Rev 786 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 762 | Rev 763 | ||
---|---|---|---|
Line 46... | Line 46... | ||
46 | 46 | ||
47 | #define FRAME_OK 0 /* frame_alloc return status */ |
47 | #define FRAME_OK 0 /* frame_alloc return status */ |
48 | #define FRAME_NO_MEMORY 1 /* frame_alloc return status */ |
48 | #define FRAME_NO_MEMORY 1 /* frame_alloc return status */ |
49 | #define FRAME_ERROR 2 /* frame_alloc return status */ |
49 | #define FRAME_ERROR 2 /* frame_alloc return status */ |
50 | 50 | ||
51 | #define FRAME2ADDR(zone, frame) ((zone)->base + ((frame) - (zone)->frames) * FRAME_SIZE) |
51 | #define FRAME2ADDR(zone, frame) ((zone)->base + (((frame) - (zone)->frames) << FRAME_WIDTH)) |
52 | #define ADDR2FRAME(zone, addr) (&((zone)->frames[((addr) - (zone)->base) / FRAME_SIZE])) |
52 | #define ADDR2FRAME(zone, addr) (&((zone)->frames[(((addr) - (zone)->base) >> FRAME_WIDTH)])) |
53 | #define FRAME_INDEX(zone, frame) ((index_t)((frame) - (zone)->frames)) |
53 | #define FRAME_INDEX(zone, frame) ((index_t)((frame) - (zone)->frames)) |
54 | #define FRAME_INDEX_ABS(zone, frame) (((index_t)((frame) - (zone)->frames)) + (zone)->base_index) |
54 | #define FRAME_INDEX_ABS(zone, frame) (((index_t)((frame) - (zone)->frames)) + (zone)->base_index) |
55 | #define FRAME_INDEX_VALID(zone, index) (((index) >= 0) && ((index) < ((zone)->free_count + (zone)->busy_count))) |
55 | #define FRAME_INDEX_VALID(zone, index) (((index) >= 0) && ((index) < ((zone)->free_count + (zone)->busy_count))) |
56 | #define IS_BUDDY_ORDER_OK(index, order) ((~(((__native) -1) << (order)) & (index)) == 0) |
56 | #define IS_BUDDY_ORDER_OK(index, order) ((~(((__native) -1) << (order)) & (index)) == 0) |
57 | #define IS_BUDDY_LEFT_BLOCK(zone, frame) (((FRAME_INDEX((zone), (frame)) >> (frame)->buddy_order) & 0x1) == 0) |
57 | #define IS_BUDDY_LEFT_BLOCK(zone, frame) (((FRAME_INDEX((zone), (frame)) >> (frame)->buddy_order) & 0x1) == 0) |