cpu/arm: fix MSR by changing modes
Signed-off-by: Amneesh Singh <natto@weirdnatto.in>
This commit is contained in:
@@ -283,7 +283,7 @@ Instruction::exec(Cpu& cpu) {
|
|||||||
|
|
||||||
uint32_t address = cpu.gpr[data.rn];
|
uint32_t address = cpu.gpr[data.rn];
|
||||||
Mode mode = cpu.cpsr.mode();
|
Mode mode = cpu.cpsr.mode();
|
||||||
int8_t i = 0;
|
int8_t i = 0;
|
||||||
|
|
||||||
pc_error(data.rn);
|
pc_error(data.rn);
|
||||||
|
|
||||||
@@ -377,6 +377,11 @@ Instruction::exec(Cpu& cpu) {
|
|||||||
pc_error(data.operand);
|
pc_error(data.operand);
|
||||||
|
|
||||||
if (cpu.cpsr.mode() != Mode::User) {
|
if (cpu.cpsr.mode() != Mode::User) {
|
||||||
|
if (!data.spsr) {
|
||||||
|
Psr tmp = Psr(cpu.gpr[data.operand]);
|
||||||
|
cpu.chg_mode(tmp.mode());
|
||||||
|
}
|
||||||
|
|
||||||
psr.set_all(cpu.gpr[data.operand]);
|
psr.set_all(cpu.gpr[data.operand]);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
Reference in New Issue
Block a user