/trunk/kernel/generic/include/console/kconsole.h |
---|
45,42 → 45,28 |
ARG_TYPE_INVALID = 0, |
ARG_TYPE_INT, |
ARG_TYPE_STRING, |
/** Variable type - either symbol or string. */ |
ARG_TYPE_VAR |
ARG_TYPE_VAR /**< Variable type - either symbol or string */ |
} cmd_arg_type_t; |
/** Structure representing one argument of kconsole command line. */ |
typedef struct { |
/** 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_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 */ |
} cmd_arg_t; |
/** Structure representing one kconsole command. */ |
typedef struct { |
/** 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); |
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. */ |
} cmd_info_t; |
SPINLOCK_EXTERN(cmd_lock); |
/trunk/kernel/generic/include/console/chardev.h |
---|
45,13 → 45,10 |
/* Character device operations interface. */ |
typedef struct { |
/** 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. */ |
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 */ |
char (* read)(struct chardev *); |
} chardev_operations_t; |
60,18 → 57,17 |
char *name; |
waitq_t wq; |
/** Protects everything below. */ |
SPINLOCK_DECLARE(lock); |
SPINLOCK_DECLARE(lock); /**< Protects everything below. */ |
uint8_t buffer[CHARDEV_BUFLEN]; |
count_t counter; |
/** Implementation of chardev operations. */ |
chardev_operations_t *op; |
chardev_operations_t *op; /**< Implementation of chardev operations. */ |
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_ */ |