{"id":812830,"url":"http://patchwork.ozlabs.org/api/patches/812830/?format=json","web_url":"http://patchwork.ozlabs.org/project/qemu-devel/patch/20170912123744.14730-9-berrange@redhat.com/","project":{"id":14,"url":"http://patchwork.ozlabs.org/api/projects/14/?format=json","name":"QEMU Development","link_name":"qemu-devel","list_id":"qemu-devel.nongnu.org","list_email":"qemu-devel@nongnu.org","web_url":"","scm_url":"","webscm_url":"","list_archive_url":"","list_archive_url_format":"","commit_url_format":""},"msgid":"<20170912123744.14730-9-berrange@redhat.com>","list_archive_url":null,"date":"2017-09-12T12:37:40","name":"[v5,08/12] char: convert the escc device to keycodemapdb","commit_ref":null,"pull_url":null,"state":"new","archived":false,"hash":"fbaf7ec11b325c24653ae12826151fbc75015f07","submitter":{"id":2694,"url":"http://patchwork.ozlabs.org/api/people/2694/?format=json","name":"Daniel P. Berrangé","email":"berrange@redhat.com"},"delegate":null,"mbox":"http://patchwork.ozlabs.org/project/qemu-devel/patch/20170912123744.14730-9-berrange@redhat.com/mbox/","series":[{"id":2692,"url":"http://patchwork.ozlabs.org/api/series/2692/?format=json","web_url":"http://patchwork.ozlabs.org/project/qemu-devel/list/?series=2692","date":"2017-09-12T12:37:33","name":"Convert over to use keycodemapdb","version":5,"mbox":"http://patchwork.ozlabs.org/series/2692/mbox/"}],"comments":"http://patchwork.ozlabs.org/api/patches/812830/comments/","check":"pending","checks":"http://patchwork.ozlabs.org/api/patches/812830/checks/","tags":{},"related":[],"headers":{"Return-Path":"<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming@bilbo.ozlabs.org","Authentication-Results":["ozlabs.org;\n\tspf=pass (mailfrom) smtp.mailfrom=nongnu.org\n\t(client-ip=208.118.235.17; helo=lists.gnu.org;\n\tenvelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org;\n\treceiver=<UNKNOWN>)","ext-mx01.extmail.prod.ext.phx2.redhat.com;\n\tdmarc=none (p=none dis=none) header.from=redhat.com","ext-mx01.extmail.prod.ext.phx2.redhat.com;\n\tspf=fail smtp.mailfrom=berrange@redhat.com"],"Received":["from lists.gnu.org (lists.gnu.org [208.118.235.17])\n\t(using TLSv1 with cipher AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 3xs4RY3RYvz9t82\n\tfor <incoming@patchwork.ozlabs.org>;\n\tTue, 12 Sep 2017 22:49:54 +1000 (AEST)","from localhost ([::1]:35585 helo=lists.gnu.org)\n\tby lists.gnu.org with esmtp (Exim 4.71) (envelope-from\n\t<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>)\n\tid 1drkVN-0003E6-JC\n\tfor incoming@patchwork.ozlabs.org; Tue, 12 Sep 2017 08:41:29 -0400","from eggs.gnu.org ([2001:4830:134:3::10]:48612)\n\tby lists.gnu.org with esmtp (Exim 4.71)\n\t(envelope-from <berrange@redhat.com>) id 1drkS7-0000jK-2n\n\tfor qemu-devel@nongnu.org; Tue, 12 Sep 2017 08:38:11 -0400","from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)\n\t(envelope-from <berrange@redhat.com>) id 1drkS3-0003St-WA\n\tfor qemu-devel@nongnu.org; Tue, 12 Sep 2017 08:38:07 -0400","from mx1.redhat.com ([209.132.183.28]:36980)\n\tby eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32)\n\t(Exim 4.71) (envelope-from <berrange@redhat.com>) id 1drkS3-0003Se-Ny\n\tfor qemu-devel@nongnu.org; Tue, 12 Sep 2017 08:38:03 -0400","from smtp.corp.redhat.com\n\t(int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12])\n\t(using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby mx1.redhat.com (Postfix) with ESMTPS id C8D4B81DED\n\tfor <qemu-devel@nongnu.org>; Tue, 12 Sep 2017 12:38:02 +0000 (UTC)","from localhost.localdomain.com (unknown [10.42.22.189])\n\tby smtp.corp.redhat.com (Postfix) with ESMTP id DA0BC77D65;\n\tTue, 12 Sep 2017 12:38:01 +0000 (UTC)"],"DMARC-Filter":"OpenDMARC Filter v1.3.2 mx1.redhat.com C8D4B81DED","From":"\"Daniel P. Berrange\" <berrange@redhat.com>","To":"qemu-devel@nongnu.org","Date":"Tue, 12 Sep 2017 13:37:40 +0100","Message-Id":"<20170912123744.14730-9-berrange@redhat.com>","In-Reply-To":"<20170912123744.14730-1-berrange@redhat.com>","References":"<20170912123744.14730-1-berrange@redhat.com>","X-Scanned-By":"MIMEDefang 2.79 on 10.5.11.12","X-Greylist":"Sender IP whitelisted, not delayed by milter-greylist-4.5.16\n\t(mx1.redhat.com [10.5.110.25]);\n\tTue, 12 Sep 2017 12:38:02 +0000 (UTC)","X-detected-operating-system":"by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]\n\t[fuzzy]","X-Received-From":"209.132.183.28","Subject":"[Qemu-devel] [PATCH v5 08/12] char: convert the escc device to\n\tkeycodemapdb","X-BeenThere":"qemu-devel@nongnu.org","X-Mailman-Version":"2.1.21","Precedence":"list","List-Id":"<qemu-devel.nongnu.org>","List-Unsubscribe":"<https://lists.nongnu.org/mailman/options/qemu-devel>,\n\t<mailto:qemu-devel-request@nongnu.org?subject=unsubscribe>","List-Archive":"<http://lists.nongnu.org/archive/html/qemu-devel/>","List-Post":"<mailto:qemu-devel@nongnu.org>","List-Help":"<mailto:qemu-devel-request@nongnu.org?subject=help>","List-Subscribe":"<https://lists.nongnu.org/mailman/listinfo/qemu-devel>,\n\t<mailto:qemu-devel-request@nongnu.org?subject=subscribe>","Cc":"Gerd Hoffmann <kraxel@redhat.com>","Errors-To":"qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org","Sender":"\"Qemu-devel\"\n\t<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>"},"content":"Replace the qcode_to_keycode table with automatically\ngenerated tables.\n\nMissing entries in qcode_to_keycode now fixed:\n\n - Q_KEY_CODE_KP_COMMA -> 0x2d\n\nSigned-off-by: Daniel P. Berrange <berrange@redhat.com>\n---\n hw/char/escc.c     | 126 +++--------------------------------------------------\n include/ui/input.h |   3 ++\n ui/Makefile.objs   |   1 +\n ui/input-keymap.c  |   1 +\n 4 files changed, 10 insertions(+), 121 deletions(-)","diff":"diff --git a/hw/char/escc.c b/hw/char/escc.c\nindex 3ab831a6a7..449bf2fc63 100644\n--- a/hw/char/escc.c\n+++ b/hw/char/escc.c\n@@ -717,126 +717,6 @@ MemoryRegion *escc_init(hwaddr base, qemu_irq irqA, qemu_irq irqB,\n     return &d->mmio;\n }\n \n-static const uint8_t qcode_to_keycode[Q_KEY_CODE__MAX] = {\n-    [Q_KEY_CODE_SHIFT]         = 99,\n-    [Q_KEY_CODE_SHIFT_R]       = 110,\n-    [Q_KEY_CODE_ALT]           = 19,\n-    [Q_KEY_CODE_ALT_R]         = 13,\n-    [Q_KEY_CODE_CTRL]          = 76,\n-    [Q_KEY_CODE_CTRL_R]        = 76,\n-    [Q_KEY_CODE_ESC]           = 29,\n-    [Q_KEY_CODE_1]             = 30,\n-    [Q_KEY_CODE_2]             = 31,\n-    [Q_KEY_CODE_3]             = 32,\n-    [Q_KEY_CODE_4]             = 33,\n-    [Q_KEY_CODE_5]             = 34,\n-    [Q_KEY_CODE_6]             = 35,\n-    [Q_KEY_CODE_7]             = 36,\n-    [Q_KEY_CODE_8]             = 37,\n-    [Q_KEY_CODE_9]             = 38,\n-    [Q_KEY_CODE_0]             = 39,\n-    [Q_KEY_CODE_MINUS]         = 40,\n-    [Q_KEY_CODE_EQUAL]         = 41,\n-    [Q_KEY_CODE_BACKSPACE]     = 43,\n-    [Q_KEY_CODE_TAB]           = 53,\n-    [Q_KEY_CODE_Q]             = 54,\n-    [Q_KEY_CODE_W]             = 55,\n-    [Q_KEY_CODE_E]             = 56,\n-    [Q_KEY_CODE_R]             = 57,\n-    [Q_KEY_CODE_T]             = 58,\n-    [Q_KEY_CODE_Y]             = 59,\n-    [Q_KEY_CODE_U]             = 60,\n-    [Q_KEY_CODE_I]             = 61,\n-    [Q_KEY_CODE_O]             = 62,\n-    [Q_KEY_CODE_P]             = 63,\n-    [Q_KEY_CODE_BRACKET_LEFT]  = 64,\n-    [Q_KEY_CODE_BRACKET_RIGHT] = 65,\n-    [Q_KEY_CODE_RET]           = 89,\n-    [Q_KEY_CODE_A]             = 77,\n-    [Q_KEY_CODE_S]             = 78,\n-    [Q_KEY_CODE_D]             = 79,\n-    [Q_KEY_CODE_F]             = 80,\n-    [Q_KEY_CODE_G]             = 81,\n-    [Q_KEY_CODE_H]             = 82,\n-    [Q_KEY_CODE_J]             = 83,\n-    [Q_KEY_CODE_K]             = 84,\n-    [Q_KEY_CODE_L]             = 85,\n-    [Q_KEY_CODE_SEMICOLON]     = 86,\n-    [Q_KEY_CODE_APOSTROPHE]    = 87,\n-    [Q_KEY_CODE_GRAVE_ACCENT]  = 42,\n-    [Q_KEY_CODE_BACKSLASH]     = 88,\n-    [Q_KEY_CODE_Z]             = 100,\n-    [Q_KEY_CODE_X]             = 101,\n-    [Q_KEY_CODE_C]             = 102,\n-    [Q_KEY_CODE_V]             = 103,\n-    [Q_KEY_CODE_B]             = 104,\n-    [Q_KEY_CODE_N]             = 105,\n-    [Q_KEY_CODE_M]             = 106,\n-    [Q_KEY_CODE_COMMA]         = 107,\n-    [Q_KEY_CODE_DOT]           = 108,\n-    [Q_KEY_CODE_SLASH]         = 109,\n-    [Q_KEY_CODE_ASTERISK]      = 47,\n-    [Q_KEY_CODE_SPC]           = 121,\n-    [Q_KEY_CODE_CAPS_LOCK]     = 119,\n-    [Q_KEY_CODE_F1]            = 5,\n-    [Q_KEY_CODE_F2]            = 6,\n-    [Q_KEY_CODE_F3]            = 8,\n-    [Q_KEY_CODE_F4]            = 10,\n-    [Q_KEY_CODE_F5]            = 12,\n-    [Q_KEY_CODE_F6]            = 14,\n-    [Q_KEY_CODE_F7]            = 16,\n-    [Q_KEY_CODE_F8]            = 17,\n-    [Q_KEY_CODE_F9]            = 18,\n-    [Q_KEY_CODE_F10]           = 7,\n-    [Q_KEY_CODE_NUM_LOCK]      = 98,\n-    [Q_KEY_CODE_SCROLL_LOCK]   = 23,\n-    [Q_KEY_CODE_KP_DIVIDE]     = 46,\n-    [Q_KEY_CODE_KP_MULTIPLY]   = 47,\n-    [Q_KEY_CODE_KP_SUBTRACT]   = 71,\n-    [Q_KEY_CODE_KP_ADD]        = 125,\n-    [Q_KEY_CODE_KP_ENTER]      = 90,\n-    [Q_KEY_CODE_KP_DECIMAL]    = 50,\n-    [Q_KEY_CODE_KP_0]          = 94,\n-    [Q_KEY_CODE_KP_1]          = 112,\n-    [Q_KEY_CODE_KP_2]          = 113,\n-    [Q_KEY_CODE_KP_3]          = 114,\n-    [Q_KEY_CODE_KP_4]          = 91,\n-    [Q_KEY_CODE_KP_5]          = 92,\n-    [Q_KEY_CODE_KP_6]          = 93,\n-    [Q_KEY_CODE_KP_7]          = 68,\n-    [Q_KEY_CODE_KP_8]          = 69,\n-    [Q_KEY_CODE_KP_9]          = 70,\n-    [Q_KEY_CODE_LESS]          = 124,\n-    [Q_KEY_CODE_F11]           = 9,\n-    [Q_KEY_CODE_F12]           = 11,\n-    [Q_KEY_CODE_HOME]          = 52,\n-    [Q_KEY_CODE_PGUP]          = 96,\n-    [Q_KEY_CODE_PGDN]          = 123,\n-    [Q_KEY_CODE_END]           = 74,\n-    [Q_KEY_CODE_LEFT]          = 24,\n-    [Q_KEY_CODE_UP]            = 20,\n-    [Q_KEY_CODE_DOWN]          = 27,\n-    [Q_KEY_CODE_RIGHT]         = 28,\n-    [Q_KEY_CODE_INSERT]        = 44,\n-    [Q_KEY_CODE_DELETE]        = 66,\n-    [Q_KEY_CODE_STOP]          = 1,\n-    [Q_KEY_CODE_AGAIN]         = 3,\n-    [Q_KEY_CODE_PROPS]         = 25,\n-    [Q_KEY_CODE_UNDO]          = 26,\n-    [Q_KEY_CODE_FRONT]         = 49,\n-    [Q_KEY_CODE_COPY]          = 51,\n-    [Q_KEY_CODE_OPEN]          = 72,\n-    [Q_KEY_CODE_PASTE]         = 73,\n-    [Q_KEY_CODE_FIND]          = 95,\n-    [Q_KEY_CODE_CUT]           = 97,\n-    [Q_KEY_CODE_LF]            = 111,\n-    [Q_KEY_CODE_HELP]          = 118,\n-    [Q_KEY_CODE_META_L]        = 120,\n-    [Q_KEY_CODE_META_R]        = 122,\n-    [Q_KEY_CODE_COMPOSE]       = 67,\n-    [Q_KEY_CODE_PRINT]         = 22,\n-    [Q_KEY_CODE_SYSRQ]         = 21,\n-};\n \n static void sunkbd_handle_event(DeviceState *dev, QemuConsole *src,\n                                 InputEvent *evt)\n@@ -879,7 +759,11 @@ static void sunkbd_handle_event(DeviceState *dev, QemuConsole *src,\n         }\n     }\n \n-    keycode = qcode_to_keycode[qcode];\n+    if (qcode > qemu_input_map_qcode_to_sun_len) {\n+        return;\n+    }\n+\n+    keycode = qemu_input_map_qcode_to_sun[qcode];\n     if (!key->down) {\n         keycode |= 0x80;\n     }\ndiff --git a/include/ui/input.h b/include/ui/input.h\nindex 4aa5655a0b..4ba7340b7b 100644\n--- a/include/ui/input.h\n+++ b/include/ui/input.h\n@@ -89,6 +89,9 @@ extern const guint16 qemu_input_map_qcode_to_linux[];\n extern const guint qemu_input_map_qcode_to_qnum_len;\n extern const guint16 qemu_input_map_qcode_to_qnum[];\n \n+extern const guint qemu_input_map_qcode_to_sun_len;\n+extern const guint16 qemu_input_map_qcode_to_sun[];\n+\n extern const guint qemu_input_map_qnum_to_qcode_len;\n extern const guint16 qemu_input_map_qnum_to_qcode[];\n \ndiff --git a/ui/Makefile.objs b/ui/Makefile.objs\nindex 6846636f39..3cd1122ea9 100644\n--- a/ui/Makefile.objs\n+++ b/ui/Makefile.objs\n@@ -61,6 +61,7 @@ KEYCODEMAP_FILES = \\\n \t\t ui/input-keymap-qcode-to-atset3.c \\\n \t\t ui/input-keymap-qcode-to-linux.c \\\n \t\t ui/input-keymap-qcode-to-qnum.c \\\n+\t\t ui/input-keymap-qcode-to-sun.c \\\n \t\t ui/input-keymap-qnum-to-qcode.c \\\n \t\t $(NULL)\n \ndiff --git a/ui/input-keymap.c b/ui/input-keymap.c\nindex 5d97a38c42..1b53cb4d0a 100644\n--- a/ui/input-keymap.c\n+++ b/ui/input-keymap.c\n@@ -12,6 +12,7 @@\n #include \"ui/input-keymap-qcode-to-atset3.c\"\n #include \"ui/input-keymap-qcode-to-linux.c\"\n #include \"ui/input-keymap-qcode-to-qnum.c\"\n+#include \"ui/input-keymap-qcode-to-sun.c\"\n #include \"ui/input-keymap-qnum-to-qcode.c\"\n \n int qemu_input_linux_to_qcode(unsigned int lnx)\n","prefixes":["v5","08/12"]}