Changeset 48dcc69 in mainline for kernel/generic/src/console/cmd.c
- Timestamp:
- 2010-06-11T10:52:57Z (15 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- be06914
- Parents:
- c0f13d2
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/generic/src/console/cmd.c
rc0f13d2 r48dcc69 355 355 }; 356 356 357 static char flag_buf[MAX_CMDLINE + 1]; 358 357 359 static int cmd_threads(cmd_arg_t *argv); 360 static cmd_arg_t threads_argv = { 361 .type = ARG_TYPE_STRING_OPTIONAL, 362 .buffer = flag_buf, 363 .len = sizeof(flag_buf) 364 }; 358 365 static cmd_info_t threads_info = { 359 366 .name = "threads", 360 .description = "List all threads .",367 .description = "List all threads (use -a for additional information).", 361 368 .func = cmd_threads, 362 .argc = 0363 }; 364 369 .argc = 1, 370 .argv = &threads_argv 371 }; 365 372 366 373 static int cmd_tasks(cmd_arg_t *argv); 367 static char tasks_buf[MAX_CMDLINE + 1];368 369 374 static cmd_arg_t tasks_argv = { 370 375 .type = ARG_TYPE_STRING_OPTIONAL, 371 .buffer = tasks_buf,372 .len = sizeof( tasks_buf)376 .buffer = flag_buf, 377 .len = sizeof(flag_buf) 373 378 }; 374 379 static cmd_info_t tasks_info = { … … 923 928 /** Command for listings Thread information 924 929 * 925 * @param argv Ignore s930 * @param argv Ignored 926 931 * 927 932 * @return Always 1 928 933 */ 929 int cmd_threads(cmd_arg_t * argv) 930 { 931 thread_print_list(); 934 int cmd_threads(cmd_arg_t *argv) 935 { 936 if (str_cmp(flag_buf, "-a") == 0) 937 thread_print_list(true); 938 else if (str_cmp(flag_buf, "") == 0) 939 thread_print_list(false); 940 else 941 printf("Unknown argument \"%s\".\n", flag_buf); 942 932 943 return 1; 933 944 } … … 935 946 /** Command for listings Task information 936 947 * 937 * @param argv Ignore s948 * @param argv Ignored 938 949 * 939 950 * @return Always 1 … … 941 952 int cmd_tasks(cmd_arg_t *argv) 942 953 { 943 if (str_cmp( tasks_buf, "-a") == 0)954 if (str_cmp(flag_buf, "-a") == 0) 944 955 task_print_list(true); 945 else if (str_cmp( tasks_buf, "") == 0)956 else if (str_cmp(flag_buf, "") == 0) 946 957 task_print_list(false); 947 958 else 948 printf("Unknown argument \"%s\".\n", tasks_buf);959 printf("Unknown argument \"%s\".\n", flag_buf); 949 960 950 961 return 1;
Note:
See TracChangeset
for help on using the changeset viewer.