Changeset 319e60e in mainline for kernel/generic/src/console/cmd.c
- Timestamp:
- 2006-12-11T18:33:53Z (18 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 50661ab
- Parents:
- 134877d
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/generic/src/console/cmd.c
r134877d r319e60e 66 66 #include <ipc/irq.h> 67 67 68 #ifdef CONFIG_TEST 69 #include <test.h> 70 #endif 71 68 72 /* Data and methods for 'help' command. */ 69 73 static int cmd_help(cmd_arg_t *argv); … … 77 81 static cmd_info_t exit_info = { 78 82 .name = "exit", 79 .description = "Exit kconsole",83 .description = "Exit kconsole", 80 84 .argc = 0 81 85 }; … … 84 88 static cmd_info_t continue_info = { 85 89 .name = "continue", 86 .description = "Return console back to userspace.",90 .description = "Return console back to userspace.", 87 91 .func = cmd_continue, 88 92 .argc = 0 89 93 }; 94 95 #ifdef CONFIG_TEST 96 static int cmd_tests(cmd_arg_t *argv); 97 static cmd_info_t tests_info = { 98 .name = "tests", 99 .description = "Print available kernel tests.", 100 .func = cmd_tests, 101 .argc = 0 102 }; 103 104 static char test_buf[MAX_CMDLINE + 1]; 105 static int cmd_test(cmd_arg_t *argv); 106 static cmd_arg_t test_argv[] = { 107 { 108 .type = ARG_TYPE_STRING, 109 .buffer = test_buf, 110 .len = sizeof(test_buf) 111 } 112 }; 113 static cmd_info_t test_info = { 114 .name = "test", 115 .description = "Run kernel test.", 116 .func = cmd_test, 117 .argc = 1, 118 .argv = test_argv 119 }; 120 #endif 90 121 91 122 /* Data and methods for 'description' command. */ … … 378 409 &zones_info, 379 410 &zone_info, 411 #ifdef CONFIG_TEST 412 &tests_info, 413 &test_info, 414 #endif 380 415 NULL 381 416 }; … … 806 841 } 807 842 843 /** Command for printing kernel tests list. 844 * 845 * @param argv Ignored. 846 * 847 * return Always 1. 848 */ 849 int cmd_tests(cmd_arg_t *argv) 850 { 851 test_t *test; 852 853 for (test = tests; test->name != NULL; test++) 854 printf("%s\t%s\n", test->name, test->desc); 855 856 return 1; 857 } 858 859 /** Command for returning kernel tests 860 * 861 * @param argv Argument vector. 862 * 863 * return Always 1. 864 */ 865 int cmd_test(cmd_arg_t *argv) 866 { 867 bool fnd = false; 868 test_t *test; 869 870 for (test = tests; test->name != NULL; test++) { 871 if (strcmp(test->name, argv->buffer) == 0) { 872 fnd = true; 873 test->entry(); 874 break; 875 } 876 } 877 878 if (!fnd) 879 printf("Unknown test.\n"); 880 881 return 1; 882 } 883 808 884 /** @} 809 885 */
Note:
See TracChangeset
for help on using the changeset viewer.