summaryrefslogtreecommitdiff
path: root/src/common
diff options
context:
space:
mode:
Diffstat (limited to 'src/common')
-rw-r--r--src/common/host_memory.cpp6
-rw-r--r--src/common/settings.cpp8
-rw-r--r--src/common/signal_chain.cpp2
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
366uint64_t GetRandomU64() { 366static 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
372void* ChooseVirtualBase(size_t virtual_size) { 372static 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
413void* ChooseVirtualBase(size_t virtual_size) { 413static 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() {
159static bool is_nce_enabled = false; 159static bool is_nce_enabled = false;
160 160
161void SetNceEnabled(bool is_39bit) { 161void 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
165bool IsNceEnabled() { 171bool 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