diff options
| author | 2020-02-29 13:58:50 -0400 | |
|---|---|---|
| committer | 2020-06-27 11:35:56 -0400 | |
| commit | 1b82ccec2220a69711ba75cf51ee98cbcfe6a510 (patch) | |
| tree | 281ad19080ec4e6e14caa50b073acdfac005212b /src/core/arm/unicorn | |
| parent | X64 Clock: Reduce accuracy to be less or equal to guest accuracy. (diff) | |
| download | yuzu-1b82ccec2220a69711ba75cf51ee98cbcfe6a510.tar.gz yuzu-1b82ccec2220a69711ba75cf51ee98cbcfe6a510.tar.xz yuzu-1b82ccec2220a69711ba75cf51ee98cbcfe6a510.zip | |
Core: Refactor ARM Interface.
Diffstat (limited to 'src/core/arm/unicorn')
| -rw-r--r-- | src/core/arm/unicorn/arm_unicorn.cpp | 7 | ||||
| -rw-r--r-- | src/core/arm/unicorn/arm_unicorn.h | 5 |
2 files changed, 7 insertions, 5 deletions
diff --git a/src/core/arm/unicorn/arm_unicorn.cpp b/src/core/arm/unicorn/arm_unicorn.cpp index 0393fe641..d81d1b5b0 100644 --- a/src/core/arm/unicorn/arm_unicorn.cpp +++ b/src/core/arm/unicorn/arm_unicorn.cpp | |||
| @@ -63,8 +63,9 @@ static bool UnmappedMemoryHook(uc_engine* uc, uc_mem_type type, u64 addr, int si | |||
| 63 | return false; | 63 | return false; |
| 64 | } | 64 | } |
| 65 | 65 | ||
| 66 | ARM_Unicorn::ARM_Unicorn(System& system, CPUInterruptHandler& interrupt_handler, Arch architecture) | 66 | ARM_Unicorn::ARM_Unicorn(System& system, CPUInterruptHandler& interrupt_handler, Arch architecture, |
| 67 | : ARM_Interface{system, interrupt_handler} { | 67 | std::size_t core_index) |
| 68 | : ARM_Interface{system, interrupt_handler}, core_index{core_index} { | ||
| 68 | const auto arch = architecture == Arch::AArch32 ? UC_ARCH_ARM : UC_ARCH_ARM64; | 69 | const auto arch = architecture == Arch::AArch32 ? UC_ARCH_ARM : UC_ARCH_ARM64; |
| 69 | CHECKED(uc_open(arch, UC_MODE_ARM, &uc)); | 70 | CHECKED(uc_open(arch, UC_MODE_ARM, &uc)); |
| 70 | 71 | ||
| @@ -163,7 +164,7 @@ void ARM_Unicorn::Run() { | |||
| 163 | ExecuteInstructions(std::max(4000000U, 0U)); | 164 | ExecuteInstructions(std::max(4000000U, 0U)); |
| 164 | } else { | 165 | } else { |
| 165 | while (true) { | 166 | while (true) { |
| 166 | if (interrupt_handler.IsInterrupted()) { | 167 | if (interrupt_handlers[core_index].IsInterrupted()) { |
| 167 | return; | 168 | return; |
| 168 | } | 169 | } |
| 169 | ExecuteInstructions(10); | 170 | ExecuteInstructions(10); |
diff --git a/src/core/arm/unicorn/arm_unicorn.h b/src/core/arm/unicorn/arm_unicorn.h index 0a4c087cd..e3da368de 100644 --- a/src/core/arm/unicorn/arm_unicorn.h +++ b/src/core/arm/unicorn/arm_unicorn.h | |||
| @@ -11,7 +11,6 @@ | |||
| 11 | 11 | ||
| 12 | namespace Core { | 12 | namespace Core { |
| 13 | 13 | ||
| 14 | class CPUInterruptHandler; | ||
| 15 | class System; | 14 | class System; |
| 16 | 15 | ||
| 17 | class ARM_Unicorn final : public ARM_Interface { | 16 | class ARM_Unicorn final : public ARM_Interface { |
| @@ -21,7 +20,8 @@ public: | |||
| 21 | AArch64, // 64-bit ARM | 20 | AArch64, // 64-bit ARM |
| 22 | }; | 21 | }; |
| 23 | 22 | ||
| 24 | explicit ARM_Unicorn(System& system, CPUInterruptHandler& interrupt_handler, Arch architecture); | 23 | explicit ARM_Unicorn(System& system, CPUInterruptHandler& interrupt_handler, Arch architecture, |
| 24 | std::size_t core_index); | ||
| 25 | ~ARM_Unicorn() override; | 25 | ~ARM_Unicorn() override; |
| 26 | 26 | ||
| 27 | void SetPC(u64 pc) override; | 27 | void SetPC(u64 pc) override; |
| @@ -56,6 +56,7 @@ private: | |||
| 56 | uc_engine* uc{}; | 56 | uc_engine* uc{}; |
| 57 | GDBStub::BreakpointAddress last_bkpt{}; | 57 | GDBStub::BreakpointAddress last_bkpt{}; |
| 58 | bool last_bkpt_hit = false; | 58 | bool last_bkpt_hit = false; |
| 59 | std::size_t core_index; | ||
| 59 | }; | 60 | }; |
| 60 | 61 | ||
| 61 | } // namespace Core | 62 | } // namespace Core |