Changeset 2ec725f in mainline for kernel/generic/src/mm/frame.c
- Timestamp:
- 2008-07-06T18:20:02Z (17 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 5f7a0ef
- Parents:
- 000350f8
- File:
-
- 1 edited
-
kernel/generic/src/mm/frame.c (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
kernel/generic/src/mm/frame.c
r000350f8 r2ec725f 319 319 } 320 320 321 static void zone_buddy_print_id(buddy_system_t *b, link_t *block)322 {323 frame_t *frame;324 zone_t *zone;325 index_t index;326 327 frame = list_get_instance(block, frame_t, buddy_link);328 zone = (zone_t *) b->data;329 index = frame_index(zone, frame);330 printf("%" PRIi, index);331 }332 333 321 /** Buddy system find_buddy implementation. 334 322 * … … 470 458 .mark_busy = zone_buddy_mark_busy, 471 459 .mark_available = zone_buddy_mark_available, 472 .find_block = zone_buddy_find_block, 473 .print_id = zone_buddy_print_id 460 .find_block = zone_buddy_find_block 474 461 }; 475 462 … … 1284 1271 ipl_t ipl; 1285 1272 unsigned int i; 1273 uintptr_t base; 1274 count_t count; 1275 count_t busy_count; 1276 count_t free_count; 1286 1277 1287 1278 ipl = interrupts_disable(); … … 1295 1286 } 1296 1287 if (!zone) { 1288 spinlock_unlock(&zones.lock); 1289 interrupts_restore(ipl); 1297 1290 printf("Zone not found.\n"); 1298 goto out;1291 return; 1299 1292 } 1300 1293 1301 1294 spinlock_lock(&zone->lock); 1302 printf("Memory zone information\n"); 1303 printf("Zone base address: %p\n", PFN2ADDR(zone->base)); 1304 printf("Zone size: %" PRIc " frames (%" PRIs " KB)\n", zone->count, 1305 SIZE2KB(FRAMES2SIZE(zone->count))); 1306 printf("Allocated space: %" PRIc " frames (%" PRIs " KB)\n", 1307 zone->busy_count, SIZE2KB(FRAMES2SIZE(zone->busy_count))); 1308 printf("Available space: %" PRIc " frames (%" PRIs " KB)\n", 1309 zone->free_count, SIZE2KB(FRAMES2SIZE(zone->free_count))); 1310 buddy_system_structure_print(zone->buddy_system, FRAME_SIZE); 1295 base = PFN2ADDR(zone->base); 1296 count = zone->count; 1297 busy_count = zone->busy_count; 1298 free_count = zone->free_count; 1311 1299 spinlock_unlock(&zone->lock); 1312 1313 out:1314 1300 spinlock_unlock(&zones.lock); 1315 1301 interrupts_restore(ipl); 1302 1303 printf("Zone base address: %p\n", base); 1304 printf("Zone size: %" PRIc " frames (%" PRIs " KiB)\n", count, 1305 SIZE2KB(FRAMES2SIZE(count))); 1306 printf("Allocated space: %" PRIc " frames (%" PRIs " KiB)\n", 1307 busy_count, SIZE2KB(FRAMES2SIZE(busy_count))); 1308 printf("Available space: %" PRIc " frames (%" PRIs " KiB)\n", 1309 free_count, SIZE2KB(FRAMES2SIZE(free_count))); 1316 1310 } 1317 1311
Note:
See TracChangeset
for help on using the changeset viewer.
