From patchwork Mon Sep 5 09:55:11 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Milica Lazarevic X-Patchwork-Id: 12965916 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org 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 smtp.lore.kernel.org (Postfix) with ESMTPS id 3B9E7ECAAD5 for ; Mon, 5 Sep 2022 10:13:21 +0000 (UTC) Received: from localhost ([::1]:36202 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oV96W-0004LW-6K for qemu-devel@archiver.kernel.org; Mon, 05 Sep 2022 06:13:20 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:38970) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oV8tW-0004dl-Ug for qemu-devel@nongnu.org; Mon, 05 Sep 2022 05:59:54 -0400 Received: from mail-am7eur03on2106.outbound.protection.outlook.com ([40.107.105.106]:56865 helo=EUR03-AM7-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oV8tV-0001wM-8L for qemu-devel@nongnu.org; Mon, 05 Sep 2022 05:59:54 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=GvG+q06MQzxE7kmr9H4+uNqDS896xCXf4d5zaxh/iGqZRJ0374AZy3gN23XElbRWXSp1XvsPM7q+LR0eaVVXtG3kWL9EFrJ9UoxZIs3e6PCSZHMXxpyxOJorfLaP1ukagPdaXJGJG7n+SAFL+ggGXHXlS/iZf9A+1taHe8NpvALIhHulrkwKf9s5ns0j5vTxZppbA11tFlcsE1bTvkPe27KCfkiQ6aEi4iNxSyCHqG1/VwWyITSdg1ZJsBpto5ivoVb4Q06N4osrXMAOc24OLG+coMRWQpcUR8FNsCZxoBgQ9/446KHXfGGvzvKnNI+m2MjLsSSxnKq5LkS+vrLtKw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=2j1C6yjWoJjrbK/Am6+q3DgkQDCakhNvKyR9Q7eoWdA=; b=hnYfcff765l6NDzMB7xUQeBGILR9Opca6DXeStlWIPPXOinVNlZYSnb7foAXKSw5aVl+fbSRXPJ8+yE5HGeooymNHb9j7e5FCin810Erw8o0h4tKVkOLDwF5XgflWjmyVXy5UzJlmP8w+34hzsZ6zV3EvTjV4zCja+yqPZMG8O3nKjOPJTilguY4d6lYVnNHFnZhsm6+7WVDWTSA+fKdaDJ/sS6thR7urusXYWcj+5G87xJ4Pq45cDQM/ru0esCLadmh6mepkTWwDz4rSFMcQDZOpvC+edU+vtsKNbdlECGE2q+/tBkYT8lm1+LSOjMkROVvECJDISLRix3w+Enr1w== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=syrmia.com; dmarc=pass action=none header.from=syrmia.com; dkim=pass header.d=syrmia.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=syrmia.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=2j1C6yjWoJjrbK/Am6+q3DgkQDCakhNvKyR9Q7eoWdA=; b=mEtliPjFf4QuJkZX/bCpyP1CIxXQLkTybmKwBNOpmzzKWPqQucUKTvcqV0f39OGd2Ax30OHUQxKg1LscLHwRLCV7PUae7yRjX5NFyHBcsWPHNFCwu6ooHN87bHjl/JavDQnJn9/qM+Cxbjill+pZd07mYDxNvdDq1PtWQaCBBEE= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=syrmia.com; Received: from VE1PR03MB6045.eurprd03.prod.outlook.com (2603:10a6:803:112::20) by AS8PR03MB8740.eurprd03.prod.outlook.com (2603:10a6:20b:53b::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5588.17; Mon, 5 Sep 2022 09:59:50 +0000 Received: from VE1PR03MB6045.eurprd03.prod.outlook.com ([fe80::8975:df76:4535:fda9]) by VE1PR03MB6045.eurprd03.prod.outlook.com ([fe80::8975:df76:4535:fda9%7]) with mapi id 15.20.5588.018; Mon, 5 Sep 2022 09:59:50 +0000 From: Milica Lazarevic To: thuth@redhat.com Cc: qemu-devel@nongnu.org, cfontana@suse.de, berrange@redhat.com, pbonzini@redhat.com, vince.delvecchio@mediatek.com, richard.henderson@linaro.org, peter.maydell@linaro.org, djordje.todorovic@syrmia.com, mips32r2@gmail.com, dragan.mladjenovic@syrmia.com, Milica Lazarevic , =?utf-8?q?Philippe_Mathieu-?= =?utf-8?q?Daud=C3=A9?= Subject: [PATCH v2 09/20] disas/nanomips: Move typedefs etc to nanomips.cpp Date: Mon, 5 Sep 2022 11:55:11 +0200 Message-Id: <20220905095522.66941-10-milica.lazarevic@syrmia.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220905095522.66941-1-milica.lazarevic@syrmia.com> References: <20220905095522.66941-1-milica.lazarevic@syrmia.com> X-ClientProxiedBy: VI1PR0602CA0023.eurprd06.prod.outlook.com (2603:10a6:800:bc::33) To VE1PR03MB6045.eurprd03.prod.outlook.com (2603:10a6:803:112::20) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 74a15593-2702-4241-b661-08da8f255f67 X-MS-TrafficTypeDiagnostic: AS8PR03MB8740:EE_ X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 2+WP0ir5/PTp1T+098RRrGmNdWJ1xyzZdVJybWyc530cCkbL5inh9gYFPRhRT5V6xDc5zdFBFvJxHZ/JXMSxh54ufMmAPHkPVkl+hqghnFR+S0IGkgw+ZwpjRpU9TZnA03X8irSWnnuEuZYK8yh1+tY+YybP1NPRL4w5SdUWHuqYNkmCe3MDMsXi+SmfqjJBbnm0nKruU0NJ2RJ/HO5uQm1tQ1HowcfnEP9vT2wOZWCpR3mgDvHJ/0a2r8lgUmVNAosOjP7q0LDpu+ZW1BHZBGsbJ1eTo+VijoYcBK16lk1MZ+qLONrDbryJdS6wjPUnLaeHFLadaNe1Cd4KaAgladCeUJ2mTAGtWDIzvRLlbuMJhzdidURc5Vv5rbl8e/zzQkHjw5XzmO+IY20hlyw5cY0biPo5CuuMiSFjbMYZaroc4bdAvKd6xWm8V20sRqn6aXmPF96IGfYF76JhRuv8nQmfVHfZUVbSdhjB38u9fspkdEFhlR8azrmE/j5UkrJwtHtIxhwvHO1sZmsBAAE7+pc78hgvafpXyCdDYuAQ9S9bib1QyI7FWSNFWwCWp+Xf5XEpRZR0Ll9wemWctEQo4kShrGYfiVnTljiDNzRpzCHSNAJ7SPRxiKpU3vUHPoU9pIwxNX2YWrbOj9tHEoA/Qb05N4ZBejhlOywspoici6/5Xly74K1Ei+z7NX+HQfTTD4aGcaKgNsQDzNsC4g1STYrICFHmYXky67r2UbY96A67Qkq/7+caWzOul5AiZZNIbD22ybIDMbmEuEsGa0jw/w== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:VE1PR03MB6045.eurprd03.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230016)(346002)(136003)(376002)(366004)(396003)(39840400004)(7416002)(8936002)(44832011)(5660300002)(2906002)(38100700002)(478600001)(6486002)(41300700001)(38350700002)(52116002)(6506007)(6666004)(316002)(83380400001)(6916009)(54906003)(66476007)(4326008)(66556008)(8676002)(66946007)(26005)(6512007)(186003)(2616005)(1076003)(86362001)(36756003); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?J9FPoa/pzCS9gopxDMkZzkHI37N/?= =?utf-8?q?MeE+BqmSfRBk0PwhtRLlDvipNsrAQ5Hem8ryksrsmMPfxfxC1R9dH+//JEEMFjXmG?= =?utf-8?q?uUNS3OBixXWdjDq2Xy5LtZSVap2efR6vqaVay7LQyzmkKOWsTAUsCr+enEOn4Lz58?= =?utf-8?q?blzygmYViSpJa2gUMSqnijRTvuc/CfEf/0dzJR7Otgtf/g2NCmotrczJBbpKhFgBd?= =?utf-8?q?CXJ2nT/NKvWuy0qSkY9m+hL4zVw3iLPeZuqAe4nSFpH94UZj4lUrmrka9VcRtOL56?= =?utf-8?q?AP7nCldCdP1VZObwSiYeZZCA/6A5vyWy6fwu5uySq9ek2wuTPbwa6Fm1wm4k08duG?= =?utf-8?q?i8Z+yiwFZ/Gw6aBhyEa3LI4MELjNz1HwYsFIa50T9dsRxsV9/FVzQcp+G91vcyeun?= =?utf-8?q?/UtCkfHJD2R1SSXh5NDeM1Mby5m3y48UI+RfGCbPWtU199FlfuVjfHlLL4zq1UUEQ?= =?utf-8?q?IfonCmBs6XUzCHsX4nWuMst5r06L6RtVqUN5L70QBabc3fS/rPacM90rns7F08V+/?= =?utf-8?q?Dv6+AikJl7ibsVJ9igxmxKmLJIRtnmhTSHHIrrqOI8ZAkP92tBVLblWZpwMfhlc2Z?= =?utf-8?q?zpWNiuwMQKkrrif0gHiQ07bmAHrLzskBWEf7YsL6M3gEZQzy74k5A++Q8tQWAnxXu?= =?utf-8?q?ZaskTf9x9V5Lc9C64OvE06dJmSufGKptPPnSL4L4PKy/el0tci7H5qYzaph6l80YF?= =?utf-8?q?zSduZgy02lA/m17e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-2702-4241-b661-08da8f255f67 X-MS-Exchange-CrossTenant-AuthSource: VE1PR03MB6045.eurprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Sep 2022 09:59:50.4947 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 19214a73-c1ab-4e19-8f59-14bdcb09a66e X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: HkJ3+yuHdfUNLhqNOzFrIUvl5BvckAE3+r+HcWDrS/Ttx5WH50Kcisf9a14qTZD/wD+xRqP0XYjSdCIPGEtFFT23Wt0dR6vsDtaUaRWIK9U= X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR03MB8740 Received-SPF: pass client-ip=40.107.105.106; envelope-from=Milica.Lazarevic@Syrmia.com; helo=EUR03-AM7-obe.outbound.protection.outlook.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 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: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" The following is moved from the nanomips.h to nanomips.cpp file: - #include line - typedefs - enums - definition of the Pool struct. Header file nanomips.h will be deleted to be consistent with the rest of the disas/ code. Signed-off-by: Milica Lazarevic Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson --- disas/nanomips.cpp | 53 +++++++++++++++++++++++++++++++++++++++++++++- disas/nanomips.h | 53 ---------------------------------------------- 2 files changed, 52 insertions(+), 54 deletions(-) diff --git a/disas/nanomips.cpp b/disas/nanomips.cpp index 1326840611..c11c0aceaf 100644 --- a/disas/nanomips.cpp +++ b/disas/nanomips.cpp @@ -36,7 +36,58 @@ #include #include -#include "nanomips.h" +#include + +typedef int64_t int64; +typedef uint64_t uint64; +typedef uint32_t uint32; +typedef uint16_t uint16; +typedef uint64_t img_address; + +typedef bool (*conditional_function)(uint64 instruction); +typedef std::string (*disassembly_function)(uint64 instruction, + img_address m_pc); + +enum TABLE_ENTRY_TYPE { + instruction, + call_instruction, + branch_instruction, + return_instruction, + reserved_block, + pool, +}; + +enum TABLE_ATTRIBUTE_TYPE { + MIPS64_ = 0x00000001, + XNP_ = 0x00000002, + XMMS_ = 0x00000004, + EVA_ = 0x00000008, + DSP_ = 0x00000010, + MT_ = 0x00000020, + EJTAG_ = 0x00000040, + TLBINV_ = 0x00000080, + CP0_ = 0x00000100, + CP1_ = 0x00000200, + CP2_ = 0x00000400, + UDI_ = 0x00000800, + MCU_ = 0x00001000, + VZ_ = 0x00002000, + TLB_ = 0x00004000, + MVH_ = 0x00008000, + ALL_ATTRIBUTES = 0xffffffffull, +}; + +struct Pool { + TABLE_ENTRY_TYPE type; + struct Pool *next_table; + int next_table_size; + int instructions_size; + uint64 mask; + uint64 value; + disassembly_function disassembly; + conditional_function condition; + uint64 attributes; +}; #define IMGASSERTONCE(test) diff --git a/disas/nanomips.h b/disas/nanomips.h index 04f57c26ea..0fd7299900 100644 --- a/disas/nanomips.h +++ b/disas/nanomips.h @@ -23,57 +23,4 @@ #ifndef DISAS_NANOMIPS_H #define DISAS_NANOMIPS_H -#include - -typedef int64_t int64; -typedef uint64_t uint64; -typedef uint32_t uint32; -typedef uint16_t uint16; -typedef uint64_t img_address; - -typedef bool (*conditional_function)(uint64 instruction); -typedef std::string (*disassembly_function)(uint64 instruction, - img_address m_pc); - -enum TABLE_ENTRY_TYPE { - instruction, - call_instruction, - branch_instruction, - return_instruction, - reserved_block, - pool, -}; - -enum TABLE_ATTRIBUTE_TYPE { - MIPS64_ = 0x00000001, - XNP_ = 0x00000002, - XMMS_ = 0x00000004, - EVA_ = 0x00000008, - DSP_ = 0x00000010, - MT_ = 0x00000020, - EJTAG_ = 0x00000040, - TLBINV_ = 0x00000080, - CP0_ = 0x00000100, - CP1_ = 0x00000200, - CP2_ = 0x00000400, - UDI_ = 0x00000800, - MCU_ = 0x00001000, - VZ_ = 0x00002000, - TLB_ = 0x00004000, - MVH_ = 0x00008000, - ALL_ATTRIBUTES = 0xffffffffull, -}; - -struct Pool { - TABLE_ENTRY_TYPE type; - struct Pool *next_table; - int next_table_size; - int instructions_size; - uint64 mask; - uint64 value; - disassembly_function disassembly; - conditional_function condition; - uint64 attributes; -}; - #endif