mirror of
https://github.com/yuzu-emu/unicorn.git
synced 2024-12-23 14:15:39 +00:00
armv7m: R14 should reset to 0xffffffff
For M profile (unlike A profile) the reset value of R14 is specified as 0xffffffff. (The rationale is that this is an illegal exception return value, so if guest code tries to return to it it will result in a helpful exception.) Registers r0 to r12 and the flags are architecturally UNKNOWN on reset, so we leave those at zero. Backports commit 056f43df9168413f304500b69c33158d66efb7cf from qemu
This commit is contained in:
parent
f42f22ec02
commit
bb5819cbbc
|
@ -192,6 +192,9 @@ static void arm_cpu_reset(CPUState *s)
|
|||
* it dependent on CPU model.
|
||||
*/
|
||||
env->v7m.ccr = R_V7M_CCR_STKALIGN_MASK;
|
||||
|
||||
/* Unlike A/R profile, M profile defines the reset LR value */
|
||||
env->regs[14] = 0xffffffff;
|
||||
#if 0
|
||||
/* Load the initial SP and PC from the vector table at address 0 */
|
||||
uint8_t *rom;
|
||||
|
|
Loading…
Reference in a new issue