2020-02-25 02:04:12 +00:00
|
|
|
// Copyright 2020 yuzu emulator team
|
|
|
|
// Licensed under GPLv2 or any later version
|
|
|
|
// Refer to the license.txt file included.
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <memory>
|
|
|
|
|
|
|
|
namespace Common {
|
|
|
|
class Event;
|
|
|
|
}
|
|
|
|
|
|
|
|
namespace Core {
|
|
|
|
|
|
|
|
class CPUInterruptHandler {
|
|
|
|
public:
|
|
|
|
CPUInterruptHandler();
|
|
|
|
~CPUInterruptHandler();
|
|
|
|
|
|
|
|
CPUInterruptHandler(const CPUInterruptHandler&) = delete;
|
|
|
|
CPUInterruptHandler& operator=(const CPUInterruptHandler&) = delete;
|
|
|
|
|
|
|
|
CPUInterruptHandler(CPUInterruptHandler&&) = default;
|
|
|
|
CPUInterruptHandler& operator=(CPUInterruptHandler&&) = default;
|
|
|
|
|
2020-06-27 22:20:06 +00:00
|
|
|
bool IsInterrupted() const {
|
2020-02-25 02:04:12 +00:00
|
|
|
return is_interrupted;
|
|
|
|
}
|
|
|
|
|
|
|
|
void SetInterrupt(bool is_interrupted);
|
|
|
|
|
|
|
|
void AwaitInterrupt();
|
|
|
|
|
|
|
|
private:
|
|
|
|
bool is_interrupted{};
|
|
|
|
std::unique_ptr<Common::Event> interrupt_event;
|
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace Core
|