thermosphere: sw breakpoint code, etc.
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user