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/dev | |
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/dev')
-rw-r--r-- | sys/dev/cfe/cfe_console.c | 14 | ||||
-rw-r--r-- | sys/dev/dcons/dcons_os.c | 12 | ||||
-rw-r--r-- | sys/dev/ofw/ofw_console.c | 12 | ||||
-rw-r--r-- | sys/dev/sio/sio.c | 12 | ||||
-rw-r--r-- | sys/dev/syscons/syscons.c | 12 | ||||
-rw-r--r-- | sys/dev/uart/uart_tty.c | 12 | ||||
-rw-r--r-- | sys/dev/usb/serial/usb_serial.c | 12 | ||||
-rw-r--r-- | sys/dev/xen/console/console.c | 12 |
8 files changed, 98 insertions, 0 deletions
diff --git a/sys/dev/cfe/cfe_console.c b/sys/dev/cfe/cfe_console.c index 5a6b0a2..485fd08 100644 --- a/sys/dev/cfe/cfe_console.c +++ b/sys/dev/cfe/cfe_console.c @@ -76,6 +76,8 @@ static cn_init_t cfe_cninit; static cn_term_t cfe_cnterm; static cn_getc_t cfe_cngetc; static cn_putc_t cfe_cnputc; +static cn_grab_t cfe_cngrab; +static cn_ungrab_t cfe_cnungrab; CONSOLE_DRIVER(cfe); @@ -183,6 +185,18 @@ cfe_cnterm(struct consdev *cp) } +static void +cfe_cngrab(struct consdev *cp) +{ + +} + +static void +cfe_cnungrab(struct consdev *cp) +{ + +} + static int cfe_cngetc(struct consdev *cp) { diff --git a/sys/dev/dcons/dcons_os.c b/sys/dev/dcons/dcons_os.c index d638d41..a37d64c 100644 --- a/sys/dev/dcons/dcons_os.c +++ b/sys/dev/dcons/dcons_os.c @@ -109,6 +109,8 @@ static cn_init_t dcons_cninit; static cn_term_t dcons_cnterm; static cn_getc_t dcons_cngetc; static cn_putc_t dcons_cnputc; +static cn_grab_t dcons_cngrab; +static cn_ungrab_t dcons_cnungrab; CONSOLE_DRIVER(dcons); @@ -246,6 +248,16 @@ dcons_cnterm(struct consdev *cp) { } +static void +dcons_cngrab(struct consdev *cp) +{ +} + +static void +dcons_cnungrab(struct consdev *cp) +{ +} + static int dcons_cngetc(struct consdev *cp) { diff --git a/sys/dev/ofw/ofw_console.c b/sys/dev/ofw/ofw_console.c index 62dbe51..e71d5c1 100644 --- a/sys/dev/ofw/ofw_console.c +++ b/sys/dev/ofw/ofw_console.c @@ -74,6 +74,8 @@ static cn_init_t ofw_cninit; static cn_term_t ofw_cnterm; static cn_getc_t ofw_cngetc; static cn_putc_t ofw_cnputc; +static cn_grab_t ofw_cngrab; +static cn_ungrab_t ofw_cnungrab; CONSOLE_DRIVER(ofw); @@ -192,6 +194,16 @@ ofw_cnterm(struct consdev *cp) { } +static void +ofw_cngrab(struct consdev *cp) +{ +} + +static void +ofw_cnungrab(struct consdev *cp) +{ +} + static int ofw_cngetc(struct consdev *cp) { diff --git a/sys/dev/sio/sio.c b/sys/dev/sio/sio.c index 7e2054e..d389f45 100644 --- a/sys/dev/sio/sio.c +++ b/sys/dev/sio/sio.c @@ -2293,6 +2293,8 @@ static cn_init_t sio_cninit; static cn_term_t sio_cnterm; static cn_getc_t sio_cngetc; static cn_putc_t sio_cnputc; +static cn_grab_t sio_cngrab; +static cn_ungrab_t sio_cnungrab; CONSOLE_DRIVER(sio); @@ -2512,6 +2514,16 @@ sio_cnterm(cp) comconsole = -1; } +static void +sio_cngrab(struct consdev *cp) +{ +} + +static void +sio_cnungrab(struct consdev *cp) +{ +} + static int sio_cngetc(struct consdev *cd) { diff --git a/sys/dev/syscons/syscons.c b/sys/dev/syscons/syscons.c index db678a5..f25026e 100644 --- a/sys/dev/syscons/syscons.c +++ b/sys/dev/syscons/syscons.c @@ -229,6 +229,8 @@ static cn_init_t sc_cninit; static cn_term_t sc_cnterm; static cn_getc_t sc_cngetc; static cn_putc_t sc_cnputc; +static cn_grab_t sc_cngrab; +static cn_ungrab_t sc_cnungrab; CONSOLE_DRIVER(sc); @@ -1609,6 +1611,16 @@ sc_cnterm(struct consdev *cp) } static void +sc_cngrab(struct consdev *cp) +{ +} + +static void +sc_cnungrab(struct consdev *cp) +{ +} + +static void sc_cnputc(struct consdev *cd, int c) { u_char buf[1]; diff --git a/sys/dev/uart/uart_tty.c b/sys/dev/uart/uart_tty.c index 2170108..97ee08d 100644 --- a/sys/dev/uart/uart_tty.c +++ b/sys/dev/uart/uart_tty.c @@ -54,6 +54,8 @@ static cn_init_t uart_cninit; static cn_term_t uart_cnterm; static cn_getc_t uart_cngetc; static cn_putc_t uart_cnputc; +static cn_grab_t uart_cngrab; +static cn_ungrab_t uart_cnungrab; CONSOLE_DRIVER(uart); @@ -108,6 +110,16 @@ uart_cnterm(struct consdev *cp) } static void +uart_cngrab(struct consdev *cp) +{ +} + +static void +uart_cnungrab(struct consdev *cp) +{ +} + +static void uart_cnputc(struct consdev *cp, int c) { diff --git a/sys/dev/usb/serial/usb_serial.c b/sys/dev/usb/serial/usb_serial.c index a3e6ffb..e63a0aa 100644 --- a/sys/dev/usb/serial/usb_serial.c +++ b/sys/dev/usb/serial/usb_serial.c @@ -1308,6 +1308,8 @@ static cn_init_t ucom_cninit; static cn_term_t ucom_cnterm; static cn_getc_t ucom_cngetc; static cn_putc_t ucom_cnputc; +static cn_grab_t ucom_cngrab; +static cn_ungrab_t ucom_cnungrab; CONSOLE_DRIVER(ucom); @@ -1332,6 +1334,16 @@ ucom_cnterm(struct consdev *cp) { } +static void +ucom_cngrab(struct consdev *cp) +{ +} + +static void +ucom_cnungrab(struct consdev *cp) +{ +} + static int ucom_cngetc(struct consdev *cd) { diff --git a/sys/dev/xen/console/console.c b/sys/dev/xen/console/console.c index 5a14623..6a845ca 100644 --- a/sys/dev/xen/console/console.c +++ b/sys/dev/xen/console/console.c @@ -50,6 +50,8 @@ static cn_init_t xc_cninit; static cn_term_t xc_cnterm; static cn_getc_t xc_cngetc; static cn_putc_t xc_cnputc; +static cn_grab_t xc_cngrab; +static cn_ungrab_t xc_cnungrab; #define XC_POLLTIME (hz/10) @@ -126,6 +128,16 @@ xc_cnterm(struct consdev *cp) { } +static void +xc_cngrab(struct consdev *cp) +{ +} + +static void +xc_cnungrab(struct consdev *cp) +{ +} + static int xc_cngetc(struct consdev *dev) { |