Changeset 566ba81 in mainline for generic/src/mm/frame.c
- Timestamp:
- 2006-01-08T14:43:52Z (19 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 6d7ffa65
- Parents:
- 2fe2046c
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
generic/src/mm/frame.c
r2fe2046c r566ba81 491 491 link_t *cur; 492 492 index_t i = 0; 493 spinlock_lock(&zone_head_lock); 493 494 printf("No.\tBase address\tFree Frames\tBusy Frames\n"); 494 495 printf("---\t------------\t-----------\t-----------\n"); 495 496 for (cur = zone_head.next; cur != &zone_head; cur = cur->next) { 496 497 zone = list_get_instance(cur, zone_t, link); 498 spinlock_lock(&zone->lock); 497 499 printf("%d\t%L\t%d\t\t%d\n",i++,zone->base, zone->free_count, zone->busy_count); 498 500 } 501 spinlock_unlock(&zone_head_lock); 499 502 500 503 } … … 502 505 /** Prints zone details 503 506 * 504 * @param zone_index Zone order in zones list (0 is the first zone)505 */ 506 void zone_print_one( index_t zone_index) {507 zone_t *zone = NULL ;507 * @param base Zone base address 508 */ 509 void zone_print_one(__address base) { 510 zone_t *zone = NULL, *z ; 508 511 link_t *cur; 509 index_t i = 0; 512 513 514 spinlock_lock(&zone_head_lock); 515 510 516 511 517 for (cur = zone_head.next; cur != &zone_head; cur = cur->next) { 512 if (i == zone_index) { 513 zone = list_get_instance(cur, zone_t, link); 518 z = list_get_instance(cur, zone_t, link); 519 if (base == z->base) { 520 zone = z; 514 521 break; 515 522 } 516 i++;517 }523 } 524 518 525 519 526 if (!zone) { 520 printf("No zone with index %d\n", zone_index);527 printf("No zone with address %X\n", base); 521 528 return; 522 529 } 523 530 524 printf("Memory zone %d information\n\n", zone_index); 531 spinlock_lock(&zone->lock); 532 printf("Memory zone information\n\n"); 525 533 printf("Zone base address: %P\n", zone->base); 526 534 printf("Zone size: %d frames (%d kbytes)\n", zone->free_count + zone->busy_count, ((zone->free_count + zone->busy_count) * FRAME_SIZE) >> 10); 527 535 printf("Allocated space: %d frames (%d kbytes)\n", zone->busy_count, (zone->busy_count * FRAME_SIZE) >> 10); 528 536 printf("Available space: %d (%d kbytes)\n", zone->free_count, (zone->free_count * FRAME_SIZE) >> 10); 529 printf("Buddy allocator structures: not implemented\n"); 530 } 531 537 538 printf("\nBuddy allocator structures:\n\n"); 539 buddy_system_structure_print(zone->buddy_system); 540 541 542 spinlock_unlock(&zone->lock); 543 spinlock_unlock(&zone_head_lock); 544 545 } 546
Note:
See TracChangeset
for help on using the changeset viewer.