Index: head/emulators/rpcs3/Makefile =================================================================== --- head/emulators/rpcs3/Makefile (revision 515941) +++ head/emulators/rpcs3/Makefile (revision 515942) @@ -1,90 +1,89 @@ # $FreeBSD$ PORTNAME= rpcs3 DISTVERSIONPREFIX= v DISTVERSION= 0.0.7-8941 # git rev-list --count HEAD DISTVERSIONSUFFIX= -g0ef7ad129 +PORTREVISION= 1 CATEGORIES= emulators MAINTAINER= jbeich@FreeBSD.org COMMENT= PS3 emulator/debugger LICENSE= BSD3CLAUSE BSL GPLv2 MIT ZLIB LICENSE_COMB= multi LICENSE_FILE_BSD3CLAUSE=${WRKSRC_cereal}/LICENSE LICENSE_FILE_MIT= ${WRKSRC_GSL}/LICENSE LICENSE_FILE_ZLIB= ${WRKSRC_asmjit}/LICENSE.md LIB_DEPENDS= libpng.so:graphics/png \ libavcodec.so:multimedia/ffmpeg ONLY_FOR_ARCHS= amd64 ONLY_FOR_ARCHS_REASON= requires int128 and SSE2 USE_GITHUB= yes GH_ACCOUNT= RPCS3 GH_TUPLE= RPCS3:hidapi:hidapi-0.8.0-rc1-27-g9220f5e:hidapi/3rdparty/hidapi \ RPCS3:llvm:b860b5e8f4ee:llvm/llvm \ Cyan4973:xxHash:v0.6.5:xxHash/3rdparty/xxHash \ jbeder:yaml-cpp:yaml-cpp-0.6.2-23-geca9cfd:yamlcpp/3rdparty/yaml-cpp \ kobalicek:asmjit:fc251c9:asmjit/asmjit \ KhronosGroup:glslang:7.11.3214:glslang/Vulkan/glslang \ Microsoft:GSL:v2.0.0:GSL/3rdparty/GSL \ USCiLab:cereal:v1.2.0:cereal/3rdparty/cereal \ zeux:pugixml:v1.9-51-g8bf806c:pugixml/3rdparty/pugixml USES= cmake compiler:c++17-lang iconv:wchar_t localbase:ldflags \ openal:soft pkgconfig qt:5 USE_GL= gl glew USE_QT= qmake_build buildtools_build core dbus declarative gui network widgets USE_XORG= x11 CMAKE_ON= CMAKE_SKIP_RPATH USE_SYSTEM_FFMPEG USE_SYSTEM_LIBPNG CMAKE_OFF= USE_NATIVE_INSTRUCTIONS LDFLAGS+= -Wl,--as-needed # GLU # XXX Drop after FreeBSD 12.0 EOL .if exists(/usr/lib/clang/6.0.1) LLD_UNSAFE= yes # XXX ports/219089 .endif # XXX Remove after FreeBSD 11.2/12.0 reach EOL i.e., around 2020-02-01 -# XXX Switch to bundled libc++ to avoid error-prone reverts -.if !exists(/usr/include/c++/v1/charconv) && exists(/usr/lib/libc++.so) -EXTRA_PATCHES+= ${PATCHDIR}/extra-patch-revert-db7042b986ab -EXTRA_PATCHES+= ${PATCHDIR}/extra-patch-revert-6b1e1e402049 -EXTRA_PATCHES+= ${PATCHDIR}/extra-patch-revert-9710473a2e3e -EXTRA_PATCHES+= ${PATCHDIR}/extra-patch-revert-f9ad6358563b -EXTRA_PATCHES+= ${PATCHDIR}/extra-patch-revert-4504ac2d1248 -EXTRA_PATCHES+= ${PATCHDIR}/extra-patch-revert-5bd17a44c972 +.if make(makesum) || (!exists(/usr/include/c++/v1/charconv) && exists(/usr/lib/libc++.so)) +MASTER_SITES+= https://releases.llvm.org/${LLVM_VER}/:libcxx +DISTFILES+= libcxx-${LLVM_VER}.src.tar.xz:libcxx +EXTRA_PATCHES+= ${PATCHDIR}/extra-patch-no-cotire +CXXFLAGS+= -nostdinc++ -isystem${WRKDIR}/libcxx-${LLVM_VER}.src/include +LLVM_VER= 8.0.0 # same as FreeBSD 11.3 .endif OPTIONS_DEFINE= ALSA EVDEV LLVM PULSEAUDIO VULKAN OPTIONS_DEFAULT=LLVM VULKAN ALSA_LIB_DEPENDS= libasound.so:audio/alsa-lib ALSA_RUN_DEPENDS= ${LOCALBASE}/lib/alsa-lib/libasound_module_pcm_oss.so:audio/alsa-plugins ALSA_CMAKE_BOOL= USE_ALSA EVDEV_DESC= libevdev-based joystick support EVDEV_CMAKE_BOOL= USE_LIBEVDEV EVDEV_BUILD_DEPENDS= evdev-proto>0:devel/evdev-proto EVDEV_LIB_DEPENDS= libevdev.so:devel/libevdev LLVM_DESC= LLVM-based PPU recompiler LLVM_CMAKE_BOOL_OFF= WITHOUT_LLVM PULSEAUDIO_LIB_DEPENDS= libpulse-simple.so:audio/pulseaudio PULSEAUDIO_CMAKE_BOOL= USE_PULSE VULKAN_DESC= Vulkan renderer VULKAN_BUILD_DEPENDS= ${LOCALBASE}/include/vulkan/vulkan.h:devel/vulkan-headers VULKAN_LIB_DEPENDS= libvulkan.so:graphics/vulkan-loader VULKAN_CMAKE_BOOL= USE_VULKAN post-patch: @${REINPLACE_CMD} -e '/GIT_BRANCH/s/unknown/master/' \ -e '/GIT_TAG/s/unknown/${GH_TAGNAME:C/-.*//}/' \ -e '/GIT_VERSION/s/unknown/${GH_TAGNAME:C/[^-]*-//}/' \ ${WRKSRC}/${PORTNAME}/git-version.cmake .include Index: head/emulators/rpcs3/distinfo =================================================================== --- head/emulators/rpcs3/distinfo (revision 515941) +++ head/emulators/rpcs3/distinfo (revision 515942) @@ -1,21 +1,23 @@ TIMESTAMP = 1571505618 +SHA256 (libcxx-8.0.0.src.tar.xz) = c2902675e7c84324fb2c1e45489220f250ede016cc3117186785d9dc291f9de2 +SIZE (libcxx-8.0.0.src.tar.xz) = 1752308 SHA256 (RPCS3-rpcs3-v0.0.7-8941-g0ef7ad129_GH0.tar.gz) = daf9c83bc14d274c267cc110bdfe22d1e839eec6bfa0c9ba24d2d4eae279c857 SIZE (RPCS3-rpcs3-v0.0.7-8941-g0ef7ad129_GH0.tar.gz) = 5625433 SHA256 (RPCS3-hidapi-hidapi-0.8.0-rc1-27-g9220f5e_GH0.tar.gz) = 3120e0b701943f452760e45f9fc1ac50bab356ad4c807b4cac4598041c5ca1a5 SIZE (RPCS3-hidapi-hidapi-0.8.0-rc1-27-g9220f5e_GH0.tar.gz) = 105400 SHA256 (RPCS3-llvm-b860b5e8f4ee_GH0.tar.gz) = c151972a0c8ceac568c24b61e63d2ecbdac0f125185e23fc2238e0a14048256e SIZE (RPCS3-llvm-b860b5e8f4ee_GH0.tar.gz) = 47286737 SHA256 (Cyan4973-xxHash-v0.6.5_GH0.tar.gz) = 19030315f4fc1b4b2cdb9d7a317069a109f90e39d1fe4c9159b7aaa39030eb95 SIZE (Cyan4973-xxHash-v0.6.5_GH0.tar.gz) = 37521 SHA256 (jbeder-yaml-cpp-yaml-cpp-0.6.2-23-geca9cfd_GH0.tar.gz) = 554f6fac1d9524f807345f95ba9223332c644e56d7a7fdb2bcea1f5793b764fa SIZE (jbeder-yaml-cpp-yaml-cpp-0.6.2-23-geca9cfd_GH0.tar.gz) = 1397220 SHA256 (kobalicek-asmjit-fc251c9_GH0.tar.gz) = 0fb6271fccf8ee86d27affda7e27a6d655bfabfda83a7dd0d41f7fd05b384aad SIZE (kobalicek-asmjit-fc251c9_GH0.tar.gz) = 446910 SHA256 (KhronosGroup-glslang-7.11.3214_GH0.tar.gz) = b30b4668734328d256e30c94037e60d3775b1055743c04d8fd709f2960f302a9 SIZE (KhronosGroup-glslang-7.11.3214_GH0.tar.gz) = 2841979 SHA256 (Microsoft-GSL-v2.0.0_GH0.tar.gz) = 6cce6fb16b651e62711a4f58e484931013c33979b795d1b1f7646f640cfa9c8e SIZE (Microsoft-GSL-v2.0.0_GH0.tar.gz) = 64726 SHA256 (USCiLab-cereal-v1.2.0_GH0.tar.gz) = 1ccf3ed205a7a2f0d6a060415b123f1ae0d984cd4435db01af8de11a2eda49c1 SIZE (USCiLab-cereal-v1.2.0_GH0.tar.gz) = 299883 SHA256 (zeux-pugixml-v1.9-51-g8bf806c_GH0.tar.gz) = 37bed90f3dadb642acca41508391d1409a75af05f34f13da56c866d5c3c4b00d SIZE (zeux-pugixml-v1.9-51-g8bf806c_GH0.tar.gz) = 560956 Index: head/emulators/rpcs3/files/extra-patch-revert-6b1e1e402049 =================================================================== --- head/emulators/rpcs3/files/extra-patch-revert-6b1e1e402049 (revision 515941) +++ head/emulators/rpcs3/files/extra-patch-revert-6b1e1e402049 (nonexistent) @@ -1,188 +0,0 @@ -rpcs3/Emu/GDB.cpp:33:10: fatal error: 'charconv' file not found -#include - ^~~~~~~~~~ - ---- rpcs3/Emu/GDB.cpp.orig 2019-10-09 18:21:23 UTC -+++ rpcs3/Emu/GDB.cpp -@@ -2,7 +2,7 @@ - - #include "GDB.h" - #include "Utilities/Log.h" --#include "Utilities/StrUtil.h" -+#include - #include "Emu/Memory/vm.h" - #include "Emu/System.h" - #include "Emu/IdManager.h" -@@ -14,24 +14,17 @@ - #ifdef _WIN32 - #include - #include --#include // sockaddr_un - #else - #include - #include - #include - #include - #include --#include - #include - #include - #include --#include // sockaddr_un - #endif - --#include --#include --#include -- - extern void ppu_set_breakpoint(u32 addr); - extern void ppu_remove_breakpoint(u32 addr); - -@@ -43,22 +36,10 @@ int closesocket(int s) - return close(s); - } - --void set_nonblocking(int s) --{ -- fcntl(s, F_SETFL, fcntl(s, F_GETFL) | O_NONBLOCK); --} -- - #define sscanf_s sscanf - #define HEX_U32 "x" - #define HEX_U64 "lx" - #else -- --void set_nonblocking(int s) --{ -- u_long mode = 1; -- ioctlsocket(s, FIONBIO, &mode); --} -- - #define HEX_U32 "lx" - #define HEX_U64 "llx" - #endif -@@ -122,93 +103,46 @@ u64 hex_to_u64(std::string val) { - - void gdb_thread::start_server() - { -- // IPv4 address:port in format 127.0.0.1:2345 -- static const std::regex ipv4_regex("^([0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3})\\:([0-9]{1,5})$"); -+ server_socket = socket(AF_INET, SOCK_STREAM, 0); - -- if (g_cfg.misc.gdb_server.get()[0] == '\0') -+ if (server_socket == -1) - { -- // Empty string or starts with null: GDB server disabled -- GDB.notice("GDB Server is disabled."); -+ GDB.error("Error creating server socket."); - return; - } - -- // Try to detect socket type -- std::smatch match; -- -- if (std::regex_match(g_cfg.misc.gdb_server.get(), match, ipv4_regex)) -+#ifdef WIN32 - { -- struct addrinfo hints{}; -- struct addrinfo* info; -- hints.ai_flags = AI_PASSIVE; -- hints.ai_socktype = SOCK_STREAM; -- -- std::string bind_addr = match[1].str(); -- std::string bind_port = match[2].str(); -- -- if (getaddrinfo(bind_addr.c_str(), bind_port.c_str(), &hints, &info) == 0) -- { -- server_socket = socket(info->ai_family, info->ai_socktype, info->ai_protocol); -- -- if (server_socket == -1) -- { -- GDB.error("Error creating IP socket for '%s'.", g_cfg.misc.gdb_server.get()); -- freeaddrinfo(info); -- return; -- } -- -- set_nonblocking(server_socket); -- -- if (bind(server_socket, info->ai_addr, static_cast(info->ai_addrlen)) != 0) -- { -- GDB.error("Failed to bind socket on '%s'.", g_cfg.misc.gdb_server.get()); -- freeaddrinfo(info); -- return; -- } -- -- freeaddrinfo(info); -- -- if (listen(server_socket, 1) != 0) -- { -- GDB.error("Failed to listen on '%s'.", g_cfg.misc.gdb_server.get()); -- return; -- } -- -- GDB.notice("Started listening on '%s'.", g_cfg.misc.gdb_server.get()); -- return; -- } -+ int mode = 1; -+ ioctlsocket(server_socket, FIONBIO, (u_long FAR *)&mode); - } -+#else -+ fcntl(server_socket, F_SETFL, fcntl(server_socket, F_GETFL) | O_NONBLOCK); -+#endif - -- // Fallback to UNIX socket -- server_socket = socket(AF_UNIX, SOCK_STREAM, 0); -+ int err; - -- if (server_socket == -1) -- { -- GDB.error("Failed to create Unix socket. Possibly unsupported."); -- return; -- } -+ sockaddr_in server_saddr; -+ server_saddr.sin_family = AF_INET; -+ int port = 2345; -+ server_saddr.sin_port = htons(port); -+ server_saddr.sin_addr.s_addr = htonl(INADDR_LOOPBACK); - -- // Delete existing socket (TODO?) -- fs::remove_file(g_cfg.misc.gdb_server.get()); -- -- set_nonblocking(server_socket); -- -- sockaddr_un unix_saddr; -- unix_saddr.sun_family = AF_UNIX; -- strcpy_trunc(unix_saddr.sun_path, g_cfg.misc.gdb_server.get()); -- -- if (bind(server_socket, (struct sockaddr*) &unix_saddr, sizeof(unix_saddr)) != 0) -+ err = bind(server_socket, (struct sockaddr *) &server_saddr, sizeof(server_saddr)); -+ if (err == -1) - { -- GDB.error("Failed to bind Unix socket '%s'.", g_cfg.misc.gdb_server.get()); -+ GDB.error("Error binding to port %d.", port); - return; - } - -- if (listen(server_socket, 1) != 0) -+ err = listen(server_socket, 1); -+ if (err == -1) - { -- GDB.error("Failed to listen on Unix socket '%s'.", g_cfg.misc.gdb_server.get()); -+ GDB.error("Error listening on port %d.", port); - return; - } - -- GDB.notice("Started listening on Unix socket '%s'.", g_cfg.misc.gdb_server.get()); -+ GDB.notice("Started listening on port %d.", port); - } - - int gdb_thread::read(void* buf, int cnt) -@@ -852,7 +786,7 @@ void gdb_thread::operator()() - { - start_server(); - -- while (server_socket != -1 && thread_ctrl::state() != thread_state::aborting) -+ while (thread_ctrl::state() != thread_state::aborting) - { - sockaddr_in client; - socklen_t client_len = sizeof(client); Property changes on: head/emulators/rpcs3/files/extra-patch-revert-6b1e1e402049 ___________________________________________________________________ Deleted: fbsd:nokeywords ## -1 +0,0 ## -yes \ No newline at end of property Deleted: svn:eol-style ## -1 +0,0 ## -native \ No newline at end of property Deleted: svn:mime-type ## -1 +0,0 ## -text/plain \ No newline at end of property Index: head/emulators/rpcs3/files/extra-patch-revert-db7042b986ab =================================================================== --- head/emulators/rpcs3/files/extra-patch-revert-db7042b986ab (revision 515941) +++ head/emulators/rpcs3/files/extra-patch-revert-db7042b986ab (nonexistent) @@ -1,73 +0,0 @@ ---- Utilities/sync.h.orig 2019-10-19 17:20:18 UTC -+++ Utilities/sync.h -@@ -24,8 +24,6 @@ - #include - - #ifdef _WIN32 --DYNAMIC_IMPORT("ntdll.dll", NtWaitForKeyedEvent, NTSTATUS(HANDLE, PVOID Key, BOOLEAN Alertable, PLARGE_INTEGER Timeout)); --DYNAMIC_IMPORT("ntdll.dll", NtReleaseKeyedEvent, NTSTATUS(HANDLE, PVOID Key, BOOLEAN Alertable, PLARGE_INTEGER Timeout)); - DYNAMIC_IMPORT("ntdll.dll", NtWaitForSingleObject, NTSTATUS(HANDLE Handle, BOOLEAN Alertable, PLARGE_INTEGER Timeout)); - DYNAMIC_IMPORT("ntdll.dll", NtDelayExecution, NTSTATUS(BOOLEAN Alertable, PLARGE_INTEGER DelayInterval)); - #endif ---- rpcs3/util/atomic.cpp.orig 2019-10-19 17:20:18 UTC -+++ rpcs3/util/atomic.cpp -@@ -59,7 +59,7 @@ static thread_local bool(*s_tls_wait_cb)(const void* d - #ifdef USE_POSIX - using sema_handle = sem_t; - #elif defined(_WIN32) --using sema_handle = std::uint16_t; -+using sema_handle = HANDLE; - #else - namespace - { -@@ -119,7 +119,10 @@ static u32 sema_alloc() - // Initialize semaphore (should be very fast) - sem_init(&s_sema_list[id], 0, 0); - #elif defined(_WIN32) -- // Do nothing -+ if (!s_sema_list[id]) -+ { -+ s_sema_list[id] = CreateSemaphoreW(nullptr, 0, 0x7fff'ffff, nullptr); -+ } - #else - if (!s_sema_list[id]) - { -@@ -454,7 +457,7 @@ void atomic_storage_futex::wait(const void* data, std: - qw.QuadPart -= 1; - } - -- if (!NtWaitForKeyedEvent(nullptr, &s_sema_list[sema_id], false, timeout + 1 ? &qw : nullptr)) -+ if (!NtWaitForSingleObject(s_sema_list[sema_id], false, timeout + 1 ? &qw : nullptr)) - { - fallback = true; - } -@@ -569,7 +572,7 @@ void atomic_storage_futex::wait(const void* data, std: - #if defined(_WIN32) && !defined(USE_POSIX) - static LARGE_INTEGER instant{}; - -- if (!NtWaitForKeyedEvent(nullptr, &s_sema_list[sema_id], false, &instant)) -+ if (!NtWaitForSingleObject(s_sema_list[sema_id], false, &instant)) - { - fallback = true; - } -@@ -765,7 +768,7 @@ void atomic_storage_futex::notify_one(const void* data - #ifdef USE_POSIX - sem_post(&s_sema_list[sema_id]); - #elif defined(_WIN32) -- NtReleaseKeyedEvent(nullptr, &s_sema_list[sema_id], 1, nullptr); -+ ReleaseSemaphore(s_sema_list[sema_id], 1, nullptr); - #else - dumb_sema& sema = *s_sema_list[sema_id]; - -@@ -836,9 +839,9 @@ void atomic_storage_futex::notify_all(const void* data - sem_post(&s_sema_list[sema_id]); - } - #elif defined(_WIN32) -- for (u32 i = 0; i < count; i++) -+ if (count) - { -- NtReleaseKeyedEvent(nullptr, &s_sema_list[sema_id], count, nullptr); -+ ReleaseSemaphore(s_sema_list[sema_id], count, nullptr); - } - #else - if (count) Property changes on: head/emulators/rpcs3/files/extra-patch-revert-db7042b986ab ___________________________________________________________________ Deleted: fbsd:nokeywords ## -1 +0,0 ## -yes \ No newline at end of property Deleted: svn:eol-style ## -1 +0,0 ## -native \ No newline at end of property Deleted: svn:mime-type ## -1 +0,0 ## -text/plain \ No newline at end of property Index: head/emulators/rpcs3/files/extra-patch-revert-4504ac2d1248 =================================================================== --- head/emulators/rpcs3/files/extra-patch-revert-4504ac2d1248 (revision 515941) +++ head/emulators/rpcs3/files/extra-patch-revert-4504ac2d1248 (nonexistent) @@ -1,223 +0,0 @@ -rpcs3/util/atomic.cpp:95:3: error: use of undeclared identifier 'fallback_wait' - fallback_wait(data, size, old_value, timeout); - ^ -rpcs3/util/atomic.cpp:219:4: error: use of undeclared identifier 'fallback_notify_one' - fallback_notify_one(data); - ^ -rpcs3/util/atomic.cpp:307:5: error: use of undeclared identifier 'fallback_notify_all' - fallback_notify_all(data); - ^ - ---- rpcs3/util/atomic.cpp.orig 2019-09-13 21:02:48 UTC -+++ rpcs3/util/atomic.cpp -@@ -15,14 +15,11 @@ static atomic_t s_hashtable[s_hashtable_size]; - // Pointer mask without bits used as hash, assuming signed 48-bit pointers - static constexpr u64 s_pointer_mask = 0xffff'ffff'ffff & (~(s_hashtable_size - 1) << 2); - --// Max number of waiters is 32767 --static constexpr u64 s_waiter_mask = 0x7fff'0000'0000'0000; -+// Max number of waiters is 65535 -+static constexpr u64 s_waiter_mask = 0xffff'0000'0000'0000; - --// --static constexpr u64 s_collision_bit = 0x8000'0000'0000'0000; -- - // Implementation detail (remaining bits out of 32 available for futex) --static constexpr u64 s_signal_mask = 0xffffffff & ~(s_waiter_mask | s_pointer_mask | s_collision_bit); -+static constexpr u64 s_signal_mask = 0xffffffff & ~(s_waiter_mask | s_pointer_mask); - - // Callback for wait() function, returns false if wait should return - static thread_local bool(*s_tls_wait_cb)(const void* data) = [](const void*) -@@ -182,8 +179,6 @@ void atomic_storage_futex::wait(const void* data, std: - - u32 new_value = 0; - -- bool fallback = false; -- - const auto [_, ok] = entry.fetch_op([&](u64& value) - { - if ((value & s_waiter_mask) == s_waiter_mask || (value & s_signal_mask) == s_signal_mask) -@@ -196,17 +191,11 @@ void atomic_storage_futex::wait(const void* data, std: - { - // Store pointer bits - value |= (iptr & s_pointer_mask); -- fallback = false; -- --#ifdef _WIN32 -- value += s_signal_mask & -s_signal_mask; --#endif - } - else - { -- // Set collision bit -- value |= s_collision_bit; -- fallback = true; -+ // Set pointer bits to all ones (collision, TODO) -+ value |= s_pointer_mask; - } - - // Add waiter -@@ -220,12 +209,8 @@ void atomic_storage_futex::wait(const void* data, std: - return; - } - -- if (fallback) -+ if (ptr_cmp(data, size, old_value, mask) && s_tls_wait_cb(data)) - { -- fallback_wait(data, size, old_value, timeout, mask); -- } -- else if (ptr_cmp(data, size, old_value, mask) && s_tls_wait_cb(data)) -- { - #ifdef _WIN32 - LARGE_INTEGER qw; - qw.QuadPart = -static_cast(timeout / 100); -@@ -259,18 +244,6 @@ void atomic_storage_futex::wait(const void* data, std: - { - if (value & s_waiter_mask) - { --#ifdef _WIN32 -- if (!fallback) -- { -- if ((value & s_signal_mask) == 0) -- { -- return false; -- } -- -- value -= s_signal_mask & -s_signal_mask; -- } --#endif -- - value -= s_waiter_mask & -s_waiter_mask; - - if ((value & s_waiter_mask) == 0) -@@ -279,7 +257,7 @@ void atomic_storage_futex::wait(const void* data, std: - return false; - }); - -- if (ok || fallback) -+ if (ok) - { - break; - } -@@ -306,20 +284,15 @@ void atomic_storage_futex::notify_one(const void* data - - atomic_t& entry = s_hashtable[(iptr >> 2) % s_hashtable_size]; - -+ bool fallback = false; -+ - const auto [prev, ok] = entry.fetch_op([&](u64& value) - { - if (value & s_waiter_mask && (value & s_pointer_mask) == (iptr & s_pointer_mask)) - { - #ifdef _WIN32 -- if ((value & s_signal_mask) == 0) -- { -- // No relevant waiters, do nothing -- return false; -- } -- -- // Try to decrement if possible -+ // Try to decrement if no collision - value -= s_waiter_mask & -s_waiter_mask; -- value -= s_signal_mask & -s_signal_mask; - - if ((value & s_waiter_mask) == 0) - { -@@ -337,22 +310,30 @@ void atomic_storage_futex::notify_one(const void* data - - if ((value & s_signal_mask) == s_signal_mask) - { -- // Signal will overflow, fallback to notify_all -- notify_all(data); -+ // Signal will overflow, fallback -+ fallback = true; - return false; - } - #endif -+ - return true; - } -- else if (value & s_waiter_mask && value & s_collision_bit) -+ -+ if (value & s_waiter_mask && (value & s_pointer_mask) == s_pointer_mask) - { -- fallback_notify_one(data); -- return false; -+ // Collision, notify everything -+ fallback = true; - } - - return false; - }); - -+ if (fallback) -+ { -+ notify_all(data); -+ return; -+ } -+ - if (ok) - { - #ifdef _WIN32 -@@ -375,32 +356,11 @@ void atomic_storage_futex::notify_all(const void* data - { - if (value & s_waiter_mask) - { -- if ((value & s_pointer_mask) == (iptr & s_pointer_mask)) -+ if ((value & s_pointer_mask) == s_pointer_mask || (value & s_pointer_mask) == (iptr & s_pointer_mask)) - { -- if ((value & s_signal_mask) == 0) -- { -- // No relevant waiters, do nothing -- return false; -- } -- -- const u64 count = (value & s_signal_mask) / (s_signal_mask & -s_signal_mask); -- value -= (s_waiter_mask & -s_waiter_mask) * count; -- value -= (s_signal_mask & -s_signal_mask) * count; -- -- if ((value & s_waiter_mask) == 0) -- { -- // Reset on last waiter -- value = 0; -- } -- -+ value = 0; - return true; - } -- -- if (value & s_collision_bit) -- { -- fallback_notify_all(data); -- return false; -- } - } - - return false; -@@ -411,7 +371,7 @@ void atomic_storage_futex::notify_all(const void* data - return; - } - -- for (u64 count = old & s_signal_mask; count; count -= s_signal_mask & -s_signal_mask) -+ for (u64 count = old & s_waiter_mask; count; count -= s_waiter_mask & -s_waiter_mask) - { - NtReleaseKeyedEvent(nullptr, &entry, false, nullptr); - } -@@ -426,16 +386,10 @@ void atomic_storage_futex::notify_all(const void* data - return false; - } - -- if ((value & s_pointer_mask) == (iptr & s_pointer_mask)) -+ if ((value & s_pointer_mask) == s_pointer_mask || (value & s_pointer_mask) == (iptr & s_pointer_mask)) - { - value += s_signal_mask & -s_signal_mask; - return true; -- } -- -- if (value & s_collision_bit) -- { -- fallback_notify_all(data); -- return false; - } - } - Property changes on: head/emulators/rpcs3/files/extra-patch-revert-4504ac2d1248 ___________________________________________________________________ Deleted: fbsd:nokeywords ## -1 +0,0 ## -yes \ No newline at end of property Deleted: svn:eol-style ## -1 +0,0 ## -native \ No newline at end of property Deleted: svn:mime-type ## -1 +0,0 ## -text/plain \ No newline at end of property Index: head/emulators/rpcs3/files/extra-patch-revert-9710473a2e3e =================================================================== --- head/emulators/rpcs3/files/extra-patch-revert-9710473a2e3e (revision 515941) +++ head/emulators/rpcs3/files/extra-patch-revert-9710473a2e3e (nonexistent) @@ -1,783 +0,0 @@ ---- Utilities/sync.h.orig 2019-09-25 20:20:52 UTC -+++ Utilities/sync.h -@@ -15,6 +15,7 @@ - #include - #include - #include -+#else - #endif - #include - #include -@@ -24,8 +25,12 @@ - #include - - #ifdef _WIN32 --DYNAMIC_IMPORT("ntdll.dll", NtWaitForSingleObject, NTSTATUS(HANDLE Handle, BOOLEAN Alertable, PLARGE_INTEGER Timeout)); -+DYNAMIC_IMPORT("ntdll.dll", NtWaitForKeyedEvent, NTSTATUS(HANDLE Handle, PVOID Key, BOOLEAN Alertable, PLARGE_INTEGER Timeout)); -+DYNAMIC_IMPORT("ntdll.dll", NtReleaseKeyedEvent, NTSTATUS(HANDLE Handle, PVOID Key, BOOLEAN Alertable, PLARGE_INTEGER Timeout)); - DYNAMIC_IMPORT("ntdll.dll", NtDelayExecution, NTSTATUS(BOOLEAN Alertable, PLARGE_INTEGER DelayInterval)); -+inline utils::dynamic_import OptWaitOnAddress("kernel32.dll", "WaitOnAddress"); -+inline utils::dynamic_import OptWakeByAddressSingle("kernel32.dll", "WakeByAddressSingle"); -+inline utils::dynamic_import OptWakeByAddressAll("kernel32.dll", "WakeByAddressAll"); - #endif - - #ifndef __linux__ ---- rpcs3/util/atomic.cpp.orig 2019-09-25 20:20:52 UTC -+++ rpcs3/util/atomic.cpp -@@ -1,24 +1,11 @@ - #include "atomic.hpp" - --// USE_FUTEX takes precedence over USE_POSIX -- --#ifdef __linux__ --#define USE_FUTEX --#define USE_POSIX --#endif -- - #include "Utilities/sync.h" - #include "Utilities/asm.h" - --#ifdef USE_POSIX --#include --#endif -- - #include - #include - #include --#include --#include - - // Total number of entries, should be a power of 2. - static constexpr std::uintptr_t s_hashtable_size = 1u << 22; -@@ -35,18 +22,8 @@ static constexpr u64 s_waiter_mask = 0x7fff'0000'0000' - // - static constexpr u64 s_collision_bit = 0x8000'0000'0000'0000; - --#ifdef USE_FUTEX --static constexpr u64 s_sema_mask = 0; --#else --// Number of search groups (defines max semaphore count as gcount * 64) --static constexpr u32 s_sema_gcount = 64; -- --// Bits encoding allocated semaphore index (zero = not allocated yet) --static constexpr u64 s_sema_mask = (64 * s_sema_gcount - 1) << 2; --#endif -- - // Implementation detail (remaining bits out of 32 available for futex) --static constexpr u64 s_signal_mask = 0xffffffff & ~(s_waiter_mask | s_pointer_mask | s_collision_bit | s_sema_mask); -+static constexpr u64 s_signal_mask = 0xffffffff & ~(s_waiter_mask | s_pointer_mask | s_collision_bit); - - // Callback for wait() function, returns false if wait should return - static thread_local bool(*s_tls_wait_cb)(const void* data) = [](const void*) -@@ -54,140 +31,6 @@ static thread_local bool(*s_tls_wait_cb)(const void* d - return true; - }; - --#ifndef USE_FUTEX -- --#ifdef USE_POSIX --using sema_handle = sem_t; --#elif defined(_WIN32) --using sema_handle = HANDLE; --#else --namespace --{ -- struct dumb_sema -- { -- u64 count = 0; -- std::mutex mutex; -- std::condition_variable cond; -- }; --} -- --using sema_handle = std::unique_ptr; --#endif -- --// Array of native semaphores --static sema_handle s_sema_list[64 * s_sema_gcount]{}; -- --// Array of associated reference counters --static atomic_t s_sema_refs[64 * s_sema_gcount]{}; -- --// Allocation bits (reserve first bit) --static atomic_t s_sema_bits[s_sema_gcount]{1}; -- --static u32 sema_alloc() --{ -- // Diversify search start points to reduce contention and increase immediate success chance --#ifdef _WIN32 -- const u32 start = GetCurrentProcessorNumber(); --#elif __linux__ -- const u32 start = sched_getcpu(); --#else -- const u32 start = __rdtsc(); --#endif -- -- for (u32 i = 0; i < s_sema_gcount * 3; i++) -- { -- const u32 group = (i + start) % s_sema_gcount; -- -- const auto [bits, ok] = s_sema_bits[group].fetch_op([](u64& bits) -- { -- if (~bits) -- { -- // Set lowest clear bit -- bits |= bits + 1; -- return true; -- } -- -- return false; -- }); -- -- if (ok) -- { -- // Find lowest clear bit -- const u32 id = group * 64 + utils::cnttz64(~bits, false); -- --#ifdef USE_POSIX -- // Initialize semaphore (should be very fast) -- sem_init(&s_sema_list[id], 0, 0); --#elif defined(_WIN32) -- if (!s_sema_list[id]) -- { -- s_sema_list[id] = CreateSemaphoreW(nullptr, 0, 0x7fff'ffff, nullptr); -- } --#else -- if (!s_sema_list[id]) -- { -- s_sema_list[id] = std::make_unique(); -- } --#endif -- -- // Initialize ref counter -- if (s_sema_refs[id]++) -- { -- std::abort(); -- } -- -- return id; -- } -- } -- -- return 0; --} -- --static void sema_free(u32 id) --{ -- if (id && id < 64 * s_sema_gcount) -- { -- // Dereference first -- if (--s_sema_refs[id]) -- { -- return; -- } -- --#ifdef USE_POSIX -- // Destroy semaphore (should be very fast) -- sem_destroy(&s_sema_list[id]); --#else -- // No action required --#endif -- -- // Reset allocation bit -- s_sema_bits[id / 64] &= ~(1ull << (id % 64)); -- } --} -- --static bool sema_get(u32 id) --{ -- if (id && id < 64 * s_sema_gcount) -- { -- // Increment only if the semaphore is allocated -- if (s_sema_refs[id].fetch_op([](u64& refs) -- { -- if (refs) -- { -- // Increase reference from non-zero value -- refs++; -- } -- })) -- { -- return true; -- } -- } -- -- return false; --} -- --#endif -- - static inline bool ptr_cmp(const void* data, std::size_t size, u64 old_value, u64 mask) - { - switch (size) -@@ -308,8 +151,27 @@ namespace - } - } - -+#if !defined(_WIN32) && !defined(__linux__) -+ - void atomic_storage_futex::wait(const void* data, std::size_t size, u64 old_value, u64 timeout, u64 mask) - { -+ fallback_wait(data, size, old_value, timeout, mask); -+} -+ -+void atomic_storage_futex::notify_one(const void* data) -+{ -+ fallback_notify_one(data); -+} -+ -+void atomic_storage_futex::notify_all(const void* data) -+{ -+ fallback_notify_all(data); -+} -+ -+#else -+ -+void atomic_storage_futex::wait(const void* data, std::size_t size, u64 old_value, u64 timeout, u64 mask) -+{ - if (!timeout) - { - return; -@@ -323,8 +185,6 @@ void atomic_storage_futex::wait(const void* data, std: - - bool fallback = false; - -- u32 sema_id = -1; -- - const auto [_, ok] = entry.fetch_op([&](u64& value) - { - if ((value & s_waiter_mask) == s_waiter_mask || (value & s_signal_mask) == s_signal_mask) -@@ -333,15 +193,15 @@ void atomic_storage_futex::wait(const void* data, std: - return false; - } - --#ifndef USE_FUTEX -- sema_id = (value & s_sema_mask) >> 2; --#endif -- - if (!value || (value & s_pointer_mask) == (iptr & s_pointer_mask)) - { - // Store pointer bits - value |= (iptr & s_pointer_mask); - fallback = false; -+ -+#ifdef _WIN32 -+ value += s_signal_mask & -s_signal_mask; -+#endif - } - else - { -@@ -361,93 +221,13 @@ void atomic_storage_futex::wait(const void* data, std: - return; - } - --#ifndef USE_FUTEX -- for (u32 loop_count = 0; !fallback && loop_count < 7; loop_count++) -- { -- // Try to allocate a semaphore -- if (!sema_id) -- { -- const u32 sema = sema_alloc(); -- -- if (!sema) -- { -- break; -- } -- -- sema_id = entry.atomic_op([&](u64& value) -> u32 -- { -- if (value & s_sema_mask) -- { -- return (value & s_sema_mask) >> 2; -- } -- -- // Insert allocated semaphore -- value += s_signal_mask & -s_signal_mask; -- value |= (u64{sema} << 2); -- return 0; -- }); -- -- if (sema_id) -- { -- // Drop unnecessary allocation -- sema_free(sema); -- } -- else -- { -- sema_id = sema; -- break; -- } -- } -- -- if (!sema_get(sema_id)) -- { -- sema_id = 0; -- continue; -- } -- -- // Try to increment sig (check semaphore validity) -- const auto [_old, ok] = entry.fetch_op([&](u64& value) -- { -- if ((value & s_signal_mask) == s_signal_mask) -- { -- return false; -- } -- -- if ((value & s_sema_mask) >> 2 != sema_id) -- { -- return false; -- } -- -- value += s_signal_mask & -s_signal_mask; -- return true; -- }); -- -- if (!ok) -- { -- sema_free(sema_id); -- sema_id = 0; -- -- if ((_old & s_signal_mask) == s_signal_mask) -- { -- // Break on signal overflow -- break; -- } -- -- continue; -- } -- -- break; -- } --#endif -- - if (fallback) - { - fallback_wait(data, size, old_value, timeout, mask); - } -- else if (sema_id && ptr_cmp(data, size, old_value, mask) && s_tls_wait_cb(data)) -+ else if (ptr_cmp(data, size, old_value, mask) && s_tls_wait_cb(data)) - { --#ifndef USE_FUTEX --#if defined(_WIN32) && !defined(USE_POSIX) -+#ifdef _WIN32 - LARGE_INTEGER qw; - qw.QuadPart = -static_cast(timeout / 100); - -@@ -457,60 +237,13 @@ void atomic_storage_futex::wait(const void* data, std: - qw.QuadPart -= 1; - } - -- if (!NtWaitForSingleObject(s_sema_list[sema_id], false, timeout + 1 ? &qw : nullptr)) -+ if (!NtWaitForKeyedEvent(nullptr, &entry, false, timeout + 1 ? &qw : nullptr)) - { -- fallback = true; -+ // Return if no errors, continue if timed out -+ s_tls_wait_cb(nullptr); -+ return; - } --#elif defined(USE_POSIX) -- struct timespec ts; -- clock_gettime(CLOCK_REALTIME, &ts); -- ts.tv_sec += timeout / 1'000'000'000; -- ts.tv_nsec += timeout % 1'000'000'000; -- ts.tv_sec += ts.tv_nsec / 1'000'000'000; -- ts.tv_nsec %= 1'000'000'000; -- -- // It's pretty unreliable because it uses absolute time, which may jump backwards. Sigh. -- if (timeout + 1) -- { -- if (sem_timedwait(&s_sema_list[sema_id], &ts) == 0) -- { -- fallback = true; -- } -- } -- else -- { -- if (sem_wait(&s_sema_list[sema_id]) == 0) -- { -- fallback = true; -- } -- } - #else -- dumb_sema& sema = *s_sema_list[sema_id]; -- -- std::unique_lock lock(sema.mutex); -- -- if (timeout + 1) -- { -- sema.cond.wait_for(lock, std::chrono::nanoseconds(timeout), [&] -- { -- return sema.count > 0; -- }); -- } -- else -- { -- sema.cond.wait(lock, [&] -- { -- return sema.count > 0; -- }); -- } -- -- if (sema.count > 0) -- { -- sema.count--; -- fallback = true; -- } --#endif --#else - struct timespec ts; - ts.tv_sec = timeout / 1'000'000'000; - ts.tv_nsec = timeout % 1'000'000'000; -@@ -519,11 +252,6 @@ void atomic_storage_futex::wait(const void* data, std: - #endif - } - -- if (!sema_id) -- { -- fallback = true; -- } -- - while (true) - { - // Try to decrement -@@ -531,21 +259,15 @@ void atomic_storage_futex::wait(const void* data, std: - { - if (value & s_waiter_mask) - { --#ifndef USE_FUTEX -- // If timeout -+#ifdef _WIN32 - if (!fallback) - { -- if ((value & s_signal_mask) == 0 || (value & s_sema_mask) >> 2 != sema_id) -+ if ((value & s_signal_mask) == 0) - { - return false; - } - - value -= s_signal_mask & -s_signal_mask; -- -- if ((value & s_signal_mask) == 0) -- { -- value &= ~s_sema_mask; -- } - } - #endif - -@@ -568,45 +290,22 @@ void atomic_storage_futex::wait(const void* data, std: - break; - } - --#ifndef USE_FUTEX --#if defined(_WIN32) && !defined(USE_POSIX) -+#ifdef _WIN32 - static LARGE_INTEGER instant{}; - -- if (!NtWaitForSingleObject(s_sema_list[sema_id], false, &instant)) -+ if (!NtWaitForKeyedEvent(nullptr, &entry, false, &instant)) - { -- fallback = true; -+ break; - } --#elif defined(USE_POSIX) -- if (sem_trywait(&s_sema_list[sema_id]) == 0) -- { -- fallback = true; -- } - #else -- dumb_sema& sema = *s_sema_list[sema_id]; -- -- std::unique_lock lock(sema.mutex); -- -- if (sema.count > 0) -- { -- sema.count--; -- fallback = true; -- } -+ // Unreachable -+ std::terminate(); - #endif --#endif - } - --#ifndef USE_FUTEX -- if (sema_id) -- { -- sema_free(sema_id); -- } --#endif -- - s_tls_wait_cb(nullptr); - } - --#ifdef USE_FUTEX -- - void atomic_storage_futex::notify_one(const void* data) - { - const std::uintptr_t iptr = reinterpret_cast(data); -@@ -617,6 +316,23 @@ void atomic_storage_futex::notify_one(const void* data - { - if (value & s_waiter_mask && (value & s_pointer_mask) == (iptr & s_pointer_mask)) - { -+#ifdef _WIN32 -+ if ((value & s_signal_mask) == 0) -+ { -+ // No relevant waiters, do nothing -+ return false; -+ } -+ -+ // Try to decrement if possible -+ value -= s_waiter_mask & -s_waiter_mask; -+ value -= s_signal_mask & -s_signal_mask; -+ -+ if ((value & s_waiter_mask) == 0) -+ { -+ // Reset on last waiter -+ value = 0; -+ } -+#else - if ((value & s_signal_mask) == s_signal_mask) - { - // Signal overflow, do nothing -@@ -631,7 +347,7 @@ void atomic_storage_futex::notify_one(const void* data - notify_all(data); - return false; - } -- -+#endif - return true; - } - else if (value & s_waiter_mask && value & s_collision_bit) -@@ -645,7 +361,11 @@ void atomic_storage_futex::notify_one(const void* data - - if (ok) - { -+#ifdef _WIN32 -+ NtReleaseKeyedEvent(nullptr, &entry, false, nullptr); -+#else - futex(reinterpret_cast(&entry) + 4 * IS_BE_MACHINE, FUTEX_WAKE_PRIVATE, 1); -+#endif - } - } - -@@ -655,6 +375,53 @@ void atomic_storage_futex::notify_all(const void* data - - atomic_t& entry = s_hashtable[(iptr >> 2) % s_hashtable_size]; - -+ // Try to consume everything -+#ifdef _WIN32 -+ const auto [old, ok] = entry.fetch_op([&](u64& value) -+ { -+ if (value & s_waiter_mask) -+ { -+ if ((value & s_pointer_mask) == (iptr & s_pointer_mask)) -+ { -+ if ((value & s_signal_mask) == 0) -+ { -+ // No relevant waiters, do nothing -+ return false; -+ } -+ -+ const u64 count = (value & s_signal_mask) / (s_signal_mask & -s_signal_mask); -+ value -= (s_waiter_mask & -s_waiter_mask) * count; -+ value -= (s_signal_mask & -s_signal_mask) * count; -+ -+ if ((value & s_waiter_mask) == 0) -+ { -+ // Reset on last waiter -+ value = 0; -+ } -+ -+ return true; -+ } -+ -+ if (value & s_collision_bit) -+ { -+ fallback_notify_all(data); -+ return false; -+ } -+ } -+ -+ return false; -+ }); -+ -+ if (!ok) -+ { -+ return; -+ } -+ -+ for (u64 count = old & s_signal_mask; count; count -= s_signal_mask & -s_signal_mask) -+ { -+ NtReleaseKeyedEvent(nullptr, &entry, false, nullptr); -+ } -+#else - const auto [_, ok] = entry.fetch_op([&](u64& value) - { - if (value & s_waiter_mask) -@@ -685,6 +452,7 @@ void atomic_storage_futex::notify_all(const void* data - { - futex(reinterpret_cast(&entry) + 4 * IS_BE_MACHINE, FUTEX_WAKE_PRIVATE, 0x7fffffff); - } -+#endif - } - - #endif -@@ -704,158 +472,3 @@ void atomic_storage_futex::raw_notify(const void* data - notify_all(data); - } - } -- --#ifndef USE_FUTEX -- --void atomic_storage_futex::notify_one(const void* data) --{ -- const std::uintptr_t iptr = reinterpret_cast(data); -- -- atomic_t& entry = s_hashtable[(iptr >> 2) % s_hashtable_size]; -- -- const u64 value = entry; -- -- if (value & s_waiter_mask && (value & s_pointer_mask) == (iptr & s_pointer_mask)) -- { -- if ((value & s_signal_mask) == 0 || (value & s_sema_mask) == 0) -- { -- // No relevant waiters, do nothing -- return; -- } -- } -- else if (value & s_waiter_mask && value & s_collision_bit) -- { -- fallback_notify_one(data); -- return; -- } -- else -- { -- return; -- } -- -- const u32 sema_id = (value & s_sema_mask) >> 2; -- -- if (!sema_get(sema_id)) -- { -- return; -- } -- -- const auto [_, ok] = entry.fetch_op([&](u64& value) -- { -- if ((value & s_waiter_mask) == 0 || (value & s_pointer_mask) != (iptr & s_pointer_mask)) -- { -- return false; -- } -- -- if ((value & s_signal_mask) == 0 || (value & s_sema_mask) >> 2 != sema_id) -- { -- return false; -- } -- -- value -= s_signal_mask & -s_signal_mask; -- -- // Reset allocated semaphore on last waiter -- if ((value & s_signal_mask) == 0) -- { -- value &= ~s_sema_mask; -- } -- -- return true; -- }); -- -- if (ok) -- { --#ifdef USE_POSIX -- sem_post(&s_sema_list[sema_id]); --#elif defined(_WIN32) -- ReleaseSemaphore(s_sema_list[sema_id], 1, nullptr); --#else -- dumb_sema& sema = *s_sema_list[sema_id]; -- -- sema.mutex.lock(); -- sema.count += 1; -- sema.mutex.unlock(); -- sema.cond.notify_one(); --#endif -- } -- -- sema_free(sema_id); --} -- --void atomic_storage_futex::notify_all(const void* data) --{ -- const std::uintptr_t iptr = reinterpret_cast(data); -- -- atomic_t& entry = s_hashtable[(iptr >> 2) % s_hashtable_size]; -- -- const u64 value = entry; -- -- if (value & s_waiter_mask && (value & s_pointer_mask) == (iptr & s_pointer_mask)) -- { -- if ((value & s_signal_mask) == 0 || (value & s_sema_mask) == 0) -- { -- // No relevant waiters, do nothing -- return; -- } -- } -- else if (value & s_waiter_mask && value & s_collision_bit) -- { -- fallback_notify_all(data); -- return; -- } -- else -- { -- return; -- } -- -- const u32 sema_id = (value & s_sema_mask) >> 2; -- -- if (!sema_get(sema_id)) -- { -- return; -- } -- -- const auto [_, count] = entry.fetch_op([&](u64& value) -> u32 -- { -- if ((value & s_waiter_mask) == 0 || (value & s_pointer_mask) != (iptr & s_pointer_mask)) -- { -- return 0; -- } -- -- if ((value & s_signal_mask) == 0 || (value & s_sema_mask) >> 2 != sema_id) -- { -- return 0; -- } -- -- const u32 r = (value & s_signal_mask) / (s_signal_mask & -s_signal_mask); -- value &= ~s_sema_mask; -- value &= ~s_signal_mask; -- return r; -- }); -- --#ifdef USE_POSIX -- for (u32 i = 0; i < count; i++) -- { -- sem_post(&s_sema_list[sema_id]); -- } --#elif defined(_WIN32) -- if (count) -- { -- ReleaseSemaphore(s_sema_list[sema_id], count, nullptr); -- } --#else -- if (count) -- { -- dumb_sema& sema = *s_sema_list[sema_id]; -- -- sema.mutex.lock(); -- sema.count += count; -- sema.mutex.unlock(); -- sema.cond.notify_all(); -- } --#endif -- -- sema_free(sema_id); --} -- --#endif Property changes on: head/emulators/rpcs3/files/extra-patch-revert-9710473a2e3e ___________________________________________________________________ Deleted: fbsd:nokeywords ## -1 +0,0 ## -yes \ No newline at end of property Deleted: svn:eol-style ## -1 +0,0 ## -native \ No newline at end of property Deleted: svn:mime-type ## -1 +0,0 ## -text/plain \ No newline at end of property Index: head/emulators/rpcs3/files/extra-patch-revert-f9ad6358563b =================================================================== --- head/emulators/rpcs3/files/extra-patch-revert-f9ad6358563b (revision 515941) +++ head/emulators/rpcs3/files/extra-patch-revert-f9ad6358563b (nonexistent) @@ -1,169 +0,0 @@ -In file included from rpcs3/Emu/RSX/GL/GLGSRender.cpp:4: -In file included from rpcs3/Emu/RSX/GL/GLGSRender.h:8: -In file included from rpcs3/Emu/RSX/GL/GLTextOut.h:5: -rpcs3/Emu/RSX/GL/../Common/TextGlyphs.h:4:10: fatal error: 'charconv' file not found -#include - ^~~~~~~~~~ -rpcs3/Emu/RSX/GL/../Common/TextGlyphs.h:174:9: error: - no member named 'from_chars' in namespace 'std' - std::from_chars(index.data(), index.data() + index.size(), this_glyph.character, 16); - ~~~~~^ -rpcs3/Emu/RSX/GL/../Common/TextGlyphs.h:182:11: error: - no member named 'from_chars' in namespace 'std' - std::from_chars(line.data(), line.data() + line.size(), this_glyph... - ~~~~~^ - ---- rpcs3/Emu/RSX/Common/TextGlyphs.h.orig 2019-06-10 11:57:03 UTC -+++ rpcs3/Emu/RSX/Common/TextGlyphs.h -@@ -1,13 +1,9 @@ - #pragma once - --#include --#include --#include --#include - #include -+#include -+#include - --#include "Utilities/types.h" -- - /** - * FONT GLYPHS GO HERE - * Any font in hex format should work here. -@@ -16,7 +12,7 @@ - * This example is the GNU unifont glyph set - */ - --constexpr std::array GNU_UNIFONT_GLYPHS = -+const static std::string GNU_UNIFONT_GLYPHS[128] = - { - "0000 : AAAA00018000000180004A51EA505A51C99E0001800000018000000180005555", - "0001 : AAAA00018000000180003993C252325F8A527193800000018000000180005555", -@@ -157,37 +153,40 @@ class GlyphManager (private) - u8 character; - u32 glyph_point_offset; - u32 points_count; -- std::array plot; -+ std::vector plot; - }; - -- std::vector glyph_map; -+ std::unordered_map glyph_map; - -- void decode_glyph_map(const std::array& font_glyphs) -+ void decode_glyph_map(const std::string glyphs[128]) - { -- glyph_map.reserve(font_glyphs.size()); -- -- for (const auto &font_glyph : font_glyphs) -+ for (int i = 0; i < 128; ++i) - { -- glyph this_glyph{}; -+ std::string character = glyphs[i]; -+ std::string index = character.substr(0, 4); -+ std::string glyph_data = character.substr(7); - -- const auto index = font_glyph.substr(0, 4); -- std::from_chars(index.data(), index.data() + index.size(), this_glyph.character, 16); -+ glyph this_glyph; -+ this_glyph.character = (u8)strtol(index.c_str(), nullptr, 16); -+ this_glyph.plot.reserve(16); - -- const auto glyph_data = font_glyph.substr(7); - if (glyph_data.length() == 32) - { -- for (std::size_t n = 0; n < this_glyph.plot.size(); ++n) -+ for (int n = 0; n < 16; ++n) - { -- const auto line = glyph_data.substr(n * 2, 2); -- std::from_chars(line.data(), line.data() + line.size(), this_glyph.plot[n], 16); -+ std::string line = glyph_data.substr(n * 2, 2); -+ u8 value = (u8)strtol(line.c_str(), nullptr, 16); -+ this_glyph.plot.push_back(value); - } - } - else - { -- // TODO: Support 16-wide characters -+ //TODO: Support 16-wide characters -+ for (int n = 0; n < 16; ++n) -+ this_glyph.plot.push_back(0); - } - -- glyph_map.push_back(this_glyph); -+ glyph_map[this_glyph.character] = this_glyph; - } - } - -@@ -198,12 +197,13 @@ class GlyphManager (private) - float x; - float y; - -- explicit glyph_point(float _x, float _y) : x(_x), y(_y) -+ glyph_point(float _x, float _y) : x(_x), y(_y) - {} - }; - - GlyphManager() - { -+ glyph_map = {}; - decode_glyph_map(GNU_UNIFONT_GLYPHS); - } - -@@ -213,11 +213,12 @@ class GlyphManager (private) - - for (auto &entry : glyph_map) - { -- entry.glyph_point_offset = (u32)result.size(); -+ glyph& text = entry.second; -+ text.glyph_point_offset = (u32)result.size(); - -- for (std::size_t j = 0; j < entry.plot.size(); ++j) -+ for (int j = 0; j < 16; ++j) - { -- const auto &line = entry.plot[j]; -+ auto &line = text.plot[j]; - if (line == 0) - continue; - -@@ -225,29 +226,28 @@ class GlyphManager (private) - { - if (line & (1 << i)) - { -- // Font is inverted, so we correct it for conventional renderers -- const auto x = (float)(7 - i); -- const auto y = (float)(15 - j); -- result.emplace_back(x, y); -+ //Font is inverted, so we correct it for conventional renderers -+ float x = (float)(7 - i); -+ float y = (float)(15 - j); -+ result.push_back({ x, y }); - } - } - } - -- entry.points_count = (u32)result.size() - entry.glyph_point_offset; -+ text.points_count = (u32)result.size() - text.glyph_point_offset; - } - - return result; - } - -- std::unordered_map> get_glyph_offsets() const -+ std::unordered_map> get_glyph_offsets() - { - std::unordered_map> result = {}; -- -- for (const auto &entry : glyph_map) -+ for (auto &entry : glyph_map) - { -- result[entry.character] = std::make_pair(entry.glyph_point_offset, entry.points_count); -+ result[entry.second.character] = std::make_pair(entry.second.glyph_point_offset, entry.second.points_count); - } - - return result; - } --}; -+}; -\ No newline at end of file Property changes on: head/emulators/rpcs3/files/extra-patch-revert-f9ad6358563b ___________________________________________________________________ Deleted: fbsd:nokeywords ## -1 +0,0 ## -yes \ No newline at end of property Deleted: svn:eol-style ## -1 +0,0 ## -native \ No newline at end of property Deleted: svn:mime-type ## -1 +0,0 ## -text/plain \ No newline at end of property Index: head/emulators/rpcs3/files/extra-patch-revert-5bd17a44c972 =================================================================== --- head/emulators/rpcs3/files/extra-patch-revert-5bd17a44c972 (revision 515941) +++ head/emulators/rpcs3/files/extra-patch-revert-5bd17a44c972 (nonexistent) @@ -1,184 +0,0 @@ -rpcs3/util/atomic.cpp:55:51: error: no type named 'node_type' in 'std::__1::multimap, std::__1::allocator > >'; did you mean 'size_type'? - thread_local std::multimap::node_type s_tls_waiter = []() - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~ - size_type -/usr/include/c++/v1/map:1507:60: note: 'size_type' declared here - typedef typename __alloc_traits::size_type size_type; - ^ -rpcs3/util/atomic.cpp:59:16: error: no member named 'extract' in 'std::__1::multimap, std::__1::allocator > >' - return dummy.extract(dummy.emplace(nullptr, &s_tls_waiter)); - ~~~~~ ^ -rpcs3/util/atomic.cpp:55:61: error: cannot initialize a variable of type 'std::multimap::size_type' (aka 'unsigned long') with an rvalue of type 'void' - thread_local std::multimap::node_type s_tls_waiter = []() - ^ ~~~~ -rpcs3/util/atomic.cpp:92:69: error: no type named 'node_type' in 'std::__1::multimap, std::__1::allocator > >'; did you mean 'size_type'? - const auto ptls = static_cast::node_type*>(found->second.tls_ptr); - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~ - size_type -/usr/include/c++/v1/map:1507:60: note: 'size_type' declared here - typedef typename __alloc_traits::size_type size_type; - ^ -rpcs3/util/atomic.cpp:93:21: error: no member named 'extract' in 'std::__1::multimap, std::__1::allocator > >' - *ptls = wmap.list.extract(found); - ~~~~~~~~~ ^ -rpcs3/util/atomic.cpp:94:7: error: member reference base type 'unsigned long' is not a structure or union - ptls->mapped().cond.notify_one(); - ~~~~^ ~~~~~~ - ---- rpcs3/util/atomic.cpp.orig 2019-09-13 21:02:48 UTC -+++ rpcs3/util/atomic.cpp -@@ -2,10 +2,6 @@ - - #include "Utilities/sync.h" - --#include --#include --#include -- - // Total number of entries, should be a power of 2. - static constexpr std::uintptr_t s_hashtable_size = 1u << 22; - -@@ -40,134 +36,8 @@ static inline bool ptr_cmp(const void* data, std::size - return false; - } - --// Fallback implementation --namespace --{ -- struct waiter -- { -- std::condition_variable cond; -- void* const tls_ptr; -- -- explicit waiter(void* tls_ptr) -- : tls_ptr(tls_ptr) -- { -- } -- }; -- -- struct waiter_map -- { -- std::mutex mutex; -- std::multimap list; -- }; -- -- // Thread's unique node to insert without allocation -- thread_local std::multimap::node_type s_tls_waiter = []() -- { -- // Initialize node from a dummy container (there is no separate node constructor) -- std::multimap dummy; -- return dummy.extract(dummy.emplace(nullptr, &s_tls_waiter)); -- }(); -- -- waiter_map& get_fallback_map(const void* ptr) -- { -- static waiter_map s_waiter_maps[4096]; -- -- return s_waiter_maps[std::hash()(ptr) % std::size(s_waiter_maps)]; -- } -- -- void fallback_wait(const void* data, std::size_t size, u64 old_value, u64 timeout, u64 mask) -- { -- auto& wmap = get_fallback_map(data); -- -- if (!timeout) -- { -- return; -- } -- -- // Update node key -- s_tls_waiter.key() = data; -- -- if (std::unique_lock lock(wmap.mutex); ptr_cmp(data, size, old_value, mask) && s_tls_wait_cb(data)) -- { -- // Add node to the waiter list -- const auto iter = wmap.list.insert(std::move(s_tls_waiter)); -- -- // Wait until the node is returned to its TLS location -- if (timeout + 1) -- { -- if (!iter->second.cond.wait_for(lock, std::chrono::nanoseconds(timeout), [&] -- { -- return 1 && s_tls_waiter; -- })) -- { -- // Put it back -- s_tls_waiter = wmap.list.extract(iter); -- } -- -- return; -- } -- -- while (!s_tls_waiter) -- { -- iter->second.cond.wait(lock); -- } -- } -- } -- -- void fallback_notify(waiter_map& wmap, std::multimap::iterator found) -- { -- // Return notified node to its TLS location -- const auto ptls = static_cast::node_type*>(found->second.tls_ptr); -- *ptls = wmap.list.extract(found); -- ptls->mapped().cond.notify_one(); -- } -- -- void fallback_notify_one(const void* data) -- { -- auto& wmap = get_fallback_map(data); -- -- std::lock_guard lock(wmap.mutex); -- -- if (auto found = wmap.list.find(data); found != wmap.list.end()) -- { -- fallback_notify(wmap, found); -- } -- } -- -- void fallback_notify_all(const void* data) -- { -- auto& wmap = get_fallback_map(data); -- -- std::lock_guard lock(wmap.mutex); -- -- for (auto it = wmap.list.lower_bound(data); it != wmap.list.end() && it->first == data;) -- { -- fallback_notify(wmap, it++); -- } -- } --} -- --#if !defined(_WIN32) && !defined(__linux__) -- - void atomic_storage_futex::wait(const void* data, std::size_t size, u64 old_value, u64 timeout, u64 mask) - { -- fallback_wait(data, size, old_value, timeout, mask); --} -- --void atomic_storage_futex::notify_one(const void* data) --{ -- fallback_notify_one(data); --} -- --void atomic_storage_futex::notify_all(const void* data) --{ -- fallback_notify_all(data); --} -- --#else -- --void atomic_storage_futex::wait(const void* data, std::size_t size, u64 old_value, u64 timeout, u64 mask) --{ - if (!timeout) - { - return; -@@ -402,8 +272,6 @@ void atomic_storage_futex::notify_all(const void* data - } - #endif - } -- --#endif - - void atomic_storage_futex::set_wait_callback(bool(*cb)(const void* data)) - { Property changes on: head/emulators/rpcs3/files/extra-patch-revert-5bd17a44c972 ___________________________________________________________________ Deleted: fbsd:nokeywords ## -1 +0,0 ## -yes \ No newline at end of property Deleted: svn:eol-style ## -1 +0,0 ## -native \ No newline at end of property Deleted: svn:mime-type ## -1 +0,0 ## -text/plain \ No newline at end of property Index: head/emulators/rpcs3/files/extra-patch-no-cotire =================================================================== --- head/emulators/rpcs3/files/extra-patch-no-cotire (nonexistent) +++ head/emulators/rpcs3/files/extra-patch-no-cotire (revision 515942) @@ -0,0 +1,41 @@ +- Cotire precompiles system libc++ headers but bundled are needed + +--- rpcs3/CMakeLists.txt.orig 2019-10-27 16:17:27 UTC ++++ rpcs3/CMakeLists.txt +@@ -1,7 +1,5 @@ + cmake_minimum_required(VERSION 3.8.2) + +-include(cotire) +- + # Generate git-version.h at build time. + include(${CMAKE_CURRENT_SOURCE_DIR}/git-version.cmake) + +@@ -97,12 +95,6 @@ if(WIN32) + else() + target_link_libraries(rpcs3 ${CMAKE_DL_LIBS}) + endif() +- +-set_target_properties(rpcs3 PROPERTIES +- COTIRE_CXX_PREFIX_HEADER_INIT "${RPCS3_SRC_DIR}/stdafx.h" +- COTIRE_ADD_UNITY_BUILD OFF) +- +-cotire(rpcs3) + + # Copy icons to executable directory + if(APPLE) +--- rpcs3/Emu/CMakeLists.txt.orig 2019-10-27 16:17:27 UTC ++++ rpcs3/Emu/CMakeLists.txt +@@ -397,13 +397,3 @@ target_link_libraries(rpcs3_emu + PRIVATE + 3rdparty::gsl 3rdparty::xxhash + ) +- +- +-# Setup cotire +-option(UNITY_BUILD_EMU "Use unity build for rpcs3_emu target" OFF) +- +-set_target_properties(rpcs3_emu PROPERTIES +- COTIRE_CXX_PREFIX_HEADER_INIT "${RPCS3_SRC_DIR}/stdafx.h" +- COTIRE_ADD_UNITY_BUILD ${UNITY_BUILD_EMU}) +- +-cotire(rpcs3_emu) Property changes on: head/emulators/rpcs3/files/extra-patch-no-cotire ___________________________________________________________________ Added: fbsd:nokeywords ## -0,0 +1 ## +yes \ No newline at end of property Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property