Deleted Added
full compact
syscons.c (185028) syscons.c (186681)
1/*-
2 * Copyright (c) 1992-1998 S�ren Schmidt
3 * All rights reserved.
4 *
5 * This code is derived from software contributed to The DragonFly Project
6 * by Sascha Wildner <saw@online.de>
7 *
8 * Redistribution and use in source and binary forms, with or without

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

25 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
26 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
27 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
28 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
29 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30 */
31
32#include <sys/cdefs.h>
1/*-
2 * Copyright (c) 1992-1998 S�ren Schmidt
3 * All rights reserved.
4 *
5 * This code is derived from software contributed to The DragonFly Project
6 * by Sascha Wildner <saw@online.de>
7 *
8 * Redistribution and use in source and binary forms, with or without

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

25 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
26 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
27 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
28 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
29 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30 */
31
32#include <sys/cdefs.h>
33__FBSDID("$FreeBSD: head/sys/dev/syscons/syscons.c 185028 2008-11-17 20:33:13Z emax $");
33__FBSDID("$FreeBSD: head/sys/dev/syscons/syscons.c 186681 2009-01-01 13:26:53Z ed $");
34
35#include "opt_compat.h"
36#include "opt_syscons.h"
37#include "opt_splash.h"
38#include "opt_ddb.h"
39
40#include <sys/param.h>
41#include <sys/systm.h>

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

2736 * might panic kernel. Wait for sc_attach_unit() to actually
2737 * create the devices.
2738 */
2739 sc->dev = main_devs;
2740 scp = &main_console;
2741 init_scp(sc, sc->first_vty, scp);
2742 sc_vtb_init(&scp->vtb, VTB_MEMORY, scp->xsize, scp->ysize,
2743 (void *)sc_buffer, FALSE);
34
35#include "opt_compat.h"
36#include "opt_syscons.h"
37#include "opt_splash.h"
38#include "opt_ddb.h"
39
40#include <sys/param.h>
41#include <sys/systm.h>

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

2736 * might panic kernel. Wait for sc_attach_unit() to actually
2737 * create the devices.
2738 */
2739 sc->dev = main_devs;
2740 scp = &main_console;
2741 init_scp(sc, sc->first_vty, scp);
2742 sc_vtb_init(&scp->vtb, VTB_MEMORY, scp->xsize, scp->ysize,
2743 (void *)sc_buffer, FALSE);
2744
2745 /* move cursors to the initial positions */
2746 if (col >= scp->xsize)
2747 col = 0;
2748 if (row >= scp->ysize)
2749 row = scp->ysize - 1;
2750 scp->xpos = col;
2751 scp->ypos = row;
2752 scp->cursor_pos = scp->cursor_oldpos = row*scp->xsize + col;
2753
2744 if (sc_init_emulator(scp, SC_DFLT_TERM))
2745 sc_init_emulator(scp, "*");
2746 (*scp->tsw->te_default_attr)(scp,
2747 kernel_default.std_color,
2748 kernel_default.rev_color);
2749 } else {
2750 /* assert(sc_malloc) */
2751 sc->dev = malloc(sizeof(struct tty *)*sc->vtys, M_DEVBUF,

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

2759#ifndef __sparc64__
2760 /* copy screen to temporary buffer */
2761 sc_vtb_init(&scp->scr, VTB_FRAMEBUFFER, scp->xsize, scp->ysize,
2762 (void *)scp->sc->adp->va_window, FALSE);
2763 if (ISTEXTSC(scp))
2764 sc_vtb_copy(&scp->scr, 0, &scp->vtb, 0, scp->xsize*scp->ysize);
2765#endif
2766
2754 if (sc_init_emulator(scp, SC_DFLT_TERM))
2755 sc_init_emulator(scp, "*");
2756 (*scp->tsw->te_default_attr)(scp,
2757 kernel_default.std_color,
2758 kernel_default.rev_color);
2759 } else {
2760 /* assert(sc_malloc) */
2761 sc->dev = malloc(sizeof(struct tty *)*sc->vtys, M_DEVBUF,

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

2769#ifndef __sparc64__
2770 /* copy screen to temporary buffer */
2771 sc_vtb_init(&scp->scr, VTB_FRAMEBUFFER, scp->xsize, scp->ysize,
2772 (void *)scp->sc->adp->va_window, FALSE);
2773 if (ISTEXTSC(scp))
2774 sc_vtb_copy(&scp->scr, 0, &scp->vtb, 0, scp->xsize*scp->ysize);
2775#endif
2776
2767 /* move cursors to the initial positions */
2768 if (col >= scp->xsize)
2769 col = 0;
2770 if (row >= scp->ysize)
2771 row = scp->ysize - 1;
2772 scp->xpos = col;
2773 scp->ypos = row;
2774 scp->cursor_pos = scp->cursor_oldpos = row*scp->xsize + col;
2775
2776 if (bios_value.cursor_end < scp->font_size)
2777 sc->dflt_curs_attr.base = scp->font_size -
2778 bios_value.cursor_end - 1;
2779 else
2780 sc->dflt_curs_attr.base = 0;
2781 i = bios_value.cursor_end - bios_value.cursor_start + 1;
2782 sc->dflt_curs_attr.height = imin(i, scp->font_size);
2783 sc->dflt_curs_attr.flags = 0;

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

3564void
3565sc_show_font(scr_stat *scp, int page)
3566{
3567 vidd_show_font(scp->sc->adp, page);
3568}
3569#endif /* !SC_NO_FONT_LOADING */
3570
3571void
2777 if (bios_value.cursor_end < scp->font_size)
2778 sc->dflt_curs_attr.base = scp->font_size -
2779 bios_value.cursor_end - 1;
2780 else
2781 sc->dflt_curs_attr.base = 0;
2782 i = bios_value.cursor_end - bios_value.cursor_start + 1;
2783 sc->dflt_curs_attr.height = imin(i, scp->font_size);
2784 sc->dflt_curs_attr.flags = 0;

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

3565void
3566sc_show_font(scr_stat *scp, int page)
3567{
3568 vidd_show_font(scp->sc->adp, page);
3569}
3570#endif /* !SC_NO_FONT_LOADING */
3571
3572void
3572sc_paste(scr_stat *scp, u_char *p, int count)
3573sc_paste(scr_stat *scp, const u_char *p, int count)
3573{
3574 struct tty *tp;
3575 u_char *rmap;
3576
3577 tp = SC_DEV(scp->sc, scp->sc->cur_scp->index);
3578 if (!tty_opened(tp))
3579 return;
3580 rmap = scp->sc->scr_rmap;
3581 for (; count > 0; --count)
3582 ttydisc_rint(tp, rmap[*p++], 0);
3583 ttydisc_rint_done(tp);
3584}
3585
3586void
3574{
3575 struct tty *tp;
3576 u_char *rmap;
3577
3578 tp = SC_DEV(scp->sc, scp->sc->cur_scp->index);
3579 if (!tty_opened(tp))
3580 return;
3581 rmap = scp->sc->scr_rmap;
3582 for (; count > 0; --count)
3583 ttydisc_rint(tp, rmap[*p++], 0);
3584 ttydisc_rint_done(tp);
3585}
3586
3587void
3588sc_respond(scr_stat *scp, const u_char *p, int count)
3589{
3590 struct tty *tp;
3591
3592 tp = SC_DEV(scp->sc, scp->sc->cur_scp->index);
3593 if (!tty_opened(tp))
3594 return;
3595 for (; count > 0; --count)
3596 ttydisc_rint(tp, *p++, 0);
3597#if 0
3598 /* XXX: we can't call ttydisc_rint_done() here! */
3599 ttydisc_rint_done(tp);
3600#endif
3601}
3602
3603void
3587sc_bell(scr_stat *scp, int pitch, int duration)
3588{
3589 if (cold || shutdown_in_progress || !enable_bell)
3590 return;
3591
3592 if (scp != scp->sc->cur_scp && (scp->sc->flags & SC_QUIET_BELL))
3593 return;
3594

--- 90 unchanged lines hidden ---
3604sc_bell(scr_stat *scp, int pitch, int duration)
3605{
3606 if (cold || shutdown_in_progress || !enable_bell)
3607 return;
3608
3609 if (scp != scp->sc->cur_scp && (scp->sc->flags & SC_QUIET_BELL))
3610 return;
3611

--- 90 unchanged lines hidden ---