Changeset ff3b3197 in mainline for generic/include/main/kconsole.h


Ignore:
Timestamp:
2005-11-25T22:58:38Z (20 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
f4338d2
Parents:
78c32b4
Message:

Implement basic kernel console command recognition.
Commands without arguments are now recognized.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • generic/include/main/kconsole.h

    r78c32b4 rff3b3197  
    3030#define __KCONSOLE_H__
    3131
     32#include <typedefs.h>
     33#include <list.h>
     34#include <synch/spinlock.h>
     35
     36enum cmd_arg_type {
     37        ARG_TYPE_INVALID = 0,
     38        ARG_TYPE_INT,
     39        ARG_TYPE_STRING
     40};
     41
     42/** Structure representing one argument of kconsole command line. */
     43struct cmd_arg {
     44        cmd_arg_type_t type;            /**< Type descriptor. */
     45        void *buffer;                   /**< Buffer where to store data. */
     46        size_t buflen;                  /**< Size of the buffer. */
     47};
     48
     49/** Structure representing one kconsole command. */
     50struct cmd_info {
     51        link_t link;                    /**< Command list link. */
     52        spinlock_t lock;                /**< This lock protects everything below. */
     53        const char *name;               /**< Command name. */
     54        const char *description;        /**< Textual description. */
     55        int (* func)(cmd_arg_t *cmd);   /**< Function implementing the command. */
     56        count_t argc;                   /**< Number of arguments. */
     57        cmd_arg_t *argv;                /**< Argument vector. */
     58};
     59
     60extern spinlock_t cmd_lock;
     61extern link_t cmd_head;
     62
     63extern void kconsole_init(void);
    3264extern void kconsole(void *arg);
    3365
     66extern int cmd_register(cmd_info_t *cmd);
     67
    3468#endif
Note: See TracChangeset for help on using the changeset viewer.