diff options
Diffstat (limited to 'src/common')
| -rw-r--r-- | src/common/common_funcs.h | 4 | ||||
| -rw-r--r-- | src/common/host_memory.cpp | 6 | ||||
| -rw-r--r-- | src/common/settings.cpp | 1 |
3 files changed, 10 insertions, 1 deletions
diff --git a/src/common/common_funcs.h b/src/common/common_funcs.h index e1e2a90fc..0dad9338a 100644 --- a/src/common/common_funcs.h +++ b/src/common/common_funcs.h | |||
| @@ -31,8 +31,10 @@ | |||
| 31 | 31 | ||
| 32 | #ifndef _MSC_VER | 32 | #ifndef _MSC_VER |
| 33 | 33 | ||
| 34 | #ifdef ARCHITECTURE_x86_64 | 34 | #if defined(ARCHITECTURE_x86_64) |
| 35 | #define Crash() __asm__ __volatile__("int $3") | 35 | #define Crash() __asm__ __volatile__("int $3") |
| 36 | #elif defined(ARCHITECTURE_arm64) | ||
| 37 | #define Crash() __asm__ __volatile__("brk #0") | ||
| 36 | #else | 38 | #else |
| 37 | #define Crash() exit(1) | 39 | #define Crash() exit(1) |
| 38 | #endif | 40 | #endif |
diff --git a/src/common/host_memory.cpp b/src/common/host_memory.cpp index 7f9659612..909f6cf3f 100644 --- a/src/common/host_memory.cpp +++ b/src/common/host_memory.cpp | |||
| @@ -359,6 +359,12 @@ public: | |||
| 359 | } | 359 | } |
| 360 | }); | 360 | }); |
| 361 | 361 | ||
| 362 | long page_size = sysconf(_SC_PAGESIZE); | ||
| 363 | if (page_size != 0x1000) { | ||
| 364 | LOG_CRITICAL(HW_Memory, "page size {:#x} is incompatible with 4K paging", page_size); | ||
| 365 | throw std::bad_alloc{}; | ||
| 366 | } | ||
| 367 | |||
| 362 | // Backing memory initialization | 368 | // Backing memory initialization |
| 363 | #if defined(__FreeBSD__) && __FreeBSD__ < 13 | 369 | #if defined(__FreeBSD__) && __FreeBSD__ < 13 |
| 364 | // XXX Drop after FreeBSD 12.* reaches EOL on 2024-06-30 | 370 | // XXX Drop after FreeBSD 12.* reaches EOL on 2024-06-30 |
diff --git a/src/common/settings.cpp b/src/common/settings.cpp index 0a560ebb7..8173462cb 100644 --- a/src/common/settings.cpp +++ b/src/common/settings.cpp | |||
| @@ -151,6 +151,7 @@ void UpdateRescalingInfo() { | |||
| 151 | ASSERT(false); | 151 | ASSERT(false); |
| 152 | info.up_scale = 1; | 152 | info.up_scale = 1; |
| 153 | info.down_shift = 0; | 153 | info.down_shift = 0; |
| 154 | break; | ||
| 154 | } | 155 | } |
| 155 | info.up_factor = static_cast<f32>(info.up_scale) / (1U << info.down_shift); | 156 | info.up_factor = static_cast<f32>(info.up_scale) / (1U << info.down_shift); |
| 156 | info.down_factor = static_cast<f32>(1U << info.down_shift) / info.up_scale; | 157 | info.down_factor = static_cast<f32>(1U << info.down_shift) / info.up_scale; |