Commit graph

81 commits

Author SHA1 Message Date
Megamouse
d662a39a12 PPUAnalyser: fix std::move nonsense 2023-06-14 11:05:00 +03:00
Eladash
d152537e50 sys_lwcond/cond/ppu_thread: Respect scheduler in various syscalls 2023-06-02 08:54:46 +03:00
Eladash
5d4e87373f LV2: Make _sys_lwcond_destroy wait for lwmutex lock 2023-06-02 08:54:46 +03:00
Eladash
5d13978bbf sys_lwcond: Implement TIMEOUT on lwmutex lock 2023-06-02 08:54:46 +03:00
Margen67
5bb89328d0 Remove whitespace 2023-02-15 08:58:02 +01: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
7ff4509858 sys_lwcond: Fix a loose notification in cond wait 2022-08-11 12:44:40 +03:00
Eladash
9b0d33048c Savestates/LV2: Fix race on _sys_lwcond_queue_wait saving
cpu_flag::again modification requires exclusive access.
2022-08-11 11:42:16 +03:00
Eladash
bc8bf2c329 sys_cond/lwcond: Fix waiting time in the debugger for mutex lock 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
Elad Ashkenazi
0e1931f178
sys_lwcond: Fix rare race on mode 3 signal (#12413) 2022-08-04 14:13:51 +03:00
Eladash
ce01457510 Fix futile wait regression in sys_lwcond_signal 2022-07-20 18:11:52 +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
8c3a4c260e Bugfix of sys_lwmutex_destroy 2021-08-04 09:03:17 +03:00
Eladash
44f0ca08e2 Simplify PPU exit 2021-05-25 22:47:23 +03:00
Nekotekina
160b131de3 types.hpp: implement smin, smax, amin, amax
Rewritten the following global utility constants:
`umax` returns max number, restricted to unsigned.
`smax` returns max signed number, restricted to integrals.
`smin` returns min signed number, restricted to signed.
`amin` returns smin or zero, less restricted.
`amax` returns smax or umax, less restricted.

Fix operators == and <=> for synthesized rel-ops.
2021-05-22 12:10:57 +03:00
Nekotekina
038148bf06 Fix almost all GCC warnings 2021-02-17 22:59:04 +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
36c8654fb8 Remove HERE macro
Some cleanup.
Add location to some functions.
2020-12-10 12:30:22 +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
34fa010601 Improve cond_var notifiers
But nobody uses it anyway, so clean up includes.
2020-11-06 00:10:16 +03:00
Eladash
17f965c171 lv2: Minor fix of "unspecific ppu" path of _sys_lwcond_signal 2020-08-03 02:57:20 +03:00
Eladash
d9750e8f9f SPU/PPU reservations: Optimizations for reservation locks and check_state() (non-TSX) 2020-07-09 03:17:35 +01:00
Eladash
5fda9a4efb sus_lwcond_signal_all: use protocol specified in lwmutex
Trying to fix a nearly impossible corner case.
2020-06-15 17:08:57 +03:00
Eladash
37ce7056ac lv2: Minor optimization for "awake all" threads in sleep queue 2020-05-04 01:10:19 +03:00
Eladash
fdd7f0645d
Some typos (#7908)
* sys_lwcond: replace writer lock with reader lock

* sys_rsx: Typo fix

* sys_net: Fixup for buffer reading
2020-03-31 16:44:50 +03:00
Eladash
66bd8308d9
lv2: Wait for rescheduling before confirming timeouts (#7875) 2020-03-28 03:16:59 +00:00
Eladash
3de41bfea7 _sys_lwcond_signal: Make mode 3 respect ordering of the sleep queue 2020-03-23 21:37:37 +03:00
Eladash
cccc32fa9d
sys_lwmutex/lwcond: track lwcond waiters (#7826)
In lwmutex destroy syscall, wait for pending waiters.
2020-03-23 10:30:17 +03:00
Eladash
7be35315da Fix lv2 sys_lwcond/sys_lwmutex kernel explorer names 2020-03-19 06:45:14 +03:00
Eladash
03a6d67c6c Log sys_lwmutex/sys_lwcond names as strings
Use std::string_view instead of creating a temporary NTS string when reading object name.
2020-03-17 18:22:13 +03:00
Nekotekina
92e3eaf3ff Fix signed-unsigned comparisons and mark warning as error (part 2). 2020-02-19 22:54:58 +03:00
Megamouse
fe75311be2 move config structs to own files and clean up some headers 2020-02-17 15:08:17 +03:00
Nekotekina
b3f5d6d85b Put lv2_obj::awake calls under mutex 2019-08-29 02:44:12 +03:00
Nekotekina
fd839243ec Revert PR 6405 2019-08-27 14:05:38 +03:00
Eladash
a921fe3351 lv2: Wait for rescheduling before confirming ETIMEOUT 2019-08-27 03:44:34 +03:00
Nekotekina
dd86aa472d Fix _sys_lwcond_queue_wait
Fixup after #5883
2019-08-18 00:19:31 +03:00
Nekotekina
6535fb0603 Fix _sys_lwcond_signal_all
Fixup after #5883
2019-08-18 00:19:31 +03:00
eladash
050339bb3e PPU/LV2: Make thread-lists scheduling atomic 2019-08-17 22:46:36 +03:00
eladash
e40b76b253 sys_lwcond: Extract protocol from lwmutex at creation
This is the only reason theres a need to specify lwmutex_sq id at creation. unlike sys_cond, lwcond isn't connected to lwmutex at the lv2 level.
SYS_SYNC_RETRY fix is done explicitly at the firmware level.
This fixes issues when the original lwcond and lwmutexol data got corrupted or deallocated, this can happen when the program simply memcpy the control data to somewhere else.
Or if it uses direct lv2 the lwcond conrol param can even be NULL which will make it access violate when dereferncing it. (This param is unchecked and can be anything)
2019-07-29 21:58:04 +03:00
Eladash
85b1152e29 Timers scaling and fixes 2019-07-23 00:09:01 +01:00