diff options
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: | |||
| 363 | 363 | ||
| 364 | #ifdef ARCHITECTURE_arm64 | 364 | #ifdef ARCHITECTURE_arm64 |
| 365 | 365 | ||
| 366 | uint64_t GetRandomU64() { | 366 | static uint64_t GetRandomU64() { |
| 367 | uint64_t ret; | 367 | uint64_t ret; |
| 368 | ASSERT(getrandom(&ret, sizeof(ret), 0) == 0); | 368 | ASSERT(getrandom(&ret, sizeof(ret), 0) == 0); |
| 369 | return ret; | 369 | return ret; |
| 370 | } | 370 | } |
| 371 | 371 | ||
| 372 | void* ChooseVirtualBase(size_t virtual_size) { | 372 | static void* ChooseVirtualBase(size_t virtual_size) { |
| 373 | constexpr uintptr_t Map39BitSize = (1ULL << 39); | 373 | constexpr uintptr_t Map39BitSize = (1ULL << 39); |
| 374 | constexpr uintptr_t Map36BitSize = (1ULL << 36); | 374 | constexpr uintptr_t Map36BitSize = (1ULL << 36); |
| 375 | 375 | ||
| @@ -410,7 +410,7 @@ void* ChooseVirtualBase(size_t virtual_size) { | |||
| 410 | return MAP_FAILED; | 410 | return MAP_FAILED; |
| 411 | } | 411 | } |
| 412 | #else | 412 | #else |
| 413 | void* ChooseVirtualBase(size_t virtual_size) { | 413 | static void* ChooseVirtualBase(size_t virtual_size) { |
| 414 | return mmap(nullptr, virtual_size, PROT_READ | PROT_WRITE, | 414 | return mmap(nullptr, virtual_size, PROT_READ | PROT_WRITE, |
| 415 | MAP_PRIVATE | MAP_ANONYMOUS | MAP_NORESERVE, -1, 0); | 415 | MAP_PRIVATE | MAP_ANONYMOUS | MAP_NORESERVE, -1, 0); |
| 416 | } | 416 | } |
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() { | |||
| 159 | static bool is_nce_enabled = false; | 159 | static bool is_nce_enabled = false; |
| 160 | 160 | ||
| 161 | void SetNceEnabled(bool is_39bit) { | 161 | void SetNceEnabled(bool is_39bit) { |
| 162 | is_nce_enabled = values.cpu_backend.GetValue() == CpuBackend::Nce && is_39bit; | 162 | const bool is_nce_selected = values.cpu_backend.GetValue() == CpuBackend::Nce; |
| 163 | is_nce_enabled = is_nce_selected && is_39bit; | ||
| 164 | if (is_nce_selected && !is_nce_enabled) { | ||
| 165 | LOG_WARNING( | ||
| 166 | Common, | ||
| 167 | "Program does not utilize 39-bit address space, unable to natively execute code"); | ||
| 168 | } | ||
| 163 | } | 169 | } |
| 164 | 170 | ||
| 165 | bool IsNceEnabled() { | 171 | 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) { | |||
| 18 | UNREACHABLE_MSG("Failed to open libc!"); | 18 | UNREACHABLE_MSG("Failed to open libc!"); |
| 19 | } | 19 | } |
| 20 | #else | 20 | #else |
| 21 | // For other operating environments, we assume the symbol is not overriden. | 21 | // For other operating environments, we assume the symbol is not overridden. |
| 22 | const char* base = nullptr; | 22 | const char* base = nullptr; |
| 23 | Common::DynamicLibrary provider(base); | 23 | Common::DynamicLibrary provider(base); |
| 24 | #endif | 24 | #endif |