Changeset bbc28be in mainline for kernel/generic/src/console/cmd.c


Ignore:
Timestamp:
2010-12-03T12:59:13Z (13 years ago)
Author:
Lubos Slovak <lubos.slovak@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
70c85211
Parents:
2e15ac40 (diff), da55d5b (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merged branch development into /lelian/hidd

File:
1 edited

Legend:

Unmodified
Added
Removed
  • kernel/generic/src/console/cmd.c

    r2e15ac40 rbbc28be  
    554554        }
    555555       
     556        unsigned int _len = (unsigned int) len;
     557        if ((_len != len) || (((int) _len) < 0)) {
     558                printf("Command length overflow\n");
     559                return 1;
     560        }
     561       
    556562        for (cur = cmd_head.next; cur != &cmd_head; cur = cur->next) {
    557563                cmd_info_t *hlp;
     
    559565               
    560566                spinlock_lock(&hlp->lock);
    561                 printf("%-*s %s\n", len, hlp->name, hlp->description);
     567                printf("%-*s %s\n", _len, hlp->name, hlp->description);
    562568                spinlock_unlock(&hlp->lock);
    563569        }
     
    668674                fnc = (unative_t (*)(void)) arch_construct_function(&fptr,
    669675                    (void *) symaddr, (void *) cmd_call0);
    670                 printf("Calling %s() (%p)\n", symbol, symaddr);
     676                printf("Calling %s() (%p)\n", symbol, (void *) symaddr);
    671677                printf("Result: %#" PRIxn "\n", fnc());
    672678                interrupts_restore(ipl);
     
    685691         */
    686692       
    687         size_t i;
     693        unsigned int i;
    688694        for (i = 0; i < config.cpu_count; i++) {
    689695                if (!cpus[i].active)
     
    697703                        irq_spinlock_unlock(&thread->lock, true);
    698704                       
    699                         printf("cpu%" PRIs ": ", i);
     705                        printf("cpu%u: ", i);
    700706                       
    701707                        thread_ready(thread);
     
    703709                        thread_detach(thread);
    704710                } else
    705                         printf("Unable to create thread for cpu%" PRIs "\n", i);
     711                        printf("Unable to create thread for cpu%u\n", i);
    706712        }
    707713       
     
    731737
    732738                ipl = interrupts_disable();
    733                 fnc = (unative_t (*)(unative_t, ...)) arch_construct_function(&fptr, (void *) symaddr, (void *) cmd_call1);
    734                 printf("Calling f(%#" PRIxn "): %p: %s\n", arg1, symaddr, symbol);
     739                fnc = (unative_t (*)(unative_t, ...))
     740                    arch_construct_function(&fptr, (void *) symaddr,
     741                    (void *) cmd_call1);
     742                printf("Calling f(%#" PRIxn "): %p: %s\n", arg1,
     743                    (void *) symaddr, symbol);
    735744                printf("Result: %#" PRIxn "\n", fnc(arg1));
    736745                interrupts_restore(ipl);
     
    765774
    766775                ipl = interrupts_disable();
    767                 fnc = (unative_t (*)(unative_t, unative_t, ...)) arch_construct_function(&fptr, (void *) symaddr, (void *) cmd_call2);
     776                fnc = (unative_t (*)(unative_t, unative_t, ...))
     777                    arch_construct_function(&fptr, (void *) symaddr,
     778                    (void *) cmd_call2);
    768779                printf("Calling f(%#" PRIxn ", %#" PRIxn "): %p: %s\n",
    769                        arg1, arg2, symaddr, symbol);
     780                       arg1, arg2, (void *) symaddr, symbol);
    770781                printf("Result: %#" PRIxn "\n", fnc(arg1, arg2));
    771782                interrupts_restore(ipl);
     
    800811
    801812                ipl = interrupts_disable();
    802                 fnc = (unative_t (*)(unative_t, unative_t, unative_t, ...)) arch_construct_function(&fptr, (void *) symaddr, (void *) cmd_call3);
    803                 printf("Calling f(%#" PRIxn ",%#" PRIxn ", %#" PRIxn "): %p: %s\n",
    804                        arg1, arg2, arg3, symaddr, symbol);
     813                fnc = (unative_t (*)(unative_t, unative_t, unative_t, ...))
     814                    arch_construct_function(&fptr, (void *) symaddr,
     815                    (void *) cmd_call3);
     816                printf("Calling f(%#" PRIxn ",%#" PRIxn ", %#" PRIxn "): %p: %s\n",
     817                       arg1, arg2, arg3, (void *) symaddr, symbol);
    805818                printf("Result: %#" PRIxn "\n", fnc(arg1, arg2, arg3));
    806819                interrupts_restore(ipl);
     
    875888       
    876889        if (rc == ENOENT)
    877                 printf("Symbol %s not found.\n", argv->buffer);
     890                printf("Symbol %s not found.\n", (char *) argv->buffer);
    878891        else if (rc == EINVAL)
    879892                printf("Invalid address.\n");
     
    884897                if (pointer)
    885898                        addr = *(uintptr_t *) addr;
    886                 printf("Writing %#" PRIx64 " -> %p\n", arg1, addr);
     899                printf("Writing %#" PRIx32" -> %p\n", arg1, (void *) addr);
    887900                *(uint32_t *) addr = arg1;
    888901        } else
     
    11721185        }
    11731186       
     1187        unsigned int _len = (unsigned int) len;
     1188        if ((_len != len) || (((int) _len) < 0)) {
     1189                printf("Command length overflow\n");
     1190                return;
     1191        }
     1192       
    11741193        for (test = tests; test->name != NULL; test++)
    1175                 printf("%-*s %s%s\n", len, test->name, test->desc, (test->safe ? "" : " (unsafe)"));
    1176        
    1177         printf("%-*s Run all safe tests\n", len, "*");
     1194                printf("%-*s %s%s\n", _len, test->name, test->desc,
     1195                    (test->safe ? "" : " (unsafe)"));
     1196       
     1197        printf("%-*s Run all safe tests\n", _len, "*");
    11781198}
    11791199
Note: See TracChangeset for help on using the changeset viewer.