[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 24/55] disas/nanomips: Move typedefs etc to nanomips.cpp
From: |
Philippe Mathieu-Daudé |
Subject: |
[PULL 24/55] disas/nanomips: Move typedefs etc to nanomips.cpp |
Date: |
Sun, 30 Oct 2022 23:28:10 +0100 |
From: Milica Lazarevic <milica.lazarevic@syrmia.com>
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>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20220912122635.74032-11-milica.lazarevic@syrmia.com>
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
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 <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;
+
+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 <string>
-
-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
--
2.37.3
- [PULL 14/55] hw: Remove unused MAX_IDE_BUS define, (continued)
- [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é, 2022/10/30
- [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é <=
- [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
- [PULL 28/55] disas/nanomips: Delete wrapper functions, Philippe Mathieu-Daudé, 2022/10/30
- [PULL 27/55] disas/nanomips: Delete copy functions, Philippe Mathieu-Daudé, 2022/10/30
- [PULL 30/55] disas/nanomips: Remove IMMEDIATE functions, Philippe Mathieu-Daudé, 2022/10/30
- [PULL 29/55] disas/nanomips: Replace std::string type, Philippe Mathieu-Daudé, 2022/10/30
- [PULL 31/55] disas/nanomips: Remove CPR function, Philippe Mathieu-Daudé, 2022/10/30
- [PULL 32/55] disas/nanomips: Prevent memory leaking, Philippe Mathieu-Daudé, 2022/10/30
- [PULL 33/55] disas/nanomips: Remove function overloading, Philippe Mathieu-Daudé, 2022/10/30
- [PULL 34/55] disas/nanomips: Expand Dis_info struct, Philippe Mathieu-Daudé, 2022/10/30