diff options
Diffstat (limited to 'sys/include/dev/cons/cons.h')
-rw-r--r-- | sys/include/dev/cons/cons.h | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/sys/include/dev/cons/cons.h b/sys/include/dev/cons/cons.h index 3569c52..7c4e41a 100644 --- a/sys/include/dev/cons/cons.h +++ b/sys/include/dev/cons/cons.h @@ -32,8 +32,12 @@ #include <sys/types.h> #include <sys/spinlock.h> +#include <sys/proc.h> +#include <sys/mutex.h> +#include <sys/console.h> #include <dev/video/fbdev.h> #include <dev/cons/consvar.h> +#include <dev/cons/ansi.h> struct cons_char { char c; @@ -45,6 +49,11 @@ struct cons_char { struct cons_screen { struct fbdev fbdev; + struct ansi_state ansi_s; + struct console_feat feat; /* Features */ + struct console_attr attr; /* Attributes */ + struct proc *atproc; /* Attached proc */ + struct mutex *atproc_lock; uint32_t fg; uint32_t bg; @@ -54,17 +63,25 @@ struct cons_screen { uint32_t ncols; uint32_t ch_col; /* Current col */ uint32_t ch_row; /* Current row */ - uint32_t curs_col; /* Cursor col */ - uint32_t curs_row; /* Cursor row */ struct cons_buf *ib; /* Input buffer */ struct cons_buf **ob; /* Output buffers */ struct cons_char last_chr; struct spinlock lock; }; +#define curs_col attr.cursor_x +#define curs_row attr.cursor_y + void cons_init(void); void cons_expose(void); +void cons_update_color(struct cons_screen *scr, uint32_t fg, uint32_t bg); +void cons_clear_scr(struct cons_screen *scr, uint32_t bg); +void cons_reset_color(struct cons_screen *scr); +void cons_reset_cursor(struct cons_screen *scr); +int cons_attach(void); +int cons_detach(void); int cons_putch(struct cons_screen *scr, char c); +int cons_putstr(struct cons_screen *scr, const char *s, size_t len); extern struct cons_screen g_root_scr; |