Changeset 7f1c620 in mainline for generic/src/mm/frame.c
- Timestamp:
- 2006-07-04T17:17:56Z (19 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 0ffa3ef5
- Parents:
- 991779c5
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
generic/src/mm/frame.c
r991779c5 r7f1c620 70 70 typedef struct { 71 71 count_t refcount; /**< tracking of shared frames */ 72 __u8buddy_order; /**< buddy system block order */72 uint8_t buddy_order; /**< buddy system block order */ 73 73 link_t buddy_link; /**< link to the next free block inside one order */ 74 74 void *parent; /**< If allocated by slab, this points there */ … … 218 218 219 219 /** @return True if zone can allocate specified order */ 220 static int zone_can_alloc(zone_t *z, __u8order)220 static int zone_can_alloc(zone_t *z, uint8_t order) 221 221 { 222 222 return buddy_system_can_alloc(z->buddy_system, order); … … 231 231 * @param pzone Pointer to preferred zone or NULL, on return contains zone number 232 232 */ 233 static zone_t * find_free_zone_lock( __u8order, int *pzone)233 static zone_t * find_free_zone_lock(uint8_t order, int *pzone) 234 234 { 235 235 int i; … … 272 272 */ 273 273 static link_t *zone_buddy_find_block(buddy_system_t *b, link_t *child, 274 __u8order)274 uint8_t order) 275 275 { 276 276 frame_t * frame; … … 381 381 * @param order Order to set 382 382 */ 383 static void zone_buddy_set_order(buddy_system_t *b, link_t * block, __u8order) {383 static void zone_buddy_set_order(buddy_system_t *b, link_t * block, uint8_t order) { 384 384 frame_t * frame; 385 385 frame = list_get_instance(block, frame_t, buddy_link); … … 394 394 * @return Order of block 395 395 */ 396 static __u8zone_buddy_get_order(buddy_system_t *b, link_t * block) {396 static uint8_t zone_buddy_get_order(buddy_system_t *b, link_t * block) { 397 397 frame_t * frame; 398 398 frame = list_get_instance(block, frame_t, buddy_link); … … 451 451 * 452 452 */ 453 static pfn_t zone_frame_alloc(zone_t *zone, __u8order)453 static pfn_t zone_frame_alloc(zone_t *zone, uint8_t order) 454 454 { 455 455 pfn_t v; … … 484 484 { 485 485 frame_t *frame; 486 __u8order;486 uint8_t order; 487 487 488 488 frame = &zone->frames[frame_idx]; … … 538 538 static void _zone_merge(zone_t *z, zone_t *z1, zone_t *z2) 539 539 { 540 __u8max_order;540 uint8_t max_order; 541 541 int i, z2idx; 542 542 pfn_t frame_idx; … … 625 625 int i; 626 626 627 pfn = ADDR2PFN(( __address)KA2PA(oldzone));627 pfn = ADDR2PFN((uintptr_t)KA2PA(oldzone)); 628 628 cframes = SIZE2FRAMES(zone_conf_size(oldzone->count)); 629 629 … … 654 654 { 655 655 count_t i; 656 __u8order;656 uint8_t order; 657 657 frame_t *frame; 658 658 … … 690 690 zone_t *zone1, *zone2, *newzone; 691 691 int cframes; 692 __u8order;692 uint8_t order; 693 693 int i; 694 694 pfn_t pfn; … … 780 780 { 781 781 int i; 782 __u8max_order;782 uint8_t max_order; 783 783 784 784 spinlock_initialize(&z->lock, "zone_lock"); … … 818 818 * @return Size of zone configuration info (in bytes) 819 819 */ 820 __addresszone_conf_size(count_t count)820 uintptr_t zone_conf_size(count_t count) 821 821 { 822 822 int size = sizeof(zone_t) + count*sizeof(frame_t); … … 846 846 { 847 847 zone_t *z; 848 __addressaddr;848 uintptr_t addr; 849 849 count_t confcount; 850 850 int i; … … 932 932 * 933 933 */ 934 void * frame_alloc_generic( __u8order, int flags, int *pzone)934 void * frame_alloc_generic(uint8_t order, int flags, int *pzone) 935 935 { 936 936 ipl_t ipl; … … 991 991 * @param Frame Physical Address of of the frame to be freed. 992 992 */ 993 void frame_free( __addressframe)993 void frame_free(uintptr_t frame) 994 994 { 995 995 ipl_t ipl; … … 1100 1100 zone = zones.info[i]; 1101 1101 spinlock_lock(&zone->lock); 1102 printf("%d: %.*p \t%10zd\t%10zd\n", i, sizeof( __address) * 2, PFN2ADDR(zone->base), zone->free_count, zone->busy_count);1102 printf("%d: %.*p \t%10zd\t%10zd\n", i, sizeof(uintptr_t) * 2, PFN2ADDR(zone->base), zone->free_count, zone->busy_count); 1103 1103 spinlock_unlock(&zone->lock); 1104 1104 } … … 1132 1132 spinlock_lock(&zone->lock); 1133 1133 printf("Memory zone information\n"); 1134 printf("Zone base address: %#.*p\n", sizeof( __address) * 2, PFN2ADDR(zone->base));1134 printf("Zone base address: %#.*p\n", sizeof(uintptr_t) * 2, PFN2ADDR(zone->base)); 1135 1135 printf("Zone size: %zd frames (%zdK)\n", zone->count, ((zone->count) * FRAME_SIZE) >> 10); 1136 1136 printf("Allocated space: %zd frames (%zdK)\n", zone->busy_count, (zone->busy_count * FRAME_SIZE) >> 10);
Note:
See TracChangeset
for help on using the changeset viewer.