mirror of
https://git.eden-emu.dev/eden-emu/eden.git
synced 2026-08-31 18:46:08 +00:00
Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 4e784cc82a | |||
| beee79a06d | |||
| be790d08f3 |
@@ -25,13 +25,14 @@
|
||||
#include "common/container/unordered_map.h"
|
||||
#include "common/container/unordered_set.h"
|
||||
#include <boost/unordered_map.hpp>
|
||||
#define XBYAK_NO_EXCEPTION 1
|
||||
#define XBYAK_STD_UNORDERED_SET ::Common::unordered_set
|
||||
#define XBYAK_STD_UNORDERED_MAP ::Common::unordered_map
|
||||
#define XBYAK_STD_UNORDERED_MULTIMAP boost::unordered_multimap
|
||||
#include <xbyak/xbyak.h>
|
||||
#include <xbyak/xbyak_util.h>
|
||||
|
||||
#include <xbyak/xbyak.h>
|
||||
|
||||
namespace Common::X64 {
|
||||
|
||||
constexpr size_t RegToIndex(const Xbyak::Reg& reg) {
|
||||
|
||||
@@ -42,7 +42,7 @@ u64 DynarmicCallbacks32::MemoryRead64(u32 vaddr) {
|
||||
std::optional<u32> DynarmicCallbacks32::MemoryReadCode(u32 vaddr) {
|
||||
if (!m_memory.IsValidVirtualAddressRange(vaddr, sizeof(u32)))
|
||||
return std::nullopt;
|
||||
auto const aligned_vaddr = vaddr & ~Core::Memory::YUZU_PAGEMASK;
|
||||
auto const aligned_vaddr = vaddr & u32(~Core::Memory::YUZU_PAGEMASK);
|
||||
if (last_code_addr != aligned_vaddr) {
|
||||
m_memory.ReadBlock(aligned_vaddr, &cached_code_page, sizeof(cached_code_page));
|
||||
last_code_addr = aligned_vaddr;
|
||||
@@ -420,11 +420,13 @@ void ArmDynarmic32::SignalInterrupt(Kernel::KThread* thread) {
|
||||
}
|
||||
|
||||
void ArmDynarmic32::ClearInstructionCache() {
|
||||
m_cb->last_code_addr = u32(-1);
|
||||
m_jit->ClearCache();
|
||||
}
|
||||
|
||||
void ArmDynarmic32::InvalidateCacheRange(u64 addr, std::size_t size) {
|
||||
m_jit->InvalidateCacheRange(static_cast<u32>(addr), size);
|
||||
m_cb->last_code_addr = u32(-1);
|
||||
m_jit->InvalidateCacheRange(u32(addr), size);
|
||||
}
|
||||
|
||||
} // namespace Core
|
||||
|
||||
@@ -36,7 +36,7 @@ public:
|
||||
u64 MemoryRead64(u32 vaddr) override;
|
||||
std::optional<u32> MemoryReadCode(u32 vaddr) override;
|
||||
void InstructionSynchronizationBarrierRaised() override {
|
||||
last_code_addr = u64(-1); //reset back, force refetch
|
||||
last_code_addr = u32(-1); //reset back, force refetch
|
||||
}
|
||||
void MemoryWrite8(u32 vaddr, u8 value) override;
|
||||
void MemoryWrite16(u32 vaddr, u16 value) override;
|
||||
@@ -54,7 +54,7 @@ public:
|
||||
void ReturnException(u32 pc, Dynarmic::HaltReason hr);
|
||||
//
|
||||
Dynarmic::CodePage cached_code_page;
|
||||
u64 last_code_addr = u64(-1);
|
||||
u32 last_code_addr = u32(-1);
|
||||
ArmDynarmic32& m_parent;
|
||||
Core::Memory::Memory& m_memory;
|
||||
Kernel::KProcess* m_process{};
|
||||
|
||||
@@ -105,7 +105,7 @@ void DynarmicCallbacks64::InstructionCacheOperationRaised(Dynarmic::A64::Instruc
|
||||
last_code_addr = u64(-1); //invalidate cached page
|
||||
switch (op) {
|
||||
case Dynarmic::A64::InstructionCacheOperation::InvalidateByVAToPoU: {
|
||||
static constexpr u64 ICACHE_LINE_SIZE = 64;
|
||||
constexpr u64 ICACHE_LINE_SIZE = 64;
|
||||
const u64 cache_line_start = value & ~(ICACHE_LINE_SIZE - 1);
|
||||
m_parent.InvalidateCacheRange(cache_line_start, ICACHE_LINE_SIZE);
|
||||
break;
|
||||
@@ -447,10 +447,12 @@ void ArmDynarmic64::SignalInterrupt(Kernel::KThread* thread) {
|
||||
}
|
||||
|
||||
void ArmDynarmic64::ClearInstructionCache() {
|
||||
m_cb->last_code_addr = u64(-1);
|
||||
m_jit->ClearCache();
|
||||
}
|
||||
|
||||
void ArmDynarmic64::InvalidateCacheRange(u64 addr, std::size_t size) {
|
||||
m_cb->last_code_addr = u64(-1);
|
||||
m_jit->InvalidateCacheRange(addr, size);
|
||||
}
|
||||
|
||||
|
||||
@@ -95,6 +95,7 @@ else()
|
||||
-pedantic
|
||||
-Wno-missing-braces
|
||||
-fno-rtti
|
||||
#-fno-exceptions
|
||||
)
|
||||
if (CXX_GCC)
|
||||
# GCC produces bogus -Warray-bounds warnings from xbyak headers for code paths that are not
|
||||
@@ -112,11 +113,6 @@ else()
|
||||
# Clang mistakenly blames CMake for using unused arguments during compilation
|
||||
list(APPEND DYNARMIC_CXX_FLAGS -Wno-unused-command-line-argument)
|
||||
endif()
|
||||
# TODO: oaknut exceptions
|
||||
# TODO: fix chromeOS
|
||||
if ("x86_64" IN_LIST ARCHITECTURE AND NOT ANDROID)
|
||||
list(APPEND DYNARMIC_CXX_FLAGS -fno-exceptions)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if (NOT Boost_FOUND)
|
||||
|
||||
@@ -465,8 +465,13 @@ size_t BlockOfCode::GetTotalCodeSize() const {
|
||||
}
|
||||
|
||||
void* BlockOfCode::AllocateFromCodeSpace(size_t alloc_size) {
|
||||
ASSERT(size_ + alloc_size < maxSize_);
|
||||
if (size_ + alloc_size >= maxSize_) {
|
||||
using Xbyak::Error;
|
||||
XBYAK_THROW(Xbyak::ERR_CODE_IS_TOO_BIG);
|
||||
}
|
||||
|
||||
EnsureMemoryCommitted(alloc_size);
|
||||
|
||||
void* ret = getCurr<void*>();
|
||||
size_ += alloc_size;
|
||||
memset(ret, 0, alloc_size);
|
||||
|
||||
@@ -7,7 +7,6 @@
|
||||
#include "common/container/unordered_map.h"
|
||||
#include "common/container/unordered_set.h"
|
||||
#include <boost/unordered_map.hpp>
|
||||
#define XBYAK_NO_EXCEPTION 1
|
||||
#define XBYAK_STD_UNORDERED_SET ::Common::unordered_set
|
||||
#define XBYAK_STD_UNORDERED_MAP ::Common::unordered_map
|
||||
#define XBYAK_STD_UNORDERED_MULTIMAP boost::unordered_multimap
|
||||
|
||||
Reference in New Issue
Block a user