1/*-
2 * Copyright (c) 1992-1997 S�ren Schmidt
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright
--- 11 unchanged lines hidden (view full) ---
20 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
21 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
22 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
23 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
24 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
26 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 *
28 * $Id: syscons.c,v 1.275 1998/08/18 07:36:47 sos Exp $
29 */
30
31#include "sc.h"
32#include "apm.h"
33#include "opt_ddb.h"
34#include "opt_devfs.h"
35#include "opt_syscons.h"
36
--- 294 unchanged lines hidden (view full) ---
331static d_open_t scopen;
332static d_close_t scclose;
333static d_read_t scread;
334static d_write_t scwrite;
335static d_ioctl_t scioctl;
336static d_devtotty_t scdevtotty;
337static d_mmap_t scmmap;
338
339#define CDEV_MAJOR 12
340static struct cdevsw sc_cdevsw = {
341 scopen, scclose, scread, scwrite,
342 scioctl, nullstop, noreset, scdevtotty,
343 ttpoll, scmmap, nostrategy, "sc",
344 NULL, -1, nodump, nopsize,
345 D_TTY,
346};
347
348/*
349 * These functions need to be before calls to them so they can be inlined.
350 */
351static void
352draw_cursor_image(scr_stat *scp)
353{
354 u_short cursor_image, *ptr = Crtat + (scp->cursor_pos - scp->scr_buf);
--- 476 unchanged lines hidden (view full) ---
831 scp->r_hook.ah_arg = NULL;
832 scp->r_hook.ah_name = "system keyboard";
833 scp->r_hook.ah_order = APM_MID_ORDER;
834 apm_hook_establish(APM_HOOK_RESUME , &scp->r_hook);
835#endif
836
837 at_shutdown(scshutdown, NULL, SHUTDOWN_PRE_SYNC);
838
839 cdevsw_add(&cdev, &sc_cdevsw, NULL);
840
841#ifdef DEVFS
842 for (vc = 0; vc < MAXCONS; vc++)
843 sc_devfs_token[vc] = devfs_add_devswf(&sc_cdevsw, vc, DV_CHR,
844 UID_ROOT, GID_WHEEL, 0600, "ttyv%r", vc);
845 sc_vga_devfs_token = devfs_link(sc_devfs_token[0], "vga");
846 sc_mouse_devfs_token = devfs_add_devswf(&sc_cdevsw, SC_MOUSE, DV_CHR,
847 UID_ROOT, GID_WHEEL, 0600, "sysmouse");
848 sc_console_devfs_token = devfs_add_devswf(&sc_cdevsw, SC_CONSOLE, DV_CHR,
849 UID_ROOT, GID_WHEEL, 0600, "consolectl");
850#endif
851 return 0;
852}
853
854struct tty
855*scdevtotty(dev_t dev)
856{
--- 27 unchanged lines hidden (view full) ---
884 /* If the Delete key is preferable, an stty is necessary */
885 tp->t_cc[VERASE] = key_map.key[0x0e].map[0];
886 tp->t_iflag = TTYDEF_IFLAG;
887 tp->t_oflag = TTYDEF_OFLAG;
888 tp->t_cflag = TTYDEF_CFLAG;
889 tp->t_lflag = TTYDEF_LFLAG;
890 tp->t_ispeed = tp->t_ospeed = TTYDEF_SPEED;
891 scparam(tp, &tp->t_termios);
892 (*linesw[tp->t_line].l_modem)(tp, 1);
893 if (minor(dev) == SC_MOUSE)
894 mouse_level = 0; /* XXX */
895 }
896 else
897 if (tp->t_state & TS_XCLUDE && p->p_ucred->cr_uid != 0)
898 return(EBUSY);
899 if (minor(dev) < MAXCONS && !console[minor(dev)]) {
--- 4515 unchanged lines hidden ---
2 * Copyright (c) 1992-1997 S�ren Schmidt
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright
--- 11 unchanged lines hidden (view full) ---
20 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
21 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
22 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
23 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
24 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
26 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 *
28 * $Id: syscons.c,v 1.275 1998/08/18 07:36:47 sos Exp $
29 */
30
31#include "sc.h"
32#include "apm.h"
33#include "opt_ddb.h"
34#include "opt_devfs.h"
35#include "opt_syscons.h"
36
--- 294 unchanged lines hidden (view full) ---
331static d_open_t scopen;
332static d_close_t scclose;
333static d_read_t scread;
334static d_write_t scwrite;
335static d_ioctl_t scioctl;
336static d_devtotty_t scdevtotty;
337static d_mmap_t scmmap;
338
339#define CDEV_MAJOR 12
340static struct cdevsw sc_cdevsw = {
341 scopen, scclose, scread, scwrite,
342 scioctl, nullstop, noreset, scdevtotty,
343 ttpoll, scmmap, nostrategy, "sc",
344 NULL, -1, nodump, nopsize,
345 D_TTY,
346};
347
348/*
349 * These functions need to be before calls to them so they can be inlined.
350 */
351static void
352draw_cursor_image(scr_stat *scp)
353{
354 u_short cursor_image, *ptr = Crtat + (scp->cursor_pos - scp->scr_buf);
--- 476 unchanged lines hidden (view full) ---
831 scp->r_hook.ah_arg = NULL;
832 scp->r_hook.ah_name = "system keyboard";
833 scp->r_hook.ah_order = APM_MID_ORDER;
834 apm_hook_establish(APM_HOOK_RESUME , &scp->r_hook);
835#endif
836
837 at_shutdown(scshutdown, NULL, SHUTDOWN_PRE_SYNC);
838
839 cdevsw_add(&cdev, &sc_cdevsw, NULL);
840
841#ifdef DEVFS
842 for (vc = 0; vc < MAXCONS; vc++)
843 sc_devfs_token[vc] = devfs_add_devswf(&sc_cdevsw, vc, DV_CHR,
844 UID_ROOT, GID_WHEEL, 0600, "ttyv%r", vc);
845 sc_vga_devfs_token = devfs_link(sc_devfs_token[0], "vga");
846 sc_mouse_devfs_token = devfs_add_devswf(&sc_cdevsw, SC_MOUSE, DV_CHR,
847 UID_ROOT, GID_WHEEL, 0600, "sysmouse");
848 sc_console_devfs_token = devfs_add_devswf(&sc_cdevsw, SC_CONSOLE, DV_CHR,
849 UID_ROOT, GID_WHEEL, 0600, "consolectl");
850#endif
851 return 0;
852}
853
854struct tty
855*scdevtotty(dev_t dev)
856{
--- 27 unchanged lines hidden (view full) ---
884 /* If the Delete key is preferable, an stty is necessary */
885 tp->t_cc[VERASE] = key_map.key[0x0e].map[0];
886 tp->t_iflag = TTYDEF_IFLAG;
887 tp->t_oflag = TTYDEF_OFLAG;
888 tp->t_cflag = TTYDEF_CFLAG;
889 tp->t_lflag = TTYDEF_LFLAG;
890 tp->t_ispeed = tp->t_ospeed = TTYDEF_SPEED;
891 scparam(tp, &tp->t_termios);
892 (*linesw[tp->t_line].l_modem)(tp, 1);
893 if (minor(dev) == SC_MOUSE)
894 mouse_level = 0; /* XXX */
895 }
896 else
897 if (tp->t_state & TS_XCLUDE && p->p_ucred->cr_uid != 0)
898 return(EBUSY);
899 if (minor(dev) < MAXCONS && !console[minor(dev)]) {
--- 4515 unchanged lines hidden ---