Skip to content

Commit

Permalink
target-rl78: Reset GPR area
Browse files Browse the repository at this point in the history
This is not in the manual, but all registers in CPUState are cleared
implicitly.

Signed-off-by: Andreas Färber <andreas.faerber@web.de>
  • Loading branch information
afaerber committed Dec 24, 2013
1 parent bac1699 commit 589e151
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions target-78k0/cpu.c
Expand Up @@ -32,12 +32,16 @@ static void rl78_cpu_reset(CPUState *cs)
RL78CPUClass *rcc = RL78_CPU_GET_CLASS(cs);
uint8_t *rom;
uint16_t reset_vector;
hwaddr addr;

rcc->parent_reset(cs);

tlb_flush(&cpu->env, 1);

memset(&cpu->env, 0, offsetof(CPU78K0State, breakpoints));
for (addr = 0xffee0; addr < 0xfff00; addr += 2) {
stw_phys(addr, 0);
}
#ifdef TARGET_RL78
cpu->env.psw = 0x06;
cpu->env.es = 0x0f;
Expand Down

0 comments on commit 589e151

Please sign in to comment.