From patchwork Mon Sep 12 12:26:21 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Milica Lazarevic X-Patchwork-Id: 12973621 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 07767ECAAD5 for ; Mon, 12 Sep 2022 12:35:42 +0000 (UTC) Received: from localhost ([::1]:42436 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oXif7-0000FN-1x for qemu-devel@archiver.kernel.org; Mon, 12 Sep 2022 08:35:41 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:40356) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oXiZ8-0004dO-Pr for qemu-devel@nongnu.org; Mon, 12 Sep 2022 08:29:30 -0400 Received: from mail-eopbgr70131.outbound.protection.outlook.com ([40.107.7.131]:5091 helo=EUR04-HE1-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 1oXiZ7-0005rg-3B for qemu-devel@nongnu.org; Mon, 12 Sep 2022 08:29:30 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=DeM8PK9hyU/OQ1LGjt/DzxaNavMT4uSrMObJQiis8WKlTTYozxjEO5hU7P/8+Esh5DNDIgWDPAlg3wWnN8yRhlaeKiMQsrlKbCiFLb/Q3BQXr/EoFHEUQvEWYupfwTJA2HuJwxOgDuplvDQ8Pws1YNy/ADHl7dfEnfQCMEAjLi3ZBpqCR4Y0NThzW7vrqkp8QpTbeGL9jjhEEZb9ndJp7MV/fnYZg49ukcPxzK1AN4+8B0EmBxk7GvCF98xwW8pNDFu6aV4I7rwTsd1dNJFUTCt1pkHxNqRpxptFtxx7Zo/PIgkgmf4EMuaa3Qe9p9sWMruXCQVC55+Cvr79LpLwLw== 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=WaF844un6Xw322CZ4MvVCkXLwjCShophUBJ/Hvg0r7I=; b=QeyLXEldpuEhv2+WAXdu+/PHE0i+CAOQpNNSHYYwyfUUYAmQ+Ft4/3I8IAVWuoaSQlTYflr2MIaV0F2Tn9gb6b1Ai8Gl72ylIYv8tycEfkvtJDtQOEjAB7NwFO8mdleIIDKpVNMUB4zLkrrsWnh1vwKrC6k6R4LaQJE8LaV0L4kOS4h4m+rEenW5Z+Gt7tbhYwyHv93VshNcZoez1MhTlvjhCzQqE0Aj9o4eoI+yHoXrrF/hUJY/BjZw0i6eLTkgp1qVpeY3zfhNo7Y22KeUoaPe9G6I+6zqnmib6qbPX1TKOQvbvvjcHoZmlEvmkrODRIuHHdQ6G+iTUtTK9f09GQ== 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=WaF844un6Xw322CZ4MvVCkXLwjCShophUBJ/Hvg0r7I=; b=e+jJMdut89hBGCsj04G2S8KHnQwE8DaP2PQNEDJZmkRisv7FCmfaYqQPR1SJXf9qVBYCDZH8T4rEvVZMFWSZhfJRme4xAJzcVsoCZdHbaBvEmLApzeV7542JzcdniBDqMfM+UoIGGvvyE8vPgV70uDtsgJ0lhk44eE/NhJtRtDM= 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 AS8PR03MB7603.eurprd03.prod.outlook.com (2603:10a6:20b:34e::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5612.22; Mon, 12 Sep 2022 12:29:24 +0000 Received: from VE1PR03MB6045.eurprd03.prod.outlook.com ([fe80::6dde:d3f:2ed9:e27c]) by VE1PR03MB6045.eurprd03.prod.outlook.com ([fe80::6dde:d3f:2ed9:e27c%6]) with mapi id 15.20.5612.022; Mon, 12 Sep 2022 12:29:24 +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 v3 10/24] disas/nanomips: Move typedefs etc to nanomips.cpp Date: Mon, 12 Sep 2022 14:26:21 +0200 Message-Id: <20220912122635.74032-11-milica.lazarevic@syrmia.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220912122635.74032-1-milica.lazarevic@syrmia.com> References: <20220912122635.74032-1-milica.lazarevic@syrmia.com> X-ClientProxiedBy: VI1PR08CA0145.eurprd08.prod.outlook.com (2603:10a6:800:d5::23) To VE1PR03MB6045.eurprd03.prod.outlook.com (2603:10a6:803:112::20) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: VE1PR03MB6045:EE_|AS8PR03MB7603:EE_ X-MS-Office365-Filtering-Correlation-Id: 917c2e5e-7bf1-44a1-f604-08da94ba6d37 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: OBXDQRF9ZCLTayHhXH58LYOzlCwoMEVcI1yet8D4istCGNtqp1hn7SxvsAz2P80d9q2BmJgNqVybN3n/TZ5ad+kGQCimfyGbSWkcfKxiYD5H2jw/y+03pH2CvU6C40QKSzKOR2YpcVFT9ohfCDTVFqfxR4E7qGlI2jZQjtBlqAQXGhpIsD0PqYlt1mDbDWdraxkW/ZOa7jE6BKd6iPTvmqBxYKT1T8MrwLhPrViwHu1YGvNTsMKu5ry5Z25uLIrzsw1TuW/zsoIO1sxY1MThHU1gxAKXd5tHIkQeVIN9w55vfVVDBnL+uHqeTi4fSviQ8cMfFKIAr0kIXQy3IBUviXaX8AC+2iYzVbJmGsr3c0yoZVgRO37YcARq6NpK/i2n8v0nzC+lpQjG5oLaZhxFHHKXAXpkB1n3dnUs61I3KM+nvlfqqg9B9agnlyEuJOreEkHHl7gm3AItaVyTwdQLo+KJw9uyXig11eM6u50mkKF/CMYKUc6rkVUrbmFQHihVq5yemzFgJrI7q263iQMys2oVdW5dGmYRAYSvnN/PhqAb++2O6AClOb/dUjXD/vdifoxmQvVHj0R3zhBIBJ4FNQzCGbvbCfl0CvnpdJfQjHyTijlJ7pqxFx0c5irigPYYK30G3Jftlpozy++BL9JRpiDgEmQurRoZuzQp9QdQn8tZnJxnCc/20ul31PPvRzcw0B+1S7TSEAyXdJKsG4D0uHVl7VQhkL6f5vRMPvEXNIiHPK8KKjrakDEWKq3sDxaR 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)(136003)(376002)(346002)(396003)(366004)(39840400004)(38100700002)(38350700002)(44832011)(83380400001)(2616005)(186003)(1076003)(8936002)(4326008)(66476007)(66946007)(316002)(8676002)(2906002)(6916009)(54906003)(5660300002)(7416002)(36756003)(66556008)(6506007)(41300700001)(6486002)(478600001)(26005)(6512007)(52116002)(86362001)(6666004); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?794cpWCqCyxK5psdnvr1+gB12QUR?= =?utf-8?q?GOTzZneu+MSyr0+GYEmklHVKALifIxeqBm0HeSIUmKihLyul49/D9YXP5yRdnrviZ?= =?utf-8?q?bFWQzoO5zW/ghrxbFCIa1+J3iV+AV1zVmhN68loJPKItsY7K5a9ZPvlSEpIy07f4v?= =?utf-8?q?pa4FFXvDMpToXtc6qeMgt4Qjqf5abJunRtXsTguqfvmpEew+e/DrFPIbVUjcVsHdi?= =?utf-8?q?9Zw8J5APkCc2FBtp8mhI3LOLXkaV+19SiPIhQaAjjBV1Kqh299limSjwdX7njZemx?= =?utf-8?q?I7+B8ZCWr4L0lCpXNCCmLztdosZ4fz8A61Qiacq5urKlGmsDsmKT2161oStPEniWD?= =?utf-8?q?QtzfRBr4UE8DBhLPiuklltX+/UNZYk6Azn23x1242zdjrbjp/MrxsJfWF0TcTgaEt?= =?utf-8?q?nk5XleF56pVDuQSVh3fJ3Rv6obmkV1gnST/czG2iz5IXAvEhhhduFYjPpZa7zEK+B?= =?utf-8?q?n0we+rQAjAGZZTfN69eUApawQTh4VWhGwBbtzTqZE7i9kYb48MZOMbUUoJKcCrtDb?= =?utf-8?q?ntbQBiSzBEX8oSm0+uEdvaX7X5aVAZaMu2hwUnn0M+jPS1SnlSW8yFlZ/1Yp7nvK8?= =?utf-8?q?x9bzPViki9PdL2YPWJBH9ENHILWenHceeM7sq/yMoJdm4Hn1qx74Hh3Gl+8gTyF7o?= =?utf-8?q?JRHbJmWkk6BgtedtyCZMBQf3vxCxNZGXSSPUSegT2/vwcozEmkVyryAwIDb6ll9wM?= =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rg: syrmia.com X-MS-Exchange-CrossTenant-Network-Message-Id: 917c2e5e-7bf1-44a1-f604-08da94ba6d37 X-MS-Exchange-CrossTenant-AuthSource: VE1PR03MB6045.eurprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Sep 2022 12:29:24.4964 (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: TavzGshXNEE0NoXdsYDihRrbdGyQW+VJbGrGo0YqPdg/tLTaraDPd/XcOAHRAhWWLBFqyKAFHViWK74RbkBYadJV4Fb/4tPD/C5gEY2F6/g= X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR03MB7603 Received-SPF: pass client-ip=40.107.7.131; envelope-from=Milica.Lazarevic@Syrmia.com; helo=EUR04-HE1-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_DNSWL_NONE=-0.0001, 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 | 57 +++++++++++++++++++++++++++++++++++++++++++++- disas/nanomips.h | 57 ---------------------------------------------- 2 files changed, 56 insertions(+), 58 deletions(-) diff --git a/disas/nanomips.cpp b/disas/nanomips.cpp index 3b5e6d520f..7fed1abff0 100644 --- a/disas/nanomips.cpp +++ b/disas/nanomips.cpp @@ -36,7 +36,62 @@ #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; + +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, +}; + +typedef struct Dis_info { + img_address m_pc; +} Dis_info; + +typedef bool (*conditional_function)(uint64 instruction); +typedef std::string (*disassembly_function)(uint64 instruction, + Dis_info *info); + +typedef struct Pool { + TABLE_ENTRY_TYPE type; + const struct Pool *next_table; + int next_table_size; + int instructions_size; + uint64 mask; + uint64 value; + disassembly_function disassembly; + conditional_function condition; + uint64 attributes; +} Pool; #define IMGASSERTONCE(test) diff --git a/disas/nanomips.h b/disas/nanomips.h index 75abe03bba..0fd7299900 100644 --- a/disas/nanomips.h +++ b/disas/nanomips.h @@ -23,61 +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; - -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, -}; - -typedef struct Dis_info { - img_address m_pc; -} Dis_info; - -typedef bool (*conditional_function)(uint64 instruction); -typedef std::string (*disassembly_function)(uint64 instruction, - Dis_info *info); - -typedef struct Pool { - TABLE_ENTRY_TYPE type; - const struct Pool *next_table; - int next_table_size; - int instructions_size; - uint64 mask; - uint64 value; - disassembly_function disassembly; - conditional_function condition; - uint64 attributes; -} Pool; - #endif