mirror of https://github.com/xemu-project/xemu.git
disas/nanomips: Extract enums out of the NMD class
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>
This commit is contained in:
parent
c52316925c
commit
bfffba15b2
|
@ -50,8 +50,8 @@ int nanomips_dis(char *buf,
|
||||||
std::string disasm;
|
std::string disasm;
|
||||||
uint16 bits[3] = {one, two, three};
|
uint16 bits[3] = {one, two, three};
|
||||||
|
|
||||||
NMD::TABLE_ENTRY_TYPE type;
|
TABLE_ENTRY_TYPE type;
|
||||||
NMD d(address, NMD::ALL_ATTRIBUTES);
|
NMD d(address, ALL_ATTRIBUTES);
|
||||||
int size = d.Disassemble(bits, disasm, type);
|
int size = d.Disassemble(bits, disasm, type);
|
||||||
|
|
||||||
strcpy(buf, disasm.c_str());
|
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,
|
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);
|
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
|
* disassembly string - on error will constain error string
|
||||||
*/
|
*/
|
||||||
int NMD::Disassemble(const uint16 * data, std::string & dis,
|
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)
|
int table_size)
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
|
|
|
@ -31,21 +31,16 @@ typedef uint32_t uint32;
|
||||||
typedef uint16_t uint16;
|
typedef uint16_t uint16;
|
||||||
typedef uint64_t img_address;
|
typedef uint64_t img_address;
|
||||||
|
|
||||||
|
enum TABLE_ENTRY_TYPE {
|
||||||
class NMD
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
|
|
||||||
enum TABLE_ENTRY_TYPE {
|
|
||||||
instruction,
|
instruction,
|
||||||
call_instruction,
|
call_instruction,
|
||||||
branch_instruction,
|
branch_instruction,
|
||||||
return_instruction,
|
return_instruction,
|
||||||
reserved_block,
|
reserved_block,
|
||||||
pool,
|
pool,
|
||||||
};
|
};
|
||||||
|
|
||||||
enum TABLE_ATTRIBUTE_TYPE {
|
enum TABLE_ATTRIBUTE_TYPE {
|
||||||
MIPS64_ = 0x00000001,
|
MIPS64_ = 0x00000001,
|
||||||
XNP_ = 0x00000002,
|
XNP_ = 0x00000002,
|
||||||
XMMS_ = 0x00000004,
|
XMMS_ = 0x00000004,
|
||||||
|
@ -63,9 +58,13 @@ public:
|
||||||
TLB_ = 0x00004000,
|
TLB_ = 0x00004000,
|
||||||
MVH_ = 0x00008000,
|
MVH_ = 0x00008000,
|
||||||
ALL_ATTRIBUTES = 0xffffffffull,
|
ALL_ATTRIBUTES = 0xffffffffull,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
class NMD
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
|
||||||
NMD(img_address pc, TABLE_ATTRIBUTE_TYPE requested_instruction_categories)
|
NMD(img_address pc, TABLE_ATTRIBUTE_TYPE requested_instruction_categories)
|
||||||
: m_pc(pc)
|
: m_pc(pc)
|
||||||
, m_requested_instruction_categories(requested_instruction_categories)
|
, m_requested_instruction_categories(requested_instruction_categories)
|
||||||
|
|
Loading…
Reference in New Issue