Commit graph

481 commits

Author SHA1 Message Date
Eladash
4c20881f8f Fixup after #6933 (#7166)
* fixup

* Get rid of obsolute arg in lv2_obj::awake

* nvm ill do this later

* Typo fix of the decade
2020-01-01 17:38:05 +00:00
Eladash
71c4a2a15f Silence some log messages 2019-12-31 22:27:27 +03:00
Eladash
9690854e58 Some cleanup
* Prefer default initializer over std::memset 0 when possible and more readable.
* Use std::format in trophy files name obtaining.
* Use vm::ptr<>::operator bool() instead of comparing vm::ptr to vm::null or using addr().
* Add a few std::memset calls in hle where it matters (or in some places just to document an actual firmware memcpy call).
2019-12-31 22:27:27 +03:00
Eladash
c2eb9a583d Implement ps3 application root flags detection 2019-12-31 22:22:06 +03:00
Eladash
45cff1219c Allow sys_raw_spu_create_tag to be called more than once 2019-12-30 23:46:45 +03:00
Nekotekina
ef8872c0d7 sys_net: fix sys_net_bnet_connect on Windows
Properly write is_connecting variable.
2019-12-29 21:53:43 +03:00
Nekotekina
01b1b21efd sys_net: add a workaround for WSAPoll with timeout
Don't call WSAPoll with empty socket list.
2019-12-29 21:24:13 +03:00
Nekotekina
abe2cc196a sys_net: fixup for race condition
Don't reset is_connecting without checking correctness.
Also cleanup dead WIN32 code.
2019-12-23 22:39:18 +03:00
RipleyTom
90e4fe23c5 WSAPoll workaround 2019-12-23 22:31:09 +03:00
Jayveer
364ba95d26 Updated sys_net to use WSAPoll on win32 as this fixes connection issues
in Metal Gear Online. Also aligns with implementations on non win32
platforms
2019-12-13 21:52:29 +03:00
Eladash
5142d7c011 Minor fixup after #7068 2019-12-06 19:59:29 +03:00
Eladash
5631382623 sys_spu: Fix SPU Thread Id
* Removed wrong code in sys_spu_thread_group_terminate.
* SPU Thread ID is accurate, including 5th thread id "rule".
* Fixed possible use-after-free access of spu_thread::group member.
* RawSPU ID management simplified.
2019-12-06 19:59:29 +03:00
Eladash
98970884c8 Make sys_tty accurate in release console mode, message saving in log 2019-12-05 23:31:46 +03:00
Eladash
a2c69e4a2e sys_spu_thread_group_dis/connect_event Improvements 2019-12-05 23:31:46 +03:00
Nekotekina
bf11a28fb5 C-style cast cleanup IV 2019-12-01 22:12:33 +03:00
Nekotekina
28eacc616a C-style cast cleanup III 2019-12-01 00:32:44 +03:00
Nekotekina
ad9c9f0183 C-style cast cleanup II 2019-11-30 18:17:45 +03:00
Eladash
8bd52c9843 Fix sys_spu_thread_un/bind_queue queue existence check 2019-11-28 01:54:45 +03:00
Eladash
9cc3838e49 Fix possible division by zero in sys_spu_thread_write/read_ls 2019-11-28 01:54:45 +03:00
Eladash
b8220ec12f Stub sys_spu_thread_group_log 2019-11-28 01:54:45 +03:00
Nekotekina
2290c389d6 vm: implement vm::try_access, vm::ptr::try_read/write 2019-11-26 00:12:45 +03:00
Eladash
fd433779bb sys_prx: Tiny improvement 2019-11-25 09:04:56 +00:00
Nekotekina
f31233b822 sys_net: don't report SYS_NET_EWOULDBLOCK in blocking syscalls 2019-11-22 18:56:40 +03:00
Nekotekina
5c55d4f2fe sys_net: format both negative and positive sys_net_error values 2019-11-22 18:56:13 +03:00
Eladash
6ad8b0a443 sys_net: Add error_code 2019-11-21 22:51:22 +03:00
Nekotekina
0d629743ca cellSysCache: poison opened cache files on cache clear
Make opened files return CELL_EIO after cache clear.
2019-11-09 14:50:41 +03:00
Nekotekina
e0bc276205 cellSysCache: keep mounted /dev_hdd1 after exitspawn 2019-11-09 14:43:19 +03:00
Eladash
7475be99ab lv2: Check ipc_key value if object is process shared 2019-11-03 14:59:47 +03:00
Eladash
b99992d570 sys_spu: Fix SNR and Inbound Mailbox state reset
Also remove bugged ESTAT check at sys_spu_thread_write_spu_mb.
2019-10-29 18:34:28 +03:00
Eladash
f88a135b5b Fix lv2_config_service_event event id reset 2019-10-29 18:15:26 +03:00
Eladash
114b9498bf Remove unjustified use of idm::import_existing in sys_config 2019-10-29 18:15:26 +03:00
Eladash
8b6383b489 lv2: Correct alignment of some attributes structs 2019-10-29 18:15:41 +03:00
Eladash
3e4cbf67f6 sys_rwlock_wlock: Fix typo 2019-10-29 18:15:26 +03:00
Marin Baron
4599d58413 Fix debug build gcc/clang linker.
Create temporary variable to resolve undefined reference.

[ 98%] Linking CXX executable ../bin/rpcs3
/usr/bin/ld : Emu/librpcs3_emu.a(sys_vm.cpp.o) : dans la fonction « sys_vm_t::~sys_vm_t() » :
/mnt/raid/Git/rpcs3/rpcs3/Emu/Cell/lv2/sys_vm.cpp:21 : référence indéfinie vers « id_manager::id_traits<sys_vm_t, void>::invalid »
collect2: erreur: ld a retourné le statut de sortie 1
make[2]: *** [rpcs3/CMakeFiles/rpcs3.dir/build.make:426: bin/rpcs3] Error 1
2019-10-24 14:34:38 +03:00
Emmanuel Gil Peyrot
9d1b7af2eb Avoid std::move() for copy elision
This could disable zero-copy optimisations, which is the opposite of
what we want.
2019-10-22 16:11:43 +03:00
Eladash
586fe11e22 Fix cellGcm HLE regression
Also correct flags.
2019-10-22 13:45:09 +03:00
Eladash
cbecbc264e cellGcm: Fix driver_info->memory_size
based hw test
2019-10-21 15:31:45 +03:00
eladash
730e9cde84 sys_rsx: Improve allocations and error checks
* allow sys_rsx_device_map to be called twice: in this case the DEVICE address retrived from the previous call returned
* Add ENOMEM checks for sys_rsx_memory_allocate and sys_rsx_context_allocate
* add EINVAL check for sys_rsx_context_allocate if memory handle is not found
* Separate sys_rsx_device_map allocation from sys_rsx_context_allocate's
* Implement sys_rsx_memory_free; used by cellGcmInit upon failure
* Added context_id checks
* Throw if sys_rsx_context_allocate was called twice.
2019-10-21 15:31:45 +03:00
Eladash
79a3a7ce4c Add exception for sys_usbd_initialize 2019-10-20 15:28:26 +01:00
Eladash
a1e7cdf1e9 Forcefully awake waiters in sys_usbd_finalize
This is a no-op from cellUsbd side but happens on lv2 side as well.
2019-10-20 15:28:26 +01:00
Eladash
d90696be90 sys_usbd Tiny update 2019-10-20 15:28:26 +01:00
Nekotekina
00895862e1 Fix sys_vm_t destructor
It's not a destructor's job to free vm like this.
2019-10-17 19:57:29 +03:00
eladash
95752607ea sys_spu: Don't reset snr config at group_start()
Also first check for EINVAL in sys_spu_thread_set_spu_cfg
2019-10-16 21:11:29 +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
Malcolm Jestadt
1a9e06d3c6 Linux: Change default Sleep Timers accuracy to host
- This doesn't change existing configs
- Also sets the host_min_quantum to the true value
- Restores lost TODO: comment
2019-10-15 00:32:31 +03:00
Nekotekina
16dd72b3e3 Replace some uses of Emu.IsStopped()
Poll thread state instead.
2019-10-12 21:12:47 +03:00
plappermaul
925f2ce02f Use Linux timers for sleeps up to 1ms (#6697)
* Use Linux timers for sleeps up to 1ms (v3)
The current sleep timer implementation basically offers two variants. Either
wait the specified time exactly with a condition variable (as host) or use a
combination of it with a thread yielding busy loop afterwards (usleep timer).

While the second one is very precise it consumes CPU loops for each wait call
below 50us. Games like Bomberman Ultra spam 30us waits and the emulator hogs
low power CPUs. Switching to host mode reduces CPU consumption but gives a
~50us penalty for each wait call. Thus extending all sleeps by a factor of
more than two.

The following bugfix tries to improve the system timer for Linux by using
Linux native timers for small wait calls below 1ms. This has two effects.

- Host wait setting has much less wait overhead
- usleep wait setting produces lower CPU overhead
2019-10-09 20:03:34 +03:00
Nekotekina
9d4de51cb6 Use g_fxo for network thread
Minor refactoring
2019-10-08 23:12:54 +03:00
Eladash
0f3c5f9e5a Fix verification failure on Emu.Stop() at sys_cond_wait 2019-10-08 23:12:34 +03:00
Eladash
36de3d4f4c sys_gpio Cleanup 2019-10-08 02:52:33 +03:00