Changeset 5c3243e in mainline
- Timestamp:
- 2006-02-08T14:01:58Z (19 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 4c8715d2
- Parents:
- 5e3757d
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
arch/ia64/src/mm/frame.c
r5e3757d r5c3243e 43 43 zone_create(0, config.memory_size >> FRAME_WIDTH, 1, 0); 44 44 45 46 45 /* 47 46 * Workaround to prevent slab allocator from allocating frame 0. -
generic/include/mm/frame.h
r5e3757d r5c3243e 42 42 #define ZONES_MAX 16 /**< Maximum number of zones in system */ 43 43 44 #define ZONE_JOIN 0x1 /**< If possible, merge with neighberhood zones */ 45 44 #define ZONE_JOIN 0x1 /**< If possible, merge with neighberhood zones */ 46 45 47 46 #define FRAME_KA 0x1 /* skip frames conflicting with user address space */ 48 47 #define FRAME_PANIC 0x2 /* panic on failure */ 49 48 #define FRAME_ATOMIC 0x4 /* do not panic and do not sleep on failure */ 50 #define FRAME_NO_RECLAIM 0x8 /* Do not start reclaiming when no free memory */49 #define FRAME_NO_RECLAIM 0x8 /* do not start reclaiming when no free memory */ 51 50 52 51 #define FRAME_OK 0 /* frame_alloc return status */ … … 68 67 static inline __address PFN2ADDR(pfn_t frame) 69 68 { 70 return (__address)(frame << PAGE_WIDTH);69 return (__address)(frame << FRAME_WIDTH); 71 70 } 72 71 73 72 static inline pfn_t ADDR2PFN(__address addr) 74 73 { 75 return (pfn_t)(addr >> PAGE_WIDTH);74 return (pfn_t)(addr >> FRAME_WIDTH); 76 75 } 77 76 … … 80 79 if (!size) 81 80 return 0; 82 return (pfn_t)((size-1) >> PAGE_WIDTH)+1;81 return (pfn_t)((size-1) >> FRAME_WIDTH)+1; 83 82 } 84 83 … … 88 87 #define IS_BUDDY_LEFT_BLOCK_ABS(zone, frame) (((frame_index_abs((zone), (frame)) >> (frame)->buddy_order) & 0x1) == 0) 89 88 #define IS_BUDDY_RIGHT_BLOCK_ABS(zone, frame) (((frame_index_abs((zone), (frame)) >> (frame)->buddy_order) & 0x1) == 1) 90 91 89 92 90 #define frame_alloc(order, flags) frame_alloc_generic(order, flags, NULL, NULL) -
test/mm/mapping1/test.c
r5e3757d r5c3243e 48 48 printf("Memory management test mapping #1\n"); 49 49 50 frame0 = frame_alloc(ONE_FRAME, FRAME_KA);51 frame1 = frame_alloc(ONE_FRAME, FRAME_KA);50 frame0 = PA2KA(PFN2ADDR(frame_alloc(ONE_FRAME, FRAME_KA))); 51 frame1 = PA2KA(PFN2ADDR(frame_alloc(ONE_FRAME, FRAME_KA))); 52 52 53 53 printf("Writing %L to physical address %P.\n", VALUE0, KA2PA(frame0));
Note:
See TracChangeset
for help on using the changeset viewer.