Rev 683 | Rev 689 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 683 | Rev 686 | ||
---|---|---|---|
Line 487... | Line 487... | ||
487 | * |
487 | * |
488 | */ |
488 | */ |
489 | void zone_print_list(void) { |
489 | void zone_print_list(void) { |
490 | zone_t *zone = NULL; |
490 | zone_t *zone = NULL; |
491 | link_t *cur; |
491 | link_t *cur; |
492 | index_t i = 0; |
- | |
493 | spinlock_lock(&zone_head_lock); |
492 | spinlock_lock(&zone_head_lock); |
494 | printf("No.\tBase address\tFree Frames\tBusy Frames\n"); |
493 | printf("Base address\tFree Frames\tBusy Frames\n"); |
495 | printf("---\t------------\t-----------\t-----------\n"); |
494 | printf("------------\t-----------\t-----------\n"); |
496 | for (cur = zone_head.next; cur != &zone_head; cur = cur->next) { |
495 | for (cur = zone_head.next; cur != &zone_head; cur = cur->next) { |
497 | zone = list_get_instance(cur, zone_t, link); |
496 | zone = list_get_instance(cur, zone_t, link); |
498 | spinlock_lock(&zone->lock); |
497 | spinlock_lock(&zone->lock); |
499 | printf("%d\t%L\t%d\t\t%d\n",i++,zone->base, zone->free_count, zone->busy_count); |
498 | printf("%L\t%d\t\t%d\n",zone->base, zone->free_count, zone->busy_count); |
500 | } |
499 | } |
501 | spinlock_unlock(&zone_head_lock); |
500 | spinlock_unlock(&zone_head_lock); |
502 | 501 | ||
503 | } |
502 | } |
504 | 503 | ||
Line 534... | Line 533... | ||
534 | printf("Zone size: %d frames (%d kbytes)\n", zone->free_count + zone->busy_count, ((zone->free_count + zone->busy_count) * FRAME_SIZE) >> 10); |
533 | printf("Zone size: %d frames (%d kbytes)\n", zone->free_count + zone->busy_count, ((zone->free_count + zone->busy_count) * FRAME_SIZE) >> 10); |
535 | printf("Allocated space: %d frames (%d kbytes)\n", zone->busy_count, (zone->busy_count * FRAME_SIZE) >> 10); |
534 | printf("Allocated space: %d frames (%d kbytes)\n", zone->busy_count, (zone->busy_count * FRAME_SIZE) >> 10); |
536 | printf("Available space: %d (%d kbytes)\n", zone->free_count, (zone->free_count * FRAME_SIZE) >> 10); |
535 | printf("Available space: %d (%d kbytes)\n", zone->free_count, (zone->free_count * FRAME_SIZE) >> 10); |
537 | 536 | ||
538 | printf("\nBuddy allocator structures:\n\n"); |
537 | printf("\nBuddy allocator structures:\n\n"); |
539 | buddy_system_structure_print(zone->buddy_system); |
538 | buddy_system_structure_print(zone->buddy_system, FRAME_SIZE); |
540 | - | ||
541 | 539 | ||
542 | spinlock_unlock(&zone->lock); |
540 | spinlock_unlock(&zone->lock); |
543 | spinlock_unlock(&zone_head_lock); |
541 | spinlock_unlock(&zone_head_lock); |
544 | 542 | ||
545 | } |
543 | } |