1 #ifndef __LUNAIX_TERM_H
2 #define __LUNAIX_TERM_H
4 #include <lunaix/device.h>
5 #include <lunaix/ds/rbuffer.h>
6 #include <lunaix/ds/waitq.h>
7 #include <lunaix/signal_defs.h>
9 #include <usr/lunaix/term.h>
16 struct rbuffer* current;
21 #define LEVT_EOF (1 << 1)
22 #define LEVT_SIGRAISE (1 << 2)
24 typedef struct rbuffer** lbuf_ref_t;
25 #define ref_current(lbuf) (&(lbuf)->current)
26 #define ref_next(lbuf) (&(lbuf)->next)
27 #define deref(bref) (*(bref))
31 struct termport_pot_ops
33 void (*set_speed)(struct device*, speed_t);
34 void (*set_clkbase)(struct device*, unsigned int);
35 void (*set_cntrl_mode)(struct device*, tcflag_t);
38 struct termport_potens
41 struct termport_pot_ops* ops;
49 struct linebuffer line_out;
50 struct linebuffer line_in;
54 struct termport_potens* tp_cap;
55 waitq_t line_in_event;
57 /* -- POSIX.1-2008 compliant fields -- */
64 /* -- END POSIX.1-2008 compliant fields -- */
67 tcflag_t tflags; // temp flags
70 extern struct device* sysconsole;
72 struct termport_potens*
73 term_attach_potens(struct device* chardev,
74 struct termport_pot_ops* ops, char* suffix);
77 term_bind(struct term* tdev, struct device* chdev);
80 line_flip(struct linebuffer* lbf)
82 struct rbuffer* tmp = lbf->current;
83 lbf->current = lbf->next;
88 line_alloc(struct linebuffer* lbf, size_t sz_hlf);
91 line_free(struct linebuffer* lbf, size_t sz_hlf);
94 term_sendsig(struct term* tdev, int signal);
97 term_flush(struct term* tdev);
100 term_read(struct term* tdev);
103 lcntl_transform_inseq(struct term* tdev);
106 lcntl_transform_outseq(struct term* tdev);
109 term_notify_data_avaliable(struct termport_potens* cap);
111 #endif /* __LUNAIX_TERM_H */