1*3d8817e4Smiod /* Disassembler structures definitions for the ARC. 2*3d8817e4Smiod Copyright 1994, 1995, 1997, 1998, 2000, 2001 3*3d8817e4Smiod Free Software Foundation, Inc. 4*3d8817e4Smiod Contributed by Doug Evans (dje@cygnus.com). 5*3d8817e4Smiod 6*3d8817e4Smiod This program is free software; you can redistribute it and/or modify 7*3d8817e4Smiod it under the terms of the GNU General Public License as published by 8*3d8817e4Smiod the Free Software Foundation; either version 2 of the License, or 9*3d8817e4Smiod (at your option) any later version. 10*3d8817e4Smiod 11*3d8817e4Smiod This program is distributed in the hope that it will be useful, 12*3d8817e4Smiod but WITHOUT ANY WARRANTY; without even the implied warranty of 13*3d8817e4Smiod MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14*3d8817e4Smiod GNU General Public License for more details. 15*3d8817e4Smiod 16*3d8817e4Smiod You should have received a copy of the GNU General Public License 17*3d8817e4Smiod along with this program; if not, write to the Free Software Foundation, 18*3d8817e4Smiod Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ 19*3d8817e4Smiod 20*3d8817e4Smiod #ifndef ARCDIS_H 21*3d8817e4Smiod #define ARCDIS_H 22*3d8817e4Smiod 23*3d8817e4Smiod enum 24*3d8817e4Smiod { 25*3d8817e4Smiod BR_exec_when_no_jump, 26*3d8817e4Smiod BR_exec_always, 27*3d8817e4Smiod BR_exec_when_jump 28*3d8817e4Smiod }; 29*3d8817e4Smiod 30*3d8817e4Smiod enum Flow 31*3d8817e4Smiod { 32*3d8817e4Smiod noflow, 33*3d8817e4Smiod direct_jump, 34*3d8817e4Smiod direct_call, 35*3d8817e4Smiod indirect_jump, 36*3d8817e4Smiod indirect_call, 37*3d8817e4Smiod invalid_instr 38*3d8817e4Smiod }; 39*3d8817e4Smiod 40*3d8817e4Smiod enum { no_reg = 99 }; 41*3d8817e4Smiod enum { allOperandsSize = 256 }; 42*3d8817e4Smiod 43*3d8817e4Smiod struct arcDisState 44*3d8817e4Smiod { 45*3d8817e4Smiod void *_this; 46*3d8817e4Smiod int instructionLen; 47*3d8817e4Smiod void (*err)(void*, const char*); 48*3d8817e4Smiod const char *(*coreRegName)(void*, int); 49*3d8817e4Smiod const char *(*auxRegName)(void*, int); 50*3d8817e4Smiod const char *(*condCodeName)(void*, int); 51*3d8817e4Smiod const char *(*instName)(void*, int, int, int*); 52*3d8817e4Smiod 53*3d8817e4Smiod unsigned char* instruction; 54*3d8817e4Smiod unsigned index; 55*3d8817e4Smiod const char *comm[6]; /* instr name, cond, NOP, 3 operands */ 56*3d8817e4Smiod int opWidth; 57*3d8817e4Smiod int targets[4]; 58*3d8817e4Smiod int addresses[4]; 59*3d8817e4Smiod /* Set as a side-effect of calling the disassembler. 60*3d8817e4Smiod Used only by the debugger. */ 61*3d8817e4Smiod enum Flow flow; 62*3d8817e4Smiod int register_for_indirect_jump; 63*3d8817e4Smiod int ea_reg1, ea_reg2, _offset; 64*3d8817e4Smiod int _cond, _opcode; 65*3d8817e4Smiod unsigned long words[2]; 66*3d8817e4Smiod char *commentBuffer; 67*3d8817e4Smiod char instrBuffer[40]; 68*3d8817e4Smiod char operandBuffer[allOperandsSize]; 69*3d8817e4Smiod char _ea_present; 70*3d8817e4Smiod char _mem_load; 71*3d8817e4Smiod char _load_len; 72*3d8817e4Smiod char nullifyMode; 73*3d8817e4Smiod unsigned char commNum; 74*3d8817e4Smiod unsigned char isBranch; 75*3d8817e4Smiod unsigned char tcnt; 76*3d8817e4Smiod unsigned char acnt; 77*3d8817e4Smiod }; 78*3d8817e4Smiod 79*3d8817e4Smiod #define __TRANSLATION_REQUIRED(state) ((state).acnt != 0) 80*3d8817e4Smiod 81*3d8817e4Smiod #endif 82