[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v2 09/20] disas/nanomips: Move typedefs etc to nanomips.cpp
From: |
Milica Lazarevic |
Subject: |
[PATCH v2 09/20] disas/nanomips: Move typedefs etc to nanomips.cpp |
Date: |
Mon, 5 Sep 2022 11:55:11 +0200 |
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 <milica.lazarevic@syrmia.com>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
---
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 <stdio.h>
#include <stdarg.h>
-#include "nanomips.h"
+#include <string>
+
+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 <string>
-
-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
--
2.25.1
- [PATCH v2 04/20] disas/nanomips: Remove helper methods from class, (continued)
- [PATCH v2 04/20] disas/nanomips: Remove helper methods from class, Milica Lazarevic, 2022/09/05
- [PATCH v2 06/20] disas/nanomips: Remove disasm methods from class, Milica Lazarevic, 2022/09/05
- [PATCH v2 07/20] disas/nanomips: Remove Pool tables from the class, Milica Lazarevic, 2022/09/05
- [PATCH v2 08/20] disas/nanomips: Remove NMD class, Milica Lazarevic, 2022/09/05
- [PATCH v2 10/20] disas/nanomips: Delete nanomips.h, Milica Lazarevic, 2022/09/05
- [PATCH v2 09/20] disas/nanomips: Move typedefs etc to nanomips.cpp,
Milica Lazarevic <=
- [PATCH v2 11/20] disas/nanomips: Remove #inlcude <sstream>, Milica Lazarevic, 2022/09/05
- [PATCH v2 12/20] disas/nanomips: Replace std::string type, Milica Lazarevic, 2022/09/05
[PATCH v2 13/20] disas/nanomips: Prevent memory leaking, Milica Lazarevic, 2022/09/05