Changes in kernel/generic/src/console/cmd.c [851f33a:0b0f4bb] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/generic/src/console/cmd.c
r851f33a r0b0f4bb 554 554 } 555 555 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 556 562 for (cur = cmd_head.next; cur != &cmd_head; cur = cur->next) { 557 563 cmd_info_t *hlp; … … 559 565 560 566 spinlock_lock(&hlp->lock); 561 printf("%-*s %s\n", len, hlp->name, hlp->description);567 printf("%-*s %s\n", _len, hlp->name, hlp->description); 562 568 spinlock_unlock(&hlp->lock); 563 569 } … … 668 674 fnc = (unative_t (*)(void)) arch_construct_function(&fptr, 669 675 (void *) symaddr, (void *) cmd_call0); 670 printf("Calling %s() (%p)\n", symbol, symaddr);676 printf("Calling %s() (%p)\n", symbol, (void *) symaddr); 671 677 printf("Result: %#" PRIxn "\n", fnc()); 672 678 interrupts_restore(ipl); … … 685 691 */ 686 692 687 size_t i;693 unsigned int i; 688 694 for (i = 0; i < config.cpu_count; i++) { 689 695 if (!cpus[i].active) … … 697 703 irq_spinlock_unlock(&thread->lock, true); 698 704 699 printf("cpu% " PRIs ": ", i);705 printf("cpu%u: ", i); 700 706 701 707 thread_ready(thread); … … 703 709 thread_detach(thread); 704 710 } else 705 printf("Unable to create thread for cpu% " PRIs "\n", i);711 printf("Unable to create thread for cpu%u\n", i); 706 712 } 707 713 … … 731 737 732 738 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); 735 744 printf("Result: %#" PRIxn "\n", fnc(arg1)); 736 745 interrupts_restore(ipl); … … 765 774 766 775 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); 768 779 printf("Calling f(%#" PRIxn ", %#" PRIxn "): %p: %s\n", 769 arg1, arg2, symaddr, symbol);780 arg1, arg2, (void *) symaddr, symbol); 770 781 printf("Result: %#" PRIxn "\n", fnc(arg1, arg2)); 771 782 interrupts_restore(ipl); … … 800 811 801 812 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); 805 818 printf("Result: %#" PRIxn "\n", fnc(arg1, arg2, arg3)); 806 819 interrupts_restore(ipl); … … 875 888 876 889 if (rc == ENOENT) 877 printf("Symbol %s not found.\n", argv->buffer);890 printf("Symbol %s not found.\n", (char *) argv->buffer); 878 891 else if (rc == EINVAL) 879 892 printf("Invalid address.\n"); … … 884 897 if (pointer) 885 898 addr = *(uintptr_t *) addr; 886 printf("Writing %#" PRIx 64 " -> %p\n", arg1,addr);899 printf("Writing %#" PRIx32" -> %p\n", arg1, (void *) addr); 887 900 *(uint32_t *) addr = arg1; 888 901 } else … … 1172 1185 } 1173 1186 1187 unsigned int _len = (unsigned int) len; 1188 if ((_len != len) || (((int) _len) < 0)) { 1189 printf("Command length overflow\n"); 1190 return; 1191 } 1192 1174 1193 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, "*"); 1178 1198 } 1179 1199
Note:
See TracChangeset
for help on using the changeset viewer.