Changeset 61e6c39 in mainline
- Timestamp:
- 2005-12-05T17:56:23Z (19 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- eef75f6
- Parents:
- 4457455
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
arch/sparc64/src/mm/frame.c
r4457455 r61e6c39 30 30 #include <mm/frame.h> 31 31 #include <config.h> 32 #include <panic.h>33 32 34 33 void frame_arch_init(void) 35 34 { 36 zone_t *z; 37 38 z = zone_create(0, config.memory_size, 0); 39 if (!z) { 40 panic("Can't allocate zone (%dB).\n", config.memory_size); 41 } 42 zone_attach(z); 35 zone_create_in_region(0, config.memory_size & ~(FRAME_SIZE - 1)); 43 36 } -
generic/include/mm/frame.h
r4457455 r61e6c39 42 42 #define FRAME2ADDR(zone, frame) ((zone)->base + ((frame) - (zone)->frames) * FRAME_SIZE) 43 43 #define ADDR2FRAME(zone, addr) (&((zone)->frames[((addr) - (zone)->base) / FRAME_SIZE])) 44 #define FRAME_INDEX(zone, frame) (( count_t)((frame) - (zone)->frames))44 #define FRAME_INDEX(zone, frame) ((index_t)((frame) - (zone)->frames)) 45 45 #define FRAME_INDEX_VALID(zone, index) (((index) >= 0) && ((index) < ((zone)->free_count + (zone)->busy_count))) 46 #define IS_BUDDY_LEFT_BLOCK(zone, frame) ((FRAME_INDEX((zone), (frame)) % (1 << ((frame)->buddy_order + 1))) == 0) 47 #define IS_BUDDY_RIGHT_BLOCK(zone, frame) ((FRAME_INDEX((zone), (frame)) % (1 << ((frame)->buddy_order + 1))) == (1 << (frame)->buddy_order)) 46 #define IS_BUDDY_LEFT_BLOCK(zone, frame) ((FRAME_INDEX((zone), (frame)) & ~(((__native) -1)<<((frame)->buddy_order + 1))) == 0) 48 47 49 48 #define ZONE_BLACKLIST_SIZE 3 -
generic/src/mm/frame.c
r4457455 r61e6c39 389 389 390 390 is_left = IS_BUDDY_LEFT_BLOCK(zone, frame); 391 is_right = IS_BUDDY_RIGHT_BLOCK(zone, frame); 392 393 ASSERT((is_left || is_right) && (!is_left || !is_right)); 391 is_right = !is_left; 394 392 395 393 /*
Note:
See TracChangeset
for help on using the changeset viewer.