#include "sim-signal.h"
#include "target-newlib-syscall.h"
-typedef int word;
-
/* Extract the signed 10-bit offset from a 16-bit branch
instruction. */
#define INST2OFFSET(o) ((((signed short)((o & ((1<<10)-1))<<6))>>6)<<1)
/* TODO: This should be moved to sim-main.h:_sim_cpu. */
struct moxie_regset
{
- word regs[NUM_MOXIE_REGS + 1]; /* primary registers */
- word sregs[256]; /* special registers */
- word cc; /* the condition code reg */
+ int32_t regs[NUM_MOXIE_REGS + 1]; /* primary registers */
+ int32_t sregs[256]; /* special registers */
+ int32_t cc; /* the condition code reg */
unsigned long long insts; /* instruction counter */
};
union
{
struct moxie_regset asregs;
- word asints [1]; /* but accessed larger... */
+ int32_t asints [1]; /* but accessed larger... */
} cpu;
static void
/* Write a 1 byte value to memory. */
static INLINE void
-wbat (sim_cpu *scpu, word pc, word x, word v)
+wbat (sim_cpu *scpu, int32_t pc, int32_t x, int32_t v)
{
address_word cia = CPU_PC_GET (scpu);
/* Write a 2 byte value to memory. */
static INLINE void
-wsat (sim_cpu *scpu, word pc, word x, word v)
+wsat (sim_cpu *scpu, int32_t pc, int32_t x, int32_t v)
{
address_word cia = CPU_PC_GET (scpu);
/* Write a 4 byte value to memory. */
static INLINE void
-wlat (sim_cpu *scpu, word pc, word x, word v)
+wlat (sim_cpu *scpu, int32_t pc, int32_t x, int32_t v)
{
address_word cia = CPU_PC_GET (scpu);
/* Read 2 bytes from memory. */
static INLINE int
-rsat (sim_cpu *scpu, word pc, word x)
+rsat (sim_cpu *scpu, int32_t pc, int32_t x)
{
address_word cia = CPU_PC_GET (scpu);
/* Read 1 byte from memory. */
static INLINE int
-rbat (sim_cpu *scpu, word pc, word x)
+rbat (sim_cpu *scpu, int32_t pc, int32_t x)
{
address_word cia = CPU_PC_GET (scpu);
/* Read 4 bytes from memory. */
static INLINE int
-rlat (sim_cpu *scpu, word pc, word x)
+rlat (sim_cpu *scpu, int32_t pc, int32_t x)
{
address_word cia = CPU_PC_GET (scpu);
int nr_cpus, /* ignore */
int siggnal) /* ignore */
{
- word pc, opc;
+ int32_t pc, opc;
unsigned short inst;
sim_cpu *scpu = STATE_CPU (sd, 0); /* FIXME */
address_word cia = CPU_PC_GET (scpu);