thermosphere: sw breakpoint code, etc.

This commit is contained in:
TuxSH
2019-08-08 21:38:13 +02:00
parent f8266775f6
commit 6289d2e398
12 changed files with 403 additions and 28 deletions

View File

@@ -18,6 +18,7 @@
#include "sysreg.h"
#include "arm.h"
#include "debug_log.h"
#include "software_breakpoints.h"
static void doSystemRegisterRwImpl(u64 *val, u32 iss)
{
@@ -67,13 +68,32 @@ void doSystemRegisterWrite(ExceptionStackFrame *frame, u32 iss, u32 reg)
val = frame->x[reg];
bool reevalSoftwareBreakpoints = false;
// Hooks go here:
switch (iss) {
case ENCODE_SYSREG_ISS(TTBR0_EL1):
case ENCODE_SYSREG_ISS(TTBR1_EL1):
case ENCODE_SYSREG_ISS(TCR_EL1):
case ENCODE_SYSREG_ISS(SCTLR_EL1):
reevalSoftwareBreakpoints = true;
break;
default:
break;
}
if (reevalSoftwareBreakpoints) {
revertAllSoftwareBreakpoints();
}
doSystemRegisterRwImpl(&val, iss);
if (reevalSoftwareBreakpoints) {
__dsb_sy();
__isb();
applyAllSoftwareBreakpoints();
}
skipFaultingInstruction(frame, 4);
}