Core: Refactor ARM Interface.

This commit is contained in:
Fernando Sahmkow 2020-02-29 13:58:50 -04:00
parent 534466754f
commit 1b82ccec22
10 changed files with 69 additions and 42 deletions

View file

@ -76,7 +76,7 @@ public:
}
u64 GetTicksRemaining() override {
if (!parent.interrupt_handler.IsInterrupted()) {
if (!parent.interrupt_handlers[parent.core_index].IsInterrupted()) {
return std::max<s64>(ticks, 0);
}
return 0ULL;
@ -111,9 +111,9 @@ void ARM_Dynarmic_32::Step() {
jit->Step();
}
ARM_Dynarmic_32::ARM_Dynarmic_32(System& system, CPUInterruptHandler& interrupt_handler,
ARM_Dynarmic_32::ARM_Dynarmic_32(System& system, CPUInterrupts& interrupt_handlers,
ExclusiveMonitor& exclusive_monitor, std::size_t core_index)
: ARM_Interface{system, interrupt_handler}, cb(std::make_unique<DynarmicCallbacks32>(*this)),
: ARM_Interface{system, interrupt_handlers}, cb(std::make_unique<DynarmicCallbacks32>(*this)),
cp15(std::make_shared<DynarmicCP15>(*this)), core_index{core_index},
exclusive_monitor{dynamic_cast<DynarmicExclusiveMonitor&>(exclusive_monitor)} {}

View file

@ -29,7 +29,7 @@ class System;
class ARM_Dynarmic_32 final : public ARM_Interface {
public:
ARM_Dynarmic_32(System& system, CPUInterruptHandler& interrupt_handler,
ARM_Dynarmic_32(System& system, CPUInterrupts& interrupt_handlers,
ExclusiveMonitor& exclusive_monitor, std::size_t core_index);
~ARM_Dynarmic_32() override;

View file

@ -128,7 +128,7 @@ public:
}
u64 GetTicksRemaining() override {
if (!parent.interrupt_handler.IsInterrupted()) {
if (!parent.interrupt_handlers[parent.core_index].IsInterrupted()) {
return std::max<s64>(ticks, 0);
}
return 0ULL;
@ -199,11 +199,14 @@ void ARM_Dynarmic_64::Step() {
cb->InterpreterFallback(jit->GetPC(), 1);
}
ARM_Dynarmic_64::ARM_Dynarmic_64(System& system, CPUInterruptHandler& interrupt_handler,
ARM_Dynarmic_64::ARM_Dynarmic_64(System& system, CPUInterrupts& interrupt_handlers,
ExclusiveMonitor& exclusive_monitor, std::size_t core_index)
: ARM_Interface{system, interrupt_handler}, cb(std::make_unique<DynarmicCallbacks64>(*this)),
inner_unicorn{system, interrupt_handler, ARM_Unicorn::Arch::AArch64}, core_index{core_index},
exclusive_monitor{dynamic_cast<DynarmicExclusiveMonitor&>(exclusive_monitor)} {}
: ARM_Interface{system, interrupt_handler},
cb(std::make_unique<DynarmicCallbacks64>(*this)), inner_unicorn{system, interrupt_handler,
ARM_Unicorn::Arch::AArch64,
core_index},
core_index{core_index}, exclusive_monitor{
dynamic_cast<DynarmicExclusiveMonitor&>(exclusive_monitor)} {}
ARM_Dynarmic_64::~ARM_Dynarmic_64() = default;

View file

@ -28,7 +28,7 @@ class System;
class ARM_Dynarmic_64 final : public ARM_Interface {
public:
ARM_Dynarmic_64(System& system, CPUInterruptHandler& interrupt_handler,
ARM_Dynarmic_64(System& system, CPUInterrupts& interrupt_handlers,
ExclusiveMonitor& exclusive_monitor, std::size_t core_index);
~ARM_Dynarmic_64() override;