From patchwork Sun Oct 30 22:28:10 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 620021 Delivered-To: patch@linaro.org Received: by 2002:a17:522:c983:b0:460:3032:e3c4 with SMTP id kr3csp2451186pvb; Sun, 30 Oct 2022 15:33:48 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7bQ5JqWtqXnjL9wZSJe3AvKE3RoroKaJCSLo8pu0Ung2pPwCJrX38StnY3CSQLluT8N4De X-Received: by 2002:a05:620a:cf0:b0:6f9:7ee1:2cc3 with SMTP id c16-20020a05620a0cf000b006f97ee12cc3mr6984682qkj.362.1667169228117; Sun, 30 Oct 2022 15:33:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1667169228; cv=none; d=google.com; s=arc-20160816; b=EDYoPJYbbmNVn+ybFLgpdf3PsgCYf6YxrWwQmWWzD+BgOCH5cUXPsFRG41wUFRacp0 tKCmGCwDY8Vf5dKDAqzXD8CR/E+XGrIBxke5HSmDR316OCm4CJ3DCst52JgHOkKjUJ6J rO/E+7qOh7Ge1joZuuuPmLO1Oms3tFf7TcZD3Aq04DJ2kL8vCr2RWmf61WvJT9wZwvs2 OI7v5e09yRRiydc2kQzL2k4DEhrQJpZimR9GcryHJamKatAGFJgRC4mOFWk6fi9ZejQ7 Ex8eU6fQQ2hPHwNCO/9LJ0E9A+5FOdz/mqD2XvnYRoe0D0hq4v5EVGIZmU62J3pE5McI 5ACA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=errors-to:sender:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=78GzyGFEMH2M2sCxvMXcou2KqVZiNLCYi4vOv1w4erk=; b=u5KBPNfwqOfaoVh5jmHacSU7UbRcVM43E4drRaA7f7z6Kj9tZysEgzISDz8rU5oKtg ijicWMlebhTNcX3Iy2ZEfpbC0G2AHXCd5/DxaxPnq5Cui+ryKdiZEA81huEs0hyQgzhJ 7DKVe0bmINuMXSn5gkm1akHZsoNzNEaDWlV7zBG3dUTGLL+tfAihDI+EB9C+7hdY+No5 ntPK6+YzBKN5KTbIYL6q2dzxQ3jJxwwuDmxUROrXl91TsMYtKGGk9LWS6fIE8ydwDSmu 4tNx0lPlNMQjZmapaS3Bti2RxPNbnsSkfnVfsEpXKrFO+6G5w+sRJnc5IOBZ+ou0EWlX IApg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=a8tjl+Yq; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id h1-20020ac81381000000b0035de2be972dsi2743955qtj.483.2022.10.30.15.33.48 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sun, 30 Oct 2022 15:33:48 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=a8tjl+Yq; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1opGq1-00075X-EZ; Sun, 30 Oct 2022 18:31:29 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1opGpz-0006qX-En for qemu-devel@nongnu.org; Sun, 30 Oct 2022 18:31:27 -0400 Received: from mail-wm1-x32d.google.com ([2a00:1450:4864:20::32d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1opGpx-0008Bd-L0 for qemu-devel@nongnu.org; Sun, 30 Oct 2022 18:31:27 -0400 Received: by mail-wm1-x32d.google.com with SMTP id 5so6234793wmo.1 for ; Sun, 30 Oct 2022 15:31:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=78GzyGFEMH2M2sCxvMXcou2KqVZiNLCYi4vOv1w4erk=; b=a8tjl+YqIWKQq4+Nrey+B3AtZZozXOYPyOXmT7HKBcHf92oUlYhsJHj3UK18J8pXhs PAO76hjb7wuFP8iUhlT+E9Pzn6LJEeC7mn7C7a9a0C2AHAyWQ4GWoksakeSkEenpou26 q5n8ZYdWLedML1VoFLlVgISJDFNfpGV3xPaT90wJG1pw0z5tFK5YfLpxtyxqISMXAv84 prBb503/RE3Jbw8lv1arbaVQNlsQTyqPGk3nCNsoGKL97D90Vij4CWxIOri+GHgKCTNe DivTiB6kfDjW4eQ/A3LjAaxaP/vxj2j0KlIhfCrrCA96OsV1vIO5RyWkKCMsXtAnJjeN a3Ug== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=78GzyGFEMH2M2sCxvMXcou2KqVZiNLCYi4vOv1w4erk=; b=QI3cwiURD1JRbnNVHM8kQz1q0IqewfFa17+KmSWJL6lyaaFXTzIhjm/HKVBeTgAv8b tRQ6FvX5e26Y0aY1tALqKWh/buWMexDZtDvu5CIOjmi+fg0LtnYtdXOdHGse55STf4Hi WayO6eQdl2FNe3emCba1nSWPlw7U0yH+FpOpn8E61IXaJtE6XZ+6U/0UJCiqVSh+RrVF 4sX7IB5nzN5jR4gGZSwDay7h7tNn2NHPBQ31SwnpI2Fwu7th+xHGXO72/pGP57i4k1GN I1LMujq5Yh4ZdlHo5RZDMIILgNnGPKwRkSzKjv0wj30VhW7kNFZfBhZiOF9c01bBKZo0 6goA== X-Gm-Message-State: ACrzQf3Mw5SmhobBMOqjsxwhdYcSctC1XemK7WU4wwSXJUGxYCR+wukH FZ/rFq/z+ga2ukpI9xgK10ntJmFY8LSV7w== X-Received: by 2002:a05:600c:4ed2:b0:3c6:c1ff:222 with SMTP id g18-20020a05600c4ed200b003c6c1ff0222mr5955721wmq.163.1667169084104; Sun, 30 Oct 2022 15:31:24 -0700 (PDT) Received: from localhost.localdomain ([185.126.107.38]) by smtp.gmail.com with ESMTPSA id z3-20020a05600c0a0300b003cf55844453sm5736540wmp.22.2022.10.30.15.31.22 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Sun, 30 Oct 2022 15:31:23 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Aleksandar Rikalo , Huacai Chen , Stefan Pejic , Jiaxun Yang , Aurelien Jarno , Paul Burton , Milica Lazarevic , =?utf-8?q?Philippe_Mathieu-?= =?utf-8?q?Daud=C3=A9?= , Richard Henderson Subject: [PULL 24/55] disas/nanomips: Move typedefs etc to nanomips.cpp Date: Sun, 30 Oct 2022 23:28:10 +0100 Message-Id: <20221030222841.42377-25-philmd@linaro.org> X-Mailer: git-send-email 2.37.3 In-Reply-To: <20221030222841.42377-1-philmd@linaro.org> References: <20221030222841.42377-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::32d; envelope-from=philmd@linaro.org; helo=mail-wm1-x32d.google.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, SPF_HELO_NONE=0.001, SPF_PASS=-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: , Sender: "Qemu-devel" Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org From: Milica Lazarevic 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 Message-Id: <20220912122635.74032-11-milica.lazarevic@syrmia.com> Signed-off-by: Philippe Mathieu-Daudé --- 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 0d67462e5d..7d09fd1a69 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 47b44af751..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