From patchwork Thu Feb 14 22:59:48 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Max Filippov X-Patchwork-Id: 10813975 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id D131C1390 for ; Thu, 14 Feb 2019 23:18:25 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id BFEE62F3CA for ; Thu, 14 Feb 2019 23:18:25 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B3FB42F400; Thu, 14 Feb 2019 23:18:25 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.2 required=2.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, DKIM_INVALID,DKIM_SIGNED,FREEMAIL_FROM,FROM_LOCAL_NOVOWEL,MAILING_LIST_MULTI autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 536372F3CA for ; Thu, 14 Feb 2019 23:18:25 +0000 (UTC) Received: from localhost ([127.0.0.1]:56537 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1guQGu-0000Ke-Jr for patchwork-qemu-devel@patchwork.kernel.org; Thu, 14 Feb 2019 18:18:24 -0500 Received: from eggs.gnu.org ([209.51.188.92]:49516) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1guQ8t-00035F-Vs for qemu-devel@nongnu.org; Thu, 14 Feb 2019 18:10:08 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1guQ05-00055Q-Np for qemu-devel@nongnu.org; Thu, 14 Feb 2019 18:01:03 -0500 Received: from mail-lf1-x144.google.com ([2a00:1450:4864:20::144]:37595) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1guQ05-0004tI-CZ for qemu-devel@nongnu.org; Thu, 14 Feb 2019 18:01:01 -0500 Received: by mail-lf1-x144.google.com with SMTP id n23so5807821lfl.4 for ; Thu, 14 Feb 2019 15:00:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=k7Wf1KKSw2qa2dG6DqF/I5CBUT/MvJh/Ty2cr8bUOys=; b=uNhCjbJr0k4hlpSxqyc9k0ImBYplwJuBWyIp8qWh1L5jpMiYDUtAQfkiOEISj0zCLs zhgajc2vNm9TocvYZZ/TszftEcC/7MWI9sYgpDS4Rr01V/2W+ARiUQaqTvjcq2XMixtw vNpsE6nF+LN1j72YCyvxnxwdmSgR7EwYIi2ogKKenxBsGrmR6JoyLrGGVFp3rD7qyF+N QQnfWnwQ8Qqx15ChSkQmSOL6nVc7ZGgw04o8eaROAOvOSl1E8oLXS6piPcv0S/X3jcCj yABPsm0/6CBYzbx9kRmC8NUteTlC3dSoz0I8RhL8MKLdhMtk09JerL+Ox217juPWjMnu zMog== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=k7Wf1KKSw2qa2dG6DqF/I5CBUT/MvJh/Ty2cr8bUOys=; b=kC5fTFJ8KS4KCZA3VqNyUfYGBbSMkAxPlZHhH3pUThlBEHW930hsvJ+tznqEsCG8q9 9bguiTTAjmyWzb6UEBGSi9SCzXSUthBB6eQlyFlmv/AlcezsmC/+PIIHfavrQudkOd12 FLhq343wIeoUIO+tGViBUYVpdgoHL5UuqfKlZOkMYgc1VpmgeFUUtb52lAFaT5289Fq3 BJa3TNtx39aY2h6sWS4ZREdx0s4RLdelhkwyMkYKN8OiIN+H4+Xu3pJvHEhmDjfxiPFj XZ+RHfEgmvx/11lGwmqngrCTgIPcCrJXdMLRzL0W+QiZiGzY4OuXxZAKVRYnzwZv0oIa KQFg== X-Gm-Message-State: AHQUAuZvr5vIQ1mD6BiCGGuGv7eOIEVMvgF7S1OHqictGbxkZIlFwdr6 wsLGbrixZISIwSfYLBRnBamQPNmA X-Google-Smtp-Source: AHgI3IYmdJcbyE42SasKozKYdj1Hvz5x8ow940VQj+yz/PbWr0dzFrfYgbnPUTdEI/kO8ZeTdgi+Uw== X-Received: by 2002:ac2:5288:: with SMTP id q8mr3892578lfm.157.1550185241836; Thu, 14 Feb 2019 15:00:41 -0800 (PST) Received: from octofox.cadence.com (jcmvbkbc-1-pt.tunnel.tserv24.sto1.ipv6.he.net. [2001:470:27:1fa::2]) by smtp.gmail.com with ESMTPSA id h123sm172384lfh.26.2019.02.14.15.00.39 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 14 Feb 2019 15:00:41 -0800 (PST) From: Max Filippov To: qemu-devel@nongnu.org Date: Thu, 14 Feb 2019 14:59:48 -0800 Message-Id: <20190214230000.24894-2-jcmvbkbc@gmail.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20190214230000.24894-1-jcmvbkbc@gmail.com> References: <20190214230000.24894-1-jcmvbkbc@gmail.com> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::144 Subject: [Qemu-devel] [PATCH 01/13] target/xtensa: move xtensa_finalize_config to xtensa_core_class_init X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Max Filippov , Richard Henderson Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP Don't run xtensa_finalize_config at the time of core registration, instead run it at the CPU class initialization. Signed-off-by: Max Filippov --- target/xtensa/cpu.h | 1 - target/xtensa/helper.c | 36 +++++++++++++++++++----------------- target/xtensa/overlay_tool.h | 1 - 3 files changed, 19 insertions(+), 19 deletions(-) diff --git a/target/xtensa/cpu.h b/target/xtensa/cpu.h index f1861244720e..47d80a59e2f5 100644 --- a/target/xtensa/cpu.h +++ b/target/xtensa/cpu.h @@ -566,7 +566,6 @@ void xtensa_cpu_do_unaligned_access(CPUState *cpu, vaddr addr, void xtensa_translate_init(void); void xtensa_breakpoint_handler(CPUState *cs); -void xtensa_finalize_config(XtensaConfig *config); void xtensa_register_core(XtensaConfigList *node); void xtensa_sim_open_console(Chardev *chr); void check_interrupts(CPUXtensaState *s); diff --git a/target/xtensa/helper.c b/target/xtensa/helper.c index 6cf1dbb8a69b..321ca4295521 100644 --- a/target/xtensa/helper.c +++ b/target/xtensa/helper.c @@ -34,22 +34,6 @@ static struct XtensaConfigList *xtensa_cores; -static void xtensa_core_class_init(ObjectClass *oc, void *data) -{ - CPUClass *cc = CPU_CLASS(oc); - XtensaCPUClass *xcc = XTENSA_CPU_CLASS(oc); - const XtensaConfig *config = data; - - xcc->config = config; - - /* Use num_core_regs to see only non-privileged registers in an unmodified - * gdb. Use num_regs to see all registers. gdb modification is required - * for that: reset bit 0 in the 'flags' field of the registers definitions - * in the gdb/xtensa-config.c inside gdb source tree or inside gdb overlay. - */ - cc->gdb_num_core_regs = config->gdb_regmap.num_regs; -} - static void init_libisa(XtensaConfig *config) { unsigned i, j; @@ -91,7 +75,7 @@ static void init_libisa(XtensaConfig *config) config->a_regfile = xtensa_regfile_lookup(config->isa, "AR"); } -void xtensa_finalize_config(XtensaConfig *config) +static void xtensa_finalize_config(XtensaConfig *config) { if (config->isa_internal) { init_libisa(config); @@ -112,6 +96,24 @@ void xtensa_finalize_config(XtensaConfig *config) } } +static void xtensa_core_class_init(ObjectClass *oc, void *data) +{ + CPUClass *cc = CPU_CLASS(oc); + XtensaCPUClass *xcc = XTENSA_CPU_CLASS(oc); + XtensaConfig *config = data; + + xtensa_finalize_config(config); + xcc->config = config; + + /* + * Use num_core_regs to see only non-privileged registers in an unmodified + * gdb. Use num_regs to see all registers. gdb modification is required + * for that: reset bit 0 in the 'flags' field of the registers definitions + * in the gdb/xtensa-config.c inside gdb source tree or inside gdb overlay. + */ + cc->gdb_num_core_regs = config->gdb_regmap.num_regs; +} + void xtensa_register_core(XtensaConfigList *node) { TypeInfo type = { diff --git a/target/xtensa/overlay_tool.h b/target/xtensa/overlay_tool.h index 12609a0d0c1e..ea07576bc921 100644 --- a/target/xtensa/overlay_tool.h +++ b/target/xtensa/overlay_tool.h @@ -377,7 +377,6 @@ static XtensaConfigList node = { \ .config = &core, \ }; \ - xtensa_finalize_config(&core); \ xtensa_register_core(&node); \ } #else