forked from Imagelibrary/binutils-gdb
sim: mcore: switch to common sim-reg
This is not entirely useful as mcore doesn't (yet) store its register state in the cpu state, but it does allow for switching to the common code for these functions.
This commit is contained in:
@@ -1285,8 +1285,8 @@ sim_engine_run (SIM_DESC sd,
|
||||
}
|
||||
}
|
||||
|
||||
int
|
||||
sim_store_register (SIM_DESC sd, int rn, unsigned char *memory, int length)
|
||||
static int
|
||||
mcore_reg_store (SIM_CPU *scpu, int rn, unsigned char *memory, int length)
|
||||
{
|
||||
if (rn < NUM_MCORE_REGS && rn >= 0)
|
||||
{
|
||||
@@ -1305,8 +1305,8 @@ sim_store_register (SIM_DESC sd, int rn, unsigned char *memory, int length)
|
||||
return 0;
|
||||
}
|
||||
|
||||
int
|
||||
sim_fetch_register (SIM_DESC sd, int rn, unsigned char *memory, int length)
|
||||
static int
|
||||
mcore_reg_fetch (SIM_CPU *scpu, int rn, unsigned char *memory, int length)
|
||||
{
|
||||
if (rn < NUM_MCORE_REGS && rn >= 0)
|
||||
{
|
||||
@@ -1447,6 +1447,8 @@ sim_open (SIM_OPEN_KIND kind, host_callback *cb, struct bfd *abfd, char **argv)
|
||||
{
|
||||
SIM_CPU *cpu = STATE_CPU (sd, i);
|
||||
|
||||
CPU_REG_FETCH (cpu) = mcore_reg_fetch;
|
||||
CPU_REG_STORE (cpu) = mcore_reg_store;
|
||||
CPU_PC_FETCH (cpu) = mcore_pc_get;
|
||||
CPU_PC_STORE (cpu) = mcore_pc_set;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user