Commit graph

81 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
Antonino Di Guardo 3f66297593
Fix crash on VFS Tool (#16146) 2024-09-29 03:11:27 +03:00
Megamouse 5fb6be4bf6 vfs_directory: try to fix compilation on gcc 14.1 2024-05-11 18:40:55 +02:00
Eladash 825ae5b8aa Ensure HDD1 is never damaged or corrupted due to unexpected RPCS3/game termination 2024-01-11 20:24:53 +02:00
Eladash edf74313ef Remove some fxo->need calls 2023-12-19 15:34:07 +02:00
Megamouse f11c1613bd fix unused parameter warning 2023-10-25 21:44:31 +02:00
Elad Ashkenazi 927685fd63 VFS: fix rename 2023-10-16 14:47:50 +03:00
Eladash 0240a7d43d sys_fs: Savestate fixup 2023-10-05 05:07:46 +03:00
Eladash c3f1d39563 Improve vfs::host::rename 2023-10-03 15:50:46 +03:00
Eladash ce3d7f90fd VFS: Fix recursive locking 2023-10-03 05:32:39 +03:00
brian218 6a570ae57e sys_fs: Implemented sys_fs_mount(prot=1) read-only mounting & fixed up some operation and permission checks 2023-06-05 13:51:54 +03:00
Megamouse 54e6cf95d7 Fix some warnings 2023-05-18 12:41:22 +02:00
Elad Ashkenazi 8bc92a2cbb
VFS: Fix mounting non-existant paths (#13488) 2023-03-04 17:12:45 +01:00
Elad Ashkenazi e6a7597444
PRX/savestates/VSH: Associate PRX with library, fix VSH browser (#13221)
* PRX/savestate:s Associate PRX with library

* VFS/Savestates: Fix host_root resolving

* Savestates: Fix segfault in ppu_initialize

* SPU: Avoid some log spam

* VSH/sys_vm: Fix limit on root processes
2023-01-15 23:12:54 +03:00
brian218 b639f3c8ec Fixed up lv2_fs_mount_point stuff & Fixed loop.tmp potential leak 2022-11-19 10:42:49 +01:00
brian218 13ca1a7f09 Further implemented sys_fs_get_mount_info() and sys_fs_get_mount_info_size() 2022-11-19 10:42:49 +01:00
brian218 c7ced46707 Add support for mounting and unmounting CELL_FS_SIMPLEFS 2022-10-31 18:53:09 +03:00
Nekotekina a1b4ffcf52 VFS.cpp: fixup for mounting files 2022-10-31 14:20:02 +03:00
brian218 61a371b106 Implemented sys_fs_mount() and sys_fs_unmount() 2022-10-28 08:51:41 +02:00
Nekotekina 6ff6a4989a Implement at32() util
Works like .at() but uses source location for "exception".
2022-09-26 18:04:15 +03:00
Nekotekina b49a1f27eb Warning fixes 2022-09-17 16:35:02 +03:00
Eladash 68718361a7 Allow non-existing paths in vfs::retrieve 2022-07-19 10:43:51 +03:00
Eladash dc48944979 Prefer BDVD over HDD0 in vfs::retrieve 2022-07-19 10:43:51 +03:00
Elad Ashkenazi fcd297ffb2
Savestates Support For PS3 Emulation (#10478) 2022-07-04 16:02:17 +03:00
Megamouse 87762a9b17 cellGame: implement disc change callbacks 2022-06-24 17:34:21 +02:00
aliaspider 5797673daa fix vfs::host::rename.
- resolve_path requires the path to be valid and can only be used before
the call to fs::rename, not after.
2022-03-21 08:49:01 +03:00
MSuih f526027778
Revert recent file system changes (#11370)
* Revert "FS: use std::filesystem::u8path"

This reverts commit cd016be86e.

* Revert "VFS: fix missing path deliminators"

This reverts commit 84753db574.

* Revert "Bugfix of Emulator::Load disc path searching"

This reverts commit b9179de288.

* Revert "fs: Reimplement path resolving using std::filesystem::weakly_canonical"

This reverts commit 0c4b2ff06b.
2022-01-13 07:24:04 +03:00
Megamouse 84753db574 VFS: fix missing path deliminators 2022-01-13 00:07:25 +03:00
Eladash 0c4b2ff06b fs: Reimplement path resolving using std::filesystem::weakly_canonical 2022-01-12 03:37:39 +03:00
Megamouse da91a841b7 VFS: add logging to mount 2021-09-25 19:21:59 +03:00
Megamouse a16d8ba3ea More random changes 2021-04-11 14:01:51 +03:00
Eladash 49c5ce30cc Emulation: Fix boot path resolving
* Fix /dev_flash executables path arg. (/host_root is wrong for it)
* Fix usage of /host_root for homebrew applications when it is not mounted, use /app_home.
* Fix path source detection. (don't get fooled by path slashes repetitions, symlinks, '.', ".." and ('\' on Windows))
* Unescape tail of /dev_hdd0 paths.
2021-04-08 23:57:00 +03:00
Nekotekina 2212a131ef Fix some -Weffc++ warnings (part 1) 2021-03-31 11:27:09 +03:00
Nekotekina 8fcebebae3 Implement lv2_mp_flag::cache
Identify /dev_hdd1 without unsafe path comparison.
2021-03-16 19:37:03 +03:00
Eladash d7b4753007 Make gamedata installation atomic as real PS3 2021-03-16 19:31:52 +03:00
Nekotekina 87af905018 Enable -Wunused-parameter 2021-03-06 18:07:08 +03:00
Nekotekina ea5e837bd6 fixed_typemap.hpp: return reference 2021-03-02 16:08:14 +03:00
Nekotekina db8e6fe7a7 Enable -Wunused-variable 2021-01-12 14:34:14 +03:00
Nekotekina 6ae1f1b02c VFS: fixup handling . and .. after #9528 2021-01-05 16:16:01 +03:00
Eladash d1e1c14dc3 VFS: Escape path components which end with space or period 2021-01-05 16:15:47 +03:00
Nekotekina bd269bccaf types.hpp: remove intrinsic includes
Replace v128 with u128 in some places.
Removed some unused files.
2020-12-21 21:11:25 +03:00
Nekotekina fb29933d3d Add usz alias for std::size_t 2020-12-18 12:23:53 +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
Nekotekina 9b22661c19 fs: improve mountpoint detection
Properly handle . and .. path components in mountpoint detection.
Remove app_home mountpoint and use mountpoint from argv[0] instead.
Add dev_root mountpoint for special purposes.
2020-10-02 12:32:35 +03:00
Eladash 3b11f22062 MSVC bug workaround 2020-09-25 13:26:08 +03:00
Eladash b8fa6fb4c4 Win32 FS: Rewrite (fix) vfs::host::rename 2020-09-24 18:06:51 +03:00
Eladash 3a96d99187 sceNpTrophyRegisterContext: Atomically create trophy data 2020-09-22 19:46:52 +03:00
QuadDamage 60f8fc293d VFS: fix off-by-one error in vfs::escape() 2020-09-08 08:20:41 +02:00
Nekotekina 9176ca084c VFS: clarify escape/unescape cannot work on paths
With recent changes, it can only work with file or directory name.
2020-03-14 16:01:55 +03:00