thermosphere: interrupt mask guard

This commit is contained in:
TuxSH
2020-02-11 21:41:14 +00:00
parent dd9b3ddb0d
commit c99a77a0c3
3 changed files with 63 additions and 34 deletions

View File

@@ -18,7 +18,6 @@
#include "hvisor_gicv2.hpp"
#include "hvisor_synchronization.hpp"
#include "cpu/hvisor_cpu_sysreg_general.hpp"
#include "memory_map.h"
#include "exceptions.h" // TODO
@@ -93,25 +92,6 @@ namespace ams::hvisor {
gicd->sgir = GicV2Distributor::ForwardToAllOthers << 24 | id;
}
static u64 MaskIrq()
{
u64 daif = THERMOSPHERE_GET_SYSREG(daif);
THERMOSPHERE_SET_SYSREG_IMM(daifset, BIT(1));
return daif;
}
static u64 UnmaskIrq()
{
u64 daif = THERMOSPHERE_GET_SYSREG(daif);
THERMOSPHERE_SET_SYSREG_IMM(daifclr, BIT(1));
return daif;
}
static void RestoreInterruptFlags(u64 flags)
{
THERMOSPHERE_SET_SYSREG(daif, flags);
}
static IrqManager &GetInstance() { return instance; }
static void HandleInterrupt(ExceptionStackFrame *frame);