Changeset 0132630 in mainline for generic/src/console/cmd.c


Ignore:
Timestamp:
2006-01-03T21:55:31Z (19 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
b524c5e0
Parents:
93e90c7
Message:

Add 'version' and 'cpus' kconsole commands.
Remove leading p from names of p* commands.

File:
1 edited

Legend:

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

    r93e90c7 r0132630  
    4646#include <debug.h>
    4747#include <symtab.h>
    48 
     48#include <cpu.h>
    4949#include <mm/tlb.h>
    5050#include <arch/mm/tlb.h>
    5151#include <mm/frame.h>
     52#include <main/version.h>
    5253
    5354/** Data and methods for 'help' command. */
     
    119120        .argv = set4_argv
    120121};
    121 
    122 
    123122
    124123/** Data and methods for 'call0' command. */
     
    233232};
    234233
    235 /** Data and methods for 'ptlb' command. */
    236 static int cmd_ptlb(cmd_arg_t *argv);
    237 cmd_info_t ptlb_info = {
    238         .name = "ptlb",
     234/** Data and methods for 'tlb' command. */
     235static int cmd_tlb(cmd_arg_t *argv);
     236cmd_info_t tlb_info = {
     237        .name = "tlb",
    239238        .description = "Print TLB of current processor.",
    240239        .help = NULL,
    241         .func = cmd_ptlb,
     240        .func = cmd_tlb,
    242241        .argc = 0,
    243242        .argv = NULL
     
    263262};
    264263
    265 
    266264static cmd_info_t zone_info = {
    267265        .name = "zone",
     
    272270};
    273271
     272/** Data and methods for 'cpus' command. */
     273static int cmd_cpus(cmd_arg_t *argv);
     274cmd_info_t cpus_info = {
     275        .name = "cpus",
     276        .description = "List all processors.",
     277        .help = NULL,
     278        .func = cmd_cpus,
     279        .argc = 0,
     280        .argv = NULL
     281};
     282
     283/** Data and methods for 'version' command. */
     284static int cmd_version(cmd_arg_t *argv);
     285cmd_info_t version_info = {
     286        .name = "version",
     287        .description = "Print version information.",
     288        .help = NULL,
     289        .func = cmd_version,
     290        .argc = 0,
     291        .argv = NULL
     292};
     293
     294
    274295
    275296
     
    328349                panic("could not register command %s\n", halt_info.name);
    329350
    330         cmd_initialize(&ptlb_info);
    331         if (!cmd_register(&ptlb_info))
    332                 panic("could not register command %s\n", ptlb_info.name);
     351        cmd_initialize(&tlb_info);
     352        if (!cmd_register(&tlb_info))
     353                panic("could not register command %s\n", tlb_info.name);
    333354
    334355        cmd_initialize(&zones_info);
     
    340361                panic("could not register command %s\n", zone_info.name);
    341362
     363        cmd_initialize(&cpus_info);
     364        if (!cmd_register(&cpus_info))
     365                panic("could not register command %s\n", cpus_info.name);
     366               
     367        cmd_initialize(&version_info);
     368        if (!cmd_register(&version_info))
     369                panic("could not register command %s\n", version_info.name);
     370               
     371               
    342372
    343373}
     
    539569 * @return Always returns 1.
    540570 */
    541 int cmd_ptlb(cmd_arg_t *argv)
     571int cmd_tlb(cmd_arg_t *argv)
    542572{
    543573        tlb_print();
     
    577607}
    578608
    579 
    580609int cmd_zones(cmd_arg_t * argv) {
    581610        printf("Zones listing not implemented\n");
    582611        return 1;
    583612}
     613
    584614int cmd_zone(cmd_arg_t * argv) {
    585615        printf("Zone details not implemented\n");
     
    587617}
    588618
     619/** Command for listing processors.
     620 *
     621 * @param argv Ignored.
     622 *
     623 * return Always 1.
     624 */
     625int cmd_cpus(cmd_arg_t *argv)
     626{
     627        cpu_list();
     628        return 1;
     629}
     630
     631/** Command for printing kernel version.
     632 *
     633 * @param argv Ignored.
     634 *
     635 * return Always 1.
     636 */
     637int cmd_version(cmd_arg_t *argv)
     638{
     639        version_print();
     640        return 1;
     641}
Note: See TracChangeset for help on using the changeset viewer.