Changes in kernel/generic/src/console/cmd.c [df58e44:96b02eb9] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/generic/src/console/cmd.c
rdf58e44 r96b02eb9 78 78 static cmd_info_t help_info = { 79 79 .name = "help", 80 .description = "List supported commands.",80 .description = "List of supported commands.", 81 81 .func = cmd_help, 82 82 .argc = 0 83 83 }; 84 84 85 /* Data and methods for 'reboot' command. */86 85 static int cmd_reboot(cmd_arg_t *argv); 87 86 static cmd_info_t reboot_info = { 88 87 .name = "reboot", 89 .description = "Reboot system.",88 .description = "Reboot.", 90 89 .func = cmd_reboot, 91 90 .argc = 0 92 91 }; 93 92 94 /* Data and methods for 'uptime' command. */95 93 static int cmd_uptime(cmd_arg_t *argv); 96 94 static cmd_info_t uptime_info = { 97 95 .name = "uptime", 98 .description = " Show system uptime.",96 .description = "Print uptime information.", 99 97 .func = cmd_uptime, 100 98 .argc = 0 101 99 }; 102 100 103 /* Data and methods for 'continue' command. */104 101 static int cmd_continue(cmd_arg_t *argv); 105 102 static cmd_info_t continue_info = { … … 111 108 112 109 #ifdef CONFIG_TEST 113 /* Data and methods for 'test' command. */114 110 static char test_buf[MAX_CMDLINE + 1]; 115 111 static int cmd_test(cmd_arg_t *argv); … … 123 119 static cmd_info_t test_info = { 124 120 .name = "test", 125 .description = " <test> Listkernel tests or run a test.",121 .description = "Print list of kernel tests or run a test.", 126 122 .func = cmd_test, 127 123 .argc = 1, … … 129 125 }; 130 126 131 /* Data and methods for 'bench' command. */132 127 static int cmd_bench(cmd_arg_t *argv); 133 128 static cmd_arg_t bench_argv[] = { … … 143 138 static cmd_info_t bench_info = { 144 139 .name = "bench", 145 .description = " <test> <count>Run kernel test as benchmark.",140 .description = "Run kernel test as benchmark.", 146 141 .func = cmd_bench, 147 142 .argc = 2, … … 153 148 static int cmd_desc(cmd_arg_t *argv); 154 149 static void desc_help(void); 155 static char desc_buf[MAX_CMDLINE +1];150 static char desc_buf[MAX_CMDLINE+1]; 156 151 static cmd_arg_t desc_argv = { 157 152 .type = ARG_TYPE_STRING, … … 161 156 static cmd_info_t desc_info = { 162 157 .name = "describe", 163 .description = " <command>Describe specified command.",158 .description = "Describe specified command.", 164 159 .help = desc_help, 165 160 .func = cmd_desc, … … 170 165 /* Data and methods for 'symaddr' command. */ 171 166 static int cmd_symaddr(cmd_arg_t *argv); 172 static char symaddr_buf[MAX_CMDLINE +1];167 static char symaddr_buf[MAX_CMDLINE+1]; 173 168 static cmd_arg_t symaddr_argv = { 174 169 .type = ARG_TYPE_STRING, … … 178 173 static cmd_info_t symaddr_info = { 179 174 .name = "symaddr", 180 .description = " <symbol>Return symbol address.",175 .description = "Return symbol address.", 181 176 .func = cmd_symaddr, 182 177 .argc = 1, … … 184 179 }; 185 180 186 /* Data and methods for 'set4' command. */ 187 static char set_buf[MAX_CMDLINE + 1]; 181 static char set_buf[MAX_CMDLINE+1]; 188 182 static int cmd_set4(cmd_arg_t *argv); 189 183 static cmd_arg_t set4_argv[] = { … … 199 193 static cmd_info_t set4_info = { 200 194 .name = "set4", 201 .description = " <addr> <value> Set 4B memory location to a value.",195 .description = "set <dest_addr> <value> - 4byte version", 202 196 .func = cmd_set4, 203 197 .argc = 2, … … 219 213 static cmd_info_t call0_info = { 220 214 .name = "call0", 221 .description = " <function> Call function().",215 .description = "call0 <function> -> call function().", 222 216 .func = cmd_call0, 223 217 .argc = 1, … … 234 228 static cmd_info_t mcall0_info = { 235 229 .name = "mcall0", 236 .description = " <function> Call function() on each CPU.",230 .description = "mcall0 <function> -> call function() on each CPU.", 237 231 .func = cmd_mcall0, 238 232 .argc = 1, … … 256 250 static cmd_info_t call1_info = { 257 251 .name = "call1", 258 .description = " <function> <arg1> Call function(arg1).",252 .description = "call1 <function> <arg1> -> call function(arg1).", 259 253 .func = cmd_call1, 260 254 .argc = 2, … … 283 277 static cmd_info_t call2_info = { 284 278 .name = "call2", 285 .description = " <function> <arg1> <arg2> Call function(arg1,arg2).",279 .description = "call2 <function> <arg1> <arg2> -> call function(arg1,arg2).", 286 280 .func = cmd_call2, 287 281 .argc = 3, … … 316 310 static cmd_info_t call3_info = { 317 311 .name = "call3", 318 .description = " <function> <arg1> <arg2> <arg3> Call function(arg1, arg2,arg3).",312 .description = "call3 <function> <arg1> <arg2> <arg3> -> call function(arg1,arg2,arg3).", 319 313 .func = cmd_call3, 320 314 .argc = 4, … … 346 340 cmd_info_t tlb_info = { 347 341 .name = "tlb", 348 .description = "Print TLB of the current CPU.",342 .description = "Print TLB of current processor.", 349 343 .help = NULL, 350 344 .func = cmd_tlb, … … 383 377 }; 384 378 385 /* Data and methods for 'btrace' command */386 static int cmd_btrace(cmd_arg_t *argv);387 static cmd_arg_t btrace_argv = {388 .type = ARG_TYPE_INT,389 };390 static cmd_info_t btrace_info = {391 .name = "btrace",392 .description = "<threadid> Show thread stack trace.",393 .func = cmd_btrace,394 .argc = 1,395 .argv = &btrace_argv396 };397 379 398 380 static int cmd_sched(cmd_arg_t *argv); 399 381 static cmd_info_t sched_info = { 400 382 .name = "scheduler", 401 .description = " Showscheduler information.",383 .description = "List all scheduler information.", 402 384 .func = cmd_sched, 403 385 .argc = 0 … … 424 406 static cmd_info_t zones_info = { 425 407 .name = "zones", 426 .description = "List memory zones.",408 .description = "List of memory zones.", 427 409 .func = cmd_zones, 428 410 .argc = 0 411 }; 412 413 /* Data and methods for 'ipc' command */ 414 static int cmd_ipc(cmd_arg_t *argv); 415 static cmd_arg_t ipc_argv = { 416 .type = ARG_TYPE_INT, 417 }; 418 static cmd_info_t ipc_info = { 419 .name = "ipc", 420 .description = "ipc <taskid> Show IPC information of given task.", 421 .func = cmd_ipc, 422 .argc = 1, 423 .argv = &ipc_argv 424 }; 425 426 /* Data and methods for 'kill' command */ 427 static int cmd_kill(cmd_arg_t *argv); 428 static cmd_arg_t kill_argv = { 429 .type = ARG_TYPE_INT, 430 }; 431 static cmd_info_t kill_info = { 432 .name = "kill", 433 .description = "kill <taskid> Kill a task.", 434 .func = cmd_kill, 435 .argc = 1, 436 .argv = &kill_argv 429 437 }; 430 438 … … 437 445 static cmd_info_t zone_info = { 438 446 .name = "zone", 439 .description = " <zone>Show memory zone structure.",447 .description = "Show memory zone structure.", 440 448 .func = cmd_zone, 441 449 .argc = 1, 442 450 .argv = &zone_argv 443 };444 445 /* Data and methods for 'ipc' command */446 static int cmd_ipc(cmd_arg_t *argv);447 static cmd_arg_t ipc_argv = {448 .type = ARG_TYPE_INT,449 };450 static cmd_info_t ipc_info = {451 .name = "ipc",452 .description = "<taskid> Show IPC information of a task.",453 .func = cmd_ipc,454 .argc = 1,455 .argv = &ipc_argv456 };457 458 /* Data and methods for 'kill' command */459 static int cmd_kill(cmd_arg_t *argv);460 static cmd_arg_t kill_argv = {461 .type = ARG_TYPE_INT,462 };463 static cmd_info_t kill_info = {464 .name = "kill",465 .description = "<taskid> Kill a task.",466 .func = cmd_kill,467 .argc = 1,468 .argv = &kill_argv469 451 }; 470 452 … … 492 474 493 475 static cmd_info_t *basic_commands[] = { 494 &btrace_info,495 476 &call0_info, 496 477 &mcall0_info, … … 501 482 &cpus_info, 502 483 &desc_info, 484 &reboot_info, 485 &uptime_info, 503 486 &halt_info, 504 487 &help_info, 505 488 &ipc_info, 506 489 &kill_info, 507 &physmem_info,508 &reboot_info,509 &sched_info,510 490 &set4_info, 511 491 &slabs_info, 492 &sysinfo_info, 512 493 &symaddr_info, 513 &sysinfo_info, 494 &sched_info, 495 &threads_info, 514 496 &tasks_info, 515 & threads_info,497 &physmem_info, 516 498 &tlb_info, 517 &uptime_info,518 499 &version_info, 519 500 &zones_info, … … 550 531 } 551 532 533 552 534 /** List supported commands. 553 535 * … … 592 574 } 593 575 576 594 577 /** Reboot the system. 595 578 * … … 605 588 return 1; 606 589 } 590 607 591 608 592 /** Print system uptime information. … … 840 824 } 841 825 826 842 827 /** Print detailed description of 'describe' command. */ 843 828 void desc_help(void) … … 926 911 * @return Always 1 927 912 */ 928 int cmd_slabs(cmd_arg_t * argv)913 int cmd_slabs(cmd_arg_t * argv) 929 914 { 930 915 slab_print_list(); … … 938 923 * @return Always 1 939 924 */ 940 int cmd_sysinfo(cmd_arg_t * argv)925 int cmd_sysinfo(cmd_arg_t * argv) 941 926 { 942 927 sysinfo_dump(NULL); … … 944 929 } 945 930 946 /** Command for listing thread information 931 932 /** Command for listings Thread information 947 933 * 948 934 * @param argv Ignored … … 962 948 } 963 949 964 /** Command for listing task information950 /** Command for listings Task information 965 951 * 966 952 * @param argv Ignored … … 980 966 } 981 967 982 /** Command for printing thread stack trace 968 /** Command for listings Thread information 969 * 970 * @param argv Ignores 971 * 972 * @return Always 1 973 */ 974 int cmd_sched(cmd_arg_t * argv) 975 { 976 sched_print_list(); 977 return 1; 978 } 979 980 /** Command for listing memory zones 981 * 982 * @param argv Ignored 983 * 984 * return Always 1 985 */ 986 int cmd_zones(cmd_arg_t * argv) 987 { 988 zones_print_list(); 989 return 1; 990 } 991 992 /** Command for memory zone details 983 993 * 984 994 * @param argv Integer argument from cmdline expected 985 995 * 986 996 * return Always 1 987 * 988 */ 989 int cmd_btrace(cmd_arg_t *argv) 990 { 991 thread_stack_trace(argv[0].intval); 992 return 1; 993 } 994 995 /** Command for printing scheduler information 996 * 997 * @param argv Ignores 998 * 999 * @return Always 1 1000 */ 1001 int cmd_sched(cmd_arg_t *argv) 1002 { 1003 sched_print_list(); 1004 return 1; 1005 } 1006 1007 /** Command for listing memory zones 1008 * 1009 * @param argv Ignored 997 */ 998 int cmd_zone(cmd_arg_t * argv) 999 { 1000 zone_print_one(argv[0].intval); 1001 return 1; 1002 } 1003 1004 /** Command for printing task ipc details 1005 * 1006 * @param argv Integer argument from cmdline expected 1010 1007 * 1011 1008 * return Always 1 1012 1009 */ 1013 int cmd_ zones(cmd_arg_t *argv)1014 { 1015 zones_print_list();1016 return 1; 1017 } 1018 1019 /** Command for memory zone details1010 int cmd_ipc(cmd_arg_t * argv) 1011 { 1012 ipc_print_task(argv[0].intval); 1013 return 1; 1014 } 1015 1016 /** Command for killing a task 1020 1017 * 1021 1018 * @param argv Integer argument from cmdline expected 1022 1019 * 1023 * return Always 11024 */1025 int cmd_zone(cmd_arg_t *argv)1026 {1027 zone_print_one(argv[0].intval);1028 return 1;1029 }1030 1031 /** Command for printing task IPC details1032 *1033 * @param argv Integer argument from cmdline expected1034 *1035 * return Always 11036 */1037 int cmd_ipc(cmd_arg_t *argv)1038 {1039 ipc_print_task(argv[0].intval);1040 return 1;1041 }1042 1043 /** Command for killing a task1044 *1045 * @param argv Integer argument from cmdline expected1046 *1047 1020 * return 0 on failure, 1 on success. 1048 1021 */ 1049 int cmd_kill(cmd_arg_t * argv)1022 int cmd_kill(cmd_arg_t * argv) 1050 1023 { 1051 1024 if (task_kill(argv[0].intval) != EOK)
Note:
See TracChangeset
for help on using the changeset viewer.