Subversion Repositories HelenOS

Compare Revisions

Ignore whitespace Rev 2105 → Rev 2106

/trunk/kernel/generic/include/console/chardev.h
45,10 → 45,13
 
/* Character device operations interface. */
typedef struct {
void (* suspend)(struct chardev *); /**< Suspend pushing characters. */
void (* resume)(struct chardev *); /**< Resume pushing characters. */
void (* write)(struct chardev *, char c); /**< Write character to stream. */
/** Read character directly from device, assume interrupts disabled */
/** Suspend pushing characters. */
void (* suspend)(struct chardev *);
/** Resume pushing characters. */
void (* resume)(struct chardev *);
/** Write character to stream. */
void (* write)(struct chardev *, char c);
/** Read character directly from device, assume interrupts disabled. */
char (* read)(struct chardev *);
} chardev_operations_t;
 
57,17 → 60,18
char *name;
waitq_t wq;
SPINLOCK_DECLARE(lock); /**< Protects everything below. */
/** Protects everything below. */
SPINLOCK_DECLARE(lock);
uint8_t buffer[CHARDEV_BUFLEN];
count_t counter;
chardev_operations_t *op; /**< Implementation of chardev operations. */
/** Implementation of chardev operations. */
chardev_operations_t *op;
index_t index;
void *data;
} chardev_t;
 
extern void chardev_initialize(char *name,
chardev_t *chardev,
chardev_operations_t *op);
extern void chardev_initialize(char *name, chardev_t *chardev,
chardev_operations_t *op);
extern void chardev_push_character(chardev_t *chardev, uint8_t ch);
 
#endif /* KERN_CHARDEV_H_ */
/trunk/kernel/generic/include/console/kconsole.h
45,28 → 45,42
ARG_TYPE_INVALID = 0,
ARG_TYPE_INT,
ARG_TYPE_STRING,
ARG_TYPE_VAR /**< Variable type - either symbol or string */
/** Variable type - either symbol or string. */
ARG_TYPE_VAR
} cmd_arg_type_t;
 
/** Structure representing one argument of kconsole command line. */
typedef struct {
cmd_arg_type_t type; /**< Type descriptor. */
void *buffer; /**< Buffer where to store data. */
size_t len; /**< Size of the buffer. */
unative_t intval; /**< Integer value */
cmd_arg_type_t vartype; /**< Resulting type of variable arg */
/** Type descriptor. */
cmd_arg_type_t type;
/** Buffer where to store data. */
void *buffer;
/** Size of the buffer. */
size_t len;
/** Integer value. */
unative_t intval;
/** Resulting type of variable arg */
cmd_arg_type_t vartype;
} cmd_arg_t;
 
/** Structure representing one kconsole command. */
typedef struct {
link_t link; /**< Command list link. */
SPINLOCK_DECLARE(lock); /**< This lock protects everything below. */
const char *name; /**< Command name. */
const char *description; /**< Textual description. */
int (* func)(cmd_arg_t *); /**< Function implementing the command. */
count_t argc; /**< Number of arguments. */
cmd_arg_t *argv; /**< Argument vector. */
void (* help)(void); /**< Function for printing detailed help. */
/** Command list link. */
link_t link;
/** This lock protects everything below. */
SPINLOCK_DECLARE(lock);
/** Command name. */
const char *name;
/** Textual description. */
const char *description;
/** Function implementing the command. */
int (* func)(cmd_arg_t *);
/** Number of arguments. */
count_t argc;
/** Argument vector. */
cmd_arg_t *argv;
/** Function for printing detailed help. */
void (* help)(void);
} cmd_info_t;
 
SPINLOCK_EXTERN(cmd_lock);