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