Deleted Added
full compact
syscons.c (54543) syscons.c (55823)
1/*-
2 * Copyright (c) 1992-1998 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 *
1/*-
2 * Copyright (c) 1992-1998 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 * $FreeBSD: head/sys/dev/syscons/syscons.c 54543 1999-12-13 09:31:43Z yokota $
28 * $FreeBSD: head/sys/dev/syscons/syscons.c 55823 2000-01-11 14:54:01Z yokota $
29 */
30
31#include "sc.h"
32#include "splash.h"
33#include "opt_syscons.h"
34#include "opt_ddb.h"
35#ifdef __i386__
36#include "apm.h"

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

119SYSCTL_INT(_machdep, OID_AUTO, enable_panic_key, CTLFLAG_RW, &enable_panic_key,
120 0, "");
121
122#define SC_MOUSE 128
123#define SC_CONSOLECTL 255
124
125#define VIRTUAL_TTY(sc, x) (SC_DEV((sc), (x))->si_tty)
126
29 */
30
31#include "sc.h"
32#include "splash.h"
33#include "opt_syscons.h"
34#include "opt_ddb.h"
35#ifdef __i386__
36#include "apm.h"

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

119SYSCTL_INT(_machdep, OID_AUTO, enable_panic_key, CTLFLAG_RW, &enable_panic_key,
120 0, "");
121
122#define SC_MOUSE 128
123#define SC_CONSOLECTL 255
124
125#define VIRTUAL_TTY(sc, x) (SC_DEV((sc), (x))->si_tty)
126
127#define debugger FALSE
127static int debugger;
128
128
129#ifdef __i386__
130#ifdef DDB
131extern int in_Debugger;
132#undef debugger
133#define debugger in_Debugger
134#endif /* DDB */
135#endif /* __i386__ */
136
137/* prototypes */
138static int scvidprobe(int unit, int flags, int cons);
139static int sckbdprobe(int unit, int flags, int cons);
140static void scmeminit(void *arg);
141static int scdevtounit(dev_t dev);
142static kbd_callback_func_t sckbdevent;
143static int scparam(struct tty *tp, struct termios *t);
144static void scstart(struct tty *tp);

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

194
195#define CDEV_MAJOR 12
196
197static cn_probe_t sccnprobe;
198static cn_init_t sccninit;
199static cn_getc_t sccngetc;
200static cn_checkc_t sccncheckc;
201static cn_putc_t sccnputc;
129/* prototypes */
130static int scvidprobe(int unit, int flags, int cons);
131static int sckbdprobe(int unit, int flags, int cons);
132static void scmeminit(void *arg);
133static int scdevtounit(dev_t dev);
134static kbd_callback_func_t sckbdevent;
135static int scparam(struct tty *tp, struct termios *t);
136static void scstart(struct tty *tp);

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

186
187#define CDEV_MAJOR 12
188
189static cn_probe_t sccnprobe;
190static cn_init_t sccninit;
191static cn_getc_t sccngetc;
192static cn_checkc_t sccncheckc;
193static cn_putc_t sccnputc;
194static cn_dbctl_t sccndbctl;
202static cn_term_t sccnterm;
203
204#if __alpha__
205void sccnattach(void);
206#endif
207
195static cn_term_t sccnterm;
196
197#if __alpha__
198void sccnattach(void);
199#endif
200
208CONS_DRIVER(sc, sccnprobe, sccninit, sccnterm, sccngetc, sccncheckc, sccnputc);
201CONS_DRIVER(sc, sccnprobe, sccninit, sccnterm, sccngetc, sccncheckc, sccnputc,
202 sccndbctl);
209
210static d_open_t scopen;
211static d_close_t scclose;
212static d_read_t scread;
213static d_ioctl_t scioctl;
214static d_mmap_t scmmap;
215
216static struct cdevsw sc_cdevsw = {

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

1469}
1470
1471static int
1472sccncheckc(dev_t dev)
1473{
1474 return sccngetch(SCGETC_NONBLOCK);
1475}
1476
203
204static d_open_t scopen;
205static d_close_t scclose;
206static d_read_t scread;
207static d_ioctl_t scioctl;
208static d_mmap_t scmmap;
209
210static struct cdevsw sc_cdevsw = {

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

1463}
1464
1465static int
1466sccncheckc(dev_t dev)
1467{
1468 return sccngetch(SCGETC_NONBLOCK);
1469}
1470
1471static void
1472sccndbctl(dev_t dev, int on)
1473{
1474 /* try to switch to the kernel console screen */
1475 if (on && debugger == 0) {
1476 /*
1477 * TRY to make sure the screen saver is stopped,
1478 * and the screen is updated before switching to
1479 * the vty0.
1480 */
1481 scrn_timer(NULL);
1482 if (!cold
1483 && sc_console->sc->cur_scp->smode.mode == VT_AUTO
1484 && sc_console->smode.mode == VT_AUTO)
1485 switch_scr(sc_console->sc, sc_console->index);
1486 }
1487 if (on)
1488 ++debugger;
1489 else
1490 --debugger;
1491}
1492
1477static int
1478sccngetch(int flags)
1479{
1480 static struct fkeytab fkey;
1481 static int fkeycp;
1482 scr_stat *scp;
1483 u_char *p;
1484 int cur_mode;

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

1548static void
1549sccnupdate(scr_stat *scp)
1550{
1551 /* this is a cut-down version of scrn_timer()... */
1552
1553 if (scp->sc->font_loading_in_progress || scp->sc->videoio_in_progress)
1554 return;
1555
1493static int
1494sccngetch(int flags)
1495{
1496 static struct fkeytab fkey;
1497 static int fkeycp;
1498 scr_stat *scp;
1499 u_char *p;
1500 int cur_mode;

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

1564static void
1565sccnupdate(scr_stat *scp)
1566{
1567 /* this is a cut-down version of scrn_timer()... */
1568
1569 if (scp->sc->font_loading_in_progress || scp->sc->videoio_in_progress)
1570 return;
1571
1556 if (debugger || panicstr || shutdown_in_progress) {
1572 if (debugger > 0 || panicstr || shutdown_in_progress) {
1557 sc_touch_scrn_saver();
1558 } else if (scp != scp->sc->cur_scp) {
1559 return;
1560 }
1561
1562 if (!run_scrn_saver)
1563 scp->sc->flags &= ~SC_SCRN_IDLE;
1564#if NSPLASH > 0

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

1621 }
1622 }
1623
1624 /* find the vty to update */
1625 scp = sc->cur_scp;
1626
1627 /* should we stop the screen saver? */
1628 getmicrouptime(&tv);
1573 sc_touch_scrn_saver();
1574 } else if (scp != scp->sc->cur_scp) {
1575 return;
1576 }
1577
1578 if (!run_scrn_saver)
1579 scp->sc->flags &= ~SC_SCRN_IDLE;
1580#if NSPLASH > 0

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

1637 }
1638 }
1639
1640 /* find the vty to update */
1641 scp = sc->cur_scp;
1642
1643 /* should we stop the screen saver? */
1644 getmicrouptime(&tv);
1629 if (debugger || panicstr || shutdown_in_progress)
1645 if (debugger > 0 || panicstr || shutdown_in_progress)
1630 sc_touch_scrn_saver();
1631 if (run_scrn_saver) {
1632 if (tv.tv_sec > sc->scrn_time_stamp + scrn_blank_time)
1633 sc->flags |= SC_SCRN_IDLE;
1634 else
1635 sc->flags &= ~SC_SCRN_IDLE;
1636 } else {
1637 sc->scrn_time_stamp = tv.tv_sec;

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

3715 case SUSP:
3716 case STBY:
3717 break;
3718#endif
3719
3720 case DBG:
3721#ifndef SC_DISABLE_DDBKEY
3722#ifdef DDB
1646 sc_touch_scrn_saver();
1647 if (run_scrn_saver) {
1648 if (tv.tv_sec > sc->scrn_time_stamp + scrn_blank_time)
1649 sc->flags |= SC_SCRN_IDLE;
1650 else
1651 sc->flags &= ~SC_SCRN_IDLE;
1652 } else {
1653 sc->scrn_time_stamp = tv.tv_sec;

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

3731 case SUSP:
3732 case STBY:
3733 break;
3734#endif
3735
3736 case DBG:
3737#ifndef SC_DISABLE_DDBKEY
3738#ifdef DDB
3723 if (debugger)
3724 break;
3725 /* try to switch to the kernel console screen */
3726 if (sc_console) {
3727 /*
3728 * TRY to make sure the screen saver is stopped,
3729 * and the screen is updated before switching to
3730 * the vty0.
3731 */
3732 scrn_timer(NULL);
3733 if (!cold
3734 && sc_console->sc->cur_scp->smode.mode == VT_AUTO
3735 && sc_console->smode.mode == VT_AUTO)
3736 switch_scr(sc_console->sc, sc_console->index);
3737 }
3738 Debugger("manual escape to debugger");
3739#else
3740 printf("No debugger in kernel\n");
3741#endif
3742#else /* SC_DISABLE_DDBKEY */
3743 /* do nothing */
3744#endif /* SC_DISABLE_DDBKEY */
3745 break;

--- 301 unchanged lines hidden ---
3739 Debugger("manual escape to debugger");
3740#else
3741 printf("No debugger in kernel\n");
3742#endif
3743#else /* SC_DISABLE_DDBKEY */
3744 /* do nothing */
3745#endif /* SC_DISABLE_DDBKEY */
3746 break;

--- 301 unchanged lines hidden ---