Remove i386_elf_emit_arch_note
[deliverable/binutils-gdb.git] / sim / cr16 / cr16_sim.h
index 19922f6f99d748993807e016b013fd8234cdb44d..5e0eabe3b76ec758cc742aab83f3ddf7f91bf7e9 100644 (file)
@@ -1,5 +1,5 @@
 /* Simulation code for the CR16 processor.
-   Copyright (C) 2008 Free Software Foundation, Inc.
+   Copyright (C) 2008-2015 Free Software Foundation, Inc.
    Contributed by M Ranga Swami Reddy <MR.Swami.Reddy@nsc.com>
 
    This file is part of GDB, the GNU debugger.
@@ -14,8 +14,9 @@
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.
  
-   You should have received a copy of the GNU General Public License along
-   with this program. If not, see <http://www.gnu.org/licenses/>.  */
+   You should have received a copy of the GNU General Public License
+   along with this program. If not, see <http://www.gnu.org/licenses/>.  */
+
 
 #include "config.h"
 #include <stdio.h>
@@ -59,15 +60,15 @@ typedef uint32 creg_t;
 
 struct simops 
 {
-  char mnimonic[6];
-  int  size; // size
-  long mask;
-  long opcode;
+  char mnimonic[12];
+  uint32 size;
+  uint32 mask;
+  uint32 opcode;
   int format;
-  char fname[10];
+  char fname[12];
   void (*func)();
   int numops;
-  int operands[4];
+  operand_desc operands[4];
 };
 
 enum _ins_type
@@ -284,10 +285,6 @@ extern host_callback *cr16_callback;
 extern uint32 OP[4];
 extern uint32 sign_flag;
 extern struct simops Simops[];
-extern asection *text;
-extern bfd_vma text_start;
-extern bfd_vma text_end;
-extern bfd *prog_bfd;
 
 enum
 {
@@ -309,13 +306,13 @@ enum
   PSR_I_BIT = 0x0800,
   PSR_P_BIT = 0x0400,
   PSR_E_BIT = 0x0200,
-  PSR_N_BIT = 0x0100,
+  PSR_N_BIT = 0x0080,
   PSR_Z_BIT = 0x0040,
   PSR_F_BIT = 0x0020,
-  PSR_U_BIT = 0x0010,
+  PSR_U_BIT = 0x0008,
   PSR_L_BIT = 0x0004,
   PSR_T_BIT = 0x0002,
-  PSR_C_BIT = 0x0001,
+  PSR_C_BIT = 0x0001
 };
 
 #define PSR CREG (PSR_CR)
@@ -402,6 +399,11 @@ enum
 #define SIG_CR16_BUS    -3
 #define SIG_CR16_IAD    -4
 
+/* TODO: Resolve conflicts with common headers.  */
+#undef SEXT8
+#undef SEXT16
+#undef SEXT32
+
 #define SEXT3(x)       ((((x)&0x7)^(~3))+4)    
 
 /* sign-extend a 4-bit number */
@@ -420,8 +422,8 @@ enum
 #define SEXT32(x)      ((((x)&0xffffffff)^(~0x7fffffff))+0x80000000)
 
 extern uint8 *dmem_addr (uint32 offset);
-extern uint8 *imem_addr PARAMS ((uint32));
-extern bfd_vma decode_pc PARAMS ((void));
+extern uint8 *imem_addr (uint32);
+extern bfd_vma decode_pc (void);
 
 #define        RB(x)   (*(dmem_addr(x)))
 #define SB(addr,data)  ( RB(addr) = (data & 0xff))
@@ -432,12 +434,12 @@ extern bfd_vma decode_pc PARAMS ((void));
 #undef ENDIAN_INLINE
 
 #else
-extern uint32 get_longword PARAMS ((uint8 *));
-extern uint16 get_word PARAMS ((uint8 *));
-extern int64 get_longlong PARAMS ((uint8 *));
-extern void write_word PARAMS ((uint8 *addr, uint16 data));
-extern void write_longword PARAMS ((uint8 *addr, uint32 data));
-extern void write_longlong PARAMS ((uint8 *addr, int64 data));
+extern uint32 get_longword (uint8 *);
+extern uint16 get_word (uint8 *);
+extern int64 get_longlong (uint8 *);
+extern void write_word (uint8 *addr, uint16 data);
+extern void write_longword (uint8 *addr, uint32 data);
+extern void write_longlong (uint8 *addr, int64 data);
 #endif
 
 #define SW(addr,data)          write_word(dmem_addr(addr),data)
@@ -471,3 +473,9 @@ extern void write_longlong PARAMS ((uint8 *addr, int64 data));
    PSR is masked for zero bits. */
 
 extern creg_t move_to_cr (int cr, creg_t mask, creg_t val, int psw_hw_p);
+
+#ifndef SIGTRAP
+#define SIGTRAP 5
+#endif
+/* Special purpose trap  */
+#define TRAP_BREAKPOINT 8
This page took 0.026246 seconds and 4 git commands to generate.