diff options
author | GPUCode <geoster3d@gmail.com> | 2023-11-18 15:10:39 +0100 |
---|---|---|
committer | t895 <clombardo169@gmail.com> | 2023-11-25 06:47:28 +0100 |
commit | 8fab363237083a8130a7b2a023cd9c5dd83f8f4f (patch) | |
tree | fa94b90be48a5debe83b414119da5b8419dd463c /src/common | |
parent | arm: Implement native code execution backend (diff) | |
download | yuzu-8fab363237083a8130a7b2a023cd9c5dd83f8f4f.tar yuzu-8fab363237083a8130a7b2a023cd9c5dd83f8f4f.tar.gz yuzu-8fab363237083a8130a7b2a023cd9c5dd83f8f4f.tar.bz2 yuzu-8fab363237083a8130a7b2a023cd9c5dd83f8f4f.tar.lz yuzu-8fab363237083a8130a7b2a023cd9c5dd83f8f4f.tar.xz yuzu-8fab363237083a8130a7b2a023cd9c5dd83f8f4f.tar.zst yuzu-8fab363237083a8130a7b2a023cd9c5dd83f8f4f.zip |
Diffstat (limited to 'src/common')
-rw-r--r-- | src/common/host_memory.cpp | 6 | ||||
-rw-r--r-- | src/common/settings.cpp | 8 | ||||
-rw-r--r-- | src/common/signal_chain.cpp | 2 |
3 files changed, 11 insertions, 5 deletions
diff --git a/src/common/host_memory.cpp b/src/common/host_memory.cpp index 38d7b29f7..8a869e558 100644 --- a/src/common/host_memory.cpp +++ b/src/common/host_memory.cpp @@ -363,13 +363,13 @@ private: #ifdef ARCHITECTURE_arm64 -uint64_t GetRandomU64() { +static uint64_t GetRandomU64() { uint64_t ret; ASSERT(getrandom(&ret, sizeof(ret), 0) == 0); return ret; } -void* ChooseVirtualBase(size_t virtual_size) { +static void* ChooseVirtualBase(size_t virtual_size) { constexpr uintptr_t Map39BitSize = (1ULL << 39); constexpr uintptr_t Map36BitSize = (1ULL << 36); @@ -410,7 +410,7 @@ void* ChooseVirtualBase(size_t virtual_size) { return MAP_FAILED; } #else -void* ChooseVirtualBase(size_t virtual_size) { +static void* ChooseVirtualBase(size_t virtual_size) { return mmap(nullptr, virtual_size, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANONYMOUS | MAP_NORESERVE, -1, 0); } diff --git a/src/common/settings.cpp b/src/common/settings.cpp index 81a036ef0..90e7475d7 100644 --- a/src/common/settings.cpp +++ b/src/common/settings.cpp @@ -159,7 +159,13 @@ bool IsFastmemEnabled() { static bool is_nce_enabled = false; void SetNceEnabled(bool is_39bit) { - is_nce_enabled = values.cpu_backend.GetValue() == CpuBackend::Nce && is_39bit; + const bool is_nce_selected = values.cpu_backend.GetValue() == CpuBackend::Nce; + is_nce_enabled = is_nce_selected && is_39bit; + if (is_nce_selected && !is_nce_enabled) { + LOG_WARNING( + Common, + "Program does not utilize 39-bit address space, unable to natively execute code"); + } } bool IsNceEnabled() { diff --git a/src/common/signal_chain.cpp b/src/common/signal_chain.cpp index e0c6b9d4e..2e4fecc48 100644 --- a/src/common/signal_chain.cpp +++ b/src/common/signal_chain.cpp @@ -18,7 +18,7 @@ T* LookupLibcSymbol(const char* name) { UNREACHABLE_MSG("Failed to open libc!"); } #else - // For other operating environments, we assume the symbol is not overriden. + // For other operating environments, we assume the symbol is not overridden. const char* base = nullptr; Common::DynamicLibrary provider(base); #endif |