Subversion Repositories HelenOS-historic

Rev

Rev 629 | Rev 677 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 629 Rev 676
Line 480... Line 480...
480
void zone_buddy_mark_busy(buddy_system_t *b, link_t * block) {
480
void zone_buddy_mark_busy(buddy_system_t *b, link_t * block) {
481
    frame_t * frame;
481
    frame_t * frame;
482
    frame = list_get_instance(block, frame_t, buddy_link);
482
    frame = list_get_instance(block, frame_t, buddy_link);
483
    frame->refcount = 1;
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