Subversion Repositories HelenOS

Rev

Rev 4180 | Rev 4310 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 4180 Rev 4214
Line 44... Line 44...
44
struct indev;
44
struct indev;
45
 
45
 
46
/* Input character device operations interface. */
46
/* Input character device operations interface. */
47
typedef struct {
47
typedef struct {
48
    /** Read character directly from device, assume interrupts disabled. */
48
    /** Read character directly from device, assume interrupts disabled. */
49
    char (* poll)(struct indev *);
49
    wchar_t (* poll)(struct indev *);
50
} indev_operations_t;
50
} indev_operations_t;
51
 
51
 
52
/** Character input device. */
52
/** Character input device. */
53
typedef struct indev {
53
typedef struct indev {
54
    char *name;
54
    char *name;
55
    waitq_t wq;
55
    waitq_t wq;
56
   
56
   
57
    /** Protects everything below. */
57
    /** Protects everything below. */
58
    SPINLOCK_DECLARE(lock);
58
    SPINLOCK_DECLARE(lock);
59
    uint8_t buffer[INDEV_BUFLEN];
59
    wchar_t buffer[INDEV_BUFLEN];
60
    count_t counter;
60
    count_t counter;
61
   
61
   
62
    /** Implementation of indev operations. */
62
    /** Implementation of indev operations. */
63
    indev_operations_t *op;
63
    indev_operations_t *op;
64
    index_t index;
64
    index_t index;
Line 69... Line 69...
69
struct outdev;
69
struct outdev;
70
 
70
 
71
/* Output character device operations interface. */
71
/* Output character device operations interface. */
72
typedef struct {
72
typedef struct {
73
    /** Write character to output. */
73
    /** Write character to output. */
74
    void (* write)(struct outdev *, wchar_t c, bool silent);
74
    void (* write)(struct outdev *, wchar_t, bool);
75
} outdev_operations_t;
75
} outdev_operations_t;
76
 
76
 
77
/** Character input device. */
77
/** Character input device. */
78
typedef struct outdev {
78
typedef struct outdev {
79
    char *name;
79
    char *name;
Line 86... Line 86...
86
    void *data;
86
    void *data;
87
} outdev_t;
87
} outdev_t;
88
 
88
 
89
extern void indev_initialize(char *name, indev_t *indev,
89
extern void indev_initialize(char *name, indev_t *indev,
90
    indev_operations_t *op);
90
    indev_operations_t *op);
91
extern void indev_push_character(indev_t *indev, uint8_t ch);
91
extern void indev_push_character(indev_t *indev, wchar_t ch);
92
 
92
 
93
extern void outdev_initialize(char *name, outdev_t *outdev,
93
extern void outdev_initialize(char *name, outdev_t *outdev,
94
    outdev_operations_t *op);
94
    outdev_operations_t *op);
95
 
95
 
96
#endif /* KERN_CHARDEV_H_ */
96
#endif /* KERN_CHARDEV_H_ */