diff options
author | bunnei <bunneidev@gmail.com> | 2022-08-10 01:12:53 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-08-10 01:12:53 +0200 |
commit | 4bd8adfe422544097c654e9b44a90699887177d0 (patch) | |
tree | dc9fdbaa19509b8173a76e6619177296b9c518f9 /src/core | |
parent | Merge pull request #8499 from Docteh/plurals (diff) | |
parent | arm_dynarmic_cp15: Implement CP15DMB/CP15DSB/CP15ISB (diff) | |
download | yuzu-4bd8adfe422544097c654e9b44a90699887177d0.tar yuzu-4bd8adfe422544097c654e9b44a90699887177d0.tar.gz yuzu-4bd8adfe422544097c654e9b44a90699887177d0.tar.bz2 yuzu-4bd8adfe422544097c654e9b44a90699887177d0.tar.lz yuzu-4bd8adfe422544097c654e9b44a90699887177d0.tar.xz yuzu-4bd8adfe422544097c654e9b44a90699887177d0.tar.zst yuzu-4bd8adfe422544097c654e9b44a90699887177d0.zip |
Diffstat (limited to 'src/core')
-rw-r--r-- | src/core/arm/dynarmic/arm_dynarmic_cp15.cpp | 31 | ||||
-rw-r--r-- | src/core/arm/dynarmic/arm_dynarmic_cp15.h | 2 |
2 files changed, 29 insertions, 4 deletions
diff --git a/src/core/arm/dynarmic/arm_dynarmic_cp15.cpp b/src/core/arm/dynarmic/arm_dynarmic_cp15.cpp index e9123c13d..200efe4db 100644 --- a/src/core/arm/dynarmic/arm_dynarmic_cp15.cpp +++ b/src/core/arm/dynarmic/arm_dynarmic_cp15.cpp @@ -8,6 +8,10 @@ #include "core/core.h" #include "core/core_timing.h" +#ifdef _MSC_VER +#include <intrin.h> +#endif + using Callback = Dynarmic::A32::Coprocessor::Callback; using CallbackOrAccessOneWord = Dynarmic::A32::Coprocessor::CallbackOrAccessOneWord; using CallbackOrAccessTwoWords = Dynarmic::A32::Coprocessor::CallbackOrAccessTwoWords; @@ -47,12 +51,31 @@ CallbackOrAccessOneWord DynarmicCP15::CompileSendOneWord(bool two, unsigned opc1 switch (opc2) { case 4: // CP15_DATA_SYNC_BARRIER - // This is a dummy write, we ignore the value written here. - return &dummy_value; + return Callback{ + [](Dynarmic::A32::Jit*, void*, std::uint32_t, std::uint32_t) -> std::uint64_t { +#ifdef _MSC_VER + _mm_mfence(); + _mm_lfence(); +#else + asm volatile("mfence\n\tlfence\n\t" : : : "memory"); +#endif + return 0; + }, + std::nullopt, + }; case 5: // CP15_DATA_MEMORY_BARRIER - // This is a dummy write, we ignore the value written here. - return &dummy_value; + return Callback{ + [](Dynarmic::A32::Jit*, void*, std::uint32_t, std::uint32_t) -> std::uint64_t { +#ifdef _MSC_VER + _mm_mfence(); +#else + asm volatile("mfence\n\t" : : : "memory"); +#endif + return 0; + }, + std::nullopt, + }; } } diff --git a/src/core/arm/dynarmic/arm_dynarmic_cp15.h b/src/core/arm/dynarmic/arm_dynarmic_cp15.h index 5b2a51636..d90b3e568 100644 --- a/src/core/arm/dynarmic/arm_dynarmic_cp15.h +++ b/src/core/arm/dynarmic/arm_dynarmic_cp15.h @@ -35,6 +35,8 @@ public: ARM_Dynarmic_32& parent; u32 uprw = 0; u32 uro = 0; + + friend class ARM_Dynarmic_32; }; } // namespace Core |