vt.c (b2ecf00631362a83744e5ec249947620db5e240c) vt.c (496124e5e16e4974c71404bc9ddaa016156f8cb0)
1// SPDX-License-Identifier: GPL-2.0
2/*
3 * Copyright (C) 1991, 1992 Linus Torvalds
4 */
5
6/*
7 * Hopefully this will be a rather complete VT102 implementation.
8 *

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

1515 vc_uniscr_clear_lines(vc, 0, vc->vc_rows);
1516 count = vc->vc_cols * vc->vc_rows;
1517 start = (unsigned short *)vc->vc_origin;
1518 break;
1519 default:
1520 return;
1521 }
1522 scr_memsetw(start, vc->vc_video_erase_char, 2 * count);
1// SPDX-License-Identifier: GPL-2.0
2/*
3 * Copyright (C) 1991, 1992 Linus Torvalds
4 */
5
6/*
7 * Hopefully this will be a rather complete VT102 implementation.
8 *

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

1515 vc_uniscr_clear_lines(vc, 0, vc->vc_rows);
1516 count = vc->vc_cols * vc->vc_rows;
1517 start = (unsigned short *)vc->vc_origin;
1518 break;
1519 default:
1520 return;
1521 }
1522 scr_memsetw(start, vc->vc_video_erase_char, 2 * count);
1523 if (con_should_update(vc))
1524 do_update_region(vc, (unsigned long) start, count);
1523 update_region(vc, (unsigned long) start, count);
1525 vc->vc_need_wrap = 0;
1526}
1527
1528static void csi_K(struct vc_data *vc, int vpar)
1529{
1530 unsigned int count;
1531 unsigned short *start = (unsigned short *)vc->vc_pos;
1532 int offset;

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

1800{
1801 char buf[8];
1802
1803 sprintf(buf, "\033[M%c%c%c", (char)(' ' + butt), (char)('!' + mrx),
1804 (char)('!' + mry));
1805 respond_string(buf, tty->port);
1806}
1807
1524 vc->vc_need_wrap = 0;
1525}
1526
1527static void csi_K(struct vc_data *vc, int vpar)
1528{
1529 unsigned int count;
1530 unsigned short *start = (unsigned short *)vc->vc_pos;
1531 int offset;

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

1799{
1800 char buf[8];
1801
1802 sprintf(buf, "\033[M%c%c%c", (char)(' ' + butt), (char)('!' + mrx),
1803 (char)('!' + mry));
1804 respond_string(buf, tty->port);
1805}
1806
1808/* invoked via ioctl(TIOCLINUX) and through set_selection */
1807/* invoked via ioctl(TIOCLINUX) and through set_selection_user */
1809int mouse_reporting(void)
1810{
1811 return vc_cons[fg_console].d->vc_report_mouse;
1812}
1813
1814/* console_lock is held */
1815static void set_mode(struct vc_data *vc, int on_off)
1816{

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

3004/*
3005 * Generally a bit racy with respect to console_lock();.
3006 *
3007 * There are some functions which don't need it.
3008 *
3009 * There are some functions which can sleep for arbitrary periods
3010 * (paste_selection) but we don't need the lock there anyway.
3011 *
1808int mouse_reporting(void)
1809{
1810 return vc_cons[fg_console].d->vc_report_mouse;
1811}
1812
1813/* console_lock is held */
1814static void set_mode(struct vc_data *vc, int on_off)
1815{

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

3003/*
3004 * Generally a bit racy with respect to console_lock();.
3005 *
3006 * There are some functions which don't need it.
3007 *
3008 * There are some functions which can sleep for arbitrary periods
3009 * (paste_selection) but we don't need the lock there anyway.
3010 *
3012 * set_selection has locking, and definitely needs it
3011 * set_selection_user has locking, and definitely needs it
3013 */
3014
3015int tioclinux(struct tty_struct *tty, unsigned long arg)
3016{
3017 char type, data;
3018 char __user *p = (char __user *)arg;
3019 int lines;
3020 int ret;
3021
3022 if (current->signal->tty != tty && !capable(CAP_SYS_ADMIN))
3023 return -EPERM;
3024 if (get_user(type, p))
3025 return -EFAULT;
3026 ret = 0;
3027
3028 switch (type)
3029 {
3030 case TIOCL_SETSEL:
3031 console_lock();
3012 */
3013
3014int tioclinux(struct tty_struct *tty, unsigned long arg)
3015{
3016 char type, data;
3017 char __user *p = (char __user *)arg;
3018 int lines;
3019 int ret;
3020
3021 if (current->signal->tty != tty && !capable(CAP_SYS_ADMIN))
3022 return -EPERM;
3023 if (get_user(type, p))
3024 return -EFAULT;
3025 ret = 0;
3026
3027 switch (type)
3028 {
3029 case TIOCL_SETSEL:
3030 console_lock();
3032 ret = set_selection((struct tiocl_selection __user *)(p+1), tty);
3031 ret = set_selection_user((struct tiocl_selection
3032 __user *)(p+1), tty);
3033 console_unlock();
3034 break;
3035 case TIOCL_PASTESEL:
3036 ret = paste_selection(tty);
3037 break;
3038 case TIOCL_UNBLANKSCREEN:
3039 console_lock();
3040 unblank_screen();

--- 1672 unchanged lines hidden ---
3033 console_unlock();
3034 break;
3035 case TIOCL_PASTESEL:
3036 ret = paste_selection(tty);
3037 break;
3038 case TIOCL_UNBLANKSCREEN:
3039 console_lock();
3040 unblank_screen();

--- 1672 unchanged lines hidden ---