Changeset dfd9186 in mainline
- Timestamp:
- 2006-01-04T18:35:07Z (19 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 96cacc1
- Parents:
- 5fe5f1e
- Location:
- generic
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
generic/include/mm/frame.h
r5fe5f1e rdfd9186 109 109 extern void frame_release(frame_t *frame); 110 110 111 112 /* 113 * Console functions 114 */ 115 extern void zone_print_list(void); 116 extern void zone_print_one(index_t index); 117 111 118 #endif -
generic/src/console/cmd.c
r5fe5f1e rdfd9186 255 255 /** Data and methods for 'zone' command */ 256 256 static int cmd_zone(cmd_arg_t *argv); 257 static char zone_buf[MAX_CMDLINE+1];257 //static char zone_buf[sizeof(__native)]; 258 258 static cmd_arg_t zone_argv = { 259 259 .type = ARG_TYPE_INT, 260 .buffer = zone_buf,261 .len = sizeof( zone_buf)260 //.buffer = zone_buf, 261 .len = sizeof(__native) 262 262 }; 263 263 … … 608 608 609 609 int cmd_zones(cmd_arg_t * argv) { 610 printf("Zones listing not implemented\n");610 zone_print_list(); 611 611 return 1; 612 612 } 613 613 614 614 int cmd_zone(cmd_arg_t * argv) { 615 printf("Zone details not implemented\n");615 zone_print_one(argv[0].intval); 616 616 return 1; 617 617 } -
generic/src/mm/frame.c
r5fe5f1e rdfd9186 483 483 frame->refcount = 1; 484 484 } 485 486 487 void zone_print_list(void) { 488 zone_t *zone = NULL; 489 link_t *cur; 490 index_t i = 0; 491 printf("No.\tBase address\tFree Frames\tBusy Frames\n"); 492 printf("---\t------------\t-----------\t-----------\n"); 493 for (cur = zone_head.next; cur != &zone_head; cur = cur->next) { 494 zone = list_get_instance(cur, zone_t, link); 495 printf("%d\t%L\t%d\t\t%d\n",i++,zone->base, zone->free_count, zone->busy_count); 496 } 497 498 } 499 500 void zone_print_one(index_t zone_index) { 501 zone_t *zone = NULL; 502 link_t *cur; 503 index_t i = 0; 504 505 for (cur = zone_head.next; cur != &zone_head; cur = cur->next) { 506 if (i == zone_index) { 507 zone = list_get_instance(cur, zone_t, link); 508 break; 509 } 510 i++; 511 } 512 513 if (!zone) { 514 printf("No zone with index %d\n", zone_index); 515 return; 516 } 517 518 printf("Memory zone %d information\n\n", zone_index); 519 printf("Zone base address: %P\n", zone->base); 520 printf("Zone size: %d frames (%d kbytes)\n", zone->free_count + zone->busy_count, ((zone->free_count + zone->busy_count) * FRAME_SIZE) >> 10); 521 printf("Allocated space: %d frames (%d kbytes)\n", zone->busy_count, (zone->busy_count * FRAME_SIZE) >> 10); 522 printf("Available space: %d (%d kbytes)\n", zone->free_count, (zone->free_count * FRAME_SIZE) >> 10); 523 printf("Buddy allocator structures: not implemented\n"); 524 } 525
Note:
See TracChangeset
for help on using the changeset viewer.