Changeset 263104b in mainline
- Timestamp:
- 2006-01-10T22:43:40Z (19 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 0369911
- Parents:
- e30bc2a
- Location:
- generic/src/mm
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
generic/src/mm/buddy.c
re30bc2a r263104b 232 232 } 233 233 234 235 236 234 /** Prints out structure of buddy system 237 235 * … … 251 249 cnt = 0; 252 250 if (!list_empty(&b->order[i])) { 253 for (cur = b->order[i].next; cur != &b->order[i]; cur = cur->next) cnt++; 254 } 255 256 printf("#%d\t%d\t%d kb\t\t%d kb\t\t%d\n", i, cnt, (cnt * (1 << i) * elem_size) >> 10, ((1 << i) * elem_size) >> 10, 1 << i); 251 for (cur = b->order[i].next; cur != &b->order[i]; cur = cur->next) 252 cnt++; 253 } 254 255 printf("#%d\t%d\t%dK\t\t%dK\t\t%d\n", i, cnt, (cnt * (1 << i) * elem_size) >> 10, ((1 << i) * elem_size) >> 10, 1 << i); 257 256 258 257 block_count += cnt; … … 260 259 } 261 260 printf("-----\t------\t--------\t----------\t---------------\n"); 262 printf("Buddy system contains %d elements (%d blocks)\n" , elem_count, block_count);263 264 } 261 printf("Buddy system contains %d free elements (%d blocks)\n" , elem_count, block_count); 262 263 } -
generic/src/mm/frame.c
re30bc2a r263104b 118 118 panic("Can't allocate frame.\n"); 119 119 120 121 122 120 /* 123 121 * TODO: Sleep until frames are available again. … … 155 153 spinlock_unlock(&zone_head_lock); 156 154 interrupts_restore(ipl); 157 158 155 159 156 if (flags & FRAME_KA) … … 206 203 break; 207 204 } 205 208 206 spinlock_unlock(&z->lock); 209 207 } … … 503 501 zone_t *zone = NULL; 504 502 link_t *cur; 503 ipl_t ipl; 504 505 ipl = interrupts_disable(); 505 506 spinlock_lock(&zone_head_lock); 506 507 printf("Base address\tFree Frames\tBusy Frames\n"); … … 510 511 spinlock_lock(&zone->lock); 511 512 printf("%L\t%d\t\t%d\n",zone->base, zone->free_count, zone->busy_count); 513 spinlock_unlock(&zone->lock); 512 514 } 513 515 spinlock_unlock(&zone_head_lock); 514 516 interrupts_restore(ipl); 515 517 } 516 518 … … 522 524 zone_t *zone = NULL, *z ; 523 525 link_t *cur; 524 525 526 ipl_t ipl; 527 528 ipl = interrupts_disable(); 526 529 spinlock_lock(&zone_head_lock); 527 528 530 529 531 for (cur = zone_head.next; cur != &zone_head; cur = cur->next) { … … 535 537 } 536 538 537 538 539 if (!zone) { 540 spinlock_unlock(&zone_head_lock); 541 interrupts_restore(ipl); 539 542 printf("No zone with address %X\n", base); 540 543 return; … … 544 547 printf("Memory zone information\n\n"); 545 548 printf("Zone base address: %P\n", zone->base); 546 printf("Zone size: %d frames (%d kbytes)\n", zone->free_count + zone->busy_count, ((zone->free_count + zone->busy_count) * FRAME_SIZE) >> 10);547 printf("Allocated space: %d frames (%d kbytes)\n", zone->busy_count, (zone->busy_count * FRAME_SIZE) >> 10);548 printf("Available space: %d (%d kbytes)\n", zone->free_count, (zone->free_count * FRAME_SIZE) >> 10);549 printf("Zone size: %d frames (%dK)\n", zone->free_count + zone->busy_count, ((zone->free_count + zone->busy_count) * FRAME_SIZE) >> 10); 550 printf("Allocated space: %d frames (%dK)\n", zone->busy_count, (zone->busy_count * FRAME_SIZE) >> 10); 551 printf("Available space: %d (%dK)\n", zone->free_count, (zone->free_count * FRAME_SIZE) >> 10); 549 552 550 553 printf("\nBuddy allocator structures:\n\n"); … … 553 556 spinlock_unlock(&zone->lock); 554 557 spinlock_unlock(&zone_head_lock); 555 556 } 557 558 interrupts_restore(ipl); 559 } 560
Note:
See TracChangeset
for help on using the changeset viewer.