597151d963
The new API now covers the entire character driver protocol, while hiding all the message details. It should therefore be used by all new character drivers. All existing drivers that already made use of libchardriver have been changed to use the new API. As one of the most important API changes, support for scatter and gather transfers has been removed, as several key drivers already did not support this, and it could be supported at the safecopy level instead (for a future readv/writev). Additional changes include: - respond to block device open requests to avoid hanging VFS threads; - add support for sef_cancel. Change-Id: I1bab6c1cb66916c71b87aeb1db54a9bdf171fe6b
30 lines
632 B
C
30 lines
632 B
C
/* Includes. */
|
|
#include <minix/drivers.h>
|
|
#include <minix/chardriver.h>
|
|
#include <minix/type.h>
|
|
#include <minix/const.h>
|
|
#include <minix/com.h>
|
|
#include <sys/types.h>
|
|
#include <minix/ipc.h>
|
|
|
|
/* Constants and types. */
|
|
|
|
#define LOG_SIZE (50*1024)
|
|
|
|
struct logdevice {
|
|
char log_buffer[LOG_SIZE];
|
|
int log_size, /* no. of bytes in log buffer */
|
|
log_read, /* read mark */
|
|
log_write; /* write mark */
|
|
endpoint_t log_source;
|
|
cdev_id_t log_id;
|
|
int log_iosize,
|
|
log_status;
|
|
cp_grant_id_t log_grant;
|
|
int log_selected, log_select_proc;
|
|
};
|
|
|
|
/* Function prototypes. */
|
|
void do_new_kmess(void);
|
|
void log_append(char *buf, int len);
|
|
|