head 1.1; access; symbols pkgsrc-2026Q3:1.1.0.24 pkgsrc-2026Q3-base:1.1 pkgsrc-2026Q2:1.1.0.22 pkgsrc-2026Q2-base:1.1 pkgsrc-2026Q1:1.1.0.20 pkgsrc-2026Q1-base:1.1 pkgsrc-2025Q4:1.1.0.18 pkgsrc-2025Q4-base:1.1 pkgsrc-2025Q3:1.1.0.16 pkgsrc-2025Q3-base:1.1 pkgsrc-2025Q2:1.1.0.14 pkgsrc-2025Q2-base:1.1 pkgsrc-2025Q1:1.1.0.12 pkgsrc-2025Q1-base:1.1 pkgsrc-2024Q4:1.1.0.10 pkgsrc-2024Q4-base:1.1 pkgsrc-2024Q3:1.1.0.8 pkgsrc-2024Q3-base:1.1 pkgsrc-2024Q2:1.1.0.6 pkgsrc-2024Q2-base:1.1 pkgsrc-2024Q1:1.1.0.4 pkgsrc-2024Q1-base:1.1 pkgsrc-2023Q4:1.1.0.2 pkgsrc-2023Q4-base:1.1; locks; strict; comment @// @; 1.1 date 2023.11.14.17.57.41; author nia; state Exp; branches; next ; commitid 6j4nJUj41nclxBME; desc @@ 1.1 log @Import emulators/duckstation-qt DuckStation is an simulator/emulator of the Sony PlayStation(TM) console, focusing on playability, speed, and long-term maintainability. The goal is to be as accurate as possible while maintaining performance suitable for low-end devices. A "BIOS" ROM image is required to to start the emulator and to play games. You can use an image from any hardware version or region, although mismatching game regions and BIOS regions may have compatibility issues. @ text @$NetBSD$ NetBSD (and more POSIX platforms) support. --- src/util/jit_code_buffer.cpp.orig 2023-08-12 04:46:09.000000000 +0000 +++ src/util/jit_code_buffer.cpp @@@@ -53,7 +53,7 @@@@ bool JitCodeBuffer::Allocate(u32 size /* Log_ErrorPrintf("VirtualAlloc(RWX, %u) for internal buffer failed: %u", m_total_size, GetLastError()); return false; } -#elif defined(__linux__) || defined(__ANDROID__) || defined(__APPLE__) || defined(__HAIKU__) || defined(__FreeBSD__) +#else int flags = MAP_PRIVATE | MAP_ANONYMOUS; #if defined(__APPLE__) && defined(__aarch64__) // MAP_JIT and toggleable write protection is required on Apple Silicon. @@@@ -66,8 +66,6 @@@@ bool JitCodeBuffer::Allocate(u32 size /* Log_ErrorPrintf("mmap(RWX, %u) for internal buffer failed: %d", m_total_size, errno); return false; } -#else - return false; #endif m_free_code_ptr = m_code_ptr; @@@@ -113,7 +111,7 @@@@ bool JitCodeBuffer::Initialize(void* buf m_code_ptr = static_cast(buffer); m_old_protection = static_cast(old_protect); -#elif defined(__linux__) || defined(__ANDROID__) || defined(__APPLE__) || defined(__HAIKU__) || defined(__FreeBSD__) +#else if (mprotect(buffer, size, PROT_READ | PROT_WRITE | PROT_EXEC) != 0) { Log_ErrorPrintf("mprotect(RWX) for external buffer failed: %d", errno); @@@@ -133,8 +131,6 @@@@ bool JitCodeBuffer::Initialize(void* buf // reasonable default? m_code_ptr = static_cast(buffer); m_old_protection = PROT_READ | PROT_WRITE; -#else - m_code_ptr = nullptr; #endif if (!m_code_ptr) @@@@ -298,4 +294,4 @@@@ void JitCodeBuffer::WriteProtect(bool en pthread_jit_write_protect_np(enabled ? 1 : 0); } -#endif \ No newline at end of file +#endif @