diff options
author | Fernando Sahmkow <fsahmkow27@gmail.com> | 2019-06-07 20:41:06 -0400 |
---|---|---|
committer | FernandoS27 <fsahmkow27@gmail.com> | 2019-07-05 15:49:14 -0400 |
commit | 8942047d419f6d2d0c56adad689fbf3bcd4d2961 (patch) | |
tree | aa2dd5b6aeef25c9fd5543a2a4ef267a7152b052 /src/core/hardware_interrupt_manager.cpp | |
parent | e0027eba854b9cf097360e898457e164e6ae0b4d (diff) |
Gpu: Implement Hardware Interrupt Manager and manage GPU interrupts
Diffstat (limited to 'src/core/hardware_interrupt_manager.cpp')
-rw-r--r-- | src/core/hardware_interrupt_manager.cpp | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/src/core/hardware_interrupt_manager.cpp b/src/core/hardware_interrupt_manager.cpp new file mode 100644 index 0000000000..463d2916c5 --- /dev/null +++ b/src/core/hardware_interrupt_manager.cpp @@ -0,0 +1,21 @@ + +#include "core/core.h" +#include "core/hardware_interrupt_manager.h" +#include "core/hle/service/nvdrv/interface.h" +#include "core/hle/service/sm/sm.h" + +namespace Core::Hardware { + +InterruptManager::InterruptManager(Core::System& system_in) : system(system_in) { + gpu_interrupt_event = + system.CoreTiming().RegisterEvent("GPUInterrupt", [this](u64 event_index, s64) { + auto nvdrv = system.ServiceManager().GetService<Service::Nvidia::NVDRV>("nvdrv"); + nvdrv->SignalGPUInterrupt(static_cast<u32>(event_index)); + }); +} + +void InterruptManager::InterruptGPU(const u32 event_index) { + system.CoreTiming().ScheduleEvent(10, gpu_interrupt_event, static_cast<u64>(event_index)); +} + +} // namespace Core::Hardware |