diff options
author | Michael Meissner <gnu@the-meissners.org> | 1996-10-16 22:14:23 +0000 |
---|---|---|
committer | Michael Meissner <gnu@the-meissners.org> | 1996-10-16 22:14:23 +0000 |
commit | 5c2556697f7f23dc449704a4ca2e58eaf2ef342f (patch) | |
tree | 90b9fd141495b82739126ba3508c810775b8180d /sim/d10v/d10v_sim.h | |
parent | 4948949ea28a0883a353e4cc4d07ff4a70843233 (diff) | |
download | gdb-5c2556697f7f23dc449704a4ca2e58eaf2ef342f.zip gdb-5c2556697f7f23dc449704a4ca2e58eaf2ef342f.tar.gz gdb-5c2556697f7f23dc449704a4ca2e58eaf2ef342f.tar.bz2 |
Make read/write memory functions inlined
Diffstat (limited to 'sim/d10v/d10v_sim.h')
-rw-r--r-- | sim/d10v/d10v_sim.h | 36 |
1 files changed, 19 insertions, 17 deletions
diff --git a/sim/d10v/d10v_sim.h b/sim/d10v/d10v_sim.h index 4913fa8..038f23a 100644 --- a/sim/d10v/d10v_sim.h +++ b/sim/d10v/d10v_sim.h @@ -7,8 +7,13 @@ #define DEBUG_TRACE 0x00000001 #define DEBUG_VALUES 0x00000002 -#define DEBUG_MEMSIZE 0x00000004 -#define DEBUG_INSTRUCTION 0x00000008 +#define DEBUG_LINE_NUMBER 0x00000004 +#define DEBUG_MEMSIZE 0x00000008 +#define DEBUG_INSTRUCTION 0x00000010 + +#ifndef DEBUG +#define DEBUG (DEBUG_TRACE | DEBUG_VALUES | DEBUG_LINE_NUMBER) +#endif extern int d10v_debug; @@ -83,8 +88,8 @@ extern long left_nops, right_nops; struct _state { reg_t regs[16]; /* general-purpose registers */ - reg_t cregs[16]; /* control registers */ - int64 a[2]; /* accumulators */ + reg_t cregs[16]; /* control registers */ + int64 a[2]; /* accumulators */ uint8 SM; uint8 EA; uint8 DB; @@ -99,6 +104,8 @@ struct _state uint8 exe; uint8 *imem; uint8 *dmem; + uint32 mem_min; + uint32 mem_max; int exception; enum _ins_type ins_type; } State; @@ -118,6 +125,9 @@ extern struct simops Simops[]; #define MOD_E (State.cregs[11]) #define IBA (State.cregs[14]) +#define SIG_D10V_STOP -1 +#define SIG_D10V_EXIT -2 + #define SEXT3(x) ((((x)&0x7)^(~3))+4) /* sign-extend a 4-bit number */ @@ -151,25 +161,19 @@ extern struct simops Simops[]; #define RB(x) (*((uint8 *)((x)+State.imem))) #define SB(addr,data) ( RB(addr) = (data & 0xff)) -#ifdef WORDS_BIGENDIAN - -#define RW(x) (*((uint16 *)((x)+State.imem))) -#define RLW(x) (*((uint32 *)((x)+State.imem))) -#define SW(addr,data) RW(addr)=data -#define SLW(addr,data) RLW(addr)=data -#define READ_16(x) (*((int16 *)(x))) -#define WRITE_16(addr,data) (*(int16 *)(addr)=data) -#define READ_64(x) (*((int64 *)(x))) -#define WRITE_64(addr,data) (*(int64 *)(addr)=data) +#if defined(__GNUC__) && defined(__OPTIMIZE__) && !defined(NO_ENDIAN_INLINE) +#define ENDIAN_INLINE static __inline__ +#include "endian.c" +#undef ENDIAN_INLINE #else - uint32 get_longword PARAMS ((uint8 *)); uint16 get_word PARAMS ((uint8 *)); int64 get_longlong PARAMS ((uint8 *)); void write_word PARAMS ((uint8 *addr, uint16 data)); void write_longword PARAMS ((uint8 *addr, uint32 data)); void write_longlong PARAMS ((uint8 *addr, int64 data)); +#endif #define SW(addr,data) write_word((long)(addr)+State.imem,data) #define RW(x) get_word((long)(x)+State.imem) @@ -179,5 +183,3 @@ void write_longlong PARAMS ((uint8 *addr, int64 data)); #define WRITE_16(addr,data) write_word(addr,data) #define READ_64(x) get_longlong(x) #define WRITE_64(addr,data) write_longlong(addr,data) - -#endif /* not WORDS_BIGENDIAN */ |