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