thermosphere: rewrite sysreg trapping code, add skeleton code for timer val trap handling; support A32 EL1 once again

This commit is contained in:
TuxSH
2020-01-07 02:17:05 +00:00
parent a67d682c10
commit 2f999497df
9 changed files with 217 additions and 74 deletions

View File

@@ -17,7 +17,7 @@
#include "traps.h"
#include "sysreg.h"
static void enableDebugTraps(void)
static inline void enableDebugTraps(void)
{
u64 mdcr = GET_SYSREG(mdcr_el2);
@@ -30,6 +30,13 @@ static void enableDebugTraps(void)
SET_SYSREG(mdcr_el2, mdcr);
}
static inline void enableTimerTraps(void)
{
// Disable event streams, trap everything
u64 cnthctl = 0;
SET_SYSREG(cnthctl_el2, cnthctl);
}
void enableTraps(void)
{
u64 hcr = GET_SYSREG(hcr_el2);
@@ -46,4 +53,5 @@ void enableTraps(void)
SET_SYSREG(hcr_el2, hcr);
enableDebugTraps();
enableTimerTraps();
}