sim: h8300: inline sim_state_initialize
All the state is handled already by the common cpu allocation which zeros out the entire state.
This commit is contained in:
parent
2a2757ac7e
commit
cec99e6b2c
2 changed files with 7 additions and 27 deletions
|
@ -1,3 +1,9 @@
|
||||||
|
2015-12-30 Mike Frysinger <vapier@gentoo.org>
|
||||||
|
|
||||||
|
* compile.c (sim_state_initialize): Delete.
|
||||||
|
(sim_open): Replace sim_state_initialize call with SBR_REGNUM
|
||||||
|
assignment.
|
||||||
|
|
||||||
2015-12-30 Mike Frysinger <vapier@gentoo.org>
|
2015-12-30 Mike Frysinger <vapier@gentoo.org>
|
||||||
|
|
||||||
* compile.c (h8300_reg_store): Delete sd. Change init_pointers to
|
* compile.c (h8300_reg_store): Delete sd. Change init_pointers to
|
||||||
|
|
|
@ -58,32 +58,6 @@ static void set_simcache_size (SIM_DESC, int);
|
||||||
|
|
||||||
/* CPU data object: */
|
/* CPU data object: */
|
||||||
|
|
||||||
static int
|
|
||||||
sim_state_initialize (SIM_DESC sd, sim_cpu *cpu)
|
|
||||||
{
|
|
||||||
/* FIXME: not really necessary, since sim_cpu_alloc calls zalloc. */
|
|
||||||
|
|
||||||
memset (&cpu->regs, 0, sizeof(cpu->regs));
|
|
||||||
cpu->regs[SBR_REGNUM] = 0xFFFFFF00;
|
|
||||||
cpu->pc = 0;
|
|
||||||
cpu->delayed_branch = 0;
|
|
||||||
cpu->memory = NULL;
|
|
||||||
cpu->eightbit = NULL;
|
|
||||||
cpu->mask = 0;
|
|
||||||
|
|
||||||
/* Initialize local simulator state. */
|
|
||||||
sd->sim_cache = NULL;
|
|
||||||
sd->sim_cache_size = 0;
|
|
||||||
sd->cache_idx = NULL;
|
|
||||||
sd->cache_top = 0;
|
|
||||||
sd->memory_size = 0;
|
|
||||||
sd->compiles = 0;
|
|
||||||
#ifdef ADEBUG
|
|
||||||
memset (&cpu->stats, 0, sizeof (cpu->stats));
|
|
||||||
#endif
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
static unsigned int
|
static unsigned int
|
||||||
h8_get_pc (SIM_DESC sd)
|
h8_get_pc (SIM_DESC sd)
|
||||||
{
|
{
|
||||||
|
@ -4869,7 +4843,7 @@ sim_open (SIM_OPEN_KIND kind,
|
||||||
|
|
||||||
cpu = STATE_CPU (sd, 0);
|
cpu = STATE_CPU (sd, 0);
|
||||||
SIM_ASSERT (STATE_MAGIC (sd) == SIM_MAGIC_NUMBER);
|
SIM_ASSERT (STATE_MAGIC (sd) == SIM_MAGIC_NUMBER);
|
||||||
sim_state_initialize (sd, cpu);
|
cpu->regs[SBR_REGNUM] = 0xFFFFFF00;
|
||||||
/* sim_cpu object is new, so some initialization is needed. */
|
/* sim_cpu object is new, so some initialization is needed. */
|
||||||
init_pointers_needed = 1;
|
init_pointers_needed = 1;
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue