syscons.c (49986) | syscons.c (50107) |
---|---|
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 * $Id: syscons.c,v 1.317 1999/08/13 16:17:54 dt Exp $ | 28 * $Id: syscons.c,v 1.318 1999/08/17 22:06:17 billf Exp $ |
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" 37#endif 38 39#if NSC > 0 40#include <sys/param.h> 41#include <sys/systm.h> | 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" 37#endif 38 39#if NSC > 0 40#include <sys/param.h> 41#include <sys/systm.h> |
42#include <sys/eventhandler.h> |
|
42#include <sys/reboot.h> 43#include <sys/conf.h> 44#include <sys/proc.h> 45#include <sys/signalvar.h> 46#include <sys/tty.h> 47#include <sys/kernel.h> 48#include <sys/malloc.h> 49#include <sys/cons.h> --- 85 unchanged lines hidden (view full) --- 135static kbd_callback_func_t sckbdevent; 136static int scparam(struct tty *tp, struct termios *t); 137static void scstart(struct tty *tp); 138static void scmousestart(struct tty *tp); 139static void scinit(int unit, int flags); 140#if __i386__ 141static void scterm(int unit, int flags); 142#endif | 43#include <sys/reboot.h> 44#include <sys/conf.h> 45#include <sys/proc.h> 46#include <sys/signalvar.h> 47#include <sys/tty.h> 48#include <sys/kernel.h> 49#include <sys/malloc.h> 50#include <sys/cons.h> --- 85 unchanged lines hidden (view full) --- 136static kbd_callback_func_t sckbdevent; 137static int scparam(struct tty *tp, struct termios *t); 138static void scstart(struct tty *tp); 139static void scmousestart(struct tty *tp); 140static void scinit(int unit, int flags); 141#if __i386__ 142static void scterm(int unit, int flags); 143#endif |
143static void scshutdown(int howto, void *arg); | 144static void scshutdown(void *arg, int howto); |
144static u_int scgetc(sc_softc_t *sc, u_int flags); 145#define SCGETC_CN 1 146#define SCGETC_NONBLOCK 2 147static int sccngetch(int flags); 148static void sccnupdate(scr_stat *scp); 149static scr_stat *alloc_scp(sc_softc_t *sc, int vty); 150static void init_scp(sc_softc_t *sc, int vty, scr_stat *scp); 151static timeout_t scrn_timer; --- 202 unchanged lines hidden (view full) --- 354 printf(" fb%d", sc->adapter); 355 if (sc->keyboard >= 0) 356 printf(" kbd%d", sc->keyboard); 357 printf("\n"); 358 } 359 360 /* register a shutdown callback for the kernel console */ 361 if (sc_console_unit == unit) | 145static u_int scgetc(sc_softc_t *sc, u_int flags); 146#define SCGETC_CN 1 147#define SCGETC_NONBLOCK 2 148static int sccngetch(int flags); 149static void sccnupdate(scr_stat *scp); 150static scr_stat *alloc_scp(sc_softc_t *sc, int vty); 151static void init_scp(sc_softc_t *sc, int vty, scr_stat *scp); 152static timeout_t scrn_timer; --- 202 unchanged lines hidden (view full) --- 355 printf(" fb%d", sc->adapter); 356 if (sc->keyboard >= 0) 357 printf(" kbd%d", sc->keyboard); 358 printf("\n"); 359 } 360 361 /* register a shutdown callback for the kernel console */ 362 if (sc_console_unit == unit) |
362 at_shutdown(scshutdown, (void *)(uintptr_t)unit, SHUTDOWN_PRE_SYNC); | 363 EVENTHANDLER_REGISTER(shutdown_pre_sync, scshutdown, 364 (void *)(uintptr_t)unit, SHUTDOWN_PRI_DEFAULT); |
363 364 /* 365 * syscons's cdevsw must be registered from here. As syscons and 366 * pcvt share the same major number, their cdevsw cannot be 367 * registered at module loading/initialization time or by SYSINIT. 368 */ 369 cdevsw_add(&sc_cdevsw); /* XXX do this just once... */ 370 --- 3004 unchanged lines hidden (view full) --- 3375 } 3376 bzero(sc, sizeof(*sc)); 3377 sc->keyboard = -1; 3378 sc->adapter = -1; 3379} 3380#endif 3381 3382static void | 365 366 /* 367 * syscons's cdevsw must be registered from here. As syscons and 368 * pcvt share the same major number, their cdevsw cannot be 369 * registered at module loading/initialization time or by SYSINIT. 370 */ 371 cdevsw_add(&sc_cdevsw); /* XXX do this just once... */ 372 --- 3004 unchanged lines hidden (view full) --- 3377 } 3378 bzero(sc, sizeof(*sc)); 3379 sc->keyboard = -1; 3380 sc->adapter = -1; 3381} 3382#endif 3383 3384static void |
3383scshutdown(int howto, void *arg) | 3385scshutdown(void *arg, int howto) |
3384{ 3385 /* assert(sc_console != NULL) */ 3386 3387 sc_touch_scrn_saver(); 3388 if (!cold && sc_console 3389 && sc_console->sc->cur_scp->smode.mode == VT_AUTO 3390 && sc_console->smode.mode == VT_AUTO) 3391 switch_scr(sc_console->sc, sc_console->index); --- 690 unchanged lines hidden --- | 3386{ 3387 /* assert(sc_console != NULL) */ 3388 3389 sc_touch_scrn_saver(); 3390 if (!cold && sc_console 3391 && sc_console->sc->cur_scp->smode.mode == VT_AUTO 3392 && sc_console->smode.mode == VT_AUTO) 3393 switch_scr(sc_console->sc, sc_console->index); --- 690 unchanged lines hidden --- |