mirror of
https://github.com/RPCS3/rpcs3.git
synced 2026-06-07 07:35:02 -06:00
Various sys_ fixes
This commit is contained in:
parent
260c986186
commit
064c006339
@ -59,6 +59,7 @@ CellError lv2_cond::on_id_create()
|
|||||||
if (!mutex)
|
if (!mutex)
|
||||||
{
|
{
|
||||||
_mutex = static_cast<shared_ptr<lv2_obj>>(ensure(idm::get_unlocked<lv2_obj, lv2_mutex>(mtx_id)));
|
_mutex = static_cast<shared_ptr<lv2_obj>>(ensure(idm::get_unlocked<lv2_obj, lv2_mutex>(mtx_id)));
|
||||||
|
mutex = static_cast<lv2_mutex*>(_mutex.get());
|
||||||
}
|
}
|
||||||
|
|
||||||
// Defer function
|
// Defer function
|
||||||
|
|||||||
@ -621,7 +621,7 @@ error_code sys_event_port_create(cpu_thread& cpu, vm::ptr<u32> eport_id, s32 por
|
|||||||
|
|
||||||
sys_event.warning("sys_event_port_create(eport_id=*0x%x, port_type=%d, name=0x%llx)", eport_id, port_type, name);
|
sys_event.warning("sys_event_port_create(eport_id=*0x%x, port_type=%d, name=0x%llx)", eport_id, port_type, name);
|
||||||
|
|
||||||
if (port_type != SYS_EVENT_PORT_LOCAL && port_type != 3)
|
if (port_type != SYS_EVENT_PORT_LOCAL && port_type != SYS_EVENT_PORT_IPC)
|
||||||
{
|
{
|
||||||
sys_event.error("sys_event_port_create(): unknown port type (%d)", port_type);
|
sys_event.error("sys_event_port_create(): unknown port type (%d)", port_type);
|
||||||
return CELL_EINVAL;
|
return CELL_EINVAL;
|
||||||
@ -675,8 +675,9 @@ error_code sys_event_port_connect_local(cpu_thread& cpu, u32 eport_id, u32 equeu
|
|||||||
std::lock_guard lock(id_manager::g_mutex);
|
std::lock_guard lock(id_manager::g_mutex);
|
||||||
|
|
||||||
const auto port = idm::check_unlocked<lv2_obj, lv2_event_port>(eport_id);
|
const auto port = idm::check_unlocked<lv2_obj, lv2_event_port>(eport_id);
|
||||||
|
auto queue = idm::get_unlocked<lv2_obj, lv2_event_queue>(equeue_id);
|
||||||
|
|
||||||
if (!port || !idm::check_unlocked<lv2_obj, lv2_event_queue>(equeue_id))
|
if (!port || !queue)
|
||||||
{
|
{
|
||||||
return CELL_ESRCH;
|
return CELL_ESRCH;
|
||||||
}
|
}
|
||||||
@ -691,7 +692,7 @@ error_code sys_event_port_connect_local(cpu_thread& cpu, u32 eport_id, u32 equeu
|
|||||||
return CELL_EISCONN;
|
return CELL_EISCONN;
|
||||||
}
|
}
|
||||||
|
|
||||||
port->queue = idm::get_unlocked<lv2_obj, lv2_event_queue>(equeue_id);
|
port->queue = std::move(queue);
|
||||||
|
|
||||||
return CELL_OK;
|
return CELL_OK;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -7,7 +7,6 @@
|
|||||||
#include <deque>
|
#include <deque>
|
||||||
|
|
||||||
class cpu_thread;
|
class cpu_thread;
|
||||||
class spu_thrread;
|
|
||||||
|
|
||||||
// Event Queue Type
|
// Event Queue Type
|
||||||
enum : u32
|
enum : u32
|
||||||
|
|||||||
@ -487,6 +487,8 @@ error_code _sys_lwcond_queue_wait(ppu_thread& ppu, u32 lwcond_id, u32 lwmutex_id
|
|||||||
{
|
{
|
||||||
ensure(cond.unqueue(cond.sq, &ppu));
|
ensure(cond.unqueue(cond.sq, &ppu));
|
||||||
ppu.state += cpu_flag::again;
|
ppu.state += cpu_flag::again;
|
||||||
|
cond.lwmutex_waiters--;
|
||||||
|
mutex->lwcond_waiters--;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -85,7 +85,7 @@ error_code sys_mutex_create(ppu_thread& ppu, vm::ptr<u32> mutex_id, vm::ptr<sys_
|
|||||||
sys_mutex.todo("sys_mutex_create(): unexpected adaptive (0x%x)", _attr.adaptive);
|
sys_mutex.todo("sys_mutex_create(): unexpected adaptive (0x%x)", _attr.adaptive);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (auto error = lv2_obj::create<lv2_mutex>(_attr.pshared, _attr.ipc_key, _attr.flags, [&]()
|
if (auto error = lv2_obj::create<lv2_mutex>(_attr.pshared, ipc_key, _attr.flags, [&]()
|
||||||
{
|
{
|
||||||
return make_shared<lv2_mutex>(
|
return make_shared<lv2_mutex>(
|
||||||
_attr.protocol,
|
_attr.protocol,
|
||||||
|
|||||||
@ -437,7 +437,7 @@ struct spu_limits_t
|
|||||||
raw_spu_count += spu_thread::g_raw_spu_ctr;
|
raw_spu_count += spu_thread::g_raw_spu_ctr;
|
||||||
|
|
||||||
// physical_spus_count >= spu_limit returns EBUSY, not EINVAL!
|
// physical_spus_count >= spu_limit returns EBUSY, not EINVAL!
|
||||||
if (spu_limit + raw_limit > 6 || raw_spu_count > raw_limit || physical_spus_count >= spu_limit || physical_spus_count > spu_limit || controllable_spu_count > spu_limit)
|
if (spu_limit + raw_limit > 6 || raw_spu_count > raw_limit || physical_spus_count >= spu_limit || controllable_spu_count > spu_limit)
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user