Commit | Line | Data |
---|---|---|
0d2bcfaf | 1 | /* Disassembler structures definitions for the ARC. |
b90efa5b | 2 | Copyright (C) 1994-2015 Free Software Foundation, Inc. |
886a2506 NC |
3 | |
4 | Contributed by Claudiu Zissulescu (claziss@synopsys.com) | |
0d2bcfaf | 5 | |
9b201bb5 NC |
6 | This file is part of libopcodes. |
7 | ||
8 | This library is free software; you can redistribute it and/or modify | |
0d2bcfaf | 9 | it under the terms of the GNU General Public License as published by |
9b201bb5 NC |
10 | the Free Software Foundation; either version 3, or (at your option) |
11 | any later version. | |
0d2bcfaf | 12 | |
9b201bb5 NC |
13 | It is distributed in the hope that it will be useful, but WITHOUT |
14 | ANY WARRANTY; without even the implied warranty of MERCHANTABILITY | |
15 | or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public | |
16 | License for more details. | |
0d2bcfaf NC |
17 | |
18 | You should have received a copy of the GNU General Public License | |
19 | along with this program; if not, write to the Free Software Foundation, | |
f4321104 | 20 | Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ |
0d2bcfaf NC |
21 | |
22 | #ifndef ARCDIS_H | |
23 | #define ARCDIS_H | |
24 | ||
886a2506 | 25 | enum ARC_Debugger_OperandType |
0d2bcfaf | 26 | { |
886a2506 NC |
27 | ARC_UNDEFINED, |
28 | ARC_LIMM, | |
29 | ARC_SHIMM, | |
30 | ARC_REGISTER, | |
31 | ARCOMPACT_REGISTER /* Valid only for the | |
32 | registers allowed in | |
33 | 16 bit mode. */ | |
0d2bcfaf NC |
34 | }; |
35 | ||
43e65147 | 36 | enum Flow |
0d2bcfaf NC |
37 | { |
38 | noflow, | |
39 | direct_jump, | |
40 | direct_call, | |
41 | indirect_jump, | |
42 | indirect_call, | |
43 | invalid_instr | |
44 | }; | |
45 | ||
886a2506 NC |
46 | enum NullifyMode |
47 | { | |
48 | BR_exec_when_no_jump, | |
49 | BR_exec_always, | |
50 | BR_exec_when_jump | |
51 | }; | |
52 | ||
0d2bcfaf NC |
53 | enum { allOperandsSize = 256 }; |
54 | ||
43e65147 | 55 | struct arcDisState |
0d2bcfaf NC |
56 | { |
57 | void *_this; | |
58 | int instructionLen; | |
59 | void (*err)(void*, const char*); | |
60 | const char *(*coreRegName)(void*, int); | |
61 | const char *(*auxRegName)(void*, int); | |
62 | const char *(*condCodeName)(void*, int); | |
63 | const char *(*instName)(void*, int, int, int*); | |
43e65147 | 64 | |
0d2bcfaf NC |
65 | unsigned char* instruction; |
66 | unsigned index; | |
886a2506 NC |
67 | const char *comm[6]; /* Instr name, cond, NOP, 3 operands. */ |
68 | ||
69 | union | |
70 | { | |
71 | unsigned int registerNum; | |
72 | unsigned int shortimm; | |
73 | unsigned int longimm; | |
74 | } source_operand; | |
75 | enum ARC_Debugger_OperandType sourceType; | |
76 | ||
0d2bcfaf NC |
77 | int opWidth; |
78 | int targets[4]; | |
886a2506 NC |
79 | /* START ARC LOCAL. */ |
80 | unsigned int addresses[4]; | |
81 | /* END ARC LOCAL. */ | |
0d2bcfaf NC |
82 | /* Set as a side-effect of calling the disassembler. |
83 | Used only by the debugger. */ | |
84 | enum Flow flow; | |
85 | int register_for_indirect_jump; | |
86 | int ea_reg1, ea_reg2, _offset; | |
87 | int _cond, _opcode; | |
88 | unsigned long words[2]; | |
89 | char *commentBuffer; | |
90 | char instrBuffer[40]; | |
91 | char operandBuffer[allOperandsSize]; | |
92 | char _ea_present; | |
886a2506 | 93 | char _addrWriteBack; /* Address writeback. */ |
0d2bcfaf NC |
94 | char _mem_load; |
95 | char _load_len; | |
886a2506 | 96 | enum NullifyMode nullifyMode; |
0d2bcfaf NC |
97 | unsigned char commNum; |
98 | unsigned char isBranch; | |
99 | unsigned char tcnt; | |
100 | unsigned char acnt; | |
101 | }; | |
102 | ||
886a2506 NC |
103 | struct arcDisState |
104 | arcAnalyzeInstr (bfd_vma memaddr, struct disassemble_info *); | |
0d2bcfaf | 105 | #endif |