Changeset 43b1e86 in mainline


Ignore:
Timestamp:
2008-02-01T14:11:18Z (16 years ago)
Author:
Martin Decky <martin@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
9652bd59
Parents:
acfdcb0
Message:

prettyprint output

Location:
kernel
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • kernel/arch/amd64/src/debugger.c

    racfdcb0 r43b1e86  
    105105int cmd_print_breakpoints(cmd_arg_t *argv __attribute__((unused)))
    106106{
    107         int i;
     107        unsigned int i;
    108108        char *symbol;
    109 
    110         printf("Breakpoint table.\n");
    111         for (i=0; i < BKPOINTS_MAX; i++)
     109       
     110        if (sizeof(void *) == 4) {
     111                printf("#  Count Address    In symbol\n");
     112                printf("-- ----- ---------- ---------\n");
     113        } else {
     114                printf("#  Count Address            In symbol\n");
     115                printf("-- ----- ------------------ ---------\n");
     116        }
     117       
     118        for (i = 0; i < BKPOINTS_MAX; i++)
    112119                if (breakpoints[i].address) {
    113120                        symbol = get_symtab_entry(breakpoints[i].address);
    114                         printf("%d. %lx in %s\n", i,
    115                                breakpoints[i].address, symbol);
    116                         printf("     Count(%d) ", breakpoints[i].counter);
    117                         printf("\n");
     121                       
     122                        if (sizeof(void *) == 4)
     123                                printf("%-2u %-5d %#10zx %s\n", i, breakpoints[i].counter,
     124                                        breakpoints[i].address, symbol);
     125                        else
     126                                printf("%-2u %-5d %#18zx %s\n", i, breakpoints[i].counter,
     127                                        breakpoints[i].address, symbol);
    118128                }
    119129        return 1;
  • kernel/arch/ia32/src/mm/frame.c

    racfdcb0 r43b1e86  
    9797static int cmd_e820mem(cmd_arg_t *argv)
    9898{
    99         int i;
     99        unsigned int i;
    100100        char *name;
    101 
     101       
     102        printf("Base               Size               Name\n");
     103        printf("------------------ ------------------ ---------\n");
     104               
    102105        for (i = 0; i < e820counter; i++) {
    103106                if (e820table[i].type <= MEMMAP_MEMORY_UNUSABLE)
     
    105108                else
    106109                        name = "invalid";
    107                 printf("%.*p %#.16llXB %s\n", sizeof(unative_t) * 2,
    108                     (unative_t) e820table[i].base_address,
    109                     (uint64_t) e820table[i].size, name);
     110               
     111                printf("%#18llx %#18llx %s\n", e820table[i].base_address,
     112                        e820table[i].size, name);
    110113        }                       
    111114        return 0;
  • kernel/generic/include/macros.h

    racfdcb0 r43b1e86  
    6363        return (s1 < e2) && (s2 < e1);
    6464}
     65
    6566/* Compute overlapping of physical addresses */
    6667#define PA_overlaps(x, szx, y, szy)     overlaps(KA2PA(x), szx, KA2PA(y), szy)
  • kernel/generic/src/interrupt/interrupt.c

    racfdcb0 r43b1e86  
    104104static int exc_print_cmd(cmd_arg_t *argv)
    105105{
    106         int i;
     106        unsigned int i;
    107107        char *symbol;
    108108
    109109        spinlock_lock(&exctbl_lock);
    110         printf("Exc Description Handler\n");
    111         for (i=0; i < IVT_ITEMS; i++) {
    112                 symbol = get_symtab_entry((unative_t)exc_table[i].f);
     110       
     111        if (sizeof(void *) == 4) {
     112                printf("Exc Description  Handler    Symbol\n");
     113                printf("--- ------------ ---------- --------\n");
     114        } else {
     115                printf("Exc Description  Handler            Symbol\n");
     116                printf("--- ------------ ------------------ --------\n");
     117        }
     118       
     119        for (i = 0; i < IVT_ITEMS; i++) {
     120                symbol = get_symtab_entry((unative_t) exc_table[i].f);
    113121                if (!symbol)
    114122                        symbol = "not found";
    115                 printf("%d %s %.*p(%s)\n", i + IVT_FIRST, exc_table[i].name,
    116                        sizeof(uintptr_t) * 2, exc_table[i].f,symbol);           
    117                 if (!((i+1) % 20)) {
    118                         printf("Press any key to continue.");
     123               
     124                if (sizeof(void *) == 4)
     125                        printf("%-3u %-12s %#10zx %s\n", i + IVT_FIRST, exc_table[i].name,
     126                                exc_table[i].f, symbol);
     127                else
     128                        printf("%-3u %-12s %#18zx %s\n", i + IVT_FIRST, exc_table[i].name,
     129                                exc_table[i].f, symbol);
     130               
     131                if (((i + 1) % 20) == 0) {
     132                        printf(" -- Press any key to continue -- ");
    119133                        spinlock_unlock(&exctbl_lock);
    120134                        getc(stdin);
     
    123137                }
    124138        }
     139       
    125140        spinlock_unlock(&exctbl_lock);
    126141       
  • kernel/generic/src/mm/frame.c

    racfdcb0 r43b1e86  
    11211121        ipl = interrupts_disable();
    11221122        spinlock_lock(&zones.lock);
    1123         printf("#  base address free frames  busy frames\n");
    1124         printf("-- ------------ ------------ ------------\n");
     1123       
     1124        if (sizeof(void *) == 4) {
     1125                printf("#  base address free frames  busy frames\n");
     1126                printf("-- ------------ ------------ ------------\n");
     1127        } else {
     1128                printf("#  base address         free frames  busy frames\n");
     1129                printf("-- -------------------- ------------ ------------\n");
     1130        }
     1131       
    11251132        for (i = 0; i < zones.count; i++) {
    11261133                zone = zones.info[i];
    11271134                spinlock_lock(&zone->lock);
    1128                 printf("%-2d %12p %12zd %12zd\n", i, PFN2ADDR(zone->base),
    1129                     zone->free_count, zone->busy_count);
     1135               
     1136                if (sizeof(void *) == 4)
     1137                        printf("%-2d   %#10zx %12zd %12zd\n", i, PFN2ADDR(zone->base),
     1138                            zone->free_count, zone->busy_count);
     1139                else
     1140                        printf("%-2d   %#18zx %12zd %12zd\n", i, PFN2ADDR(zone->base),
     1141                            zone->free_count, zone->busy_count);
     1142               
    11301143                spinlock_unlock(&zone->lock);
    11311144        }
     1145       
    11321146        spinlock_unlock(&zones.lock);
    11331147        interrupts_restore(ipl);
  • kernel/generic/src/printf/printf_core.c

    racfdcb0 r43b1e86  
    459459 *      - u     Print unsigned decimal number.
    460460 *
    461  *      - X, x  Print hexadecimal number with upper- or lower-case. Prefix isi
     461 *      - X, x  Print hexadecimal number with upper- or lower-case. Prefix is
    462462 *              not printed by default.
    463463 *
  • kernel/generic/src/proc/task.c

    racfdcb0 r43b1e86  
    421421        char suffix;
    422422        order(task_get_accounting(t), &cycles, &suffix);
    423                        
    424         printf("%-6llu %-10s %-3ld %#10zx %#10zx %9llu%c %7zd %6zd",
    425             t->taskid, t->name, t->context, t, t->as, cycles, suffix,
    426             t->refcount, atomic_get(&t->active_calls));
     423       
     424        if (sizeof(void *) == 4)
     425                printf("%-6llu %-10s %-3ld %#10zx %#10zx %9llu%c %7zd %6zd",
     426                t->taskid, t->name, t->context, t, t->as, cycles, suffix,
     427                    t->refcount, atomic_get(&t->active_calls));
     428        else
     429                printf("%-6llu %-10s %-3ld %#18zx %#18zx %9llu%c %7zd %6zd",
     430                    t->taskid, t->name, t->context, t, t->as, cycles, suffix,
     431                t->refcount, atomic_get(&t->active_calls));
    427432        for (j = 0; j < IPC_MAX_PHONES; j++) {
    428433                if (t->phones[j].callee)
     
    444449        spinlock_lock(&tasks_lock);
    445450       
    446         printf("taskid name       ctx address    as         cycles     threads "
    447             "calls  callee\n");
    448         printf("------ ---------- --- ---------- ---------- ---------- ------- "
    449             "------ ------>\n");
     451        if (sizeof(void *) == 4) {
     452                printf("taskid name       ctx address    as         "
     453                        "cycles     threads calls  callee\n");
     454                printf("------ ---------- --- ---------- ---------- "
     455                        "---------- ------- ------ ------>\n");
     456        } else {
     457                printf("taskid name       ctx address            as                 "
     458                        "cycles     threads calls  callee\n");
     459                printf("------ ---------- --- ------------------ ------------------ "
     460                        "---------- ------- ------ ------>\n");
     461        }
    450462
    451463        avltree_walk(&tasks_tree, task_print_walker, NULL);
  • kernel/generic/src/proc/thread.c

    racfdcb0 r43b1e86  
    587587        char suffix;
    588588        order(t->cycles, &cycles, &suffix);
    589                        
    590         printf("%-6llu %-10s %#10zx %-8s %#10zx %-3ld %#10zx %#10zx %9llu%c ",
    591             t->tid, t->name, t, thread_states[t->state], t->task,
    592             t->task->context, t->thread_code, t->kstack, cycles, suffix);
     589       
     590        if (sizeof(void *) == 4)
     591                printf("%-6llu %-10s %#10zx %-8s %#10zx %-3ld %#10zx %#10zx %9llu%c ",
     592                    t->tid, t->name, t, thread_states[t->state], t->task,
     593                t->task->context, t->thread_code, t->kstack, cycles, suffix);
     594        else
     595                printf("%-6llu %-10s %#18zx %-8s %#18zx %-3ld %#18zx %#18zx %9llu%c ",
     596                    t->tid, t->name, t, thread_states[t->state], t->task,
     597                t->task->context, t->thread_code, t->kstack, cycles, suffix);
    593598                       
    594599        if (t->cpu)
     
    597602                printf("none");
    598603                       
    599         if (t->state == Sleeping)
    600                 printf(" %#10zx", t->sleep_queue);
     604        if (t->state == Sleeping) {
     605                if (sizeof(uintptr_t) == 4)
     606                        printf(" %#10zx", t->sleep_queue);
     607                else
     608                        printf(" %#18zx", t->sleep_queue);
     609        }
    601610                       
    602611        printf("\n");
     
    614623        spinlock_lock(&threads_lock);
    615624       
    616         printf("tid    name       address    state    task       ctx code    "
    617             "   stack      cycles     cpu  waitqueue\n");
    618         printf("------ ---------- ---------- -------- ---------- --- --------"
    619             "-- ---------- ---------- ---- ---------\n");
     625        if (sizeof(uintptr_t) == 4) {
     626                printf("tid    name       address    state    task       "
     627                        "ctx code       stack      cycles     cpu  "
     628                        "waitqueue\n");
     629                printf("------ ---------- ---------- -------- ---------- "
     630                        "--- ---------- ---------- ---------- ---- "
     631                        "----------\n");
     632        } else {
     633                printf("tid    name       address            state    task               "
     634                        "ctx code               stack              cycles     cpu  "
     635                        "waitqueue\n");
     636                printf("------ ---------- ------------------ -------- ------------------ "
     637                        "--- ------------------ ------------------ ---------- ---- "
     638                        "------------------\n");
     639        }
    620640
    621641        avltree_walk(&threads_tree, thread_walker, NULL);
Note: See TracChangeset for help on using the changeset viewer.