mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-02-25 21:40:54 +00:00
Reverted BE <-> LE comp. changes in some lv2 SCs
This commit is contained in:
parent
2534216971
commit
5ed77a3ca9
@ -15,19 +15,19 @@ int sys_lwmutex_create(mem_ptr_t<sys_lwmutex_t> lwmutex, mem_ptr_t<sys_lwmutex_a
|
||||
|
||||
if (!lwmutex.IsGood() || !attr.IsGood()) return CELL_EFAULT;
|
||||
|
||||
switch (attr->attr_recursive)
|
||||
switch (attr->attr_recursive.ToBE())
|
||||
{
|
||||
case SYS_SYNC_RECURSIVE: break;
|
||||
case SYS_SYNC_NOT_RECURSIVE: break;
|
||||
case se32(SYS_SYNC_RECURSIVE): break;
|
||||
case se32(SYS_SYNC_NOT_RECURSIVE): break;
|
||||
default: sc_lwmutex.Error("Unknown recursive attribute(0x%x)", (u32)attr->attr_recursive); return CELL_EINVAL;
|
||||
}
|
||||
|
||||
switch (attr->attr_protocol)
|
||||
switch (attr->attr_protocol.ToBE())
|
||||
{
|
||||
case SYS_SYNC_PRIORITY: break;
|
||||
case SYS_SYNC_RETRY: break;
|
||||
case SYS_SYNC_PRIORITY_INHERIT: sc_lwmutex.Error("Invalid SYS_SYNC_PRIORITY_INHERIT protocol attr"); return CELL_EINVAL;
|
||||
case SYS_SYNC_FIFO: break;
|
||||
case se32(SYS_SYNC_PRIORITY): break;
|
||||
case se32(SYS_SYNC_RETRY): break;
|
||||
case se32(SYS_SYNC_PRIORITY_INHERIT): sc_lwmutex.Error("Invalid SYS_SYNC_PRIORITY_INHERIT protocol attr"); return CELL_EINVAL;
|
||||
case se32(SYS_SYNC_FIFO): break;
|
||||
default: sc_lwmutex.Error("Unknown protocol attribute(0x%x)", (u32)attr->attr_protocol); return CELL_EINVAL;
|
||||
}
|
||||
|
||||
@ -284,14 +284,14 @@ int sys_lwmutex_t::unlock(be_t<u32> tid)
|
||||
if (!recursive_count.ToBE())
|
||||
{
|
||||
be_t<u32> target = 0;
|
||||
switch (attribute & SYS_SYNC_ATTR_PROTOCOL_MASK)
|
||||
switch (attribute.ToBE() & se32(SYS_SYNC_ATTR_PROTOCOL_MASK))
|
||||
{
|
||||
case SYS_SYNC_FIFO:
|
||||
case SYS_SYNC_PRIORITY:
|
||||
case se32(SYS_SYNC_FIFO):
|
||||
case se32(SYS_SYNC_PRIORITY):
|
||||
SleepQueue* sq;
|
||||
if (!Emu.GetIdManager().GetIDData(sleep_queue, sq)) return CELL_ESRCH;
|
||||
target = attribute & SYS_SYNC_FIFO ? sq->pop() : sq->pop_prio();
|
||||
case SYS_SYNC_RETRY: break;
|
||||
case se32(SYS_SYNC_RETRY): break;
|
||||
}
|
||||
if (target) mutex.unlock(tid, target);
|
||||
else mutex.unlock(tid);
|
||||
@ -311,10 +311,10 @@ int sys_lwmutex_t::lock(be_t<u32> tid, u64 timeout)
|
||||
SleepQueue* sq;
|
||||
if (!Emu.GetIdManager().GetIDData(sleep_queue, sq)) return CELL_ESRCH;
|
||||
|
||||
switch (attribute & SYS_SYNC_ATTR_PROTOCOL_MASK)
|
||||
switch (attribute.ToBE() & se32(SYS_SYNC_ATTR_PROTOCOL_MASK))
|
||||
{
|
||||
case SYS_SYNC_PRIORITY:
|
||||
case SYS_SYNC_FIFO:
|
||||
case se32(SYS_SYNC_PRIORITY):
|
||||
case se32(SYS_SYNC_FIFO):
|
||||
sq->push(tid);
|
||||
default: break;
|
||||
}
|
||||
|
@ -18,20 +18,20 @@ int sys_mutex_create(mem32_t mutex_id, mem_ptr_t<sys_mutex_attribute> attr)
|
||||
return CELL_EFAULT;
|
||||
}
|
||||
|
||||
switch (attr->protocol)
|
||||
switch (attr->protocol.ToBE())
|
||||
{
|
||||
case SYS_SYNC_FIFO: break;
|
||||
case SYS_SYNC_PRIORITY: break;
|
||||
case SYS_SYNC_PRIORITY_INHERIT: sys_mtx.Warning("TODO: SYS_SYNC_PRIORITY_INHERIT protocol"); break;
|
||||
case SYS_SYNC_RETRY: sys_mtx.Error("Invalid SYS_SYNC_RETRY protocol"); return CELL_EINVAL;
|
||||
case se32(SYS_SYNC_FIFO): break;
|
||||
case se32(SYS_SYNC_PRIORITY): break;
|
||||
case se32(SYS_SYNC_PRIORITY_INHERIT): sys_mtx.Warning("TODO: SYS_SYNC_PRIORITY_INHERIT protocol"); break;
|
||||
case se32(SYS_SYNC_RETRY): sys_mtx.Error("Invalid SYS_SYNC_RETRY protocol"); return CELL_EINVAL;
|
||||
default: sys_mtx.Error("Unknown protocol attribute(0x%x)", (u32)attr->protocol); return CELL_EINVAL;
|
||||
}
|
||||
|
||||
bool is_recursive;
|
||||
switch (attr->recursive)
|
||||
switch (attr->recursive.ToBE())
|
||||
{
|
||||
case SYS_SYNC_RECURSIVE: is_recursive = true; break;
|
||||
case SYS_SYNC_NOT_RECURSIVE: is_recursive = false; break;
|
||||
case se32(SYS_SYNC_RECURSIVE): is_recursive = true; break;
|
||||
case se32(SYS_SYNC_NOT_RECURSIVE): is_recursive = false; break;
|
||||
default: sys_mtx.Error("Unknown recursive attribute(0x%x)", (u32)attr->recursive); return CELL_EINVAL;
|
||||
}
|
||||
|
||||
|
@ -175,7 +175,7 @@ int sys_process_get_id(u32 object, mem32_ptr_t buffer, u32 size, mem32_t set_siz
|
||||
|
||||
#define ADD_OBJECTS(objects) { \
|
||||
u32 i=0; \
|
||||
for(auto& id=objects.begin(); i<size && id!=objects.end(); id++, i++) \
|
||||
for(auto id=objects.begin(); i<size && id!=objects.end(); id++, i++) \
|
||||
buffer[i] = *id; \
|
||||
set_size = i; \
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user