diff options
author | avg <avg@FreeBSD.org> | 2011-12-17 15:08:43 +0000 |
---|---|---|
committer | avg <avg@FreeBSD.org> | 2011-12-17 15:08:43 +0000 |
commit | f6def40e18a13286043257337db12d9d78aa545e (patch) | |
tree | cf89ca64a6042918d5429b9a17cfaa8421be34c2 /sys/sys/cons.h | |
parent | 04ff721cff67dd3e641289f950656b9dbd02d09f (diff) | |
download | FreeBSD-src-f6def40e18a13286043257337db12d9d78aa545e.zip FreeBSD-src-f6def40e18a13286043257337db12d9d78aa545e.tar.gz |
kern cons: introduce infrastructure for console grabbing by kernel
At the moment grab and ungrab methods of all console drivers are no-ops.
Current intended meaning of the calls is that the kernel takes control of
console input. In the future the semantics may be extended to mean that
the calling thread takes full ownership of the console (e.g. console
output from other threads could be suspended).
Inspired by: bde
MFC after: 2 months
Diffstat (limited to 'sys/sys/cons.h')
-rw-r--r-- | sys/sys/cons.h | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/sys/sys/cons.h b/sys/sys/cons.h index e84318f..bd599c0 100644 --- a/sys/sys/cons.h +++ b/sys/sys/cons.h @@ -44,6 +44,8 @@ struct tty; typedef void cn_probe_t(struct consdev *); typedef void cn_init_t(struct consdev *); typedef void cn_term_t(struct consdev *); +typedef void cn_grab_t(struct consdev *); +typedef void cn_ungrab_t(struct consdev *); typedef int cn_getc_t(struct consdev *); typedef void cn_putc_t(struct consdev *, int); @@ -58,6 +60,10 @@ struct consdev_ops { /* kernel getchar interface */ cn_putc_t *cn_putc; /* kernel putchar interface */ + cn_grab_t *cn_grab; + /* grab console for exclusive kernel use */ + cn_ungrab_t *cn_ungrab; + /* ungrab console */ }; struct consdev { @@ -99,6 +105,8 @@ extern struct tty *constty; /* Temporary virtual console. */ .cn_term = name##_cnterm, \ .cn_getc = name##_cngetc, \ .cn_putc = name##_cnputc, \ + .cn_grab = name##_cngrab, \ + .cn_ungrab = name##_cnungrab, \ }; \ CONSOLE_DEVICE(name##_consdev, name##_consdev_ops, NULL) @@ -109,6 +117,8 @@ int cnadd(struct consdev *); void cnavailable(struct consdev *, int); void cnremove(struct consdev *); void cnselect(struct consdev *); +void cngrab(void); +void cnungrab(void); int cncheckc(void); int cngetc(void); void cnputc(int); |