Commit graph

336 commits

Author SHA1 Message Date
Nekotekina
cfdf50dcff SPU: ensure sys_spu_thread_group_join receives correct exit status
Following #5334
2019-01-13 14:45:36 +03:00
RipleyTom
7ebd3bbcbf Fixes issues where the mutex is destroyed while an unlock is happening 2018-12-31 01:39:47 +03:00
eladash
483ee5e488 Fix sys_vm_memory_map address base 2018-12-30 20:12:32 +00:00
eladash
79a6a2c7fb Debug console emulation 2018-12-30 20:12:32 +00:00
eladash
2ea061b9c7 Set total memory size according to sdkver 2018-12-30 20:12:32 +00:00
eladash
c0eb4965f2 mmapper_allocate_memory improvement
Added cases 0 for allocation granularity size,
alike sys_memory_allocate, the alignment of this case is 1mb.
2018-12-30 20:12:32 +00:00
eladash
4b65c3943c Fix sys_semaphore_post count check 2018-12-26 23:03:27 +03:00
eladash
653a4ef0df Set group status INIT on last thread stopped
this fixes the group status after sys_spu_thread_exit when not joining the spu group
2018-12-25 19:59:41 +03:00
Nekotekina
522f5ea645 Fix cellFsGetFreeSize (following #5304)
Simplify device name extraction
2018-12-24 16:04:46 +03:00
RipleyTom
077e710e3a sys_fs_fcntl with parameter 0xC0000002 should extract device path from the given path and use that to gather free space information 2018-12-10 14:24:07 +03:00
kd-11
504ab5a6d4 rsx: Minor cleanup to silence stupid compiler warnings 2018-12-03 20:01:23 +03:00
kd-11
e01d2f08c9 rsx: Refactor FIFO
- Removes fifo structures from common RSXThread
- Sets up a dedicated FIFO controller
- Allows for configurable queue optimizations
2018-11-30 23:51:25 +03:00
Nekotekina
96cabeadff Rewrite condition variables
Implement helper functions balanced_wait_until and balanced_awaken
They include new path for Windows 8.1+ (WaitOnAddress)

shared_mutex, cond_variable, cond_one, cond_x16 modified to use it
Added helper function utils::popcnt16
Replace most semaphore<> with shared_mutex
2018-11-29 01:30:05 +03:00
Nekotekina
f442a8a84c SPU TG: add thread group stop counter
Fix possible race condition introduced by waiting on `running` value
2018-11-27 23:37:26 +03:00
eladash
4baa159523 cellFsOpen flag fix 2018-11-24 02:54:48 +03:00
isJuhn
225310e04b Add null alloc_addr checks to sys_memory_allocate and sys_memory_allocate_from_container 2018-11-16 18:37:07 +00:00
Nekotekina
0044eb44e2 Cleanup after #5310 (SPU thread groups)
Move lambda into a cpu_stop()
Use running thread counter to synchronize with sys_spu_thread_group_join()
Use SPU_STATUS_STOPPED_BY_STOP exclusively for sys_spu_thread_exit() as before
Remove unnecessary waiting in sys_spu_thread_group_exit()
Rollback some minor unnecessary changes
Use shared_mutex in SPU TG
2018-11-14 12:50:24 +03:00
RipleyTom
0e0a82e536 Ensures threads are stopped in join 2018-11-13 10:19:28 +03:00
eladash
57b7892de6 Fix typo in sys_fs_mkdir
create_path is a less resticted version of create_dir, it doesnt check for EEXIST for one.
2018-11-12 13:28:58 +03:00
eladash
3332a10052 ppu: Fix threads scheduler
*Set priority under a lock
*Fix yield command making threads going out of scheduler control by removing it from the queue (not a bug that affects compatibility)
2018-11-07 13:06:29 +03:00
eladash
3fd17e43a3 lv2: Fix lwcond_queue_wait lock acquiring 2018-11-07 13:06:29 +03:00
eladash
3faaf9e7fb lv2: Fix lwmutex locking 2018-11-07 13:06:29 +03:00
eladash
777f36e604 Fix error code checking of sys_lwcond_signal_x 2018-11-07 13:06:29 +03:00
Dennis Luxen
36d4614d12 Fix a warning that shift overflows data type width (#5116) 2018-10-23 18:49:01 +03:00
eladash
5ee351234c rsx-capture: unbreak 2018-10-23 18:02:03 +03:00
eladash
d14c8a03b3 typo fix 2018-10-20 22:27:48 +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
elad
623f1b35f6 rsx_capture/gcm: Fix tile binding (#5246)
* gcm: Fix tile offset setting

highest bit signifyies location, so ignore that while reading the offset.

* rsx-capture: Fix tile binding

fixes division by zero when dividing by pitch when the tile is not bound.

* rsx-capture: Fix zcull binding
2018-10-12 19:05:08 +03:00
eladash
4174d7274d sys_rsx: fix log spam 2018-10-03 20:57:46 +03:00
Nekotekina
da6ce80f4f Make vm::get_super_ptr return contiguous memory
Cleanup RSX code complexity
2018-09-27 23:37:13 +03:00
Nekotekina
306f95a9ae New named_thread template (preview)
Old class named_thread renamed to old_thread
It's too hard to move in a single commit
2018-09-27 14:04:16 +03:00
kd-11
a3d44b5e1f rsx: Cleanup changes for the flip patch 2018-09-24 16:44:02 +03:00
Jake
699eadc84f rsx: Move render flip from rsx queue command to flip command 2018-09-24 16:44:02 +03:00
eladash
1a6c819176 cellgcm: Fix SET_REFERENCE initial value 2018-09-20 01:05:40 +03:00
Nekotekina
dce14a359a Rename lv2_spu_group::num to max_num 2018-09-19 14:15:15 +03:00
Nekotekina
b94e98aed5 Rewrite sys_fs_opendir
Rewrite lv2_dir object
Support split files and mount points
2018-09-15 17:18:40 +03:00
Nekotekina
e8b5555630 Rewrite vfs::get and vfs::mount
Preprocess . and .. correctly
Don't use recursive locking
Also use std::string_view
Fix format system for std::string and std::string_view
Fix fmt::merge for std::string_view
2018-09-15 17:09:56 +03:00
Nekotekina
2226125728 atomic_t<>: remove inline assignment
Add atomic_op/fetch_op overloads with template argument (may be removed in future)
Remove args... in atomic_op (capturing lambda is preferred)
2018-09-09 12:59:24 +03:00
Nekotekina
fb5cdf9769 atomic_t<>: extend fetch_op to support cancellation
Use std::invoke inside atomic_op/fetch_op
Remove op_fetch because it's easily replaced
Add fetch_dec_sat algorithm (conditional decrement)
2018-09-08 00:32:04 +03:00
scribam
02ba529eea sys_usbd: add sys_usbd_event_port_send function 2018-09-05 19:53:09 +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
7bccdbf157 Make vm::var unmoveable
Fix bugs with discarding vm::make_var result
2018-09-03 21:40:36 +03:00
Nekotekina
8abe6489ed Mega-cleanup for atomic_t<> and named bit-sets bs_t<>
Remove "atomic operator" classes
Remove test, test_and_set, test_and_reset, test_and_complement global functions
Simplify atomic_t<> with constexpr if, remove some garbage
Redesign bs_t<> to use class, mark its methods constexpr
Implement atomic_bs_t<> for optimizations
Remove unused __bitwise_ops concept (should be in other header anyway)
Bitsets can now be tested via safe bool conversion
2018-09-03 21:40:36 +03:00
eladash
9acaee563b Fix sys_memory_free 2018-09-01 22:44:20 +04:00
Nekotekina
c49c7de427 sys_fs_stat: support split files
Was forgotten after sys_fs_open
2018-08-30 14:56:45 +03:00
Nekotekina
363811981d Reintroduce LOG_CHANNEL
Groundwork for further improvements
2018-08-25 15:39:00 +03:00
eladash
158019b50f Rsx: fix translation when address is negative
move address shift to where it should be, extend io table to catch all possible values.
2018-08-22 12:20:31 +03:00
eladash
9d8c9c2460 sys_memory: fix default alignment flag
its 1mb
2018-08-16 03:27:11 +04:00
Nekotekina
a3daa99a33 Fixup sys_vm_memory_map 2018-08-14 16:08:45 +03:00
Nekotekina
aa4040bb7b Implement vm::find_map; improve memory allocation
Add vm::user64k and vm::user1m constants
Remove vm::user_space, unreserve it
2018-08-14 15:14:06 +03:00