diff options
author | MerryMage <MerryMage@users.noreply.github.com> | 2021-03-24 12:08:41 +0100 |
---|---|---|
committer | MerryMage <MerryMage@users.noreply.github.com> | 2021-03-24 19:47:17 +0100 |
commit | 52dae41d7f5774fb7efbfcfaf355ac5a747612f2 (patch) | |
tree | cab12a4a2d5ef61bae18513da39926864bf150cf /src/core/arm/dynarmic/arm_dynarmic_64.cpp | |
parent | Merge pull request #6100 from bunnei/arm-fix (diff) | |
download | yuzu-52dae41d7f5774fb7efbfcfaf355ac5a747612f2.tar yuzu-52dae41d7f5774fb7efbfcfaf355ac5a747612f2.tar.gz yuzu-52dae41d7f5774fb7efbfcfaf355ac5a747612f2.tar.bz2 yuzu-52dae41d7f5774fb7efbfcfaf355ac5a747612f2.tar.lz yuzu-52dae41d7f5774fb7efbfcfaf355ac5a747612f2.tar.xz yuzu-52dae41d7f5774fb7efbfcfaf355ac5a747612f2.tar.zst yuzu-52dae41d7f5774fb7efbfcfaf355ac5a747612f2.zip |
Diffstat (limited to 'src/core/arm/dynarmic/arm_dynarmic_64.cpp')
-rw-r--r-- | src/core/arm/dynarmic/arm_dynarmic_64.cpp | 38 |
1 files changed, 13 insertions, 25 deletions
diff --git a/src/core/arm/dynarmic/arm_dynarmic_64.cpp b/src/core/arm/dynarmic/arm_dynarmic_64.cpp index b36b7d918..083c2bdee 100644 --- a/src/core/arm/dynarmic/arm_dynarmic_64.cpp +++ b/src/core/arm/dynarmic/arm_dynarmic_64.cpp @@ -142,7 +142,7 @@ public: static constexpr u64 minimum_run_cycles = 1000U; }; -std::shared_ptr<Dynarmic::A64::Jit> ARM_Dynarmic_64::MakeJit(Common::PageTable& page_table, +std::shared_ptr<Dynarmic::A64::Jit> ARM_Dynarmic_64::MakeJit(Common::PageTable* page_table, std::size_t address_space_bits) const { Dynarmic::A64::UserConfig config; @@ -150,13 +150,15 @@ std::shared_ptr<Dynarmic::A64::Jit> ARM_Dynarmic_64::MakeJit(Common::PageTable& config.callbacks = cb.get(); // Memory - config.page_table = reinterpret_cast<void**>(page_table.pointers.data()); - config.page_table_address_space_bits = address_space_bits; - config.page_table_pointer_mask_bits = Common::PageTable::ATTRIBUTE_BITS; - config.silently_mirror_page_table = false; - config.absolute_offset_page_table = true; - config.detect_misaligned_access_via_page_table = 16 | 32 | 64 | 128; - config.only_detect_misalignment_via_page_table_on_page_boundary = true; + if (page_table) { + config.page_table = reinterpret_cast<void**>(page_table->pointers.data()); + config.page_table_address_space_bits = address_space_bits; + config.page_table_pointer_mask_bits = Common::PageTable::ATTRIBUTE_BITS; + config.silently_mirror_page_table = false; + config.absolute_offset_page_table = true; + config.detect_misaligned_access_via_page_table = 16 | 32 | 64 | 128; + config.only_detect_misalignment_via_page_table_on_page_boundary = true; + } // Multi-process state config.processor_id = core_index; @@ -237,7 +239,8 @@ ARM_Dynarmic_64::ARM_Dynarmic_64(System& system, CPUInterrupts& interrupt_handle std::size_t core_index) : ARM_Interface{system, interrupt_handlers, uses_wall_clock}, cb(std::make_unique<DynarmicCallbacks64>(*this)), core_index{core_index}, - exclusive_monitor{dynamic_cast<DynarmicExclusiveMonitor&>(exclusive_monitor)} {} + exclusive_monitor{dynamic_cast<DynarmicExclusiveMonitor&>(exclusive_monitor)}, + jit(MakeJit(nullptr, 48)) {} ARM_Dynarmic_64::~ARM_Dynarmic_64() = default; @@ -294,9 +297,6 @@ void ARM_Dynarmic_64::ChangeProcessorID(std::size_t new_core_id) { } void ARM_Dynarmic_64::SaveContext(ThreadContext64& ctx) { - if (!jit) { - return; - } ctx.cpu_registers = jit->GetRegisters(); ctx.sp = jit->GetSP(); ctx.pc = jit->GetPC(); @@ -308,9 +308,6 @@ void ARM_Dynarmic_64::SaveContext(ThreadContext64& ctx) { } void ARM_Dynarmic_64::LoadContext(const ThreadContext64& ctx) { - if (!jit) { - return; - } jit->SetRegisters(ctx.cpu_registers); jit->SetSP(ctx.sp); jit->SetPC(ctx.pc); @@ -326,23 +323,14 @@ void ARM_Dynarmic_64::PrepareReschedule() { } void ARM_Dynarmic_64::ClearInstructionCache() { - if (!jit) { - return; - } jit->ClearCache(); } void ARM_Dynarmic_64::InvalidateCacheRange(VAddr addr, std::size_t size) { - if (!jit) { - return; - } jit->InvalidateCacheRange(addr, size); } void ARM_Dynarmic_64::ClearExclusiveState() { - if (!jit) { - return; - } jit->ClearExclusiveState(); } @@ -358,7 +346,7 @@ void ARM_Dynarmic_64::PageTableChanged(Common::PageTable& page_table, LoadContext(ctx); return; } - jit = MakeJit(page_table, new_address_space_size_in_bits); + jit = MakeJit(&page_table, new_address_space_size_in_bits); LoadContext(ctx); jit_cache.emplace(key, jit); } |