Rev 3386 | Rev 4263 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 3386 | Rev 4153 | ||
---|---|---|---|
Line 48... | Line 48... | ||
48 | #include <arch/types.h> |
48 | #include <arch/types.h> |
49 | #include <adt/list.h> |
49 | #include <adt/list.h> |
50 | #include <arch.h> |
50 | #include <arch.h> |
51 | #include <config.h> |
51 | #include <config.h> |
52 | #include <func.h> |
52 | #include <func.h> |
- | 53 | #include <string.h> |
|
53 | #include <macros.h> |
54 | #include <macros.h> |
54 | #include <debug.h> |
55 | #include <debug.h> |
55 | #include <symtab.h> |
- | |
56 | #include <cpu.h> |
56 | #include <cpu.h> |
57 | #include <mm/tlb.h> |
57 | #include <mm/tlb.h> |
58 | #include <arch/mm/tlb.h> |
58 | #include <arch/mm/tlb.h> |
59 | #include <mm/frame.h> |
59 | #include <mm/frame.h> |
60 | #include <main/version.h> |
60 | #include <main/version.h> |
Line 62... | Line 62... | ||
62 | #include <proc/scheduler.h> |
62 | #include <proc/scheduler.h> |
63 | #include <proc/thread.h> |
63 | #include <proc/thread.h> |
64 | #include <proc/task.h> |
64 | #include <proc/task.h> |
65 | #include <ipc/ipc.h> |
65 | #include <ipc/ipc.h> |
66 | #include <ipc/irq.h> |
66 | #include <ipc/irq.h> |
- | 67 | #include <symtab.h> |
|
- | 68 | #include <errno.h> |
|
67 | 69 | ||
68 | #ifdef CONFIG_TEST |
70 | #ifdef CONFIG_TEST |
69 | #include <test.h> |
71 | #include <test.h> |
70 | #endif |
72 | #endif |
71 | 73 | ||
Line 76... | Line 78... | ||
76 | .description = "List of supported commands.", |
78 | .description = "List of supported commands.", |
77 | .func = cmd_help, |
79 | .func = cmd_help, |
78 | .argc = 0 |
80 | .argc = 0 |
79 | }; |
81 | }; |
80 | 82 | ||
81 | static cmd_info_t exit_info = { |
- | |
82 | .name = "exit", |
- | |
83 | .description = "Exit kconsole.", |
- | |
84 | .argc = 0 |
- | |
85 | }; |
- | |
86 | - | ||
87 | static int cmd_reboot(cmd_arg_t *argv); |
83 | static int cmd_reboot(cmd_arg_t *argv); |
88 | static cmd_info_t reboot_info = { |
84 | static cmd_info_t reboot_info = { |
89 | .name = "reboot", |
85 | .name = "reboot", |
90 | .description = "Reboot.", |
86 | .description = "Reboot.", |
91 | .func = cmd_reboot, |
87 | .func = cmd_reboot, |
Line 396... | Line 392... | ||
396 | .description = "List of memory zones.", |
392 | .description = "List of memory zones.", |
397 | .func = cmd_zones, |
393 | .func = cmd_zones, |
398 | .argc = 0 |
394 | .argc = 0 |
399 | }; |
395 | }; |
400 | 396 | ||
401 | /* Data and methods for 'ipc_task' command */ |
397 | /* Data and methods for 'ipc' command */ |
402 | static int cmd_ipc_task(cmd_arg_t *argv); |
398 | static int cmd_ipc(cmd_arg_t *argv); |
403 | static cmd_arg_t ipc_task_argv = { |
399 | static cmd_arg_t ipc_argv = { |
404 | .type = ARG_TYPE_INT, |
400 | .type = ARG_TYPE_INT, |
405 | }; |
401 | }; |
406 | static cmd_info_t ipc_task_info = { |
402 | static cmd_info_t ipc_info = { |
407 | .name = "ipc_task", |
403 | .name = "ipc", |
408 | .description = "ipc_task <taskid> Show IPC information of given task.", |
404 | .description = "ipc <taskid> Show IPC information of given task.", |
409 | .func = cmd_ipc_task, |
405 | .func = cmd_ipc, |
410 | .argc = 1, |
406 | .argc = 1, |
411 | .argv = &ipc_task_argv |
407 | .argv = &ipc_argv |
412 | }; |
408 | }; |
413 | 409 | ||
414 | /* Data and methods for 'zone' command */ |
410 | /* Data and methods for 'zone' command */ |
415 | static int cmd_zone(cmd_arg_t *argv); |
411 | static int cmd_zone(cmd_arg_t *argv); |
416 | static cmd_arg_t zone_argv = { |
412 | static cmd_arg_t zone_argv = { |
Line 454... | Line 450... | ||
454 | &call2_info, |
450 | &call2_info, |
455 | &call3_info, |
451 | &call3_info, |
456 | &continue_info, |
452 | &continue_info, |
457 | &cpus_info, |
453 | &cpus_info, |
458 | &desc_info, |
454 | &desc_info, |
459 | &exit_info, |
- | |
460 | &reboot_info, |
455 | &reboot_info, |
461 | &uptime_info, |
456 | &uptime_info, |
462 | &halt_info, |
457 | &halt_info, |
463 | &help_info, |
458 | &help_info, |
464 | &ipc_task_info, |
459 | &ipc_info, |
465 | &set4_info, |
460 | &set4_info, |
466 | &slabs_info, |
461 | &slabs_info, |
467 | &symaddr_info, |
462 | &symaddr_info, |
468 | &sched_info, |
463 | &sched_info, |
469 | &threads_info, |
464 | &threads_info, |
Line 499... | Line 494... | ||
499 | unsigned int i; |
494 | unsigned int i; |
500 | 495 | ||
501 | for (i = 0; basic_commands[i]; i++) { |
496 | for (i = 0; basic_commands[i]; i++) { |
502 | cmd_initialize(basic_commands[i]); |
497 | cmd_initialize(basic_commands[i]); |
503 | if (!cmd_register(basic_commands[i])) |
498 | if (!cmd_register(basic_commands[i])) |
504 | panic("could not register command %s\n", basic_commands[i]->name); |
499 | printf("Cannot register command %s\n", basic_commands[i]->name); |
505 | } |
500 | } |
506 | } |
501 | } |
507 | 502 | ||
508 | 503 | ||
509 | /** List supported commands. |
504 | /** List supported commands. |
Line 512... | Line 507... | ||
512 | * |
507 | * |
513 | * @return 0 on failure, 1 on success. |
508 | * @return 0 on failure, 1 on success. |
514 | */ |
509 | */ |
515 | int cmd_help(cmd_arg_t *argv) |
510 | int cmd_help(cmd_arg_t *argv) |
516 | { |
511 | { |
517 | link_t *cur; |
- | |
518 | - | ||
519 | spinlock_lock(&cmd_lock); |
512 | spinlock_lock(&cmd_lock); |
520 | 513 | ||
- | 514 | link_t *cur; |
|
- | 515 | size_t len = 0; |
|
521 | for (cur = cmd_head.next; cur != &cmd_head; cur = cur->next) { |
516 | for (cur = cmd_head.next; cur != &cmd_head; cur = cur->next) { |
522 | cmd_info_t *hlp; |
517 | cmd_info_t *hlp; |
523 | - | ||
524 | hlp = list_get_instance(cur, cmd_info_t, link); |
518 | hlp = list_get_instance(cur, cmd_info_t, link); |
- | 519 | ||
525 | spinlock_lock(&hlp->lock); |
520 | spinlock_lock(&hlp->lock); |
- | 521 | if (strlen(hlp->name) > len) |
|
- | 522 | len = strlen(hlp->name); |
|
- | 523 | spinlock_unlock(&hlp->lock); |
|
- | 524 | } |
|
- | 525 | ||
- | 526 | for (cur = cmd_head.next; cur != &cmd_head; cur = cur->next) { |
|
- | 527 | cmd_info_t *hlp; |
|
- | 528 | hlp = list_get_instance(cur, cmd_info_t, link); |
|
526 | 529 | ||
- | 530 | spinlock_lock(&hlp->lock); |
|
527 | printf("%s - %s\n", hlp->name, hlp->description); |
531 | printf("%-*s %s\n", len, hlp->name, hlp->description); |
528 | - | ||
529 | spinlock_unlock(&hlp->lock); |
532 | spinlock_unlock(&hlp->lock); |
530 | } |
533 | } |
531 | 534 | ||
532 | spinlock_unlock(&cmd_lock); |
535 | spinlock_unlock(&cmd_lock); |
533 | 536 | ||
534 | return 1; |
537 | return 1; |
535 | } |
538 | } |
536 | 539 | ||
537 | 540 | ||
538 | /** Reboot the system. |
541 | /** Reboot the system. |
Line 614... | Line 617... | ||
614 | /** Call function with zero parameters */ |
617 | /** Call function with zero parameters */ |
615 | int cmd_call0(cmd_arg_t *argv) |
618 | int cmd_call0(cmd_arg_t *argv) |
616 | { |
619 | { |
617 | uintptr_t symaddr; |
620 | uintptr_t symaddr; |
618 | char *symbol; |
621 | char *symbol; |
619 | unative_t (*f)(void); |
622 | unative_t (*fnc)(void); |
620 | #ifdef ia64 |
- | |
621 | struct { |
- | |
622 | unative_t f; |
- | |
623 | unative_t gp; |
623 | fncptr_t fptr; |
624 | } fptr; |
624 | int rc; |
625 | #endif |
- | |
626 | 625 | ||
627 | symaddr = get_symbol_addr((char *) argv->buffer); |
626 | symbol = (char *) argv->buffer; |
- | 627 | rc = symtab_addr_lookup(symbol, &symaddr); |
|
- | 628 | ||
628 | if (!symaddr) |
629 | if (rc == ENOENT) |
629 | printf("Symbol %s not found.\n", argv->buffer); |
630 | printf("Symbol %s not found.\n", symbol); |
630 | else if (symaddr == (uintptr_t) -1) { |
631 | else if (rc == EOVERFLOW) { |
631 | symtab_print_search((char *) argv->buffer); |
632 | symtab_print_search(symbol); |
632 | printf("Duplicate symbol, be more specific.\n"); |
633 | printf("Duplicate symbol, be more specific.\n"); |
633 | } else { |
634 | } else if (rc == EOK) { |
- | 635 | fnc = (unative_t (*)(void)) arch_construct_function(&fptr, |
|
634 | symbol = get_symtab_entry(symaddr); |
636 | (void *) symaddr, (void *) cmd_call0); |
635 | printf("Calling %s() (%p)\n", symbol, symaddr); |
637 | printf("Calling %s() (%p)\n", symbol, symaddr); |
636 | #ifdef ia64 |
- | |
637 | fptr.f = symaddr; |
- | |
638 | fptr.gp = ((unative_t *)cmd_call2)[1]; |
638 | printf("Result: %#" PRIxn "\n", fnc()); |
639 | f = (unative_t (*)(void)) &fptr; |
- | |
640 | #else |
639 | } else { |
641 | f = (unative_t (*)(void)) symaddr; |
- | |
642 | #endif |
- | |
643 | printf("Result: %#" PRIxn "\n", f()); |
640 | printf("No symbol information available.\n"); |
644 | } |
641 | } |
645 | - | ||
646 | return 1; |
642 | return 1; |
647 | } |
643 | } |
648 | 644 | ||
649 | /** Call function with zero parameters on each CPU */ |
645 | /** Call function with zero parameters on each CPU */ |
650 | int cmd_mcall0(cmd_arg_t *argv) |
646 | int cmd_mcall0(cmd_arg_t *argv) |
Line 678... | Line 674... | ||
678 | /** Call function with one parameter */ |
674 | /** Call function with one parameter */ |
679 | int cmd_call1(cmd_arg_t *argv) |
675 | int cmd_call1(cmd_arg_t *argv) |
680 | { |
676 | { |
681 | uintptr_t symaddr; |
677 | uintptr_t symaddr; |
682 | char *symbol; |
678 | char *symbol; |
683 | unative_t (*f)(unative_t,...); |
679 | unative_t (*fnc)(unative_t, ...); |
684 | unative_t arg1 = argv[1].intval; |
680 | unative_t arg1 = argv[1].intval; |
685 | #ifdef ia64 |
- | |
686 | struct { |
- | |
687 | unative_t f; |
- | |
688 | unative_t gp; |
681 | fncptr_t fptr; |
689 | } fptr; |
682 | int rc; |
690 | #endif |
- | |
691 | 683 | ||
692 | symaddr = get_symbol_addr((char *) argv->buffer); |
- | |
693 | if (!symaddr) |
- | |
694 | printf("Symbol %s not found.\n", argv->buffer); |
- | |
695 | else if (symaddr == (uintptr_t) -1) { |
- | |
696 | symtab_print_search((char *) argv->buffer); |
684 | symbol = (char *) argv->buffer; |
697 | printf("Duplicate symbol, be more specific.\n"); |
- | |
698 | } else { |
- | |
699 | symbol = get_symtab_entry(symaddr); |
685 | rc = symtab_addr_lookup(symbol, &symaddr); |
700 | 686 | ||
- | 687 | if (rc == ENOENT) { |
|
- | 688 | printf("Symbol %s not found.\n", symbol); |
|
- | 689 | } else if (rc == EOVERFLOW) { |
|
- | 690 | symtab_print_search(symbol); |
|
- | 691 | printf("Duplicate symbol, be more specific.\n"); |
|
- | 692 | } else if (rc == EOK) { |
|
- | 693 | fnc = (unative_t (*)(unative_t, ...)) arch_construct_function(&fptr, (void *) symaddr, (void *) cmd_call1); |
|
701 | printf("Calling f(%#" PRIxn "): %p: %s\n", arg1, symaddr, symbol); |
694 | printf("Calling f(%#" PRIxn "): %p: %s\n", arg1, symaddr, symbol); |
702 | #ifdef ia64 |
- | |
703 | fptr.f = symaddr; |
- | |
704 | fptr.gp = ((unative_t *)cmd_call2)[1]; |
- | |
705 | f = (unative_t (*)(unative_t,...)) &fptr; |
695 | printf("Result: %#" PRIxn "\n", fnc(arg1)); |
706 | #else |
696 | } else { |
707 | f = (unative_t (*)(unative_t,...)) symaddr; |
- | |
708 | #endif |
- | |
709 | printf("Result: %#" PRIxn "\n", f(arg1)); |
697 | printf("No symbol information available.\n"); |
710 | } |
698 | } |
711 | 699 | ||
712 | return 1; |
700 | return 1; |
713 | } |
701 | } |
714 | 702 | ||
715 | /** Call function with two parameters */ |
703 | /** Call function with two parameters */ |
716 | int cmd_call2(cmd_arg_t *argv) |
704 | int cmd_call2(cmd_arg_t *argv) |
717 | { |
705 | { |
718 | uintptr_t symaddr; |
706 | uintptr_t symaddr; |
719 | char *symbol; |
707 | char *symbol; |
720 | unative_t (*f)(unative_t,unative_t,...); |
708 | unative_t (*fnc)(unative_t, unative_t, ...); |
721 | unative_t arg1 = argv[1].intval; |
709 | unative_t arg1 = argv[1].intval; |
722 | unative_t arg2 = argv[2].intval; |
710 | unative_t arg2 = argv[2].intval; |
723 | #ifdef ia64 |
- | |
724 | struct { |
- | |
725 | unative_t f; |
- | |
726 | unative_t gp; |
711 | fncptr_t fptr; |
727 | }fptr; |
712 | int rc; |
728 | #endif |
- | |
729 | 713 | ||
730 | symaddr = get_symbol_addr((char *) argv->buffer); |
714 | symbol = (char *) argv->buffer; |
- | 715 | rc = symtab_addr_lookup(symbol, &symaddr); |
|
- | 716 | ||
731 | if (!symaddr) |
717 | if (rc == ENOENT) { |
732 | printf("Symbol %s not found.\n", argv->buffer); |
718 | printf("Symbol %s not found.\n", symbol); |
733 | else if (symaddr == (uintptr_t) -1) { |
719 | } else if (rc == EOVERFLOW) { |
734 | symtab_print_search((char *) argv->buffer); |
720 | symtab_print_search(symbol); |
735 | printf("Duplicate symbol, be more specific.\n"); |
721 | printf("Duplicate symbol, be more specific.\n"); |
736 | } else { |
722 | } else if (rc == EOK) { |
737 | symbol = get_symtab_entry(symaddr); |
723 | fnc = (unative_t (*)(unative_t, unative_t, ...)) arch_construct_function(&fptr, (void *) symaddr, (void *) cmd_call2); |
738 | printf("Calling f(%#" PRIxn ", %#" PRIxn "): %p: %s\n", |
724 | printf("Calling f(%#" PRIxn ", %#" PRIxn "): %p: %s\n", |
739 | arg1, arg2, symaddr, symbol); |
725 | arg1, arg2, symaddr, symbol); |
740 | #ifdef ia64 |
- | |
741 | fptr.f = symaddr; |
- | |
742 | fptr.gp = ((unative_t *)cmd_call2)[1]; |
726 | printf("Result: %#" PRIxn "\n", fnc(arg1, arg2)); |
743 | f = (unative_t (*)(unative_t,unative_t,...)) &fptr; |
- | |
744 | #else |
727 | } else { |
745 | f = (unative_t (*)(unative_t,unative_t,...)) symaddr; |
- | |
746 | #endif |
- | |
747 | printf("Result: %#" PRIxn "\n", f(arg1, arg2)); |
728 | printf("No symbol information available.\n"); |
748 | } |
729 | } |
749 | - | ||
750 | return 1; |
730 | return 1; |
751 | } |
731 | } |
752 | 732 | ||
753 | /** Call function with three parameters */ |
733 | /** Call function with three parameters */ |
754 | int cmd_call3(cmd_arg_t *argv) |
734 | int cmd_call3(cmd_arg_t *argv) |
755 | { |
735 | { |
756 | uintptr_t symaddr; |
736 | uintptr_t symaddr; |
757 | char *symbol; |
737 | char *symbol; |
758 | unative_t (*f)(unative_t,unative_t,unative_t,...); |
738 | unative_t (*fnc)(unative_t, unative_t, unative_t, ...); |
759 | unative_t arg1 = argv[1].intval; |
739 | unative_t arg1 = argv[1].intval; |
760 | unative_t arg2 = argv[2].intval; |
740 | unative_t arg2 = argv[2].intval; |
761 | unative_t arg3 = argv[3].intval; |
741 | unative_t arg3 = argv[3].intval; |
762 | #ifdef ia64 |
- | |
763 | struct { |
- | |
764 | unative_t f; |
- | |
765 | unative_t gp; |
742 | fncptr_t fptr; |
766 | }fptr; |
743 | int rc; |
767 | #endif |
744 | |
- | 745 | symbol = (char *) argv->buffer; |
|
- | 746 | rc = symtab_addr_lookup(symbol, &symaddr); |
|
768 | 747 | ||
769 | symaddr = get_symbol_addr((char *) argv->buffer); |
- | |
770 | if (!symaddr) |
748 | if (rc == ENOENT) { |
771 | printf("Symbol %s not found.\n", argv->buffer); |
749 | printf("Symbol %s not found.\n", symbol); |
772 | else if (symaddr == (uintptr_t) -1) { |
750 | } else if (rc == EOVERFLOW) { |
773 | symtab_print_search((char *) argv->buffer); |
751 | symtab_print_search(symbol); |
774 | printf("Duplicate symbol, be more specific.\n"); |
752 | printf("Duplicate symbol, be more specific.\n"); |
775 | } else { |
753 | } else if (rc == EOK) { |
776 | symbol = get_symtab_entry(symaddr); |
754 | fnc = (unative_t (*)(unative_t, unative_t, unative_t, ...)) arch_construct_function(&fptr, (void *) symaddr, (void *) cmd_call3); |
777 | printf("Calling f(%#" PRIxn ",%#" PRIxn ", %#" PRIxn "): %p: %s\n", |
755 | printf("Calling f(%#" PRIxn ",%#" PRIxn ", %#" PRIxn "): %p: %s\n", |
778 | arg1, arg2, arg3, symaddr, symbol); |
756 | arg1, arg2, arg3, symaddr, symbol); |
779 | #ifdef ia64 |
- | |
780 | fptr.f = symaddr; |
- | |
781 | fptr.gp = ((unative_t *)cmd_call2)[1]; |
- | |
782 | f = (unative_t (*)(unative_t,unative_t,unative_t,...)) &fptr; |
757 | printf("Result: %#" PRIxn "\n", fnc(arg1, arg2, arg3)); |
783 | #else |
758 | } else { |
784 | f = (unative_t (*)(unative_t,unative_t,unative_t,...)) symaddr; |
- | |
785 | #endif |
- | |
786 | printf("Result: %#" PRIxn "\n", f(arg1, arg2, arg3)); |
759 | printf("No symbol information available.\n"); |
787 | } |
760 | } |
788 | - | ||
789 | return 1; |
761 | return 1; |
790 | } |
762 | } |
791 | 763 | ||
792 | 764 | ||
793 | /** Print detailed description of 'describe' command. */ |
765 | /** Print detailed description of 'describe' command. */ |
Line 833... | Line 805... | ||
833 | } |
805 | } |
834 | 806 | ||
835 | /** Write 4 byte value to address */ |
807 | /** Write 4 byte value to address */ |
836 | int cmd_set4(cmd_arg_t *argv) |
808 | int cmd_set4(cmd_arg_t *argv) |
837 | { |
809 | { |
838 | uint32_t *addr; |
810 | uintptr_t addr; |
839 | uint32_t arg1 = argv[1].intval; |
811 | uint32_t arg1 = argv[1].intval; |
840 | bool pointer = false; |
812 | bool pointer = false; |
- | 813 | int rc; |
|
841 | 814 | ||
842 | if (((char *)argv->buffer)[0] == '*') { |
815 | if (((char *)argv->buffer)[0] == '*') { |
843 | addr = (uint32_t *) get_symbol_addr((char *) argv->buffer + 1); |
816 | rc = symtab_addr_lookup((char *) argv->buffer + 1, &addr); |
844 | pointer = true; |
817 | pointer = true; |
845 | } else if (((char *) argv->buffer)[0] >= '0' && |
818 | } else if (((char *) argv->buffer)[0] >= '0' && |
846 | ((char *)argv->buffer)[0] <= '9') |
819 | ((char *)argv->buffer)[0] <= '9') { |
- | 820 | rc = EOK; |
|
847 | addr = (uint32_t *)atoi((char *)argv->buffer); |
821 | addr = atoi((char *)argv->buffer); |
848 | else |
822 | } else { |
849 | addr = (uint32_t *)get_symbol_addr((char *) argv->buffer); |
823 | rc = symtab_addr_lookup((char *) argv->buffer, &addr); |
- | 824 | } |
|
850 | 825 | ||
851 | if (!addr) |
826 | if (rc == ENOENT) |
852 | printf("Symbol %s not found.\n", argv->buffer); |
827 | printf("Symbol %s not found.\n", argv->buffer); |
853 | else if (addr == (uint32_t *) -1) { |
828 | else if (rc == EOVERFLOW) { |
854 | symtab_print_search((char *) argv->buffer); |
829 | symtab_print_search((char *) argv->buffer); |
855 | printf("Duplicate symbol, be more specific.\n"); |
830 | printf("Duplicate symbol, be more specific.\n"); |
856 | } else { |
831 | } else if (rc == EOK) { |
857 | if (pointer) |
832 | if (pointer) |
858 | addr = (uint32_t *)(*(unative_t *)addr); |
833 | addr = *(uintptr_t *) addr; |
859 | printf("Writing %#" PRIx64 " -> %p\n", arg1, addr); |
834 | printf("Writing %#" PRIx64 " -> %p\n", arg1, addr); |
860 | *addr = arg1; |
835 | *(uint32_t *) addr = arg1; |
861 | 836 | } else { |
|
- | 837 | printf("No symbol information available.\n"); |
|
862 | } |
838 | } |
863 | 839 | ||
864 | return 1; |
840 | return 1; |
865 | } |
841 | } |
866 | 842 | ||
Line 935... | Line 911... | ||
935 | * |
911 | * |
936 | * @param argv Integer argument from cmdline expected |
912 | * @param argv Integer argument from cmdline expected |
937 | * |
913 | * |
938 | * return Always 1 |
914 | * return Always 1 |
939 | */ |
915 | */ |
940 | int cmd_ipc_task(cmd_arg_t * argv) { |
916 | int cmd_ipc(cmd_arg_t * argv) { |
941 | ipc_print_task(argv[0].intval); |
917 | ipc_print_task(argv[0].intval); |
942 | return 1; |
918 | return 1; |
943 | } |
919 | } |
944 | 920 | ||
945 | 921 | ||
Line 974... | Line 950... | ||
974 | * return Always 1. |
950 | * return Always 1. |
975 | */ |
951 | */ |
976 | int cmd_continue(cmd_arg_t *argv) |
952 | int cmd_continue(cmd_arg_t *argv) |
977 | { |
953 | { |
978 | printf("The kernel will now relinquish the console.\n"); |
954 | printf("The kernel will now relinquish the console.\n"); |
- | 955 | release_console(); |
|
- | 956 | ||
979 | printf("Use userspace controls to redraw the screen.\n"); |
957 | if ((kconsole_notify) && (kconsole_irq.notif_cfg.notify)) |
980 | arch_release_console(); |
958 | ipc_irq_send_msg_0(&kconsole_irq); |
- | 959 | ||
981 | return 1; |
960 | return 1; |
982 | } |
961 | } |
983 | 962 | ||
984 | #ifdef CONFIG_TEST |
963 | #ifdef CONFIG_TEST |
985 | /** Command for printing kernel tests list. |
964 | /** Command for printing kernel tests list. |
Line 988... | Line 967... | ||
988 | * |
967 | * |
989 | * return Always 1. |
968 | * return Always 1. |
990 | */ |
969 | */ |
991 | int cmd_tests(cmd_arg_t *argv) |
970 | int cmd_tests(cmd_arg_t *argv) |
992 | { |
971 | { |
- | 972 | size_t len = 0; |
|
993 | test_t *test; |
973 | test_t *test; |
- | 974 | for (test = tests; test->name != NULL; test++) { |
|
- | 975 | if (strlen(test->name) > len) |
|
- | 976 | len = strlen(test->name); |
|
- | 977 | } |
|
994 | 978 | ||
995 | for (test = tests; test->name != NULL; test++) |
979 | for (test = tests; test->name != NULL; test++) |
996 | printf("%s\t\t%s%s\n", test->name, test->desc, (test->safe ? "" : " (unsafe)")); |
980 | printf("%-*s %s%s\n", len, test->name, test->desc, (test->safe ? "" : " (unsafe)")); |
997 | 981 | ||
998 | printf("*\t\tRun all safe tests\n"); |
982 | printf("%-*s Run all safe tests\n", len, "*"); |
999 | return 1; |
983 | return 1; |
1000 | } |
984 | } |
1001 | 985 | ||
1002 | static bool run_test(const test_t *test) |
986 | static bool run_test(const test_t *test) |
1003 | { |
987 | { |
1004 | printf("%s\t\t%s\n", test->name, test->desc); |
988 | printf("%s (%s)\n", test->name, test->desc); |
1005 | 989 | ||
1006 | /* Update and read thread accounting |
990 | /* Update and read thread accounting |
1007 | for benchmarking */ |
991 | for benchmarking */ |
1008 | ipl_t ipl = interrupts_disable(); |
992 | ipl_t ipl = interrupts_disable(); |
1009 | spinlock_lock(&TASK->lock); |
993 | spinlock_lock(&TASK->lock); |