Commit graph

17 commits

Author SHA1 Message Date
Elad 575a245f8d
IDM: Implement lock-free smart pointers (#16403)
Replaces `std::shared_pointer` with `stx::atomic_ptr` and `stx::shared_ptr`.

Notes to programmers:

* This pr kills the use of `dynamic_cast`, `std::dynamic_pointer_cast` and `std::weak_ptr` on IDM objects, possible replacement is to save the object ID on the base object, then use idm::check/get_unlocked to the destination type via the saved ID which may be null. Null pointer check is how you can tell type mismatch (as dynamic cast) or object destruction (as weak_ptr locking).
* Double-inheritance on IDM objects should be used with care, `stx::shared_ptr` does not support constant-evaluated pointer offsetting to parent/child type.
* `idm::check/get_unlocked` can now be used anywhere.

Misc fixes:
* Fixes some segfaults with RPCN with interaction with IDM.
* Fix deadlocks in access violation handler due locking recursion.
* Fixes race condition in process exit-spawn on memory containers read.
* Fix bug that theoretically can prevent RPCS3 from booting - fix `id_manager::typeinfo` comparison to compare members instead of `memcmp` which can fail spuriously on padding bytes.
* Ensure all IDM inherited types of base, either has `id_base` or `id_type` defined locally, this allows to make getters such as `idm::get_unlocked<lv2_socket, lv2_socket_raw>()` which were broken before. (requires save-states invalidation)
* Removes broken operator[] overload of `stx::shared_ptr` and `stx::single_ptr` for non-array types.
2024-12-22 20:59:48 +02:00
Elad Ashkenazi 29b0298f1e Fix sys_io thread deadlock
Co-Authored-By: Megamouse <23019877+Megamouse@users.noreply.github.com>
2024-08-14 08:56:40 +03:00
Eladash 9aff2d5ee1 cellPad: Fix LDD pads registration 2024-01-01 11:58:00 +02:00
Eladash e6f1e598a9 Fix pad_state_notify_state_change 2024-01-01 11:58:00 +02:00
Megamouse 7a02787bee fix some more warnings 2023-12-30 21:14:26 +01:00
Eladash f60bdbaece Savestates: Compressed state files 2023-11-27 12:36:17 +02:00
Megamouse 9d88102520 cellPad: fix potential out of bounds read and u32 warnings 2023-08-27 00:18:23 +02:00
Eladash 68c70dd1b9 Savestates: Fix config_event_entry compatibility 2023-08-25 12:52:02 +03:00
Elad Ashkenazi 219ee76bf2 cellPad: Fixup sys_config management 2023-08-13 14:20:39 +03:00
Eladash 4bbe885f35 LV2/cellPad: Implement priority-based connection updates 2023-08-10 09:31:49 +03:00
Nekotekina ea5e837bd6 fixed_typemap.hpp: return reference 2021-03-02 16:08:14 +03:00
Eladash e4c3b1c2bd vm: Remove vm::dealloc_verbose_nothrow 2021-01-15 17:37:52 +03:00
Nekotekina e055d16b2c Replace verify() with ensure() with auto src location.
Expression ensure(x) returns x.
Using comma operator removed.
2020-12-09 15:43:38 +03:00
RipleyTom af8c661a64 Remove BOM markers 2020-12-06 15:30:12 +03:00
Eladash 83d71519e0 Implement HLE sys_config stack allocation 2020-09-26 21:48:12 +03:00
Megamouse d854a39500 add a gazillion more error_code 2020-07-24 14:47:10 +02:00
Eladash 1915fe75a4 VSH: Stubs 2020-02-08 23:07:03 +03:00
Renamed from rpcs3/Emu/Cell/Modules/sys_io.cpp (Browse further)