If LENGTH does not match the size of REGNO no data is transfered
(the actual register size is still returned). */
-int sim_fetch_register (SIM_DESC sd, int regno, unsigned char *buf, int length);
+int sim_fetch_register (SIM_DESC sd, int regno, void *buf, int length);
/* Store register REGNO from the raw (target endian) value in BUF.
Return a LENGTH of 0 to indicate the register was not updated
but no error has occurred. */
-int sim_store_register (SIM_DESC sd, int regno, const unsigned char *buf,
- int length);
+int sim_store_register (SIM_DESC sd, int regno, const void *buf, int length);
/* Print whatever statistics the simulator has collected.
}
static int
-aarch64_reg_get (SIM_CPU *cpu, int regno, unsigned char *buf, int length)
+aarch64_reg_get (SIM_CPU *cpu, int regno, void *buf, int length)
{
size_t size;
bfd_vma val;
}
static int
-aarch64_reg_set (SIM_CPU *cpu, int regno, const unsigned char *buf, int length)
+aarch64_reg_set (SIM_CPU *cpu, int regno, const void *buf, int length)
{
size_t size;
bfd_vma val;
}
static int
-arm_reg_store (SIM_CPU *cpu, int rn, const unsigned char *memory, int length)
+arm_reg_store (SIM_CPU *cpu, int rn, const void *buf, int length)
{
init ();
case SIM_ARM_FP6_REGNUM:
case SIM_ARM_FP7_REGNUM:
case SIM_ARM_FPS_REGNUM:
- ARMul_SetReg (state, state->Mode, rn, frommem (state, memory));
+ ARMul_SetReg (state, state->Mode, rn, frommem (state, buf));
break;
case SIM_ARM_PS_REGNUM:
- state->Cpsr = frommem (state, memory);
+ state->Cpsr = frommem (state, buf);
ARMul_CPSRAltered (state);
break;
case SIM_ARM_MAVERIC_COP0R14_REGNUM:
case SIM_ARM_MAVERIC_COP0R15_REGNUM:
memcpy (& DSPregs [rn - SIM_ARM_MAVERIC_COP0R0_REGNUM],
- memory, sizeof (struct maverick_regs));
+ buf, sizeof (struct maverick_regs));
return sizeof (struct maverick_regs);
case SIM_ARM_MAVERIC_DSPSC_REGNUM:
- memcpy (&DSPsc, memory, sizeof DSPsc);
+ memcpy (&DSPsc, buf, sizeof DSPsc);
return sizeof DSPsc;
case SIM_ARM_IWMMXT_COP0R0_REGNUM:
case SIM_ARM_IWMMXT_COP1R13_REGNUM:
case SIM_ARM_IWMMXT_COP1R14_REGNUM:
case SIM_ARM_IWMMXT_COP1R15_REGNUM:
- return Store_Iwmmxt_Register (rn - SIM_ARM_IWMMXT_COP0R0_REGNUM, memory);
+ return Store_Iwmmxt_Register (rn - SIM_ARM_IWMMXT_COP0R0_REGNUM, buf);
default:
return 0;
}
static int
-arm_reg_fetch (SIM_CPU *cpu, int rn, unsigned char *memory, int length)
+arm_reg_fetch (SIM_CPU *cpu, int rn, void *buf, int length)
{
+ unsigned char *memory = buf;
ARMword regval;
int len = length;
}
static int
-avr_reg_store (SIM_CPU *cpu, int rn, const unsigned char *memory, int length)
+avr_reg_store (SIM_CPU *cpu, int rn, const void *buf, int length)
{
+ const unsigned char *memory = buf;
+
if (rn < 32 && length == 1)
{
sram[rn] = *memory;
}
static int
-avr_reg_fetch (SIM_CPU *cpu, int rn, unsigned char *memory, int length)
+avr_reg_fetch (SIM_CPU *cpu, int rn, void *buf, int length)
{
+ unsigned char *memory = buf;
+
if (rn < 32 && length == 1)
{
*memory = sram[rn];
}
static int
-bfin_reg_fetch (SIM_CPU *cpu, int rn, unsigned char *buf, int len)
+bfin_reg_fetch (SIM_CPU *cpu, int rn, void *buf, int len)
{
bu32 value, *reg;
}
static int
-bfin_reg_store (SIM_CPU *cpu, int rn, const unsigned char *buf, int len)
+bfin_reg_store (SIM_CPU *cpu, int rn, const void *buf, int len)
{
bu32 value, *reg;
int
bpfbf_fetch_register (SIM_CPU *current_cpu,
int rn,
- unsigned char *buf,
+ void *buf,
int len)
{
if (rn == 11)
int
bpfbf_store_register (SIM_CPU *current_cpu,
int rn,
- const unsigned char *buf,
+ const void *buf,
int len)
{
if (rn == 11)
/* Types for register access functions.
These routines implement the sim_{fetch,store}_register interface. */
-typedef int (CPUREG_FETCH_FN) (sim_cpu *, int, unsigned char *, int);
-typedef int (CPUREG_STORE_FN) (sim_cpu *, int, const unsigned char *, int);
+typedef int (CPUREG_FETCH_FN) (sim_cpu *, int, void *, int);
+typedef int (CPUREG_STORE_FN) (sim_cpu *, int, const void *, int);
/* Types for PC access functions.
Some simulators require a functional interface to access the program
cpus. */
int
-sim_fetch_register (SIM_DESC sd, int rn, unsigned char *buf, int length)
+sim_fetch_register (SIM_DESC sd, int rn, void *buf, int length)
{
SIM_CPU *cpu = STATE_CPU (sd, 0);
cpus. */
int
-sim_store_register (SIM_DESC sd, int rn, const unsigned char *buf, int length)
+sim_store_register (SIM_DESC sd, int rn, const void *buf, int length)
{
SIM_CPU *cpu = STATE_CPU (sd, 0);
sim_state_free (sd);
}
-static int cr16_reg_fetch (SIM_CPU *, int, unsigned char *, int);
-static int cr16_reg_store (SIM_CPU *, int, const unsigned char *, int);
+static int cr16_reg_fetch (SIM_CPU *, int, void *, int);
+static int cr16_reg_store (SIM_CPU *, int, const void *, int);
SIM_DESC
sim_open (SIM_OPEN_KIND kind, struct host_callback_struct *cb,
}
static int
-cr16_reg_fetch (SIM_CPU *cpu, int rn, unsigned char *memory, int length)
+cr16_reg_fetch (SIM_CPU *cpu, int rn, void *memory, int length)
{
int size;
switch ((enum sim_cr16_regs) rn)
}
static int
-cr16_reg_store (SIM_CPU *cpu, int rn, const unsigned char *memory, int length)
+cr16_reg_store (SIM_CPU *cpu, int rn, const void *memory, int length)
{
SIM_DESC sd = CPU_STATE (cpu);
int size;
Note the contents of BUF are in target byte order. */
int
-MY (f_fetch_register) (SIM_CPU *current_cpu, int rn,
- unsigned char *buf, int len ATTRIBUTE_UNUSED)
+MY (f_fetch_register) (SIM_CPU *current_cpu, int rn, void *buf,
+ int len ATTRIBUTE_UNUSED)
{
SETTSI (buf, XCONCAT3(crisv,BASENUM,f_h_gr_get) (current_cpu, rn));
return -1;
Note the contents of BUF are in target byte order. */
int
-MY (f_store_register) (SIM_CPU *current_cpu, int rn,
- const unsigned char *buf, int len ATTRIBUTE_UNUSED)
+MY (f_store_register) (SIM_CPU *current_cpu, int rn, const void *buf,
+ int len ATTRIBUTE_UNUSED)
{
XCONCAT3(crisv,BASENUM,f_h_gr_set) (current_cpu, rn, GETTSI (buf));
return -1;
sim_state_free (sd);
}
-static int d10v_reg_fetch (SIM_CPU *, int, unsigned char *, int);
-static int d10v_reg_store (SIM_CPU *, int, const unsigned char *, int);
+static int d10v_reg_fetch (SIM_CPU *, int, void *, int);
+static int d10v_reg_store (SIM_CPU *, int, const void *, int);
SIM_DESC
sim_open (SIM_OPEN_KIND kind, host_callback *cb,
}
static int
-d10v_reg_fetch (SIM_CPU *cpu, int rn, unsigned char *memory, int length)
+d10v_reg_fetch (SIM_CPU *cpu, int rn, void *memory, int length)
{
SIM_DESC sd = CPU_STATE (cpu);
int size;
}
static int
-d10v_reg_store (SIM_CPU *cpu, int rn, const unsigned char *memory, int length)
+d10v_reg_store (SIM_CPU *cpu, int rn, const void *memory, int length)
{
SIM_DESC sd = CPU_STATE (cpu);
int size;
}
int
-sim_store_register(SIM_DESC sd, int regno, const unsigned char *value, int length)
+sim_store_register(SIM_DESC sd, int regno, const void *buf, int length)
{
+ const unsigned char *value = buf;
int regval;
regval = (value[0] << 24) | (value[1] << 16)
int
-sim_fetch_register(SIM_DESC sd, int regno, unsigned char *buf, int length)
+sim_fetch_register(SIM_DESC sd, int regno, void *buf, int length)
{
get_regi(&sregs, regno, buf);
return -1;
/* The contents of BUF are in target byte order. */
int
-frvbf_fetch_register (SIM_CPU *current_cpu, int rn, unsigned char *buf, int len)
+frvbf_fetch_register (SIM_CPU *current_cpu, int rn, void *buf, int len)
{
if (SIM_FRV_GR0_REGNUM <= rn && rn <= SIM_FRV_GR63_REGNUM)
{
/* The contents of BUF are in target byte order. */
int
-frvbf_store_register (SIM_CPU *current_cpu, int rn, const unsigned char *buf, int len)
+frvbf_store_register (SIM_CPU *current_cpu, int rn, const void *buf, int len)
{
if (SIM_FRV_GR0_REGNUM <= rn && rn <= SIM_FRV_GR63_REGNUM)
{
static int
ft32_reg_store (SIM_CPU *cpu,
int rn,
- const unsigned char *memory,
+ const void *memory,
int length)
{
if (0 <= rn && rn <= 32)
static int
ft32_reg_fetch (SIM_CPU *cpu,
int rn,
- unsigned char *memory,
+ void *memory,
int length)
{
if (0 <= rn && rn <= 32)
}
static int
-h8300_reg_store (SIM_CPU *cpu, int rn, const unsigned char *value, int length)
+h8300_reg_store (SIM_CPU *cpu, int rn, const void *buf, int length)
{
+ const unsigned char *value = buf;
int longval;
int shortval;
int intval;
+
longval = (value[0] << 24) | (value[1] << 16) | (value[2] << 8) | value[3];
shortval = (value[0] << 8) | (value[1]);
intval = h8300hmode ? longval : shortval;
}
static int
-h8300_reg_fetch (SIM_CPU *cpu, int rn, unsigned char *buf, int length)
+h8300_reg_fetch (SIM_CPU *cpu, int rn, void *buf, int length)
{
+ unsigned char *value = buf;
int v;
int longreg = 0;
/* In Normal mode PC is 2 byte, but other registers are 4 byte */
if ((h8300hmode || longreg) && !(rn == PC_REGNUM && h8300_normal_mode))
{
- buf[0] = v >> 24;
- buf[1] = v >> 16;
- buf[2] = v >> 8;
- buf[3] = v >> 0;
+ value[0] = v >> 24;
+ value[1] = v >> 16;
+ value[2] = v >> 8;
+ value[3] = v >> 0;
return 4;
}
else
{
- buf[0] = v >> 8;
- buf[1] = v;
+ value[0] = v >> 8;
+ value[1] = v;
return 2;
}
}
}
int
-iq2000bf_fetch_register (SIM_CPU *cpu, int nr, unsigned char *buf, int len)
+iq2000bf_fetch_register (SIM_CPU *cpu, int nr, void *buf, int len)
{
if (nr >= GPR0_REGNUM
&& nr < (GPR0_REGNUM + NR_GPR)
}
int
-iq2000bf_store_register (SIM_CPU *cpu, int nr, const unsigned char *buf, int len)
+iq2000bf_store_register (SIM_CPU *cpu, int nr, const void *buf, int len)
{
if (nr >= GPR0_REGNUM
&& nr < (GPR0_REGNUM + NR_GPR)
/* The contents of BUF are in target byte order. */
int
-lm32bf_fetch_register (SIM_CPU * current_cpu, int rn, unsigned char *buf,
- int len)
+lm32bf_fetch_register (SIM_CPU * current_cpu, int rn, void *buf, int len)
{
if (rn < 32)
SETTSI (buf, lm32bf_h_gr_get (current_cpu, rn));
/* The contents of BUF are in target byte order. */
int
-lm32bf_store_register (SIM_CPU * current_cpu, int rn, const unsigned char *buf,
- int len)
+lm32bf_store_register (SIM_CPU * current_cpu, int rn, const void *buf, int len)
{
if (rn < 32)
lm32bf_h_gr_set (current_cpu, rn, GETTSI (buf));
}
int
-sim_fetch_register (SIM_DESC sd, int regno, unsigned char *buf, int length)
+sim_fetch_register (SIM_DESC sd, int regno, void *buf, int length)
{
size_t size;
}
int
-sim_store_register (SIM_DESC sd, int regno, const unsigned char *buf, int length)
+sim_store_register (SIM_DESC sd, int regno, const void *buf, int length)
{
size_t size;
/* The contents of BUF are in target byte order. */
int
-m32rbf_fetch_register (SIM_CPU *current_cpu, int rn, unsigned char *buf, int len)
+m32rbf_fetch_register (SIM_CPU *current_cpu, int rn, void *buf, int len)
{
int size = m32rbf_register_size (rn);
if (len != size)
/* The contents of BUF are in target byte order. */
int
-m32rbf_store_register (SIM_CPU *current_cpu, int rn, const unsigned char *buf, int len)
+m32rbf_store_register (SIM_CPU *current_cpu, int rn, const void *buf, int len)
{
int size = m32rbf_register_size (rn);
if (len != size)
/* The contents of BUF are in target byte order. */
int
-m32r2f_fetch_register (SIM_CPU *current_cpu, int rn, unsigned char *buf, int len)
+m32r2f_fetch_register (SIM_CPU *current_cpu, int rn, void *buf, int len)
{
return m32rbf_fetch_register (current_cpu, rn, buf, len);
}
/* The contents of BUF are in target byte order. */
int
-m32r2f_store_register (SIM_CPU *current_cpu, int rn, const unsigned char *buf, int len)
+m32r2f_store_register (SIM_CPU *current_cpu, int rn, const void *buf, int len)
{
return m32rbf_store_register (current_cpu, rn, buf, len);
}
/* The contents of BUF are in target byte order. */
int
-m32rxf_fetch_register (SIM_CPU *current_cpu, int rn, unsigned char *buf, int len)
+m32rxf_fetch_register (SIM_CPU *current_cpu, int rn, void *buf, int len)
{
return m32rbf_fetch_register (current_cpu, rn, buf, len);
}
/* The contents of BUF are in target byte order. */
int
-m32rxf_store_register (SIM_CPU *current_cpu, int rn, const unsigned char *buf, int len)
+m32rxf_store_register (SIM_CPU *current_cpu, int rn, const void *buf, int len)
{
return m32rbf_store_register (current_cpu, rn, buf, len);
}
cpu_set_pc (cpu, pc);
}
-static int m68hc11_reg_fetch (SIM_CPU *, int, unsigned char *, int);
-static int m68hc11_reg_store (SIM_CPU *, int, const unsigned char *, int);
+static int m68hc11_reg_fetch (SIM_CPU *, int, void *, int);
+static int m68hc11_reg_store (SIM_CPU *, int, const void *, int);
SIM_DESC
sim_open (SIM_OPEN_KIND kind, host_callback *callback,
}
static int
-m68hc11_reg_fetch (SIM_CPU *cpu, int rn, unsigned char *memory, int length)
+m68hc11_reg_fetch (SIM_CPU *cpu, int rn, void *buf, int length)
{
+ unsigned char *memory = buf;
uint16_t val;
int size = 2;
}
static int
-m68hc11_reg_store (SIM_CPU *cpu, int rn, const unsigned char *memory, int length)
+m68hc11_reg_store (SIM_CPU *cpu, int rn, const void *buf, int length)
{
+ const unsigned char *memory = buf;
uint16_t val;
val = *memory++;
}
static int
-mcore_reg_store (SIM_CPU *cpu, int rn, const unsigned char *memory, int length)
+mcore_reg_store (SIM_CPU *cpu, int rn, const void *memory, int length)
{
if (rn < NUM_MCORE_REGS && rn >= 0)
{
}
static int
-mcore_reg_fetch (SIM_CPU *cpu, int rn, unsigned char *memory, int length)
+mcore_reg_fetch (SIM_CPU *cpu, int rn, void *memory, int length)
{
if (rn < NUM_MCORE_REGS && rn >= 0)
{
}
static int
-microblaze_reg_store (SIM_CPU *cpu, int rn, const unsigned char *memory, int length)
+microblaze_reg_store (SIM_CPU *cpu, int rn, const void *memory, int length)
{
if (rn < NUM_REGS + NUM_SPECIAL && rn >= 0)
{
}
static int
-microblaze_reg_fetch (SIM_CPU *cpu, int rn, unsigned char *memory, int length)
+microblaze_reg_fetch (SIM_CPU *cpu, int rn, void *memory, int length)
{
long ival;
PC = pc;
}
-static int mips_reg_fetch (SIM_CPU *, int, unsigned char *, int);
-static int mips_reg_store (SIM_CPU *, int, const unsigned char *, int);
+static int mips_reg_fetch (SIM_CPU *, int, void *, int);
+static int mips_reg_store (SIM_CPU *, int, const void *, int);
SIM_DESC
sim_open (SIM_OPEN_KIND kind, host_callback *cb,
}
static int
-mips_reg_store (SIM_CPU *cpu, int rn, const unsigned char *memory, int length)
+mips_reg_store (SIM_CPU *cpu, int rn, const void *memory, int length)
{
/* NOTE: gdb (the client) stores registers in target byte order
while the simulator uses host byte order */
}
static int
-mips_reg_fetch (SIM_CPU *cpu, int rn, unsigned char *memory, int length)
+mips_reg_fetch (SIM_CPU *cpu, int rn, void *memory, int length)
{
/* NOTE: gdb (the client) stores registers in target byte order
while the simulator uses host byte order */
PC = pc;
}
-static int mn10300_reg_fetch (SIM_CPU *, int, unsigned char *, int);
-static int mn10300_reg_store (SIM_CPU *, int, const unsigned char *, int);
+static int mn10300_reg_fetch (SIM_CPU *, int, void *, int);
+static int mn10300_reg_store (SIM_CPU *, int, const void *, int);
/* These default values correspond to expected usage for the chip. */
but need to be changed to use the memory map. */
static int
-mn10300_reg_fetch (SIM_CPU *cpu, int rn, unsigned char *memory, int length)
+mn10300_reg_fetch (SIM_CPU *cpu, int rn, void *memory, int length)
{
reg_t reg = State.regs[rn];
uint8_t *a = memory;
}
static int
-mn10300_reg_store (SIM_CPU *cpu, int rn, const unsigned char *memory, int length)
+mn10300_reg_store (SIM_CPU *cpu, int rn, const void *memory, int length)
{
const uint8_t *a = memory;
State.regs[rn] = (a[3] << 24) + (a[2] << 16) + (a[1] << 8) + a[0];
}
static int
-moxie_reg_store (SIM_CPU *scpu, int rn, const unsigned char *memory, int length)
+moxie_reg_store (SIM_CPU *scpu, int rn, const void *memory, int length)
{
if (rn < NUM_MOXIE_REGS && rn >= 0)
{
}
static int
-moxie_reg_fetch (SIM_CPU *scpu, int rn, unsigned char *memory, int length)
+moxie_reg_fetch (SIM_CPU *scpu, int rn, void *memory, int length)
{
if (rn < NUM_MOXIE_REGS && rn >= 0)
{
}
static int
-msp430_reg_fetch (SIM_CPU *cpu, int regno, unsigned char *buf, int len)
+msp430_reg_fetch (SIM_CPU *cpu, int regno, void *buf, int len)
{
+ unsigned char *memory = buf;
+
if (0 <= regno && regno < 16)
{
if (len == 2)
{
int val = cpu->state.regs[regno];
- buf[0] = val & 0xff;
- buf[1] = (val >> 8) & 0xff;
+ memory[0] = val & 0xff;
+ memory[1] = (val >> 8) & 0xff;
return 0;
}
else if (len == 4)
{
int val = cpu->state.regs[regno];
- buf[0] = val & 0xff;
- buf[1] = (val >> 8) & 0xff;
- buf[2] = (val >> 16) & 0x0f; /* Registers are only 20 bits wide. */
- buf[3] = 0;
+ memory[0] = val & 0xff;
+ memory[1] = (val >> 8) & 0xff;
+ memory[2] = (val >> 16) & 0x0f; /* Registers are only 20 bits wide. */
+ memory[3] = 0;
return 0;
}
else
}
static int
-msp430_reg_store (SIM_CPU *cpu, int regno, const unsigned char *buf, int len)
+msp430_reg_store (SIM_CPU *cpu, int regno, const void *buf, int len)
{
+ const unsigned char *memory = buf;
+
if (0 <= regno && regno < 16)
{
if (len == 2)
{
- cpu->state.regs[regno] = (buf[1] << 8) | buf[0];
+ cpu->state.regs[regno] = (memory[1] << 8) | memory[0];
return len;
}
if (len == 4)
{
- cpu->state.regs[regno] = ((buf[2] << 16) & 0xf0000)
- | (buf[1] << 8) | buf[0];
+ cpu->state.regs[regno] = ((memory[2] << 16) & 0xf0000)
+ | (memory[1] << 8) | memory[0];
return len;
}
}
USI or1k32bf_mfspr (sim_cpu *current_cpu, USI addr);
void or1k32bf_mtspr (sim_cpu *current_cpu, USI addr, USI val);
-int or1k32bf_fetch_register (sim_cpu *current_cpu, int rn, unsigned char *buf,
+int or1k32bf_fetch_register (sim_cpu *current_cpu, int rn, void *buf, int len);
+int or1k32bf_store_register (sim_cpu *current_cpu, int rn, const void *buf,
int len);
-int or1k32bf_store_register (sim_cpu *current_cpu, int rn,
- const unsigned char *buf, int len);
int or1k32bf_model_or1200_u_exec (sim_cpu *current_cpu, const IDESC *idesc,
int unit_num, int referenced);
int or1k32bf_model_or1200nd_u_exec (sim_cpu *current_cpu, const IDESC *idesc,
#include <string.h>
int
-or1k32bf_fetch_register (sim_cpu *current_cpu, int rn, unsigned char *buf,
- int len)
+or1k32bf_fetch_register (sim_cpu *current_cpu, int rn, void *buf, int len)
{
if (rn < 32)
SETTWI (buf, GET_H_GPR (rn));
}
int
-or1k32bf_store_register (sim_cpu *current_cpu, int rn, const unsigned char *buf,
- int len)
+or1k32bf_store_register (sim_cpu *current_cpu, int rn, const void *buf, int len)
{
if (rn < 32)
SET_H_GPR (rn, GETTWI (buf));
int
-sim_fetch_register (SIM_DESC sd, int regno, unsigned char *buf, int length)
+sim_fetch_register (SIM_DESC sd, int regno, void *buf, int length)
{
const char *regname = regnum2name (regno);
int
-sim_store_register (SIM_DESC sd, int regno, const unsigned char *buf,
- int length)
+sim_store_register (SIM_DESC sd, int regno, const void *buf, int length)
{
const char *regname = regnum2name (regno);
/* Implement callback for standard CPU_REG_STORE routine. */
static int
-pru_store_register (SIM_CPU *cpu, int rn, const unsigned char *memory, int length)
+pru_store_register (SIM_CPU *cpu, int rn, const void *memory, int length)
{
if (rn < NUM_REGS && rn >= 0)
{
/* Implement callback for standard CPU_REG_FETCH routine. */
static int
-pru_fetch_register (SIM_CPU *cpu, int rn, unsigned char *memory, int length)
+pru_fetch_register (SIM_CPU *cpu, int rn, void *memory, int length)
{
long ival;
}
static int
-reg_fetch (sim_cpu *cpu, int rn, unsigned char *buf, int len)
+reg_fetch (sim_cpu *cpu, int rn, void *buf, int len)
{
if (len <= 0 || len > sizeof (unsigned_word))
return -1;
}
static int
-reg_store (sim_cpu *cpu, int rn, const unsigned char *buf, int len)
+reg_store (sim_cpu *cpu, int rn, const void *buf, int len)
{
if (len <= 0 || len > sizeof (unsigned_word))
return -1;
notion of the register's size. */
int
-sim_fetch_register (SIM_DESC sd, int regno, unsigned char *buf, int length)
+sim_fetch_register (SIM_DESC sd, int regno, void *buf, int length)
{
size_t size;
SI val;
LENGTH must match the sim's internal notion of the register size. */
int
-sim_store_register (SIM_DESC sd, int regno, const unsigned char *buf, int length)
+sim_store_register (SIM_DESC sd, int regno, const void *buf, int length)
{
size_t size;
SI val;
}
int
-sim_fetch_register (SIM_DESC sd, int regno, unsigned char *buf, int length)
+sim_fetch_register (SIM_DESC sd, int regno, void *buf, int length)
{
size_t size;
DI val;
}
int
-sim_store_register (SIM_DESC sd, int regno, const unsigned char *buf, int length)
+sim_store_register (SIM_DESC sd, int regno, const void *buf, int length)
{
size_t size;
DI val;
};
static int
-sh_reg_store (SIM_CPU *cpu, int rn, const unsigned char *memory, int length)
+sh_reg_store (SIM_CPU *cpu, int rn, const void *memory, int length)
{
unsigned val;
}
static int
-sh_reg_fetch (SIM_CPU *cpu, int rn, unsigned char *memory, int length)
+sh_reg_fetch (SIM_CPU *cpu, int rn, void *memory, int length)
{
int val;
PC = pc;
}
-static int v850_reg_fetch (SIM_CPU *, int, unsigned char *, int);
-static int v850_reg_store (SIM_CPU *, int, const unsigned char *, int);
+static int v850_reg_fetch (SIM_CPU *, int, void *, int);
+static int v850_reg_store (SIM_CPU *, int, const void *, int);
SIM_DESC
sim_open (SIM_OPEN_KIND kind,
}
static int
-v850_reg_fetch (SIM_CPU *cpu, int rn, unsigned char *memory, int length)
+v850_reg_fetch (SIM_CPU *cpu, int rn, void *memory, int length)
{
*(uint32_t*)memory = H2T_4 (State.regs[rn]);
return -1;
}
static int
-v850_reg_store (SIM_CPU *cpu, int rn, const unsigned char *memory, int length)
+v850_reg_store (SIM_CPU *cpu, int rn, const void *memory, int length)
{
State.regs[rn] = T2H_4 (*(uint32_t *) memory);
return length;