Changeset b3f8fb7 in mainline for kernel/generic/include/console


Ignore:
Timestamp:
2007-01-28T13:25:49Z (19 years ago)
Author:
Martin Decky <martin@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
8e8c1a5
Parents:
1ba41c5
Message:

huge type system cleanup
remove cyclical type dependencies across multiple header files
many minor coding style fixes

Location:
kernel/generic/include/console
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • kernel/generic/include/console/chardev.h

    r1ba41c5 rb3f8fb7  
    3636#define KERN_CHARDEV_H_
    3737
    38 #include <typedefs.h>
    3938#include <arch/types.h>
    4039#include <synch/waitq.h>
     
    4342#define CHARDEV_BUFLEN 512
    4443
     44struct chardev;
     45
    4546/* Character device operations interface. */
    46 struct chardev_operations {
    47         void (* suspend)(chardev_t *);          /**< Suspend pushing characters. */
    48         void (* resume)(chardev_t *);           /**< Resume pushing characters. */
    49         void (* write)(chardev_t *, char c);    /**< Write character to stream. */
     47typedef struct {
     48        void (* suspend)(struct chardev *);             /**< Suspend pushing characters. */
     49        void (* resume)(struct chardev *);              /**< Resume pushing characters. */
     50        void (* write)(struct chardev *, char c);       /**< Write character to stream. */
    5051        /** Read character directly from device, assume interrupts disabled */
    51         char (* read)(chardev_t *);
    52 };
    53 
    54 typedef struct chardev_operations chardev_operations_t;
     52        char (* read)(struct chardev *);
     53} chardev_operations_t;
    5554
    5655/** Character input device. */
    57 struct chardev {
     56typedef struct chardev {
    5857        char *name;
    5958       
     
    6564        index_t index;
    6665        void *data;
    67 };
     66} chardev_t;
    6867
    6968extern void chardev_initialize(char *name,
  • kernel/generic/include/console/cmd.h

    r1ba41c5 rb3f8fb7  
    3636#define KERN_CMD_H_
    3737
    38 #include <typedefs.h>
     38#include <console/kconsole.h>
    3939
    4040extern void cmd_initialize(cmd_info_t *cmd);
  • kernel/generic/include/console/console.h

    r1ba41c5 rb3f8fb7  
    3737
    3838#include <arch/types.h>
    39 #include <typedefs.h>
     39#include <console/chardev.h>
    4040
    4141extern chardev_t *stdin;
  • kernel/generic/include/console/kconsole.h

    r1ba41c5 rb3f8fb7  
    3636#define KERN_KCONSOLE_H_
    3737
    38 #include <typedefs.h>
    3938#include <adt/list.h>
    4039#include <synch/spinlock.h>
     
    4342#define KCONSOLE_HISTORY 10
    4443
    45 enum cmd_arg_type {
     44typedef enum {
    4645        ARG_TYPE_INVALID = 0,
    4746        ARG_TYPE_INT,
    4847        ARG_TYPE_STRING,
    4948        ARG_TYPE_VAR      /**< Variable type - either symbol or string */
    50 };
     49} cmd_arg_type_t;
    5150
    5251/** Structure representing one argument of kconsole command line. */
    53 struct cmd_arg {
     52typedef struct {
    5453        cmd_arg_type_t type;            /**< Type descriptor. */
    5554        void *buffer;                   /**< Buffer where to store data. */
     
    5756        unative_t intval;                /**< Integer value */
    5857        cmd_arg_type_t vartype;         /**< Resulting type of variable arg */
    59 };
     58} cmd_arg_t;
    6059
    6160/** Structure representing one kconsole command. */
    62 struct cmd_info {
     61typedef struct {
    6362        link_t link;                    /**< Command list link. */
    6463        SPINLOCK_DECLARE(lock);         /**< This lock protects everything below. */
     
    6968        cmd_arg_t *argv;                /**< Argument vector. */
    7069        void (* help)(void);            /**< Function for printing detailed help. */
    71 };
     70} cmd_info_t;
    7271
    7372extern spinlock_t cmd_lock;
Note: See TracChangeset for help on using the changeset viewer.