Rev 1093 | Rev 1221 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 1093 | Rev 1196 | ||
---|---|---|---|
Line 278... | Line 278... | ||
278 | index_t index; |
278 | index_t index; |
279 | 279 | ||
280 | frame = list_get_instance(block, frame_t, buddy_link); |
280 | frame = list_get_instance(block, frame_t, buddy_link); |
281 | zone = (zone_t *) b->data; |
281 | zone = (zone_t *) b->data; |
282 | index = frame_index(zone, frame); |
282 | index = frame_index(zone, frame); |
283 | printf("%d", index); |
283 | printf("%zd", index); |
284 | } |
284 | } |
285 | 285 | ||
286 | /** Buddy system find_buddy implementation |
286 | /** Buddy system find_buddy implementation |
287 | * |
287 | * |
288 | * @param b Buddy system. |
288 | * @param b Buddy system. |
Line 1026... | Line 1026... | ||
1026 | printf("# Base address\tFree Frames\tBusy Frames\n"); |
1026 | printf("# Base address\tFree Frames\tBusy Frames\n"); |
1027 | printf(" ------------\t-----------\t-----------\n"); |
1027 | printf(" ------------\t-----------\t-----------\n"); |
1028 | for (i = 0; i < zones.count; i++) { |
1028 | for (i = 0; i < zones.count; i++) { |
1029 | zone = zones.info[i]; |
1029 | zone = zones.info[i]; |
1030 | spinlock_lock(&zone->lock); |
1030 | spinlock_lock(&zone->lock); |
1031 | printf("%d: %L\t%d\t\t%d\n",i,PFN2ADDR(zone->base), |
1031 | printf("%d: %#X \t%zd\t\t%zd\n",i,PFN2ADDR(zone->base), |
1032 | zone->free_count, zone->busy_count); |
1032 | zone->free_count, zone->busy_count); |
1033 | spinlock_unlock(&zone->lock); |
1033 | spinlock_unlock(&zone->lock); |
1034 | } |
1034 | } |
1035 | spinlock_unlock(&zones.lock); |
1035 | spinlock_unlock(&zones.lock); |
1036 | interrupts_restore(ipl); |
1036 | interrupts_restore(ipl); |
Line 1059... | Line 1059... | ||
1059 | goto out; |
1059 | goto out; |
1060 | } |
1060 | } |
1061 | 1061 | ||
1062 | spinlock_lock(&zone->lock); |
1062 | spinlock_lock(&zone->lock); |
1063 | printf("Memory zone information\n"); |
1063 | printf("Memory zone information\n"); |
1064 | printf("Zone base address: %P\n", PFN2ADDR(zone->base)); |
1064 | printf("Zone base address: %#zX\n", PFN2ADDR(zone->base)); |
1065 | printf("Zone size: %d frames (%dK)\n", zone->count, ((zone->count) * FRAME_SIZE) >> 10); |
1065 | printf("Zone size: %zd frames (%zdK)\n", zone->count, ((zone->count) * FRAME_SIZE) >> 10); |
1066 | printf("Allocated space: %d frames (%dK)\n", zone->busy_count, (zone->busy_count * FRAME_SIZE) >> 10); |
1066 | printf("Allocated space: %zd frames (%zdK)\n", zone->busy_count, (zone->busy_count * FRAME_SIZE) >> 10); |
1067 | printf("Available space: %d (%dK)\n", zone->free_count, (zone->free_count * FRAME_SIZE) >> 10); |
1067 | printf("Available space: %zd (%zdK)\n", zone->free_count, (zone->free_count * FRAME_SIZE) >> 10); |
1068 | buddy_system_structure_print(zone->buddy_system, FRAME_SIZE); |
1068 | buddy_system_structure_print(zone->buddy_system, FRAME_SIZE); |
1069 | 1069 | ||
1070 | spinlock_unlock(&zone->lock); |
1070 | spinlock_unlock(&zone->lock); |
1071 | out: |
1071 | out: |
1072 | spinlock_unlock(&zones.lock); |
1072 | spinlock_unlock(&zones.lock); |