((sim_core_read_aligned_1 (scpu, cia, read_map, addr) << 8) \
+ (sim_core_read_aligned_1 (scpu, cia, read_map, addr+1))) << 16) >> 16)
-unsigned long
-moxie_extract_unsigned_integer (addr, len)
- unsigned char * addr;
- int len;
+static unsigned long
+moxie_extract_unsigned_integer (unsigned char *addr, int len)
{
unsigned long retval;
unsigned char * p;
unsigned char * endaddr = startaddr + len;
if (len > (int) sizeof (unsigned long))
- printf ("That operation is not available on integers of more than %d bytes.",
+ printf ("That operation is not available on integers of more than %zu bytes.",
sizeof (unsigned long));
/* Start at the most significant end of the integer, and work towards
return retval;
}
-void
-moxie_store_unsigned_integer (addr, len, val)
- unsigned char * addr;
- int len;
- unsigned long val;
+static void
+moxie_store_unsigned_integer (unsigned char *addr, int len, unsigned long val)
{
unsigned char * p;
unsigned char * startaddr = (unsigned char *)addr;
/* Write a 1 byte value to memory. */
-static void INLINE
+static INLINE void
wbat (sim_cpu *scpu, word pc, word x, word v)
{
address_word cia = CIA_GET (scpu);
/* Write a 2 byte value to memory. */
-static void INLINE
+static INLINE void
wsat (sim_cpu *scpu, word pc, word x, word v)
{
address_word cia = CIA_GET (scpu);
/* Write a 4 byte value to memory. */
-static void INLINE
+static INLINE void
wlat (sim_cpu *scpu, word pc, word x, word v)
{
address_word cia = CIA_GET (scpu);
/* Read 2 bytes from memory. */
-static int INLINE
+static INLINE int
rsat (sim_cpu *scpu, word pc, word x)
{
address_word cia = CIA_GET (scpu);
/* Read 1 byte from memory. */
-static int INLINE
+static INLINE int
rbat (sim_cpu *scpu, word pc, word x)
{
address_word cia = CIA_GET (scpu);
/* Read 4 bytes from memory. */
-static int INLINE
+static INLINE int
rlat (sim_cpu *scpu, word pc, word x)
{
address_word cia = CIA_GET (scpu);
#define CHECK_FLAG(T,H) if (tflags & T) { hflags |= H; tflags ^= T; }
-unsigned int
+static unsigned int
convert_target_flags (unsigned int tflags)
{
unsigned int hflags = 0x0;
#define TRACE(str) if (tracing) fprintf(tracefile,"0x%08x, %s, 0x%x, 0x%x, 0x%x, 0x%x, 0x%x, 0x%x, 0x%x, 0x%x, 0x%x, 0x%x, 0x%x, 0x%x, 0x%x, 0x%x, 0x%x, 0x%x\n", opc, str, cpu.asregs.regs[0], cpu.asregs.regs[1], cpu.asregs.regs[2], cpu.asregs.regs[3], cpu.asregs.regs[4], cpu.asregs.regs[5], cpu.asregs.regs[6], cpu.asregs.regs[7], cpu.asregs.regs[8], cpu.asregs.regs[9], cpu.asregs.regs[10], cpu.asregs.regs[11], cpu.asregs.regs[12], cpu.asregs.regs[13], cpu.asregs.regs[14], cpu.asregs.regs[15]);
void
-sim_resume (sd, step, siggnal)
- SIM_DESC sd;
- int step, siggnal;
+sim_resume (SIM_DESC sd, int step, int siggnal)
{
word pc, opc;
unsigned long long insts;
case 0x01: /* ldi.l (immediate) */
{
int reg = (inst >> 4) & 0xf;
+ unsigned int val = EXTRACT_WORD(pc+2);
TRACE("ldi.l");
- unsigned int val = EXTRACT_WORD(pc+2);
cpu.asregs.regs[reg] = val;
pc += 4;
}
}
int
-sim_store_register (sd, rn, memory, length)
- SIM_DESC sd;
- int rn;
- unsigned char * memory;
- int length;
+sim_store_register (SIM_DESC sd, int rn, unsigned char *memory, int length)
{
if (rn < NUM_MOXIE_REGS && rn >= 0)
{
}
int
-sim_fetch_register (sd, rn, memory, length)
- SIM_DESC sd;
- int rn;
- unsigned char * memory;
- int length;
+sim_fetch_register (SIM_DESC sd, int rn, unsigned char *memory, int length)
{
if (rn < NUM_MOXIE_REGS && rn >= 0)
{
}
SIM_DESC
-sim_open (kind, cb, abfd, argv)
- SIM_OPEN_KIND kind;
- host_callback * cb;
- struct bfd * abfd;
- char ** argv;
+sim_open (SIM_OPEN_KIND kind, host_callback *cb, struct bfd *abfd, char **argv)
{
SIM_DESC sd = sim_state_alloc (kind, cb);
SIM_ASSERT (STATE_MAGIC (sd) == SIM_MAGIC_NUMBER);
}
void
-sim_close (sd, quitting)
- SIM_DESC sd;
- int quitting;
+sim_close (SIM_DESC sd, int quitting)
{
/* nothing to do */
}
}
SIM_RC
-sim_create_inferior (sd, prog_bfd, argv, env)
- SIM_DESC sd;
- struct bfd * prog_bfd;
- char ** argv;
- char ** env;
+sim_create_inferior (SIM_DESC sd, struct bfd *prog_bfd, char **argv, char **env)
{
char ** avp;
int l, argc, i, tp;