From patchwork Mon Nov 1 08:27:42 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Laurent Vivier X-Patchwork-Id: 1549022 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4HjR570Lwjz9sXM for ; Mon, 1 Nov 2021 19:28:42 +1100 (AEDT) Received: from localhost ([::1]:36606 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mhSgK-0005yz-Ko for incoming@patchwork.ozlabs.org; Mon, 01 Nov 2021 04:28:40 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:36596) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mhSfe-0005v8-BY; Mon, 01 Nov 2021 04:27:58 -0400 Received: from mout.kundenserver.de ([212.227.126.131]:44745) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mhSfc-00086J-4n; Mon, 01 Nov 2021 04:27:58 -0400 Received: from quad ([82.142.14.190]) by mrelayeu.kundenserver.de (mreue012 [212.227.15.167]) with ESMTPSA (Nemesis) id 1MFb38-1mQOz203DC-00HB8Q; Mon, 01 Nov 2021 09:27:50 +0100 From: Laurent Vivier To: qemu-devel@nongnu.org Subject: [PULL 1/6] monitor: Trim some trailing space from human-readable output Date: Mon, 1 Nov 2021 09:27:42 +0100 Message-Id: <20211101082747.2524909-2-laurent@vivier.eu> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20211101082747.2524909-1-laurent@vivier.eu> References: <20211101082747.2524909-1-laurent@vivier.eu> MIME-Version: 1.0 X-Provags-ID: V03:K1:uKGNeJnaNMjzS72yERCQlhOgHt3P3Qf8bUqkpsxi61YLpgElKP2 4PSiFM2FmctiOrOBjxVK7SrOG/fFZVfzquoH+QpyC6FmEW4JKFmL9jBwjh493L/YladORtn kVToRJEymbUP1bGooU4YDTGLjYa/f70P75k28w55KRz8vULGXXCN5H70f2KiFCuo7g5rOdc hiSZYccttX74AdcnLXUSg== X-UI-Out-Filterresults: notjunk:1;V03:K0:8FGewMwOW6c=:7u4CILcK/TYz7QCLfy6Vzo gaodSnQlEo3p3zykaUH1p1yuk7oPSeClB6A1ell31tLlTkziRrXZlHpAWYs4ai7J6ajJgYjhg EWX1JLKzBVzl8ipesr31VmJZaVr0L3tge4frgQecI3Ou6vjBgOulwKymqkj0kJoqY0RKE4gW3 KQhUpoE2O6cqzB967hUG7NqbNunKFHICfKjkxLC8lH5ph7h5eoq2aG6qAWUJpdtJbmWAi9pXu AYyV4t+qBhTau7fj/gCO+gaQfxArpzT14hkenrtWrWP4RjE/wG0MjE/y65tVrXNzsKbR0+LKv +o/FBB3ZqIH0SwygmS8nwNVWkbq5kbsU8gQe291yT3LHing7qi1svaPJemSyBSZwbl2WyGOPM nVm1S1X6c59f4mdWx1w3mP/yJbnLfSuSzGIxemixnJwkO9WQuNJiM59bPB0VBuah+x9Z35l17 kqDQhfkE7nB0Nfmet1zQdu6H6Jbai+Yf+xlJn4ecNcwS6fT2H3XYackUqUgQbPCBBn07mEupF 0rDi4ap7UqMvpT273lMmBYWqIjs7eD6+8UcNYUvUNhF1JmJLiL7yXAsNIRt4MEtMcv1rARWJV an04ZbEBfrZ6FgxwXqmqx4pXbfmt2tCn5UcV6vvAwKW3cPBk6trpkdNcO82NQh+RsU77pCaIq lRNrw7tspuRWf5t+0Tf3hJ8L2f4XFWWdWUdXHFdM78mDUs2KkVoO85hCqCh0mWtyab+U= Received-SPF: none client-ip=212.227.126.131; envelope-from=laurent@vivier.eu; helo=mout.kundenserver.de X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_NONE=0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: qemu-trivial@nongnu.org, Richard Henderson , Markus Armbruster , Greg Kurz , Max Filippov , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Laurent Vivier Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Markus Armbruster I noticed -cpu help printing enough trailing spaces to make the output at least 84 characters wide. Looks ugly unless the terminal is wider. Ugly or not, trailing spaces are stupid. The culprit is this line in x86_cpu_list_entry(): qemu_printf("x86 %-20s %-58s\n", name, desc); This prints a string with minimum field left-justified right before a newline. Change it to qemu_printf("x86 %-20s %s\n", name, desc); which avoids the trailing spaces and is simpler to boot. A search for the pattern with "git-grep -E '%-[0-9]+s\\n'" found a few more instances. Change them similarly. Signed-off-by: Markus Armbruster Reviewed-by: Richard Henderson Acked-by: Greg Kurz Reviewed-by: Philippe Mathieu-Daudé Acked-by: Max Filippov Message-Id: <20211009152401.2982862-1-armbru@redhat.com> Signed-off-by: Laurent Vivier --- monitor/hmp-cmds.c | 2 +- target/i386/cpu-dump.c | 4 ++-- target/i386/cpu.c | 2 +- target/ppc/cpu_init.c | 2 +- target/s390x/cpu_models.c | 4 ++-- target/xtensa/mmu_helper.c | 2 +- 6 files changed, 8 insertions(+), 8 deletions(-) diff --git a/monitor/hmp-cmds.c b/monitor/hmp-cmds.c index bcaa41350e9a..9e45a138a505 100644 --- a/monitor/hmp-cmds.c +++ b/monitor/hmp-cmds.c @@ -1945,7 +1945,7 @@ void hmp_rocker_ports(Monitor *mon, const QDict *qdict) monitor_printf(mon, " port link duplex neg?\n"); for (port = list; port; port = port->next) { - monitor_printf(mon, "%10s %-4s %-3s %2s %-3s\n", + monitor_printf(mon, "%10s %-4s %-3s %2s %s\n", port->value->name, port->value->enabled ? port->value->link_up ? "up" : "down" : "!ena", diff --git a/target/i386/cpu-dump.c b/target/i386/cpu-dump.c index 02b635a52cff..08ac957e99cf 100644 --- a/target/i386/cpu-dump.c +++ b/target/i386/cpu-dump.c @@ -464,13 +464,13 @@ void x86_cpu_dump_state(CPUState *cs, FILE *f, int flags) snprintf(cc_op_name, sizeof(cc_op_name), "[%d]", env->cc_op); #ifdef TARGET_X86_64 if (env->hflags & HF_CS64_MASK) { - qemu_fprintf(f, "CCS=%016" PRIx64 " CCD=%016" PRIx64 " CCO=%-8s\n", + qemu_fprintf(f, "CCS=%016" PRIx64 " CCD=%016" PRIx64 " CCO=%s\n", env->cc_src, env->cc_dst, cc_op_name); } else #endif { - qemu_fprintf(f, "CCS=%08x CCD=%08x CCO=%-8s\n", + qemu_fprintf(f, "CCS=%08x CCD=%08x CCO=%s\n", (uint32_t)env->cc_src, (uint32_t)env->cc_dst, cc_op_name); } diff --git a/target/i386/cpu.c b/target/i386/cpu.c index 598d451dcf04..c5744ce08cf9 100644 --- a/target/i386/cpu.c +++ b/target/i386/cpu.c @@ -4878,7 +4878,7 @@ static void x86_cpu_list_entry(gpointer data, gpointer user_data) desc = g_strdup_printf("%s", model_id); } - qemu_printf("x86 %-20s %-58s\n", name, desc); + qemu_printf("x86 %-20s %s\n", name, desc); } /* list available CPU models and flags */ diff --git a/target/ppc/cpu_init.c b/target/ppc/cpu_init.c index 65545ba9ca8d..ba384a592bc1 100644 --- a/target/ppc/cpu_init.c +++ b/target/ppc/cpu_init.c @@ -8734,7 +8734,7 @@ void ppc_cpu_list(void) #ifdef CONFIG_KVM qemu_printf("\n"); - qemu_printf("PowerPC %-16s\n", "host"); + qemu_printf("PowerPC %s\n", "host"); #endif } diff --git a/target/s390x/cpu_models.c b/target/s390x/cpu_models.c index 4e4598cc774c..11e06cc51fab 100644 --- a/target/s390x/cpu_models.c +++ b/target/s390x/cpu_models.c @@ -398,14 +398,14 @@ void s390_cpu_list(void) for (feat = 0; feat < S390_FEAT_MAX; feat++) { const S390FeatDef *def = s390_feat_def(feat); - qemu_printf("%-20s %-50s\n", def->name, def->desc); + qemu_printf("%-20s %s\n", def->name, def->desc); } qemu_printf("\nRecognized feature groups:\n"); for (group = 0; group < S390_FEAT_GROUP_MAX; group++) { const S390FeatGroupDef *def = s390_feat_group_def(group); - qemu_printf("%-20s %-50s\n", def->name, def->desc); + qemu_printf("%-20s %s\n", def->name, def->desc); } } diff --git a/target/xtensa/mmu_helper.c b/target/xtensa/mmu_helper.c index b01ff9399ae6..57e319a1af3a 100644 --- a/target/xtensa/mmu_helper.c +++ b/target/xtensa/mmu_helper.c @@ -1098,7 +1098,7 @@ static void dump_tlb(CPUXtensaState *env, bool dtlb) qemu_printf("\tVaddr Paddr ASID Attr RWX Cache\n" "\t---------- ---------- ---- ---- --- -------\n"); } - qemu_printf("\t0x%08x 0x%08x 0x%02x 0x%02x %c%c%c %-7s\n", + qemu_printf("\t0x%08x 0x%08x 0x%02x 0x%02x %c%c%c %s\n", entry->vaddr, entry->paddr, entry->asid, From patchwork Mon Nov 1 08:27:43 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurent Vivier X-Patchwork-Id: 1549025 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4HjR8f6h76z9sXM for ; Mon, 1 Nov 2021 19:31:46 +1100 (AEDT) Received: from localhost ([::1]:44324 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mhSjI-0002uW-Pm for incoming@patchwork.ozlabs.org; Mon, 01 Nov 2021 04:31:44 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:36634) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mhSfh-00064i-FE; Mon, 01 Nov 2021 04:28:01 -0400 Received: from mout.kundenserver.de ([212.227.126.133]:56097) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mhSff-00086m-HQ; Mon, 01 Nov 2021 04:28:01 -0400 Received: from quad ([82.142.14.190]) by mrelayeu.kundenserver.de (mreue012 [212.227.15.167]) with ESMTPSA (Nemesis) id 1MzkK9-1muKl40eLR-00vdE9; Mon, 01 Nov 2021 09:27:51 +0100 From: Laurent Vivier To: qemu-devel@nongnu.org Subject: [PULL 2/6] hw/core/machine: Add the missing delimiter in cpu_slot_to_string() Date: Mon, 1 Nov 2021 09:27:43 +0100 Message-Id: <20211101082747.2524909-3-laurent@vivier.eu> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20211101082747.2524909-1-laurent@vivier.eu> References: <20211101082747.2524909-1-laurent@vivier.eu> MIME-Version: 1.0 X-Provags-ID: V03:K1:QddQ3rLccChP6nxlP3XsQPXwm6UskLoP5XQvGK1/uBB/uGuwu72 NAoKMRHTs3WDytQOkSQQ/9s0TPxJliLv26IQbF2AFx0+UgPz58+U4HNwZhfasY8sd9OuSYe Es7y6gbqzAoHqQhIVMGkXx0Eca3unhNgQJySwDI9yJjGLLEo2Y4qwXJQmV2zpsS9FR+nyjb vXKnCs3rzLhe2VyehTBTA== X-UI-Out-Filterresults: notjunk:1;V03:K0:W2hb3MzyiPk=:nxtKNTVHNyDZ7oLbmXhPEx txH8Wjo8EX6fYM2gg19xYy7GmvaLXoy3ZFmoHum8GC2KeitTXPM1x+Nre+UzVACEQ2eapFWPJ UL8cRgmQZOyuT7/dn/DBtqBTgihwb/KcV4F+wrnEOhpQXIq3nrRVRICO8Bs10yXRXlVZtl2qX vj0iXbqXp6MSYMA7OceYK90jca6n607hboO79xClAw7TDHi1L7yS3QxhpeZugdEpM0m2jWkuC vN3fghmHcRx1xwGFOKRHBnUS3R98PyhRiY+JlzNEQLyR4u1SOgm+duek6uNvrZU4NvVji0Mbh i+FSnCdW+75ISfx12nasv2PcqQA33Fdbmv71oMzuRQMlRWTZtp1N005dP2TcX6B6p8nb1psFd in27o84IhRBcEHzpSZ0myfJ8eMphDS3BVapqrR0elXJRuuK5z6ZQH7KmDPumdeF8qN1PNATRO POpb8O9mrDs9Jl7781FQzrIi1k11CBaZacDSJlzEKefCEJtCakWwXohcZKcHtBV5s3auDfXfz tB4ZuJp28RG6rXPGWGIlzYpTjrCCcpoGE/xAurHbEXpcwTKomPlw6GoTzRdTXI+Fyu4FjXybw GeXDhh++SSQb03wEidQLJcPFTOr2DHPTugM/cIu3aF359HTT1M91OgcVgUR1USFhduluL0oTD TnYrSBw4PXExGpE88hjjR7IfOmuef7gtstA0AwFnQ/tC5i/fLZjgWsCCPg94aeWR6wps= Received-SPF: none client-ip=212.227.126.133; envelope-from=laurent@vivier.eu; helo=mout.kundenserver.de X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_NONE=0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: qemu-trivial@nongnu.org, Yanan Wang , Laurent Vivier Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Yanan Wang The expected output string from cpu_slot_to_string() ought to be like "socket-id: *, die-id: *, core-id: *, thread-id: *", so add the missing ", " before "die-id". This affects the readability of the error message. Fixes: 176d2cda0d ("i386/cpu: Consolidate die-id validity in smp context") Signed-off-by: Yanan Wang Reviewed-by: Laurent Vivier Message-Id: <20211008075040.18028-1-wangyanan55@huawei.com> Signed-off-by: Laurent Vivier --- hw/core/machine.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/hw/core/machine.c b/hw/core/machine.c index b8d95eec32d4..0a23ae310606 100644 --- a/hw/core/machine.c +++ b/hw/core/machine.c @@ -1157,6 +1157,9 @@ static char *cpu_slot_to_string(const CPUArchId *cpu) g_string_append_printf(s, "socket-id: %"PRId64, cpu->props.socket_id); } if (cpu->props.has_die_id) { + if (s->len) { + g_string_append_printf(s, ", "); + } g_string_append_printf(s, "die-id: %"PRId64, cpu->props.die_id); } if (cpu->props.has_core_id) { From patchwork Mon Nov 1 08:27:44 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Laurent Vivier X-Patchwork-Id: 1549024 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4HjR7j36L9z9sXM for ; Mon, 1 Nov 2021 19:30:57 +1100 (AEDT) Received: from localhost ([::1]:43104 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mhSiV-00023T-7Q for incoming@patchwork.ozlabs.org; Mon, 01 Nov 2021 04:30:55 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:36616) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mhSff-0005xh-DP; Mon, 01 Nov 2021 04:27:59 -0400 Received: from mout.kundenserver.de ([212.227.126.131]:43275) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mhSfd-00086R-FJ; Mon, 01 Nov 2021 04:27:59 -0400 Received: from quad ([82.142.14.190]) by mrelayeu.kundenserver.de (mreue012 [212.227.15.167]) with ESMTPSA (Nemesis) id 1MPrXf-1mKj1Y3Ibj-00MqRP; Mon, 01 Nov 2021 09:27:51 +0100 From: Laurent Vivier To: qemu-devel@nongnu.org Subject: [PULL 3/6] MAINTAINERS: Split HPPA TCG vs HPPA machines/hardware Date: Mon, 1 Nov 2021 09:27:44 +0100 Message-Id: <20211101082747.2524909-4-laurent@vivier.eu> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20211101082747.2524909-1-laurent@vivier.eu> References: <20211101082747.2524909-1-laurent@vivier.eu> MIME-Version: 1.0 X-Provags-ID: V03:K1:cYdtptuzDFuG45gYvai7tL8cFu6w+SZLwAKfkBqP88cBixraQHS yNvX66bDoOW/ttzJMC5xP03E5xnBd7XMMUYLjv/Zc7T4muFG/jbBCoTKPgL0soisyQs6aS4 L12yNMAYkI0l2ela9i/Z19EbkeNtdF7jygipa79RVR2cCweuYIb8kBAnjJCIcvJbxy7vpjB XWa3yKw0ar+FHh6ZgY4nQ== X-UI-Out-Filterresults: notjunk:1;V03:K0:s755VrgJ/u4=:XGEFTsDCNx1G6K63+3Lf5V rKRPuxNu0R9JyEx688NauGu44epj78ee/WJdS99D7rS1r/0uekgtXgwksMLPRs6WtYvPI8Jwc C18ePvaQ+1/gCF307btDxuBtTaKYoTeDPFmfkZn+w7oVfZ99n3cAOSTNg164ofwFmhgtEepiY M+vC1UNKLszmvwq+pLNOt4+dOlG7dvjNYfBwybsx0PtYraDon1vHfo7C/QrnBCnIc9tYyQ+jk aP08tQZK0qUO2nJlwMcY23qnEWZ4Zyg2SbanL9zM2n/jCXunqPlJeBUoNJkAO88tnwP8BnmQ0 OFzFlUQfwAkLQxL6EyXFH7Nhr0350d1aoTUk5gX24BVpxBlXSCIYt8qRVYcKHsdC0LhWo6vOA YI7tX0kgPJasqz54qQtnq/YoTvObvkFh/h0mGBpo7KKy3bYYZvpzz7wWC2DcXUMwPqxnw31OT hRsX9YL/iezjm7V9Vw7yTLt7osWA+fZf1ya7WIBXYh0EiFRS4Tmo1eKIwu+tcpGwD6mjIMbHt yTanEAAYT9m1dBDZKZmfqn1pdYg4f0ji7Egr7rpvHzigaRXz9HKKrAvVUXTg1Fu6bK32Yhjfc 1UjKr7NutRmjGoI2Hm3F3Uf59UcKswgc2crnPC9BwKerVpfBxwtRs+7N1YS6UfULpCrfia1H7 ICXmy1yYk+1Bgv9V/pYPQJPmILxtgTJEt0IJhM8neqHOs1TB+dLrZCeAhKwzftrHCEUE= Received-SPF: none client-ip=212.227.126.131; envelope-from=laurent@vivier.eu; helo=mout.kundenserver.de X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_NONE=0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: qemu-trivial@nongnu.org, Helge Deller , Richard Henderson , =?utf-8?q?Philippe_Mathie?= =?utf-8?q?u-Daud=C3=A9?= , Laurent Vivier Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Philippe Mathieu-Daudé Hardware emulated models don't belong to the TCG MAINTAINERS section. Move them to the 'HP-PARISC Machines' section. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson Reviewed-by: Helge Deller Message-Id: <20211004083835.3802961-1-f4bug@amsat.org> Signed-off-by: Laurent Vivier --- MAINTAINERS | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/MAINTAINERS b/MAINTAINERS index 894dc4310526..6f2b20078032 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -205,10 +205,7 @@ HPPA (PA-RISC) TCG CPUs M: Richard Henderson S: Maintained F: target/hppa/ -F: hw/hppa/ F: disas/hppa.c -F: hw/net/*i82596* -F: include/hw/net/lasi_82596.h M68K TCG CPUs M: Laurent Vivier @@ -1099,6 +1096,8 @@ R: Helge Deller S: Odd Fixes F: configs/devices/hppa-softmmu/default.mak F: hw/hppa/ +F: hw/net/*i82596* +F: include/hw/net/lasi_82596.h F: pc-bios/hppa-firmware.img M68K Machines From patchwork Mon Nov 1 08:27:45 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Laurent Vivier X-Patchwork-Id: 1549027 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4HjRC33RzPz9sXM for ; Mon, 1 Nov 2021 19:33:49 +1100 (AEDT) Received: from localhost ([::1]:50530 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mhSlG-0007HA-Nr for incoming@patchwork.ozlabs.org; Mon, 01 Nov 2021 04:33:46 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:36664) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mhSfn-0006QE-Mu; Mon, 01 Nov 2021 04:28:07 -0400 Received: from mout.kundenserver.de ([212.227.126.135]:36337) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mhSfl-00087c-GO; Mon, 01 Nov 2021 04:28:07 -0400 Received: from quad ([82.142.14.190]) by mrelayeu.kundenserver.de (mreue012 [212.227.15.167]) with ESMTPSA (Nemesis) id 1MSZDt-1mEd9d1f3J-00SvGL; Mon, 01 Nov 2021 09:27:52 +0100 From: Laurent Vivier To: qemu-devel@nongnu.org Subject: [PULL 4/6] hw/input/lasips2: Fix typos in function names Date: Mon, 1 Nov 2021 09:27:45 +0100 Message-Id: <20211101082747.2524909-5-laurent@vivier.eu> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20211101082747.2524909-1-laurent@vivier.eu> References: <20211101082747.2524909-1-laurent@vivier.eu> MIME-Version: 1.0 X-Provags-ID: V03:K1:RTBLZN1a9AZ2r5kyMXL2h38D7xJOMNpSaK6duuP4E8uIQuhf46G mMOLgXZLj+U46ZmJov7oTbxKSrhcEaNkxZyExjsyV6hEeEI9+unKGhny5mZkhhGN468HcBv yhzN3h6zfzWxjntRaM7ZE+7JYy/MXi6W9552BTSS97+hFdTDfrIK8h1mZD5XnoNhyQfMgvW /c74CPzOseH7Pd1sF+/eg== X-UI-Out-Filterresults: notjunk:1;V03:K0:NTaAXgdASzU=:wvLIUtgg275ku4gWlXT4rP HgPhIw+T6LHz7qKxqZfoHNQquFWX6v+FzKMt9tezLkKMVDT4a9EQ5h+wZgfc1sjTNPYgUY6Bq B7x+4ZZMZkPVsj+00lKwePfENMIYyY4eghVgy0KsPRHfEyhbW9qDLxiJsBzEGLIb/PEZg3dEg xeuokhNOgt3xDLKiepXdFQB9OgOpODf9j876Tre/XaYZtUKJ65mHgHrQ16vpKOyoOGREfs6A6 BHrZeofYKbUd+uiI1t0vaDRCXd2/ZE3py9xBMSuSdkl3946/AvK9SKgA1AAIZGXtkFtBJYzJQ mH66VaFyKhmk0FZxefVLWvvpt/Apu457w3z5pDcH9VnyIFPGrEQZyrFE9u7D93qagBsQI0BP8 vU3HWHFmJUn/F0HPMKYdK5HnxaLh2ZHyXP6/zUWVqP9vIK+JmFMnGIfWT3nqNhLJNAk1GKuJJ q8kBWIROrNzSpXYbqRd8A4e2VwMerW/d0WKfG81qGHLQ2724evQFezMA5OFf3jc6UsEV6MeDz B9yZBWWWIc8F1VRTYjqD/uT+zhgC0KsvWO/s2ZY4NfySqpIZsPB4V/VgCdoC8hoBQRi01iUjP 6lu3XnsKt2PzkTHopUqu5ou97ExdGTqbdyHNWJvU8rc5idarPgifBFkzQxvympWUw9vus8msv JTtH72y46Uhz5x4BS+lwVlHkDxWrpwaTXOijpMQBF3Jcs1QAyjwHyF6dIo2xJKUfIxyo= Received-SPF: none client-ip=212.227.126.135; envelope-from=laurent@vivier.eu; helo=mout.kundenserver.de X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_HELO_NONE=0.001, SPF_NONE=0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: qemu-trivial@nongnu.org, Damien Hedde , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Laurent Vivier Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Philippe Mathieu-Daudé Artist is another device, this one is the Lasi PS/2. Rename the functions accordingly. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Damien Hedde Message-Id: <20210920064048.2729397-2-f4bug@amsat.org> Signed-off-by: Laurent Vivier --- hw/input/lasips2.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/hw/input/lasips2.c b/hw/input/lasips2.c index e7faf24058b4..68d741d34215 100644 --- a/hw/input/lasips2.c +++ b/hw/input/lasips2.c @@ -96,7 +96,7 @@ typedef enum { LASIPS2_STATUS_CLKSHD = 0x80, } lasips2_status_reg_t; -static const char *artist_read_reg_name(uint64_t addr) +static const char *lasips2_read_reg_name(uint64_t addr) { switch (addr & 0xc) { case REG_PS2_ID: @@ -116,7 +116,7 @@ static const char *artist_read_reg_name(uint64_t addr) } } -static const char *artist_write_reg_name(uint64_t addr) +static const char *lasips2_write_reg_name(uint64_t addr) { switch (addr & 0x0c) { case REG_PS2_RESET: @@ -145,7 +145,7 @@ static void lasips2_reg_write(void *opaque, hwaddr addr, uint64_t val, LASIPS2Port *port = opaque; trace_lasips2_reg_write(size, port->id, addr, - artist_write_reg_name(addr), val); + lasips2_write_reg_name(addr), val); switch (addr & 0xc) { case REG_PS2_CONTROL: @@ -239,7 +239,7 @@ static uint64_t lasips2_reg_read(void *opaque, hwaddr addr, unsigned size) break; } trace_lasips2_reg_read(size, port->id, addr, - artist_read_reg_name(addr), ret); + lasips2_read_reg_name(addr), ret); return ret; } From patchwork Mon Nov 1 08:27:46 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Laurent Vivier X-Patchwork-Id: 1549023 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4HjR5c4PG4z9sXM for ; Mon, 1 Nov 2021 19:29:08 +1100 (AEDT) Received: from localhost ([::1]:38120 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mhSgk-00073e-GS for incoming@patchwork.ozlabs.org; Mon, 01 Nov 2021 04:29:06 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:36626) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mhSfg-000600-4f; Mon, 01 Nov 2021 04:28:00 -0400 Received: from mout.kundenserver.de ([212.227.126.131]:43127) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mhSfe-00086V-4B; Mon, 01 Nov 2021 04:27:59 -0400 Received: from quad ([82.142.14.190]) by mrelayeu.kundenserver.de (mreue012 [212.227.15.167]) with ESMTPSA (Nemesis) id 1MVJZv-1mFAad44Qh-00SMER; Mon, 01 Nov 2021 09:27:53 +0100 From: Laurent Vivier To: qemu-devel@nongnu.org Subject: [PULL 5/6] hw/input/lasips2: Move LASIPS2State declaration to 'hw/input/lasips2.h' Date: Mon, 1 Nov 2021 09:27:46 +0100 Message-Id: <20211101082747.2524909-6-laurent@vivier.eu> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20211101082747.2524909-1-laurent@vivier.eu> References: <20211101082747.2524909-1-laurent@vivier.eu> MIME-Version: 1.0 X-Provags-ID: V03:K1:RpkfCmiRDLupRVEyYLVHr4RnyDj8zP76pJckPtOT2vzxwq2jrCV w4PO3ofsWHLJXVaXFPSH28mA9rhzGhWY3IUybl6Z9v4552kGroGewROHTBP+KAoOKHm6OBk cY4JRQM/0MkFrqIrVB605GBnCtGiLuqye0rkNao4z5HsELKTBB4Y3jWTJW12amVtb1BqubU 1lJ3+OSdnsFWNwTxqkKjw== X-UI-Out-Filterresults: notjunk:1;V03:K0:zpQAy5oH68k=:LuyMKKjYxjBz2vn6YhepFb GxX7wDAlhmPsGz0anMF09aCqNqrpmLv4q7mBx6L+RVcrqBd4UvDZpK1hqLIPHQs08OBZD+5mK Jm/IOFEI+adCK8rZIFD7x4PRKqD1M2+VVol4lcsByQ5I7z4bUnYLc5Kkb0ZcTloeNhQsLgMW3 vDG9HqGleVK4VLSoO/rHiiMZzN+mbLcBpg5ktLQJagQNHxZtl2aYdYWQQq7/z6KJpOOdcIDs7 9Kaq+0U2dVTHk4ogCNBsMgQzOeJeLSBh/UdF4Bto3caSZ7Qi4uRPLeaXWEqK0EkbAAsHj1FHz kBy4uUEDYQcJ/kqhq+dL5ifmrNy1ETe146+/DbBudeQ45cAcZLchcIRWrg+DCzpM4DUA4pUfQ OtdDoEmJZufnkuVVofj4lE74w6kP0HAH+X2KaMpr+q6KL3o1m6cKcybLCUDAZxzrTm58GXI5N nuG2gBELR9JIs0IdSRCoAMVFc9CfEK33svqFbKHiEeMWYtPRj4kkOVjwF8sNrQrgRhIELBlsB bsw0Aa1Wx0miJhvlvAz+yRnoqPie9xyPcnFX9PHyZ51Pa/pMcNgDkRnP5rjOW3ATYpWitmIzO KXO9IDe0j9lA3HQJPHjIkspkXv9/pw+kcgXVH2nC6WoCccqIKpp4zq9KGTlwhSzDv05S4nPRP +Tx/9/ZVwgDy8wLQSfK4as208KpEILtwW1kLxDr3rRVKMFtLsbGfXDM7/PRDjQwXXHh4= Received-SPF: none client-ip=212.227.126.131; envelope-from=laurent@vivier.eu; helo=mout.kundenserver.de X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_NONE=0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: qemu-trivial@nongnu.org, Damien Hedde , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Laurent Vivier Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Philippe Mathieu-Daudé We want to use the OBJECT_DECLARE_SIMPLE_TYPE() macro to QOM'ify this device in the next commit. To make its review simpler, as a first step move the LASIPS2State and LASIPS2Port declarations to 'hw/input/lasips2.h' Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Damien Hedde Message-Id: <20210920064048.2729397-3-f4bug@amsat.org> Signed-off-by: Laurent Vivier --- hw/input/lasips2.c | 18 ------------------ include/hw/input/lasips2.h | 18 ++++++++++++++++++ 2 files changed, 18 insertions(+), 18 deletions(-) diff --git a/hw/input/lasips2.c b/hw/input/lasips2.c index 68d741d34215..0f8362f17bc1 100644 --- a/hw/input/lasips2.c +++ b/hw/input/lasips2.c @@ -33,24 +33,6 @@ #include "hw/irq.h" -struct LASIPS2State; -typedef struct LASIPS2Port { - struct LASIPS2State *parent; - MemoryRegion reg; - void *dev; - uint8_t id; - uint8_t control; - uint8_t buf; - bool loopback_rbne; - bool irq; -} LASIPS2Port; - -typedef struct LASIPS2State { - LASIPS2Port kbd; - LASIPS2Port mouse; - qemu_irq irq; -} LASIPS2State; - static const VMStateDescription vmstate_lasips2 = { .name = "lasips2", .version_id = 0, diff --git a/include/hw/input/lasips2.h b/include/hw/input/lasips2.h index 0cd7b59064a9..c88f1700162a 100644 --- a/include/hw/input/lasips2.h +++ b/include/hw/input/lasips2.h @@ -11,6 +11,24 @@ #define TYPE_LASIPS2 "lasips2" +struct LASIPS2State; +typedef struct LASIPS2Port { + struct LASIPS2State *parent; + MemoryRegion reg; + void *dev; + uint8_t id; + uint8_t control; + uint8_t buf; + bool loopback_rbne; + bool irq; +} LASIPS2Port; + +typedef struct LASIPS2State { + LASIPS2Port kbd; + LASIPS2Port mouse; + qemu_irq irq; +} LASIPS2State; + void lasips2_init(MemoryRegion *address_space, hwaddr base, qemu_irq irq); #endif /* HW_INPUT_LASIPS2_H */ From patchwork Mon Nov 1 08:27:47 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Laurent Vivier X-Patchwork-Id: 1549026 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4HjR8j1T2Vz9sXM for ; Mon, 1 Nov 2021 19:31:49 +1100 (AEDT) Received: from localhost ([::1]:44498 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mhSjL-00031D-2x for incoming@patchwork.ozlabs.org; Mon, 01 Nov 2021 04:31:47 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:36666) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mhSfp-0006TX-76; Mon, 01 Nov 2021 04:28:09 -0400 Received: from mout.kundenserver.de ([212.227.126.134]:36767) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mhSfl-00087e-GR; Mon, 01 Nov 2021 04:28:08 -0400 Received: from quad ([82.142.14.190]) by mrelayeu.kundenserver.de (mreue012 [212.227.15.167]) with ESMTPSA (Nemesis) id 1N6bHC-1mhvtv2LBG-0182lq; Mon, 01 Nov 2021 09:27:53 +0100 From: Laurent Vivier To: qemu-devel@nongnu.org Subject: [PULL 6/6] hw/input/lasips2: QOM'ify the Lasi PS/2 Date: Mon, 1 Nov 2021 09:27:47 +0100 Message-Id: <20211101082747.2524909-7-laurent@vivier.eu> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20211101082747.2524909-1-laurent@vivier.eu> References: <20211101082747.2524909-1-laurent@vivier.eu> MIME-Version: 1.0 X-Provags-ID: V03:K1:vTRIRl9dsWwAtgu7Ui2dNw36goyA8bCbs2YTQGdBdTg2LuUphR7 aBiA6GbwT8735AEbnyHvLfszB90joxxZMUGsWNZivxvLirBjQNe6meLTaamo7LZcf3tJ0BP xTmsp8S1qxKCIXzHyArO5w3AOQKqFncJfS4kHsjLt3wuOnXX0hMiAtBtv7uX3yh01cKCZRM Nm7NMWtMy422r5iD90eyw== X-UI-Out-Filterresults: notjunk:1;V03:K0:oWYh5lWFiSM=:xdW6SZ1WAFZbp9rlrPYEnc LG7ykr8Suqx7lJ7ok5QIc5VjgvwAmL5LhBK9YoODFKjwA77TopvX7S3Z+EvwRtPwHDH59s67P cj2L7DLX8qk3ggiXXOGkMtHgsmLkQuY/Wbf2XovAUaCHhWo9wcMFeBtTdP89k1guqSl+BZaPH wGbtL9RBAl993lniH9HpNOxY9U6u+KsKhugGhDMTIdoqB1THitz1qKPgJDKnjdKgdiuo8N51f PGfYkdY2mtQ5emXfe9rUEM/campEl1L89Vrc9Uyzsl9SUwv/G33kgXqtHbxR7vt/b5qo+30pe LWB7lkgN05U6h1VYl6a1/c8Szc4Czt+skzicQVkrzJt7MZHCTAAaDaZyMv2lhBBtIWECyMvry cdYus7wkdDlE1avKOBVJhzR3r5NiuHa6LB0ebl/5ZKsG/6IY8TrB0vszJ2dL2BvAz3nxBM2lj QiFyMt/sLVGVIwgOLQJtKA1CZTYkK0IFX6K7ExckZ/dXM6KrWHS+JrtQ1cX+kucw53Logv2H3 ws9UakWuZrmUuhlDBlToh4GsopFA6w9b54ynmCtCz/0Xj2p9pEa+Ox2k/e5Q0mh8kyOq05VnP ijlW5W8lbtq70gsWshSjhHgTmApk+cFUgU0jqFC/zRqoj56agm/LrAWwkDcHAaAyaL59UUerJ bMI9JyXMvDCqulNjlB9H9n+/fAKGqty5AQuJXCkHUzmr0CGHxMfbZPR9iCnL068SM0hM= Received-SPF: none client-ip=212.227.126.134; envelope-from=laurent@vivier.eu; helo=mout.kundenserver.de X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_HELO_NONE=0.001, SPF_NONE=0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: qemu-trivial@nongnu.org, Damien Hedde , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Laurent Vivier Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Philippe Mathieu-Daudé Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Damien Hedde Message-Id: <20210920064048.2729397-4-f4bug@amsat.org> Signed-off-by: Laurent Vivier --- hw/hppa/lasi.c | 10 +++++++++- hw/input/lasips2.c | 38 ++++++++++++++++++++++++++++---------- include/hw/input/lasips2.h | 17 +++++++++++++---- 3 files changed, 50 insertions(+), 15 deletions(-) diff --git a/hw/hppa/lasi.c b/hw/hppa/lasi.c index 88c3791eb683..91414748b70d 100644 --- a/hw/hppa/lasi.c +++ b/hw/hppa/lasi.c @@ -297,6 +297,7 @@ static int lasi_get_irq(unsigned long hpa) DeviceState *lasi_init(MemoryRegion *address_space) { DeviceState *dev; + SysBusDevice *sbd; LasiState *s; dev = qdev_new(TYPE_LASI_CHIP); @@ -340,7 +341,14 @@ DeviceState *lasi_init(MemoryRegion *address_space) /* PS/2 Keyboard/Mouse */ qemu_irq ps2kbd_irq = qemu_allocate_irq(lasi_set_irq, s, lasi_get_irq(LASI_PS2KBD_HPA)); - lasips2_init(address_space, LASI_PS2KBD_HPA, ps2kbd_irq); + + sbd = SYS_BUS_DEVICE(qdev_new(TYPE_LASIPS2)); + sysbus_realize_and_unref(sbd, &error_fatal); + memory_region_add_subregion(address_space, LASI_PS2KBD_HPA, + sysbus_mmio_get_region(sbd, 0)); + memory_region_add_subregion(address_space, LASI_PS2MOU_HPA, + sysbus_mmio_get_region(sbd, 1)); + sysbus_connect_irq(sbd, 0, ps2kbd_irq); return dev; } diff --git a/hw/input/lasips2.c b/hw/input/lasips2.c index 0f8362f17bc1..46cd32316dac 100644 --- a/hw/input/lasips2.c +++ b/hw/input/lasips2.c @@ -243,28 +243,46 @@ static void ps2dev_update_irq(void *opaque, int level) lasips2_update_irq(port->parent); } -void lasips2_init(MemoryRegion *address_space, - hwaddr base, qemu_irq irq) +static void lasips2_init(Object *obj) { - LASIPS2State *s; + LASIPS2State *s = LASIPS2(obj); + SysBusDevice *sbd = SYS_BUS_DEVICE(obj); - s = g_malloc0(sizeof(LASIPS2State)); - - s->irq = irq; + sysbus_init_irq(sbd, &s->irq); s->mouse.id = 1; s->kbd.parent = s; s->mouse.parent = s; - vmstate_register(NULL, base, &vmstate_lasips2, s); - s->kbd.dev = ps2_kbd_init(ps2dev_update_irq, &s->kbd); s->mouse.dev = ps2_mouse_init(ps2dev_update_irq, &s->mouse); memory_region_init_io(&s->kbd.reg, NULL, &lasips2_reg_ops, &s->kbd, "lasips2-kbd", 0x100); - memory_region_add_subregion(address_space, base, &s->kbd.reg); + sysbus_init_mmio(sbd, &s->kbd.reg); memory_region_init_io(&s->mouse.reg, NULL, &lasips2_reg_ops, &s->mouse, "lasips2-mouse", 0x100); - memory_region_add_subregion(address_space, base + 0x100, &s->mouse.reg); + sysbus_init_mmio(sbd, &s->mouse.reg); +} + +static void lasips2_class_init(ObjectClass *oc, void *data) +{ + DeviceClass *dc = DEVICE_CLASS(oc); + + dc->vmsd = &vmstate_lasips2; } + +static const TypeInfo lasips2_info = { + .name = TYPE_LASIPS2, + .parent = TYPE_SYS_BUS_DEVICE, + .instance_size = sizeof(LASIPS2State), + .instance_init = lasips2_init, + .class_init = lasips2_class_init, +}; + +static void lasips2_register_types(void) +{ + type_register_static(&lasips2_info); +} + +type_init(lasips2_register_types) diff --git a/include/hw/input/lasips2.h b/include/hw/input/lasips2.h index c88f1700162a..834b6d867d9d 100644 --- a/include/hw/input/lasips2.h +++ b/include/hw/input/lasips2.h @@ -7,11 +7,11 @@ #ifndef HW_INPUT_LASIPS2_H #define HW_INPUT_LASIPS2_H -#include "exec/hwaddr.h" +#include "hw/sysbus.h" #define TYPE_LASIPS2 "lasips2" +OBJECT_DECLARE_SIMPLE_TYPE(LASIPS2State, LASIPS2) -struct LASIPS2State; typedef struct LASIPS2Port { struct LASIPS2State *parent; MemoryRegion reg; @@ -23,12 +23,21 @@ typedef struct LASIPS2Port { bool irq; } LASIPS2Port; +/* + * QEMU interface: + * + sysbus MMIO region 0 is the keyboard port interface + * + sysbus MMIO region 1 is the mouse port interface + * + sysbus IRQ 0 is the interrupt line shared between + * keyboard and mouse ports + */ typedef struct LASIPS2State { + /*< private >*/ + SysBusDevice parent_obj; + + /*< public >*/ LASIPS2Port kbd; LASIPS2Port mouse; qemu_irq irq; } LASIPS2State; -void lasips2_init(MemoryRegion *address_space, hwaddr base, qemu_irq irq); - #endif /* HW_INPUT_LASIPS2_H */