Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • kernel/generic/src/console/cmd.c

    rdf58e44 r96b02eb9  
    7878static cmd_info_t help_info = {
    7979        .name = "help",
    80         .description = "List supported commands.",
     80        .description = "List of supported commands.",
    8181        .func = cmd_help,
    8282        .argc = 0
    8383};
    8484
    85 /* Data and methods for 'reboot' command. */
    8685static int cmd_reboot(cmd_arg_t *argv);
    8786static cmd_info_t reboot_info = {
    8887        .name = "reboot",
    89         .description = "Reboot system.",
     88        .description = "Reboot.",
    9089        .func = cmd_reboot,
    9190        .argc = 0
    9291};
    9392
    94 /* Data and methods for 'uptime' command. */
    9593static int cmd_uptime(cmd_arg_t *argv);
    9694static cmd_info_t uptime_info = {
    9795        .name = "uptime",
    98         .description = "Show system uptime.",
     96        .description = "Print uptime information.",
    9997        .func = cmd_uptime,
    10098        .argc = 0
    10199};
    102100
    103 /* Data and methods for 'continue' command. */
    104101static int cmd_continue(cmd_arg_t *argv);
    105102static cmd_info_t continue_info = {
     
    111108
    112109#ifdef CONFIG_TEST
    113 /* Data and methods for 'test' command. */
    114110static char test_buf[MAX_CMDLINE + 1];
    115111static int cmd_test(cmd_arg_t *argv);
     
    123119static cmd_info_t test_info = {
    124120        .name = "test",
    125         .description = "<test> List kernel tests or run a test.",
     121        .description = "Print list of kernel tests or run a test.",
    126122        .func = cmd_test,
    127123        .argc = 1,
     
    129125};
    130126
    131 /* Data and methods for 'bench' command. */
    132127static int cmd_bench(cmd_arg_t *argv);
    133128static cmd_arg_t bench_argv[] = {
     
    143138static cmd_info_t bench_info = {
    144139        .name = "bench",
    145         .description = "<test> <count> Run kernel test as benchmark.",
     140        .description = "Run kernel test as benchmark.",
    146141        .func = cmd_bench,
    147142        .argc = 2,
     
    153148static int cmd_desc(cmd_arg_t *argv);
    154149static void desc_help(void);
    155 static char desc_buf[MAX_CMDLINE + 1];
     150static char desc_buf[MAX_CMDLINE+1];
    156151static cmd_arg_t desc_argv = {
    157152        .type = ARG_TYPE_STRING,
     
    161156static cmd_info_t desc_info = {
    162157        .name = "describe",
    163         .description = "<command> Describe specified command.",
     158        .description = "Describe specified command.",
    164159        .help = desc_help,
    165160        .func = cmd_desc,
     
    170165/* Data and methods for 'symaddr' command. */
    171166static int cmd_symaddr(cmd_arg_t *argv);
    172 static char symaddr_buf[MAX_CMDLINE + 1];
     167static char symaddr_buf[MAX_CMDLINE+1];
    173168static cmd_arg_t symaddr_argv = {
    174169        .type = ARG_TYPE_STRING,
     
    178173static cmd_info_t symaddr_info = {
    179174        .name = "symaddr",
    180         .description = "<symbol> Return symbol address.",
     175        .description = "Return symbol address.",
    181176        .func = cmd_symaddr,
    182177        .argc = 1,
     
    184179};
    185180
    186 /* Data and methods for 'set4' command. */
    187 static char set_buf[MAX_CMDLINE + 1];
     181static char set_buf[MAX_CMDLINE+1];
    188182static int cmd_set4(cmd_arg_t *argv);
    189183static cmd_arg_t set4_argv[] = {
     
    199193static cmd_info_t set4_info = {
    200194        .name = "set4",
    201         .description = "<addr> <value> Set 4B memory location to a value.",
     195        .description = "set <dest_addr> <value> - 4byte version",
    202196        .func = cmd_set4,
    203197        .argc = 2,
     
    219213static cmd_info_t call0_info = {
    220214        .name = "call0",
    221         .description = "<function> Call function().",
     215        .description = "call0 <function> -> call function().",
    222216        .func = cmd_call0,
    223217        .argc = 1,
     
    234228static cmd_info_t mcall0_info = {
    235229        .name = "mcall0",
    236         .description = "<function> Call function() on each CPU.",
     230        .description = "mcall0 <function> -> call function() on each CPU.",
    237231        .func = cmd_mcall0,
    238232        .argc = 1,
     
    256250static cmd_info_t call1_info = {
    257251        .name = "call1",
    258         .description = "<function> <arg1> Call function(arg1).",
     252        .description = "call1 <function> <arg1> -> call function(arg1).",
    259253        .func = cmd_call1,
    260254        .argc = 2,
     
    283277static cmd_info_t call2_info = {
    284278        .name = "call2",
    285         .description = "<function> <arg1> <arg2> Call function(arg1, arg2).",
     279        .description = "call2 <function> <arg1> <arg2> -> call function(arg1,arg2).",
    286280        .func = cmd_call2,
    287281        .argc = 3,
     
    316310static cmd_info_t call3_info = {
    317311        .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).",
    319313        .func = cmd_call3,
    320314        .argc = 4,
     
    346340cmd_info_t tlb_info = {
    347341        .name = "tlb",
    348         .description = "Print TLB of the current CPU.",
     342        .description = "Print TLB of current processor.",
    349343        .help = NULL,
    350344        .func = cmd_tlb,
     
    383377};
    384378
    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 };
    397379
    398380static int cmd_sched(cmd_arg_t *argv);
    399381static cmd_info_t sched_info = {
    400382        .name = "scheduler",
    401         .description = "Show scheduler information.",
     383        .description = "List all scheduler information.",
    402384        .func = cmd_sched,
    403385        .argc = 0
     
    424406static cmd_info_t zones_info = {
    425407        .name = "zones",
    426         .description = "List memory zones.",
     408        .description = "List of memory zones.",
    427409        .func = cmd_zones,
    428410        .argc = 0
     411};
     412
     413/* Data and methods for 'ipc' command */
     414static int cmd_ipc(cmd_arg_t *argv);
     415static cmd_arg_t ipc_argv = {
     416        .type = ARG_TYPE_INT,
     417};
     418static 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 */
     427static int cmd_kill(cmd_arg_t *argv);
     428static cmd_arg_t kill_argv = {
     429        .type = ARG_TYPE_INT,
     430};
     431static 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
    429437};
    430438
     
    437445static cmd_info_t zone_info = {
    438446        .name = "zone",
    439         .description = "<zone> Show memory zone structure.",
     447        .description = "Show memory zone structure.",
    440448        .func = cmd_zone,
    441449        .argc = 1,
    442450        .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_argv
    456 };
    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_argv
    469451};
    470452
     
    492474
    493475static cmd_info_t *basic_commands[] = {
    494         &btrace_info,
    495476        &call0_info,
    496477        &mcall0_info,
     
    501482        &cpus_info,
    502483        &desc_info,
     484        &reboot_info,
     485        &uptime_info,
    503486        &halt_info,
    504487        &help_info,
    505488        &ipc_info,
    506489        &kill_info,
    507         &physmem_info,
    508         &reboot_info,
    509         &sched_info,
    510490        &set4_info,
    511491        &slabs_info,
     492        &sysinfo_info,
    512493        &symaddr_info,
    513         &sysinfo_info,
     494        &sched_info,
     495        &threads_info,
    514496        &tasks_info,
    515         &threads_info,
     497        &physmem_info,
    516498        &tlb_info,
    517         &uptime_info,
    518499        &version_info,
    519500        &zones_info,
     
    550531}
    551532
     533
    552534/** List supported commands.
    553535 *
     
    592574}
    593575
     576
    594577/** Reboot the system.
    595578 *
     
    605588        return 1;
    606589}
     590
    607591
    608592/** Print system uptime information.
     
    840824}
    841825
     826
    842827/** Print detailed description of 'describe' command. */
    843828void desc_help(void)
     
    926911 * @return Always 1
    927912 */
    928 int cmd_slabs(cmd_arg_t *argv)
     913int cmd_slabs(cmd_arg_t * argv)
    929914{
    930915        slab_print_list();
     
    938923 * @return Always 1
    939924 */
    940 int cmd_sysinfo(cmd_arg_t *argv)
     925int cmd_sysinfo(cmd_arg_t * argv)
    941926{
    942927        sysinfo_dump(NULL);
     
    944929}
    945930
    946 /** Command for listing thread information
     931
     932/** Command for listings Thread information
    947933 *
    948934 * @param argv Ignored
     
    962948}
    963949
    964 /** Command for listing task information
     950/** Command for listings Task information
    965951 *
    966952 * @param argv Ignored
     
    980966}
    981967
    982 /** Command for printing thread stack trace
     968/** Command for listings Thread information
     969 *
     970 * @param argv Ignores
     971 *
     972 * @return Always 1
     973 */
     974int 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 */
     986int cmd_zones(cmd_arg_t * argv)
     987{
     988        zones_print_list();
     989        return 1;
     990}
     991
     992/** Command for memory zone details
    983993 *
    984994 * @param argv Integer argument from cmdline expected
    985995 *
    986996 * 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 */
     998int 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
    10101007 *
    10111008 * return Always 1
    10121009 */
    1013 int cmd_zones(cmd_arg_t *argv)
    1014 {
    1015         zones_print_list();
    1016         return 1;
    1017 }
    1018 
    1019 /** Command for memory zone details
     1010int 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
    10201017 *
    10211018 * @param argv Integer argument from cmdline expected
    10221019 *
    1023  * return Always 1
    1024  */
    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 details
    1032  *
    1033  * @param argv Integer argument from cmdline expected
    1034  *
    1035  * return Always 1
    1036  */
    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 task
    1044  *
    1045  * @param argv Integer argument from cmdline expected
    1046  *
    10471020 * return 0 on failure, 1 on success.
    10481021 */
    1049 int cmd_kill(cmd_arg_t *argv)
     1022int cmd_kill(cmd_arg_t * argv)
    10501023{
    10511024        if (task_kill(argv[0].intval) != EOK)
Note: See TracChangeset for help on using the changeset viewer.