summaryrefslogtreecommitdiffstats
path: root/src/core/arm/dynarmic
diff options
context:
space:
mode:
authorLioncash <mathew1800@gmail.com>2019-04-09 19:25:54 +0200
committerLioncash <mathew1800@gmail.com>2019-04-12 04:11:40 +0200
commitf2331a804a2fa300d9a7dc0d012e3242b7accdaf (patch)
treed7f61aa201effed9e37fc07c626218759fc75288 /src/core/arm/dynarmic
parentMerge pull request #2235 from ReinUsesLisp/spirv-decompiler (diff)
downloadyuzu-f2331a804a2fa300d9a7dc0d012e3242b7accdaf.tar
yuzu-f2331a804a2fa300d9a7dc0d012e3242b7accdaf.tar.gz
yuzu-f2331a804a2fa300d9a7dc0d012e3242b7accdaf.tar.bz2
yuzu-f2331a804a2fa300d9a7dc0d012e3242b7accdaf.tar.lz
yuzu-f2331a804a2fa300d9a7dc0d012e3242b7accdaf.tar.xz
yuzu-f2331a804a2fa300d9a7dc0d012e3242b7accdaf.tar.zst
yuzu-f2331a804a2fa300d9a7dc0d012e3242b7accdaf.zip
Diffstat (limited to 'src/core/arm/dynarmic')
-rw-r--r--src/core/arm/dynarmic/arm_dynarmic.cpp23
-rw-r--r--src/core/arm/dynarmic/arm_dynarmic.h6
2 files changed, 12 insertions, 17 deletions
diff --git a/src/core/arm/dynarmic/arm_dynarmic.cpp b/src/core/arm/dynarmic/arm_dynarmic.cpp
index dc96e35d5..44307fa19 100644
--- a/src/core/arm/dynarmic/arm_dynarmic.cpp
+++ b/src/core/arm/dynarmic/arm_dynarmic.cpp
@@ -14,7 +14,6 @@
#include "core/core_timing.h"
#include "core/core_timing_util.h"
#include "core/gdbstub/gdbstub.h"
-#include "core/hle/kernel/kernel.h"
#include "core/hle/kernel/process.h"
#include "core/hle/kernel/svc.h"
#include "core/hle/kernel/vm_manager.h"
@@ -129,18 +128,16 @@ public:
u64 tpidr_el0 = 0;
};
-std::unique_ptr<Dynarmic::A64::Jit> ARM_Dynarmic::MakeJit() const {
- auto* current_process = system.Kernel().CurrentProcess();
- auto** const page_table = current_process->VMManager().page_table.pointers.data();
-
+std::unique_ptr<Dynarmic::A64::Jit> ARM_Dynarmic::MakeJit(Common::PageTable& page_table,
+ std::size_t address_space_bits) const {
Dynarmic::A64::UserConfig config;
// Callbacks
config.callbacks = cb.get();
// Memory
- config.page_table = reinterpret_cast<void**>(page_table);
- config.page_table_address_space_bits = current_process->VMManager().GetAddressSpaceWidth();
+ config.page_table = reinterpret_cast<void**>(page_table.pointers.data());
+ config.page_table_address_space_bits = address_space_bits;
config.silently_mirror_page_table = false;
// Multi-process state
@@ -176,12 +173,7 @@ ARM_Dynarmic::ARM_Dynarmic(System& system, ExclusiveMonitor& exclusive_monitor,
std::size_t core_index)
: cb(std::make_unique<ARM_Dynarmic_Callbacks>(*this)), inner_unicorn{system},
core_index{core_index}, system{system},
- exclusive_monitor{dynamic_cast<DynarmicExclusiveMonitor&>(exclusive_monitor)} {
- ThreadContext ctx{};
- inner_unicorn.SaveContext(ctx);
- PageTableChanged();
- LoadContext(ctx);
-}
+ exclusive_monitor{dynamic_cast<DynarmicExclusiveMonitor&>(exclusive_monitor)} {}
ARM_Dynarmic::~ARM_Dynarmic() = default;
@@ -276,8 +268,9 @@ void ARM_Dynarmic::ClearExclusiveState() {
jit->ClearExclusiveState();
}
-void ARM_Dynarmic::PageTableChanged() {
- jit = MakeJit();
+void ARM_Dynarmic::PageTableChanged(Common::PageTable& page_table,
+ std::size_t new_address_space_size_in_bits) {
+ jit = MakeJit(page_table, new_address_space_size_in_bits);
}
DynarmicExclusiveMonitor::DynarmicExclusiveMonitor(std::size_t core_count) : monitor(core_count) {}
diff --git a/src/core/arm/dynarmic/arm_dynarmic.h b/src/core/arm/dynarmic/arm_dynarmic.h
index c1db254e8..b701e97a3 100644
--- a/src/core/arm/dynarmic/arm_dynarmic.h
+++ b/src/core/arm/dynarmic/arm_dynarmic.h
@@ -48,10 +48,12 @@ public:
void ClearExclusiveState() override;
void ClearInstructionCache() override;
- void PageTableChanged() override;
+ void PageTableChanged(Common::PageTable& new_page_table,
+ std::size_t new_address_space_size_in_bits) override;
private:
- std::unique_ptr<Dynarmic::A64::Jit> MakeJit() const;
+ std::unique_ptr<Dynarmic::A64::Jit> MakeJit(Common::PageTable& page_table,
+ std::size_t address_space_bits) const;
friend class ARM_Dynarmic_Callbacks;
std::unique_ptr<ARM_Dynarmic_Callbacks> cb;