Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp755658imu; Sat, 15 Dec 2018 06:42:50 -0800 (PST) X-Google-Smtp-Source: AFSGD/V0iv6OawKPcNcCF8yVyjIz0zDu/s8QTDEaM9ld7BYKSfF1PlIryiXqxlCT79/Jyd945F0M X-Received: by 2002:a17:902:12f:: with SMTP id 44mr6702285plb.74.1544884970407; Sat, 15 Dec 2018 06:42:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544884970; cv=none; d=google.com; s=arc-20160816; b=HMP/dg0cTcB8Aa3A1M8vGApMC5KkOdiXa/qQZtGxmZxTJDj+Cws6o8Jov4adbkzEQT AnakUtQIkmeOpc4h7W5ijhBOVsZYcYk9kMW2SX/8kYrOFw35Vnr6vmuQhWhfCvVJjQ7M PsXT71syT9GKjuORThRX86qrhbK0+Ni1BJhCTxMpgh+YjbwYbG5SXBLRO5ngaZ2Vi01M mMWjiFMi6AND2d7oFrl1gBYt4FODYDWvc0HTVLIeCPmqP0X1u3++JwX5Fk40c8NeAz11 r1zX9GnOkC00dsbTjgTAfA94lC8Fla936PEVi2zwWWlmYmPdNI4j/Wl5bqs+SmdnpuWz PMnw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature; bh=jhYHire91ro14ibzaMZSIvu3E/m+aG2z4sqbhsJfi3c=; b=ffTM8sxj3FtwFdd36I/AgsccvzUXynuC5/ih6eAnO+NjBpUM+2Rpmz/fwSqBW5JS63 Npg0PdsfDbZ4aUpt38ShOXLNt4RSicMLOCetuGPXTeOwl7h8FVHxMs0UvbUEIxiKToDJ GhHim94wixWLCjWsEi+1t2Bn3cQryPSg/ldeEtdCuXn0bOd6AT6uee/ugyDX08Iu1rs/ L3nPBAP2a+AM9u4G8o6uHZ/rMVuPsjjgW2502sST0S6so+QfMPVPmXDWTq1iVFtHGX9t rxcmn5DdzGUsmWZlOFgQx5QKtUXm3kcVrl1TbDFdFScSLWKzvcSvcus07XDR3phLq0nQ LsyQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@uchuujin.de header.s=h header.b=kNFt8RCJ; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t20si6593767pgl.211.2018.12.15.06.42.35; Sat, 15 Dec 2018 06:42:50 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@uchuujin.de header.s=h header.b=kNFt8RCJ; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730394AbeLOOkw (ORCPT + 99 others); Sat, 15 Dec 2018 09:40:52 -0500 Received: from static.85-10-192-230.clients.your-server.de ([85.10.192.230]:58833 "EHLO mxout.uchuujin.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729687AbeLOOkv (ORCPT ); Sat, 15 Dec 2018 09:40:51 -0500 X-Greylist: delayed 365 seconds by postgrey-1.27 at vger.kernel.org; Sat, 15 Dec 2018 09:40:50 EST Received: by neutronstar.dyndns.org (Postfix, from userid 1000) id 73EA41430BAF0; Sat, 15 Dec 2018 15:35:30 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=uchuujin.de; s=h; t=1544884530; bh=ktVaweSJBGbotv4bGWuEgtAOxgFdU0L9s5IYQMXXwAQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=kNFt8RCJUzwE1kqN6IlFnng2FOiaBgHwC4IVbL+yr9oz8OrTYh3d3otUeWVutLg4g jcQT+xSMVasuZYLyMm0CZ5T/S1u8tTYpcpZceLlTdYuTexLx+cMwNvzojLrsrMctLh wdPJR7wjt6K7z9+7JChZSURHzuguv1xitQjoSoUMU9iDgtleStNNVhw9J9eqbwYutg f/E9HK/VFEjLtF/Nfd2JBoi5RRaIhbMCbR4jOzqdt1fbmJAKoTPxRlWKn+pf1YzPNi s0s7mNHYcrq9u8/YCbbEPSivHI1NTA7wwKZgN4pp8S76LiZW5+jGcm5RTmna8gopwo U/Mm518fCKj5w== From: Martin Hostettler To: Greg Kroah-Hartman , Jiri Slaby Cc: linux-kernel@vger.kernel.org, linux-api@vger.kernel.org, Nicolas Pitre , Adam Borowski , Egmont Koblinger , Martin Hostettler Subject: [PATCH 1/4] vt: refactor vc_ques to allow of other private sequences. Date: Sat, 15 Dec 2018 15:34:20 +0100 Message-Id: <20181215143423.4556-2-textshell@uchuujin.de> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20181215143423.4556-1-textshell@uchuujin.de> References: <20181215143423.4556-1-textshell@uchuujin.de> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The vc_ques keeps track if a csi sequence is a private DEC control function beginning with '?'. Nowadays some private control functions begin with '>' and '='. Switch the code to instead use a new 3-bit vc_priv that allows for all private use parameter prefixes. Signed-off-by: Martin Hostettler --- drivers/tty/vt/vt.c | 20 +++++++++++--------- include/linux/console_struct.h | 2 +- 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/drivers/tty/vt/vt.c b/drivers/tty/vt/vt.c index 41ec8e5010f3..75826a97b0c3 100644 --- a/drivers/tty/vt/vt.c +++ b/drivers/tty/vt/vt.c @@ -1341,6 +1341,8 @@ struct vc_data *vc_deallocate(unsigned int currcons) * VT102 emulator */ +enum { EPecma = 0, EPdec, EPeq, EPgt, EPlt}; + #define set_kbd(vc, x) vt_set_kbd_mode_bit((vc)->vc_num, (x)) #define clr_kbd(vc, x) vt_clr_kbd_mode_bit((vc)->vc_num, (x)) #define is_kbd(vc, x) vt_get_kbd_mode_bit((vc)->vc_num, (x)) @@ -1814,7 +1816,7 @@ static void set_mode(struct vc_data *vc, int on_off) int i; for (i = 0; i <= vc->vc_npar; i++) - if (vc->vc_ques) { + if (vc->vc_priv == EPdec) { switch(vc->vc_par[i]) { /* DEC private modes set/reset */ case 1: /* Cursor keys send ^[Ox/^[[x */ if (on_off) @@ -2030,7 +2032,7 @@ static void reset_terminal(struct vc_data *vc, int do_clear) vc->vc_top = 0; vc->vc_bottom = vc->vc_rows; vc->vc_state = ESnormal; - vc->vc_ques = 0; + vc->vc_priv = EPecma; vc->vc_translate = set_translate(LAT1_MAP, vc); vc->vc_G0_charset = LAT1_MAP; vc->vc_G1_charset = GRAF_MAP; @@ -2233,8 +2235,8 @@ static void do_con_trol(struct tty_struct *tty, struct vc_data *vc, int c) vc->vc_state=ESfunckey; return; } - vc->vc_ques = (c == '?'); - if (vc->vc_ques) + vc->vc_priv = (c == '?') ? EPdec : EPecma; + if (vc->vc_priv != EPecma) return; case ESgetpars: if (c == ';' && vc->vc_npar < NPAR - 1) { @@ -2254,7 +2256,7 @@ static void do_con_trol(struct tty_struct *tty, struct vc_data *vc, int c) set_mode(vc, 0); return; case 'c': - if (vc->vc_ques) { + if (vc->vc_priv == EPdec) { if (vc->vc_par[0]) vc->vc_cursor_type = vc->vc_par[0] | (vc->vc_par[1] << 8) | (vc->vc_par[2] << 16); else @@ -2263,7 +2265,7 @@ static void do_con_trol(struct tty_struct *tty, struct vc_data *vc, int c) } break; case 'm': - if (vc->vc_ques) { + if (vc->vc_priv == EPdec) { clear_selection(); if (vc->vc_par[0]) vc->vc_complement_mask = vc->vc_par[0] << 8 | vc->vc_par[1]; @@ -2273,7 +2275,7 @@ static void do_con_trol(struct tty_struct *tty, struct vc_data *vc, int c) } break; case 'n': - if (!vc->vc_ques) { + if (vc->vc_priv == EPecma) { if (vc->vc_par[0] == 5) status_report(tty); else if (vc->vc_par[0] == 6) @@ -2281,8 +2283,8 @@ static void do_con_trol(struct tty_struct *tty, struct vc_data *vc, int c) } return; } - if (vc->vc_ques) { - vc->vc_ques = 0; + if (vc->vc_priv != EPecma) { + vc->vc_priv = EPecma; return; } switch(c) { diff --git a/include/linux/console_struct.h b/include/linux/console_struct.h index ab137f97ecbd..ed798e114663 100644 --- a/include/linux/console_struct.h +++ b/include/linux/console_struct.h @@ -119,7 +119,7 @@ struct vc_data { unsigned int vc_s_blink : 1; unsigned int vc_s_reverse : 1; /* misc */ - unsigned int vc_ques : 1; + unsigned int vc_priv : 3; unsigned int vc_need_wrap : 1; unsigned int vc_can_do_color : 1; unsigned int vc_report_mouse : 2; -- 2.11.0