git://scm.lunaixsky.com
/
lunaix-os.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
rewrite the device subsystem interfaces (#48)
[lunaix-os.git]
/
lunaix-os
/
includes
/
hal
/
term.h
diff --git
a/lunaix-os/includes/hal/term.h
b/lunaix-os/includes/hal/term.h
index 84da769beb0d4b4c4c9a805d074f08196822adca..be7abd0fdcda89163fb59139079e4b0299d2231f 100644
(file)
--- a/
lunaix-os/includes/hal/term.h
+++ b/
lunaix-os/includes/hal/term.h
@@
-3,6
+3,7
@@
#include <lunaix/device.h>
#include <lunaix/ds/rbuffer.h>
#include <lunaix/device.h>
#include <lunaix/ds/rbuffer.h>
+#include <lunaix/ds/waitq.h>
#include <lunaix/signal_defs.h>
#include <usr/lunaix/term.h>
#include <lunaix/signal_defs.h>
#include <usr/lunaix/term.h>
@@
-16,57
+17,64
@@
struct linebuffer
short sflags;
short sz_hlf;
};
short sflags;
short sz_hlf;
};
-#define L
STATE
_EOL (1)
-#define L
STATE
_EOF (1 << 1)
-#define L
STATE
_SIGRAISE (1 << 2)
+#define L
EVT
_EOL (1)
+#define L
EVT
_EOF (1 << 1)
+#define L
EVT
_SIGRAISE (1 << 2)
typedef struct rbuffer** lbuf_ref_t;
#define ref_current(lbuf) (&(lbuf)->current)
#define ref_next(lbuf) (&(lbuf)->next)
#define deref(bref) (*(bref))
typedef struct rbuffer** lbuf_ref_t;
#define ref_current(lbuf) (&(lbuf)->current)
#define ref_next(lbuf) (&(lbuf)->next)
#define deref(bref) (*(bref))
-struct term_lcntl
+struct term;
+
+struct termport_pot_ops
{
{
+ void (*set_speed)(struct device*, speed_t);
+ void (*set_clkbase)(struct device*, unsigned int);
+ void (*set_cntrl_mode)(struct device*, tcflag_t);
+};
+
+struct termport_potens
+{
+ POTENS_META;
+ struct termport_pot_ops* ops;
struct term* term;
struct term* term;
- int (*process_and_put)(struct term*, struct linebuffer*, char);
};
struct term
{
struct device* dev;
struct device* chdev;
};
struct term
{
struct device* dev;
struct device* chdev;
- struct term_lcntl* lcntl;
struct linebuffer line_out;
struct linebuffer line_in;
struct linebuffer line_out;
struct linebuffer line_in;
+ char* scratch_pad;
pid_t fggrp;
pid_t fggrp;
- struct
- {
- int (*set_speed)(struct device*, speed_t);
- } chdev_ops;
+ struct termport_potens* tp_cap;
+ waitq_t line_in_event;
/* -- POSIX.1-2008 compliant fields -- */
tcflag_t iflags;
tcflag_t oflags;
tcflag_t lflags;
/* -- POSIX.1-2008 compliant fields -- */
tcflag_t iflags;
tcflag_t oflags;
tcflag_t lflags;
+ tcflag_t cflags;
cc_t cc[_NCCS];
cc_t cc[_NCCS];
+
+ /* -- END POSIX.1-2008 compliant fields -- */
speed_t iospeed;
speed_t iospeed;
+ speed_t clkbase;
+ tcflag_t tflags; // temp flags
};
};
-struct term*
-term_create(struct device* chardev, char* suffix);
-
-int
-term_bind(struct term* tdev, struct device* chdev);
+extern struct device* sysconsole;
-int
-term_push_lcntl(struct term* tdev, struct term_lcntl* lcntl);
+struct termport_potens*
+term_attach_potens(struct device* chardev,
+ struct termport_pot_ops* ops, char* suffix);
int
int
-term_pop_lcntl(struct term* tdev);
-
-struct term_lcntl*
-term_get_lcntl(u32_t lcntl_index);
+term_bind(struct term* tdev, struct device* chdev);
static inline void
line_flip(struct linebuffer* lbf)
static inline void
line_flip(struct linebuffer* lbf)
@@
-97,4
+105,7
@@
lcntl_transform_inseq(struct term* tdev);
int
lcntl_transform_outseq(struct term* tdev);
int
lcntl_transform_outseq(struct term* tdev);
+void
+term_notify_data_avaliable(struct termport_potens* cap);
+
#endif /* __LUNAIX_TERM_H */
#endif /* __LUNAIX_TERM_H */