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