[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 16/55] disas/nanomips: Extract enums out of the NMD class
From: |
Philippe Mathieu-Daudé |
Subject: |
[PULL 16/55] disas/nanomips: Extract enums out of the NMD class |
Date: |
Sun, 30 Oct 2022 23:28:02 +0100 |
From: Milica Lazarevic <milica.lazarevic@syrmia.com>
Definitions of enums TABLE_ENTRY_TYPE and TABLE_ATTRIBUTE_TYPE are moved
out of the NMD class. The main goal is to remove NMD class completely.
Signed-off-by: Milica Lazarevic <milica.lazarevic@syrmia.com>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20220912122635.74032-3-milica.lazarevic@syrmia.com>
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
disas/nanomips.cpp | 8 +++----
disas/nanomips.h | 59 +++++++++++++++++++++++-----------------------
2 files changed, 33 insertions(+), 34 deletions(-)
diff --git a/disas/nanomips.cpp b/disas/nanomips.cpp
index 84529685bf..bdc640b38b 100644
--- a/disas/nanomips.cpp
+++ b/disas/nanomips.cpp
@@ -50,8 +50,8 @@ int nanomips_dis(char *buf,
std::string disasm;
uint16 bits[3] = {one, two, three};
- NMD::TABLE_ENTRY_TYPE type;
- NMD d(address, NMD::ALL_ATTRIBUTES);
+ TABLE_ENTRY_TYPE type;
+ NMD d(address, ALL_ATTRIBUTES);
int size = d.Disassemble(bits, disasm, type);
strcpy(buf, disasm.c_str());
@@ -772,7 +772,7 @@ uint64 NMD::extract_op_code_value(const uint16 * data, int
size)
int NMD::Disassemble(const uint16 * data, std::string & dis,
- NMD::TABLE_ENTRY_TYPE & type)
+ TABLE_ENTRY_TYPE & type)
{
return Disassemble(data, dis, type, MAJOR, 2);
}
@@ -790,7 +790,7 @@ int NMD::Disassemble(const uint16 * data, std::string & dis,
* disassembly string - on error will constain error string
*/
int NMD::Disassemble(const uint16 * data, std::string & dis,
- NMD::TABLE_ENTRY_TYPE & type, const Pool *table,
+ TABLE_ENTRY_TYPE & type, const Pool *table,
int table_size)
{
try
diff --git a/disas/nanomips.h b/disas/nanomips.h
index 9fe0cc67da..f65a0957b8 100644
--- a/disas/nanomips.h
+++ b/disas/nanomips.h
@@ -31,41 +31,40 @@ 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,
+};
+
class NMD
{
public:
- 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,
- };
-
-
NMD(img_address pc, TABLE_ATTRIBUTE_TYPE requested_instruction_categories)
: m_pc(pc)
, m_requested_instruction_categories(requested_instruction_categories)
--
2.37.3
- [PULL 06/55] hw/isa/vt82c686: Instantiate IDE function in host device, (continued)
- [PULL 06/55] hw/isa/vt82c686: Instantiate IDE function in host device, Philippe Mathieu-Daudé, 2022/10/30
- [PULL 07/55] hw/isa/vt82c686: Introduce TYPE_VT82C686B_USB_UHCI define, Philippe Mathieu-Daudé, 2022/10/30
- [PULL 08/55] hw/isa/vt82c686: Instantiate USB functions in host device, Philippe Mathieu-Daudé, 2022/10/30
- [PULL 09/55] hw/isa/vt82c686: Instantiate PM function in host device, Philippe Mathieu-Daudé, 2022/10/30
- [PULL 10/55] hw/isa/vt82c686: Instantiate AC97 and MC97 functions in host device, Philippe Mathieu-Daudé, 2022/10/30
- [PULL 11/55] hw/mips/fuloong2e: Inline vt82c686b_southbridge_init() and remove it, Philippe Mathieu-Daudé, 2022/10/30
- [PULL 12/55] hw/isa/vt82c686: Embed RTCState in host device, Philippe Mathieu-Daudé, 2022/10/30
- [PULL 13/55] hw/isa/vt82c686: Create rtc-time alias in boards instead, Philippe Mathieu-Daudé, 2022/10/30
- [PULL 14/55] hw: Remove unused MAX_IDE_BUS define, Philippe Mathieu-Daudé, 2022/10/30
- [PULL 15/55] disas/nanomips: Remove namespace img, Philippe Mathieu-Daudé, 2022/10/30
- [PULL 16/55] disas/nanomips: Extract enums out of the NMD class,
Philippe Mathieu-Daudé <=
- [PULL 17/55] disas/nanomips: Delete NMD class field, Philippe Mathieu-Daudé, 2022/10/30
- [PULL 18/55] disas/nanomips: Delete NMD class second field, Philippe Mathieu-Daudé, 2022/10/30
- [PULL 19/55] disas/nanomips: Remove helper methods from class, Philippe Mathieu-Daudé, 2022/10/30
- [PULL 20/55] disas/nanomips: Remove __cond methods from class, Philippe Mathieu-Daudé, 2022/10/30
- [PULL 21/55] disas/nanomips: Remove disasm methods from class, Philippe Mathieu-Daudé, 2022/10/30
- [PULL 22/55] disas/nanomips: Remove Pool tables from the class, Philippe Mathieu-Daudé, 2022/10/30
- [PULL 23/55] disas/nanomips: Remove NMD class, Philippe Mathieu-Daudé, 2022/10/30
- [PULL 24/55] disas/nanomips: Move typedefs etc to nanomips.cpp, Philippe Mathieu-Daudé, 2022/10/30
- [PULL 25/55] disas/nanomips: Delete nanomips.h, Philippe Mathieu-Daudé, 2022/10/30
- [PULL 26/55] disas/nanomips: Remove #include <sstream>, Philippe Mathieu-Daudé, 2022/10/30