Deleted Added
sdiff udiff text old ( 38421 ) new ( 38485 )
full compact
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.274 1998/08/14 06:32:03 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 scdevsw = {
341 scopen, scclose, scread, scwrite,
342 scioctl, nullstop, noreset, scdevtotty,
343 ttpoll, scmmap, nostrategy, "sc", NULL, -1 };
344
345/*
346 * These functions need to be before calls to them so they can be inlined.
347 */
348static void
349draw_cursor_image(scr_stat *scp)
350{
351 u_short cursor_image, *ptr = Crtat + (scp->cursor_pos - scp->scr_buf);

--- 476 unchanged lines hidden (view full) ---

828 scp->r_hook.ah_arg = NULL;
829 scp->r_hook.ah_name = "system keyboard";
830 scp->r_hook.ah_order = APM_MID_ORDER;
831 apm_hook_establish(APM_HOOK_RESUME , &scp->r_hook);
832#endif
833
834 at_shutdown(scshutdown, NULL, SHUTDOWN_PRE_SYNC);
835
836 cdevsw_add(&cdev, &scdevsw, NULL);
837
838#ifdef DEVFS
839 for (vc = 0; vc < MAXCONS; vc++)
840 sc_devfs_token[vc] = devfs_add_devswf(&scdevsw, vc, DV_CHR,
841 UID_ROOT, GID_WHEEL, 0600, "ttyv%r", vc);
842 sc_vga_devfs_token = devfs_link(sc_devfs_token[0], "vga");
843 sc_mouse_devfs_token = devfs_add_devswf(&scdevsw, SC_MOUSE, DV_CHR,
844 UID_ROOT, GID_WHEEL, 0600, "sysmouse");
845 sc_console_devfs_token = devfs_add_devswf(&scdevsw, SC_CONSOLE, DV_CHR,
846 UID_ROOT, GID_WHEEL, 0600, "consolectl");
847#endif
848 return 0;
849}
850
851struct tty
852*scdevtotty(dev_t dev)
853{

--- 27 unchanged lines hidden (view full) ---

881 /* If the Delete key is preferable, an stty is necessary */
882 tp->t_cc[VERASE] = key_map.key[0x0e].map[0];
883 tp->t_iflag = TTYDEF_IFLAG;
884 tp->t_oflag = TTYDEF_OFLAG;
885 tp->t_cflag = TTYDEF_CFLAG;
886 tp->t_lflag = TTYDEF_LFLAG;
887 tp->t_ispeed = tp->t_ospeed = TTYDEF_SPEED;
888 scparam(tp, &tp->t_termios);
889 ttsetwater(tp);
890 (*linesw[tp->t_line].l_modem)(tp, 1);
891 if (minor(dev) == SC_MOUSE)
892 mouse_level = 0; /* XXX */
893 }
894 else
895 if (tp->t_state & TS_XCLUDE && p->p_ucred->cr_uid != 0)
896 return(EBUSY);
897 if (minor(dev) < MAXCONS && !console[minor(dev)]) {

--- 4515 unchanged lines hidden ---