Commit graph

96 commits

Author SHA1 Message Date
Nekotekina fb29933d3d Add usz alias for std::size_t 2020-12-18 12:23:53 +03:00
RipleyTom af8c661a64 Remove BOM markers 2020-12-06 15:30:12 +03:00
Nekotekina 5bcaa25c02 CPU: remove descheduled threads from suspend_all list 2020-11-20 13:53:34 +03:00
Nekotekina ba5ed5f380 Fix vm::lock_range wrong check
Minor header refactoring.
2020-11-04 14:59:26 +03:00
Megamouse 2cee26c3e7 Cleanup some includes 2020-10-31 11:53:46 +01:00
Eladash b998852385
LV2: cleanup syscall table (#9106)
Remove old ppu_get_syscall_name from PPUFunction.cpp for deduplication.
2020-10-21 10:04:34 +03:00
Eladash 6892399699 kernel_explorer: More Improvements 2020-06-12 09:28:23 +02:00
Eladash 72bef8dd7f PPU: Clear reservation on context switch
Ensure that only 2 PPU reservations exist at maximum at a time.
2020-05-02 14:57:38 +03:00
Eladash 1cb3bf6dab Minor fixup for unimplemented syscall args dump 2020-04-19 10:56:42 +01:00
Eladash a3f2dfa232 sys_isolated_spu 2020-04-17 11:41:50 +01:00
Eladash 921b1aadfb lv2: Log all arguments of unimplemented syscalls 2020-04-17 11:41:50 +01:00
Eladash 3a36b713ce Dont spam syscalls stats if emu is paused 2020-03-21 16:31:18 +03:00
Eladash 7139c4fbab Fix bug introduced by #7797 2020-03-19 07:22:05 +03:00
Eladash b11e8f8b8d Minor fix of sys_ppu_thread_yield return value
Account for a special case where threads were rotated but no context
switch was made.
2020-03-19 06:45:14 +03:00
Eladash 664d606123 Add return value of sys_ppu_thread_yield 2020-03-17 18:22:13 +03:00
Eladash 00d25a191b lv2: Uncomment sys_ppu_thread_stop/restart 2020-03-17 18:22:13 +03:00
Nekotekina 68f50c7035 Fix ppu_syscall_usage thread waiting
Fixed 10s hang on exit
2020-03-03 18:33:02 +03:00
Nekotekina 3105b21909 Print PPU Syscall Usage Stats
* Every 10 seconds
* On normal exit
2020-03-02 20:48:20 +03:00
Eladash 4d3cdca7f6 Stub sys_spu_thread_group_set_cooperative_victims and syscall_253 2020-02-26 18:17:13 +00:00
Megamouse fe75311be2 move config structs to own files and clean up some headers 2020-02-17 15:08:17 +03:00
Eladash 1915fe75a4 VSH: Stubs 2020-02-08 23:07:03 +03:00
Nekotekina 327bb2d8f0 Modernize PPU logging (ppu_log variable) 2020-02-01 11:52:24 +03:00
Nekotekina 21f7b0ff0f Remove HLE log channel 2020-02-01 11:52:24 +03:00
Eladash e4ba096190 VSH: sys_mmapper
* Implement syscalls sys_mmapper_allocate_shared_memory_ext, sys_mmapper_allocate_shared_memory_from_container_ext.
* Implement multi-process shared memory allocations.
2020-01-24 20:08:30 +00:00
Eladash 01035d35bd sys_process: Fix sys_process_get_id, add error_code (#7246) 2020-01-14 21:32:41 +03:00
Eladash c2eb9a583d Implement ps3 application root flags detection 2019-12-31 22:22:06 +03:00
Eladash b8220ec12f Stub sys_spu_thread_group_log 2019-11-28 01:54:45 +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 050339bb3e PPU/LV2: Make thread-lists scheduling atomic 2019-08-17 22:46:36 +03:00
Eladash 72fb3ba794 perf hotfix for sys_timer_usleep 2019-08-01 23:38:09 +03:00
Eladash 997e3046e3 vm/sys_overlay Improvements
- Implement sys_overlay_load_module_by_fd.
- Implement special segment allocation when ppc_seg flag is specified.
2019-07-28 14:23:58 +03:00
Eladash 85b1152e29 Timers scaling and fixes 2019-07-23 00:09:01 +01:00
Rui Pinheiro 070c3af50f Initial sys_config implementation 2019-07-22 02:44:45 +03:00
JohnHolmesII 23094b48bb Fix warnings related to -Wswitch
Add default cases.
Move default breaks to newline
Add proper handling in some instances.
Add missing enums to switches
2019-06-28 01:40:52 +03:00
Lassi Hämäläinen 499035512b Split Emu/Memory into more logical headers
- Add vm_locking.h and vm_reservation.h and move relevant functions
  and types to these headers.
- Change include order and make vm_ptr.h, vm_var.h and vm_ref.h headers
  usable invidually and them including vm.h instead of other way around
- Because usage of vm::ptr now requires including vm_ptr.h instead of
  vm.h updated multiple #includes
- Added additional #includes to vm_reservation.h and vm_locking to
  where vm::reservation_* and locking related functions are used
2019-06-25 17:11:10 +03:00
Inviuz 52a12185a0 Initial sys_overlay 2019-04-10 23:25:09 +03:00
eladash 4a28319edf Implement SPU page faults notifications
* Implement both RawSPU and threaded SPU page fault recovery
* Guard page_fault_notification_entries access with a mutex
* Add missing lock in sys_ppu_thread_recover_page_fault/get_page_fault_context
* Fix EINVAL check in sys_ppu_thread_recover_page_fault, previously when the event was not found begin() was erased and
CELL_OK was returned.
* Fixed page fault recovery waiting logic:
- Do not rely on a single thread_ctrl notification (unsafe)
- Avoided a race where ::awake(ppu) can be called before ::sleep(ppu) therefore nop-ing out the notification
* Avoid inconsistencies with vm flags on page fault cause detection
* Fix sys_mmapper_enable_page_fault_notification EBUSY check
from RE it's allowed to register the same queue twice (on a different area) but not to enable page fault notifications twice
2019-03-12 13:28:31 +03:00
eladash d4459af4b3 Implement _sys_lwmutex_unlock (SYS_SYNC_RETRY mode) 2019-02-27 22:16:08 +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
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 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
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 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
Maxetto 05c1f192f5 Update new LV2 names (#4886) 2018-08-11 16:46:44 +04:00
Chris Weermann (TGE) c5dcef52fa Implement sys_dbg_read_process_memory and sys_dbg_write_process_memory 2018-07-10 01:47:47 +04:00
Maxetto dca6f1f863 Update some lv2 syscall names (#4490) 2018-05-06 14:21:50 +04:00
Nekotekina d392379c7a Use vm::passive_lock for SPU threads 2018-04-06 15:47:00 +03:00