diff options
| author | 2018-10-16 11:21:42 -0400 | |
|---|---|---|
| committer | 2018-10-16 11:21:42 -0400 | |
| commit | 88b8383da28f05b2a30ba853b0578fe625f7dba6 (patch) | |
| tree | f9224c0af9d0ddcc1e2496b638a6108077fcd198 /src/core/arm | |
| parent | Merge pull request #1508 from lioncash/unique-reg (diff) | |
| parent | core_cpu: Make Cpu scheduler instances unique_ptrs instead of shared_ptrs (diff) | |
| download | yuzu-88b8383da28f05b2a30ba853b0578fe625f7dba6.tar.gz yuzu-88b8383da28f05b2a30ba853b0578fe625f7dba6.tar.xz yuzu-88b8383da28f05b2a30ba853b0578fe625f7dba6.zip | |
Merge pull request #1502 from lioncash/unique
core: Convert shared_ptr instances into unique_ptr instances where applicable for System and Cpu
Diffstat (limited to 'src/core/arm')
| -rw-r--r-- | src/core/arm/dynarmic/arm_dynarmic.cpp | 7 | ||||
| -rw-r--r-- | src/core/arm/dynarmic/arm_dynarmic.h | 4 |
2 files changed, 5 insertions, 6 deletions
diff --git a/src/core/arm/dynarmic/arm_dynarmic.cpp b/src/core/arm/dynarmic/arm_dynarmic.cpp index 0762321a9..4d2491870 100644 --- a/src/core/arm/dynarmic/arm_dynarmic.cpp +++ b/src/core/arm/dynarmic/arm_dynarmic.cpp | |||
| @@ -144,7 +144,7 @@ std::unique_ptr<Dynarmic::A64::Jit> ARM_Dynarmic::MakeJit() const { | |||
| 144 | 144 | ||
| 145 | // Multi-process state | 145 | // Multi-process state |
| 146 | config.processor_id = core_index; | 146 | config.processor_id = core_index; |
| 147 | config.global_monitor = &exclusive_monitor->monitor; | 147 | config.global_monitor = &exclusive_monitor.monitor; |
| 148 | 148 | ||
| 149 | // System registers | 149 | // System registers |
| 150 | config.tpidrro_el0 = &cb->tpidrro_el0; | 150 | config.tpidrro_el0 = &cb->tpidrro_el0; |
| @@ -171,10 +171,9 @@ void ARM_Dynarmic::Step() { | |||
| 171 | cb->InterpreterFallback(jit->GetPC(), 1); | 171 | cb->InterpreterFallback(jit->GetPC(), 1); |
| 172 | } | 172 | } |
| 173 | 173 | ||
| 174 | ARM_Dynarmic::ARM_Dynarmic(std::shared_ptr<ExclusiveMonitor> exclusive_monitor, | 174 | ARM_Dynarmic::ARM_Dynarmic(ExclusiveMonitor& exclusive_monitor, std::size_t core_index) |
| 175 | std::size_t core_index) | ||
| 176 | : cb(std::make_unique<ARM_Dynarmic_Callbacks>(*this)), core_index{core_index}, | 175 | : cb(std::make_unique<ARM_Dynarmic_Callbacks>(*this)), core_index{core_index}, |
| 177 | exclusive_monitor{std::dynamic_pointer_cast<DynarmicExclusiveMonitor>(exclusive_monitor)} { | 176 | exclusive_monitor{dynamic_cast<DynarmicExclusiveMonitor&>(exclusive_monitor)} { |
| 178 | ThreadContext ctx{}; | 177 | ThreadContext ctx{}; |
| 179 | inner_unicorn.SaveContext(ctx); | 178 | inner_unicorn.SaveContext(ctx); |
| 180 | PageTableChanged(); | 179 | PageTableChanged(); |
diff --git a/src/core/arm/dynarmic/arm_dynarmic.h b/src/core/arm/dynarmic/arm_dynarmic.h index 4ee92ee27..512bf8ce9 100644 --- a/src/core/arm/dynarmic/arm_dynarmic.h +++ b/src/core/arm/dynarmic/arm_dynarmic.h | |||
| @@ -23,7 +23,7 @@ class DynarmicExclusiveMonitor; | |||
| 23 | 23 | ||
| 24 | class ARM_Dynarmic final : public ARM_Interface { | 24 | class ARM_Dynarmic final : public ARM_Interface { |
| 25 | public: | 25 | public: |
| 26 | ARM_Dynarmic(std::shared_ptr<ExclusiveMonitor> exclusive_monitor, std::size_t core_index); | 26 | ARM_Dynarmic(ExclusiveMonitor& exclusive_monitor, std::size_t core_index); |
| 27 | ~ARM_Dynarmic(); | 27 | ~ARM_Dynarmic(); |
| 28 | 28 | ||
| 29 | void MapBackingMemory(VAddr address, std::size_t size, u8* memory, | 29 | void MapBackingMemory(VAddr address, std::size_t size, u8* memory, |
| @@ -62,7 +62,7 @@ private: | |||
| 62 | ARM_Unicorn inner_unicorn; | 62 | ARM_Unicorn inner_unicorn; |
| 63 | 63 | ||
| 64 | std::size_t core_index; | 64 | std::size_t core_index; |
| 65 | std::shared_ptr<DynarmicExclusiveMonitor> exclusive_monitor; | 65 | DynarmicExclusiveMonitor& exclusive_monitor; |
| 66 | 66 | ||
| 67 | Memory::PageTable* current_page_table = nullptr; | 67 | Memory::PageTable* current_page_table = nullptr; |
| 68 | }; | 68 | }; |