Changeset 2b8b0ca in mainline for kernel/generic/src/mm/frame.c


Ignore:
Timestamp:
2008-06-03T14:46:49Z (16 years ago)
Author:
Martin Decky <martin@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
93a3348
Parents:
0f269c2
Message:

proper printf formatting

File:
1 edited

Legend:

Unmodified
Added
Removed
  • kernel/generic/src/mm/frame.c

    r0f269c2 r2b8b0ca  
    319319        zone = (zone_t *) b->data;
    320320        index = frame_index(zone, frame);
    321         printf("%zd", index);
     321        printf("%" PRIi, index);
    322322}                                   
    323323
     
    845845uintptr_t zone_conf_size(count_t count)
    846846{
    847         int size = sizeof(zone_t) + count*sizeof(frame_t);
     847        int size = sizeof(zone_t) + count * sizeof(frame_t);
    848848        int max_order;
    849849
     
    11601160        ipl = interrupts_disable();
    11611161        spinlock_lock(&zones.lock);
    1162        
    1163         if (sizeof(void *) == 4) {
    1164                 printf("#  base address free frames  busy frames\n");
    1165                 printf("-- ------------ ------------ ------------\n");
    1166         } else {
    1167                 printf("#  base address         free frames  busy frames\n");
    1168                 printf("-- -------------------- ------------ ------------\n");
    1169         }
     1162
     1163#ifdef __32_BITS__     
     1164        printf("#  base address free frames  busy frames\n");
     1165        printf("-- ------------ ------------ ------------\n");
     1166#endif
     1167
     1168#ifdef __64_BITS__
     1169        printf("#  base address         free frames  busy frames\n");
     1170        printf("-- -------------------- ------------ ------------\n");
     1171#endif
    11701172       
    11711173        for (i = 0; i < zones.count; i++) {
    11721174                zone = zones.info[i];
    11731175                spinlock_lock(&zone->lock);
    1174                
    1175                 if (sizeof(void *) == 4)
    1176                         printf("%-2d   %#10zx %12zd %12zd\n", i, PFN2ADDR(zone->base),
    1177                             zone->free_count, zone->busy_count);
    1178                 else
    1179                         printf("%-2d   %#18zx %12zd %12zd\n", i, PFN2ADDR(zone->base),
    1180                             zone->free_count, zone->busy_count);
     1176
     1177#ifdef __32_BITS__
     1178                printf("%-2u   %10p %12" PRIc " %12" PRIc "\n", i, PFN2ADDR(zone->base),
     1179                    zone->free_count, zone->busy_count);
     1180#endif
     1181
     1182#ifdef __64_BITS__
     1183                printf("%-2u   %18p %12" PRIc " %12" PRIc "\n", i, PFN2ADDR(zone->base),
     1184                    zone->free_count, zone->busy_count);
     1185#endif
    11811186               
    11821187                spinlock_unlock(&zone->lock);
     
    12121217        spinlock_lock(&zone->lock);
    12131218        printf("Memory zone information\n");
    1214         printf("Zone base address: %#.*p\n", sizeof(uintptr_t) * 2,
    1215             PFN2ADDR(zone->base));
    1216         printf("Zone size: %zd frames (%zd KB)\n", zone->count,
     1219        printf("Zone base address: %p\n", PFN2ADDR(zone->base));
     1220        printf("Zone size: %" PRIc " frames (%" PRIs " KB)\n", zone->count,
    12171221                SIZE2KB(FRAMES2SIZE(zone->count)));
    1218         printf("Allocated space: %zd frames (%zd KB)\n", zone->busy_count,
     1222        printf("Allocated space: %" PRIc " frames (%" PRIs " KB)\n", zone->busy_count,
    12191223                SIZE2KB(FRAMES2SIZE(zone->busy_count)));
    1220         printf("Available space: %zd frames (%zd KB)\n", zone->free_count,
     1224        printf("Available space: %" PRIc " frames (%" PRIs " KB)\n", zone->free_count,
    12211225                SIZE2KB(FRAMES2SIZE(zone->free_count)));
    12221226        buddy_system_structure_print(zone->buddy_system, FRAME_SIZE);
Note: See TracChangeset for help on using the changeset viewer.