fix(v5te): account for high vectors in swi
This commit is contained in:
parent
8d2a3f1b67
commit
dcff3fd588
|
@ -14,7 +14,13 @@ pub fn armSoftwareInterrupt(comptime InstrFn: type) InstrFn {
|
||||||
|
|
||||||
cpu.r[14] = ret_addr; // Resume Execution
|
cpu.r[14] = ret_addr; // Resume Execution
|
||||||
cpu.spsr.raw = cpsr; // Previous mode CPSR
|
cpu.spsr.raw = cpsr; // Previous mode CPSR
|
||||||
cpu.r[15] = 0x0000_0008;
|
cpu.r[15] = switch (Arm32.arch) {
|
||||||
|
.v4t => 0x0000_0008,
|
||||||
|
.v5te => blk: {
|
||||||
|
const ctrl = cpu.cp15.read(0, 1, 0, 0);
|
||||||
|
break :blk if (ctrl >> 13 & 1 == 1) 0xFFFF_0008 else 0x0000_0008;
|
||||||
|
},
|
||||||
|
};
|
||||||
cpu.pipe.reload(cpu);
|
cpu.pipe.reload(cpu);
|
||||||
}
|
}
|
||||||
}.inner;
|
}.inner;
|
||||||
|
|
|
@ -14,7 +14,13 @@ pub fn fmt17(comptime InstrFn: type) InstrFn {
|
||||||
|
|
||||||
cpu.r[14] = ret_addr; // Resume Execution
|
cpu.r[14] = ret_addr; // Resume Execution
|
||||||
cpu.spsr.raw = cpsr; // Previous mode CPSR
|
cpu.spsr.raw = cpsr; // Previous mode CPSR
|
||||||
cpu.r[15] = 0x0000_0008;
|
cpu.r[15] = switch (Arm32.arch) {
|
||||||
|
.v4t => 0x0000_0008,
|
||||||
|
.v5te => blk: {
|
||||||
|
const ctrl = cpu.cp15.read(0, 1, 0, 0);
|
||||||
|
break :blk if (ctrl >> 13 & 1 == 1) 0xFFFF_0008 else 0x0000_0008;
|
||||||
|
},
|
||||||
|
};
|
||||||
cpu.pipe.reload(cpu);
|
cpu.pipe.reload(cpu);
|
||||||
}
|
}
|
||||||
}.inner;
|
}.inner;
|
||||||
|
|
Loading…
Reference in New Issue