Eladash
d152537e50
sys_lwcond/cond/ppu_thread: Respect scheduler in various syscalls
2023-06-02 08:54:46 +03:00
Eladash
d25d1ecb3a
LV2: Avoid using multi-variable atomic waiting on cpu_thread::state wait
2022-10-04 16:28:34 +03:00
Eladash
194f7375da
SPU/LV2: Fix tiny race conditions
2022-09-21 20:35:34 +03:00
Eladash
bc8bf2c329
sys_cond/lwcond: Fix waiting time in the debugger for mutex lock
2022-08-11 11:42:16 +03:00
Elad Ashkenazi
f0002501f7
sys_mutex/lwmutex: Regression fixes after #12378
2022-08-11 11:42:16 +03:00
Eladash
34bae90820
LV2: Move nearly all notifications out of all mutex scopes including IDM
2022-08-07 20:23:54 +03:00
Eladash
011aabe9ed
LV2: Make sys_mutex and sys_lwmutex lock-free, add some busy waiting in sys_mutex_lock
2022-08-07 20:23:54 +03:00
Eladash
a17a6527f6
LV2: Move memory unlocking outside of mutex ownership and make it conditional
2022-08-07 20:23:54 +03:00
Eladash
73aaff1b29
LV2: allocation-free synchronization syscalls
...
* Show waiters' ID in kernel explorer.
* Remove deque dependency from sys_sync.h
2022-08-07 20:23:54 +03:00
Eladash
bc728db15b
LV2: Add busy waiting before entering atomic wait
2022-08-07 20:23:54 +03:00
Eladash
2eebbd307d
LV2: Minor optimization regarding signal flag
2022-08-07 20:23:54 +03:00
Eladash
dc851a729e
LV2: Postpone thread notifications to afterward mutex ownership(s)
2022-08-07 20:23:54 +03:00
Eladash
b692108f1e
Savestates: HLE state saving POC in sys_lwmutex
2022-07-06 19:43:25 +03:00
Elad Ashkenazi
fcd297ffb2
Savestates Support For PS3 Emulation ( #10478 )
2022-07-04 16:02:17 +03:00
Eladash
44f0ca08e2
Simplify PPU exit
2021-05-25 22:47:23 +03:00
Eladash
64997662d2
LV2: Fixup for IPC
...
* Fix typo in lv2_obj::create.
* Always save ipc_key as 0 for non-shared object creations, regardless of thbe value set by creation attribute.
* Show IPC key of shared memory (sys_mmapper) memory objects in kernel explorer.
2021-05-07 14:58:22 +03:00
Eladash
7b6482c01d
LV2: Improve IPC support ( #10206 )
...
* Remove custom event queue's IPC management of favour of universal LV2 approach.
* Move ipc_manager to FXO.
* Fix ipc_manager internal storage memory leak: deallocate entry when IPC object destroyed.
* Rewrite lv2_obj::create to be simpler (remove many duplicated code).
* Always execute lv2_obj::create under both IPC and IDM mutexes at once (not in non-atomic single-steps). Fixing potential case where concurrency can cause IDM to contain 2 or more different objects with the same IPC key with SYS_SYNC_NOT_CARE (instead of the same object).
* Do not rely on smart ptr reference count to tell if the object exists. Use similar approach as event queues as it makes error checkings accurate.
* Optimize lv2_event_port by using std::shared_ptr for queue which wasn't allowed before.
2021-05-07 09:58:30 +03:00
Eladash
a16cc3ac8a
lv2: Remove flags from IPC-supported objects
2021-04-15 10:31:40 +03:00
Megamouse
a16d8ba3ea
More random changes
2021-04-11 14:01:51 +03:00
Eladash
f43260bd58
Atomic waiting refactoring ( #9208 )
...
* Use atomic waitables instead instead of global thread wait as often as possible.
* Add ::is_stopped() and and ::is_paued() which can be used in atomic loops and with atomic wait. (constexpr cpu flags test functions)
* Fix notification bug of sys_spu_thread_group_exit/terminate. (old bug, enhanced by #9117 )
* Function time statistics at Emu.Stop() restored. (instead of current "X syscall failed with 0x00000000 : 0")
2021-02-13 17:50:07 +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
19500ac9ad
Fix truncation warning in sys_cond.cpp
2020-08-17 17:36:27 +01:00
Eladash
d9750e8f9f
SPU/PPU reservations: Optimizations for reservation locks and check_state() (non-TSX)
2020-07-09 03:17:35 +01:00
Eladash
314dc4c5de
sys_cond: Fix spurious EBUSY in sys_cond_destroy
...
Increment waiters count inside IDM's mutex lock scope.
2020-06-15 17:08:57 +03:00
Eladash
92b7c56f29
sys_cond/mutex: Fix race between sys_cond_create and sys_mutex, Fix IPC support in sys_cond/mutex
2020-06-15 17:08:57 +03:00
Eladash
6892399699
kernel_explorer: More Improvements
2020-06-12 09:28:23 +02:00
Eladash
b84b8f4db4
sys_cond_signal_all: Use SYS_SYNC_PRIORITY protocol to signal threads
2020-05-04 01:10:19 +03:00
Eladash
bb950cbb3b
vm: Fix possible IDM deadlock with Page Fault Notifications (partial)
2020-04-12 10:30:38 +01:00
Eladash
3f559cd86e
Fix sys_cond_destroy ( #7931 )
...
Dereference cond count in sys_cond_destroy
2020-04-03 12:45:59 +03:00
Eladash
3de41bfea7
_sys_lwcond_signal: Make mode 3 respect ordering of the sleep queue
2020-03-23 21:37:37 +03:00
Megamouse
fe75311be2
move config structs to own files and clean up some headers
2020-02-17 15:08:17 +03:00
Eladash
b03c2fc856
sys_cond_wait: Fix mutex acquire when signaling thread didnt pass ownership immediatly
2019-10-16 00:50:58 +03:00
Eladash
0f3c5f9e5a
Fix verification failure on Emu.Stop() at sys_cond_wait
2019-10-08 23:12:34 +03:00
Eladash
08e674aa28
sys_cond fixes ( #6584 )
...
* sys_cond fixes
sys_cond_wait is now signaled atomically (regression fix)
Fix a corner case with sys_cond_wait and sys_cond_destroy EBSUY check (waiter count was inaccurate if thread is not the owner of mutex)
Add not about EBUSY corner case (TODO)
* Fix inconcistency in sys_cond_destroy and ETIMEDOUT
.. event at sys_cond_wait regarding waiters count.
Now waiters count is properly connected to the mutex owner actions after ETIMEDOUT in sys_cond_wait.
2019-10-03 23:05:34 +03:00
Nekotekina
b3f5d6d85b
Put lv2_obj::awake calls under mutex
2019-08-29 02:44:12 +03:00
Nekotekina
b6b7d7b48c
sys_cond_wait fixup
2019-08-27 15:38:18 +03:00
Nekotekina
ec8c5453bc
Fix sys_cond_wait
...
Schedule PPU thread before relocking.
Don't lock mutex in notify functions.
2019-08-27 15:13:01 +03:00
Nekotekina
fd839243ec
Revert PR 6405
2019-08-27 14:05:38 +03:00
Eladash
35a3bed91a
sys_cond_wait: Wait for rescheduling before relocking
2019-08-27 03:44:34 +03:00
eladash
050339bb3e
PPU/LV2: Make thread-lists scheduling atomic
2019-08-17 22:46:36 +03:00
Eladash
85b1152e29
Timers scaling and fixes
2019-07-23 00:09:01 +01:00
Lassi Hämäläinen
c963c51a60
Remove unnecessary header includes
...
- Manually removed lot of unneeded #includes to clean code and reduce
compilation time
- Reordered some of the #includes to be in more logical order
2019-06-25 17:11:10 +03:00
Nekotekina
89a31292dc
sys_cond: add vm::temporary_unlock
2019-06-19 20:39:29 +03:00
eladash
13d8e33d9a
Return ESRCH if ppu thread ID was not found in sys_cond_signal_to
2019-05-07 08:58:07 +03:00
Nekotekina
1b37e775be
Migration to named_thread<>
...
Add atomic_t<>::try_dec instead of fetch_dec_sat
Add atomic_t<>::try_inc
GDBDebugServer is broken (needs rewrite)
Removed old_thread class (former named_thread)
Removed storing/rethrowing exceptions from thread
Emu.Stop doesn't inject an exception anymore
task_stack helper class removed
thread_base simplified (no shared_from_this)
thread_ctrl::spawn simplified (creates detached thread)
Implemented overrideable thread detaching logic
Disabled cellAdec, cellDmux, cellFsAio
SPUThread renamed to spu_thread
RawSPUThread removed, spu_thread used instead
Disabled deriving from ppu_thread
Partial support for thread renaming
lv2_timer... simplified, screw it
idm/fxm: butchered support for on_stop/on_init
vm: improved allocation structure (added size)
2018-10-19 22:22:35 +03:00
Nekotekina
ca5158a03e
Cleanup semaphore<> (sema.h) and mutex.h (shared_mutex)
...
Remove semaphore_lock and writer_lock classes, replace with std::lock_guard
Change semaphore<> interface to Lockable (+ exotic try_unlock method)
2018-09-03 23:00:36 +03:00
Nekotekina
363811981d
Reintroduce LOG_CHANNEL
...
Groundwork for further improvements
2018-08-25 15:39:00 +03:00
eladash
f349695a75
Rsx: rewrite address translation
2018-08-13 16:16:34 +03:00
Nekotekina
cce0ad0c35
Clean vm::ps3 namespace use
2018-02-09 17:49:37 +03:00