thermosphere: move EnterInterruptibleHypervisorCode into IrqManager

This commit is contained in:
TuxSH 2020-02-23 00:27:54 +00:00
parent 4adb675072
commit 5b56d05e11
4 changed files with 10 additions and 4 deletions

View file

@ -233,7 +233,7 @@ namespace ams::hvisor {
if (taskForBottomHalf != nullptr) { if (taskForBottomHalf != nullptr) {
// Unmasking the irq signal is left at the discretion of the bottom half handler // Unmasking the irq signal is left at the discretion of the bottom half handler
exceptionEnterInterruptibleHypervisorCode(); EnterInterruptibleHypervisorCode();
taskForBottomHalf->InterruptBottomHalfHandler(irqId, srcCore); taskForBottomHalf->InterruptBottomHalfHandler(irqId, srcCore);
} }
} }

View file

@ -19,11 +19,11 @@
#include "hvisor_gicv2.hpp" #include "hvisor_gicv2.hpp"
#include "hvisor_synchronization.hpp" #include "hvisor_synchronization.hpp"
#include "hvisor_i_interrupt_task.hpp" #include "hvisor_i_interrupt_task.hpp"
#include "hvisor_exception_stack_frame.hpp"
#include "cpu/hvisor_cpu_sysreg_general.hpp"
#include "memory_map.h" #include "memory_map.h"
#include "exceptions.h" // TODO
namespace ams::hvisor { namespace ams::hvisor {
class IrqManager final { class IrqManager final {
@ -106,6 +106,13 @@ namespace ams::hvisor {
gicd->sgir = GicV2Distributor::ForwardToAllOthers << 24 | id; gicd->sgir = GicV2Distributor::ForwardToAllOthers << 24 | id;
} }
static void EnterInterruptibleHypervisorCode()
{
// We don't want the guest to spam us with its timer interrupts. Disable the timers.
THERMOSPHERE_SET_SYSREG(cntp_ctl_el0, 0);
THERMOSPHERE_SET_SYSREG(cntv_ctl_el0, 0);
}
static void HandleInterrupt(ExceptionStackFrame *frame); static void HandleInterrupt(ExceptionStackFrame *frame);
public: public:

View file

@ -17,7 +17,6 @@
#pragma once #pragma once
#include "defines.hpp" #include "defines.hpp"
#include "exceptions.h"
#include "cpu/hvisor_cpu_exception_sysregs.hpp" #include "cpu/hvisor_cpu_exception_sysregs.hpp"
#include "hvisor_irq_manager.hpp" #include "hvisor_irq_manager.hpp"
#include "memory_map.h" #include "memory_map.h"