diff --git a/Utilities/BEType.h b/Utilities/BEType.h index b9e1d542a0..e317bee226 100644 --- a/Utilities/BEType.h +++ b/Utilities/BEType.h @@ -374,6 +374,9 @@ inline v128 operator ~(const v128& other) return v128::from64(~other._u64[0], ~other._u64[1]); } +#define IS_INTEGER(t) (std::is_integral::value || std::is_enum::value) +#define IS_BINARY_COMPARABLE(t1, t2) (IS_INTEGER(t1) && IS_INTEGER(t2) && sizeof(t1) == sizeof(t2)) + template struct se_storage { static_assert(!Size, "Bad se_storage<> type"); @@ -383,6 +386,11 @@ template struct se_storage { using type = u16; + static constexpr u16 swap(u16 src) + { + return (src >> 8) | (src << 8); + } + static inline u16 to(const T& src) { return _byteswap_ushort(reinterpret_cast(src)); @@ -399,6 +407,11 @@ template struct se_storage { using type = u32; + static constexpr u32 swap(u32 src) + { + return (src >> 24) | (src << 24) | ((src >> 8) & 0x0000ff00) | ((src << 8) & 0x00ff0000); + } + static inline u32 to(const T& src) { return _byteswap_ulong(reinterpret_cast(src)); @@ -415,6 +428,17 @@ template struct se_storage { using type = u64; + static constexpr u64 swap(u64 src) + { + return (src >> 56) | (src << 56) | + ((src >> 40) & 0x000000000000ff00) | + ((src >> 24) & 0x0000000000ff0000) | + ((src >> 8) & 0x00000000ff000000) | + ((src << 8) & 0x000000ff00000000) | + ((src << 24) & 0x0000ff0000000000) | + ((src << 40) & 0x00ff000000000000); + } + static inline u64 to(const T& src) { return _byteswap_uint64(reinterpret_cast(src)); @@ -465,16 +489,17 @@ template struct se_convert } }; +static struct se_raw_tag_t {} const se_raw{}; + template class se_t { using type = std::remove_cv_t; - using stype = se_storage_t>; - using storage = se_storage>; + using stype = se_storage_t; + using storage = se_storage; stype m_data; - static_assert(!std::is_class::value || std::is_same::value, "se_t<> error: invalid type (class or structure)"); - static_assert(!std::is_union::value || std::is_same::value || std::is_same::value, "se_t<> error: invalid type (union)"); + static_assert(!std::is_union::value && !std::is_class::value || std::is_same::value || std::is_same::value, "se_t<> error: invalid type (struct or union)"); static_assert(!std::is_pointer::value, "se_t<> error: invalid type (pointer)"); static_assert(!std::is_reference::value, "se_t<> error: invalid type (reference)"); static_assert(!std::is_array::value, "se_t<> error: invalid type (array)"); @@ -484,59 +509,106 @@ template class se_t public: se_t() = default; - se_t(const se_t&) = default; + se_t(const se_t& right) = default; - inline se_t(const type& value) + template::value && !std::is_same, std::decay_t>::value>> inline se_t(const CT& value) : m_data(storage::to(value)) { } + // construct directly from raw data (don't use) + inline se_t(const stype& raw_value, const se_raw_tag_t&) + : m_data(raw_value) + { + } + inline type value() const { return storage::from(m_data); } - inline const stype& data() const + // access underlying raw data (don't use) + inline const stype& raw_data() const { return m_data; } se_t& operator =(const se_t&) = default; - template std::enable_if_t::value, se_t&> operator =(const CT& value) + template inline std::enable_if_t::value && !std::is_same, std::decay_t>::value, se_t&> operator =(const CT& value) { return m_data = storage::to(value), *this; } - operator type() const + inline operator type() const { return value(); } + + // optimization + explicit inline operator bool() const + { + static_assert(std::is_convertible::value, "Illegal conversion to bool"); + + return m_data != 0; + } + + // optimization + template inline std::enable_if_t operator &=(const se_t& right) + { + return m_data &= right.raw_data(), *this; + } + + // optimization + template inline std::enable_if_t::value && std::is_convertible::value, se_t&> operator &=(const CT& right) + { + return m_data &= storage::to(right), *this; + } + + // optimization + template inline std::enable_if_t operator |=(const se_t& right) + { + return m_data |= right.raw_data(), *this; + } + + // optimization + template inline std::enable_if_t::value && std::is_convertible::value, se_t&> operator |=(const CT& right) + { + return m_data |= storage::to(right), *this; + } + + // optimization + template inline std::enable_if_t operator ^=(const se_t& right) + { + return m_data ^= right.raw_data(), *this; + } + + // optimization + template inline std::enable_if_t::value && std::is_convertible::value, se_t&> operator ^=(const CT& right) + { + return m_data ^= storage::to(right), *this; + } }; template class se_t { using type = std::remove_cv_t; - using stype = se_storage_t>; - using storage = se_storage>; type m_data; - static_assert(!std::is_class::value || std::is_same::value, "se_t<> error: invalid type (class or structure)"); - static_assert(!std::is_union::value || std::is_same::value || std::is_same::value, "se_t<> error: invalid type (union)"); + static_assert(!std::is_union::value && !std::is_class::value || std::is_same::value || std::is_same::value, "se_t<> error: invalid type (struct or union)"); static_assert(!std::is_pointer::value, "se_t<> error: invalid type (pointer)"); static_assert(!std::is_reference::value, "se_t<> error: invalid type (reference)"); static_assert(!std::is_array::value, "se_t<> error: invalid type (array)"); static_assert(!std::is_enum::value, "se_t<> error: invalid type (enumeration), use integral type instead"); - static_assert(alignof(type) == alignof(stype), "se_t<> error: unexpected alignment"); public: se_t() = default; se_t(const se_t&) = default; - inline se_t(const type& value) - : m_data(value) + template::value && !std::is_same, std::decay_t>::value>> inline se_t(CT&& value) + : m_data(std::forward(value)) { } @@ -545,34 +617,34 @@ public: return m_data; } - inline const stype& data() const - { - return reinterpret_cast(m_data); - } - se_t& operator =(const se_t& value) = default; - template std::enable_if_t::value, se_t&> operator =(const CT& value) + template inline std::enable_if_t::value && !std::is_same, std::decay_t>::value, se_t&> operator =(const CT& value) { return m_data = value, *this; } - operator type() const + inline operator type() const { return value(); } + + template inline std::enable_if_t::value && std::is_convertible::value, se_t&> operator &=(const CT& right) + { + return m_data &= right, *this; + } + + template inline std::enable_if_t::value && std::is_convertible::value, se_t&> operator |=(const CT& right) + { + return m_data |= right, *this; + } + + template inline std::enable_if_t::value && std::is_convertible::value, se_t&> operator ^=(const CT& right) + { + return m_data ^= right, *this; + } }; -template inline std::enable_if_t::value && std::is_integral::value, bool> operator ==(const se_t& left, const se_t& right) -{ - return left.data() == right.data(); -} - -template inline std::enable_if_t::value && std::is_integral::value, bool> operator !=(const se_t& left, const se_t& right) -{ - return left.data() != right.data(); -} - template inline se_t& operator +=(se_t& left, const T1& right) { auto value = left.value(); @@ -615,24 +687,6 @@ template inline se_t& operator >>=(se_t return left = (value >>= right); } -template inline se_t& operator &=(se_t& left, const T1& right) -{ - auto value = left.value(); - return left = (value &= right); -} - -template inline se_t& operator |=(se_t& left, const T1& right) -{ - auto value = left.value(); - return left = (value |= right); -} - -template inline se_t& operator ^=(se_t& left, const T1& right) -{ - auto value = left.value(); - return left = (value ^= right); -} - template inline se_t operator ++(se_t& left, int) { auto value = left.value(); @@ -661,6 +715,102 @@ template inline se_t& operator --(se_t& right return right = --value; } +// optimization +template inline std::enable_if_t operator ==(const se_t& left, const se_t& right) +{ + return left.raw_data() == right.raw_data(); +} + +// optimization +template inline std::enable_if_t operator ==(const se_t& left, const T2& right) +{ + return left.raw_data() == se_storage::to(right); +} + +// optimization +template inline std::enable_if_t operator ==(const T1& left, const se_t& right) +{ + return se_storage::to(left) == right.raw_data(); +} + +// optimization +template inline std::enable_if_t operator !=(const se_t& left, const se_t& right) +{ + return left.raw_data() != right.raw_data(); +} + +// optimization +template inline std::enable_if_t operator !=(const se_t& left, const T2& right) +{ + return left.raw_data() != se_storage::to(right); +} + +// optimization +template inline std::enable_if_t operator !=(const T1& left, const se_t& right) +{ + return se_storage::to(left) != right.raw_data(); +} + +// optimization +template inline std::enable_if_t= 4, se_t> operator &(const se_t& left, const se_t& right) +{ + return{ static_cast>(left.raw_data() & right.raw_data()), se_raw }; +} + +// optimization +template inline std::enable_if_t= 4, se_t> operator &(const se_t& left, const T2& right) +{ + return{ static_cast>(left.raw_data() & se_storage::to(right)), se_raw }; +} + +// optimization +template inline std::enable_if_t= 4, se_t> operator &(const T1& left, const se_t& right) +{ + return{ static_cast>(se_storage::to(left) & right.raw_data()), se_raw }; +} + +// optimization +template inline std::enable_if_t= 4, se_t> operator |(const se_t& left, const se_t& right) +{ + return{ static_cast>(left.raw_data() | right.raw_data()), se_raw }; +} + +// optimization +template inline std::enable_if_t= 4, se_t> operator |(const se_t& left, const T2& right) +{ + return{ static_cast>(left.raw_data() | se_storage::to(right)), se_raw }; +} + +// optimization +template inline std::enable_if_t= 4, se_t> operator |(const T1& left, const se_t& right) +{ + return{ static_cast>(se_storage::to(left) | right.raw_data()), se_raw }; +} + +// optimization +template inline std::enable_if_t= 4, se_t> operator ^(const se_t& left, const se_t& right) +{ + return{ static_cast>(left.raw_data() ^ right.raw_data()), se_raw }; +} + +// optimization +template inline std::enable_if_t= 4, se_t> operator ^(const se_t& left, const T2& right) +{ + return{ static_cast>(left.raw_data() ^ se_storage::to(right)), se_raw }; +} + +// optimization +template inline std::enable_if_t= 4, se_t> operator ^(const T1& left, const se_t& right) +{ + return{ static_cast>(se_storage::to(left) ^ right.raw_data()), se_raw }; +} + +// optimization +template inline std::enable_if_t= 4, se_t> operator ~(const se_t& right) +{ + return{ static_cast>(~right.raw_data()), se_raw }; +} + #ifdef IS_LE_MACHINE template using be_t = se_t; template using le_t = se_t; diff --git a/rpcs3/Emu/SysCalls/Modules.cpp b/rpcs3/Emu/SysCalls/Modules.cpp index 3788a03dca..a6ab53bd67 100644 --- a/rpcs3/Emu/SysCalls/Modules.cpp +++ b/rpcs3/Emu/SysCalls/Modules.cpp @@ -272,10 +272,10 @@ void hook_ppu_func(vm::ptr base, u32 pos, u32 size) continue; } - const u32 data = sub.ops[x].data.data(); - const u32 mask = sub.ops[x].mask.data(); + const be_t data = sub.ops[x].data; + const be_t mask = sub.ops[x].mask; - const bool match = (base[k].data() & mask) == data; + const bool match = (base[k] & mask) == data; switch (sub.ops[x].type) { @@ -301,8 +301,8 @@ void hook_ppu_func(vm::ptr base, u32 pos, u32 size) } case SPET_LABEL: { - const auto addr = (base + k--).addr(); - const auto lnum = data; + const u32 addr = (base + k--).addr(); + const u32 lnum = data; const auto label = sub.labels.find(lnum); if (label == sub.labels.end()) // register the label diff --git a/rpcs3/Emu/SysCalls/Modules/cellFs.cpp b/rpcs3/Emu/SysCalls/Modules/cellFs.cpp index 83d96244d0..773150f251 100644 --- a/rpcs3/Emu/SysCalls/Modules/cellFs.cpp +++ b/rpcs3/Emu/SysCalls/Modules/cellFs.cpp @@ -631,7 +631,7 @@ s32 cellFsStReadGetCurrentAddr(u32 fd, vm::ptr addr, vm::ptr size) const u32 position = VM_CAST(file->st_buffer + copied % file->st_ringbuf_size); const u64 total_read = file->st_total_read.load(); - if ((*size = std::min(file->st_ringbuf_size - (position - file->st_buffer), total_read - copied)).data()) + if ((*size = std::min(file->st_ringbuf_size - (position - file->st_buffer), total_read - copied))) { *addr = position; } diff --git a/rpcs3/Emu/SysCalls/Modules/cellSpurs.cpp b/rpcs3/Emu/SysCalls/Modules/cellSpurs.cpp index b2a20633f2..6aad17f86d 100644 --- a/rpcs3/Emu/SysCalls/Modules/cellSpurs.cpp +++ b/rpcs3/Emu/SysCalls/Modules/cellSpurs.cpp @@ -321,7 +321,7 @@ s32 spursAttachLv2EventQueue(PPUThread& ppu, vm::ptr spurs, u32 queue return CELL_SPURS_CORE_ERROR_ALIGN; } - if (spurs->exception.data()) + if (spurs->exception) { return CELL_SPURS_CORE_ERROR_STAT; } @@ -380,7 +380,7 @@ s32 spursDetachLv2EventQueue(vm::ptr spurs, u8 spuPort, bool spursCre return CELL_SPURS_CORE_ERROR_ALIGN; } - if (!spursCreated && spurs->exception.data()) + if (!spursCreated && spurs->exception) { return CELL_SPURS_CORE_ERROR_STAT; } @@ -555,7 +555,7 @@ s32 spursCreateHandler(vm::ptr spurs, u32 ppuPriority) /// Invoke event handlers s32 spursInvokeEventHandlers(PPUThread& ppu, vm::ptr eventPortMux) { - if (eventPortMux->reqPending.exchange(0).data()) + if (eventPortMux->reqPending.exchange(0)) { const vm::ptr handlerList = eventPortMux->handlerList.exchange(vm::null); @@ -1656,7 +1656,7 @@ s32 cellSpursSetMaxContention(vm::ptr spurs, u32 wid, u32 maxContenti return CELL_SPURS_CORE_ERROR_SRCH; } - if (spurs->exception.data()) + if (spurs->exception) { return CELL_SPURS_CORE_ERROR_STAT; } @@ -1700,7 +1700,7 @@ s32 cellSpursSetPriorities(vm::ptr spurs, u32 wid, vm::cptr prior return CELL_SPURS_CORE_ERROR_SRCH; } - if (spurs->exception.data()) + if (spurs->exception) { return CELL_SPURS_CORE_ERROR_STAT; } @@ -1810,7 +1810,7 @@ s32 cellSpursSetGlobalExceptionEventHandler(vm::ptr spurs, vm::ptrexception.data()) + if (spurs->exception) { return CELL_SPURS_CORE_ERROR_STAT; } @@ -2182,7 +2182,7 @@ s32 spursAddWorkload( return CELL_SPURS_POLICY_MODULE_ERROR_INVAL; } - if (spurs->exception.data()) + if (spurs->exception) { return CELL_SPURS_POLICY_MODULE_ERROR_STAT; } @@ -2398,7 +2398,7 @@ s32 cellSpursWakeUp(PPUThread& ppu, vm::ptr spurs) return CELL_SPURS_POLICY_MODULE_ERROR_ALIGN; } - if (spurs->exception.data()) + if (spurs->exception) { return CELL_SPURS_POLICY_MODULE_ERROR_STAT; } @@ -2433,7 +2433,7 @@ s32 cellSpursSendWorkloadSignal(vm::ptr spurs, u32 wid) return CELL_SPURS_POLICY_MODULE_ERROR_INVAL; } - if ((spurs->wklEnabled.load() & (0x80000000u >> wid)) == 0) + if (!(spurs->wklEnabled.load() & (0x80000000u >> wid))) { return CELL_SPURS_POLICY_MODULE_ERROR_SRCH; } @@ -2504,7 +2504,7 @@ s32 cellSpursReadyCountStore(vm::ptr spurs, u32 wid, u32 value) return CELL_SPURS_POLICY_MODULE_ERROR_SRCH; } - if (spurs->exception.data() || spurs->wklState(wid).load() != 2) + if (spurs->exception || spurs->wklState(wid).load() != 2) { return CELL_SPURS_POLICY_MODULE_ERROR_STAT; } @@ -2630,7 +2630,7 @@ s32 _cellSpursWorkloadFlagReceiver(vm::ptr spurs, u32 wid, u32 is_set return CELL_SPURS_POLICY_MODULE_ERROR_SRCH; } - if (spurs->exception.data()) + if (spurs->exception) { return CELL_SPURS_POLICY_MODULE_ERROR_STAT; } diff --git a/rpcs3/Emu/SysCalls/Modules/cellSync.cpp b/rpcs3/Emu/SysCalls/Modules/cellSync.cpp index 3faae111ae..6b16ce4798 100644 --- a/rpcs3/Emu/SysCalls/Modules/cellSync.cpp +++ b/rpcs3/Emu/SysCalls/Modules/cellSync.cpp @@ -331,7 +331,7 @@ s32 cellSyncRwmWrite(PPUThread& ppu, vm::ptr rwm, vm::cptr bu vm::wait_op(ppu, rwm.addr(), 4, WRAP_EXPR(rwm->ctrl.atomic_op(&sync_rwm_t::try_write_begin))); // wait until `readers` is zero - vm::wait_op(ppu, rwm.addr(), 4, WRAP_EXPR(!rwm->ctrl.load().readers.data())); + vm::wait_op(ppu, rwm.addr(), 4, WRAP_EXPR(!rwm->ctrl.load().readers)); // copy data from buffer std::memcpy(rwm->buffer.get_ptr(), buffer.get_ptr(), rwm->size); @@ -746,7 +746,7 @@ s32 cellSyncLFQueueInitialize(vm::ptr queue, vm::cptr buf const auto old = queue->init.load(); auto init = old; - if (old.data()) + if (old) { if (sdk_ver > 0x17ffff && old != 2) { @@ -837,7 +837,7 @@ s32 _cellSyncLFQueueGetPushPointer(PPUThread& ppu, vm::ptr queu s32 var2 = (s16)push.m_h8; s32 res; - if (useEventQueue && ((s32)push.m_h5 != var2 || push.m_h7.data() != 0)) + if (useEventQueue && ((s32)push.m_h5 != var2 || push.m_h7)) { res = CELL_SYNC_ERROR_BUSY; } @@ -884,7 +884,7 @@ s32 _cellSyncLFQueueGetPushPointer(PPUThread& ppu, vm::ptr queu if (queue->push1.compare_and_swap_test(old, push)) { - if (!push.m_h7.data() || res) + if (!push.m_h7 || res) { return res; } @@ -1143,7 +1143,7 @@ s32 _cellSyncLFQueueGetPopPointer(PPUThread& ppu, vm::ptr queue s32 var2 = (s32)(s16)pop.m_h4; s32 res; - if (useEventQueue && ((s32)(u16)pop.m_h1 != var2 || pop.m_h3.data() != 0)) + if (useEventQueue && ((s32)(u16)pop.m_h1 != var2 || pop.m_h3)) { res = CELL_SYNC_ERROR_BUSY; } @@ -1190,7 +1190,7 @@ s32 _cellSyncLFQueueGetPopPointer(PPUThread& ppu, vm::ptr queue if (queue->pop1.compare_and_swap_test(old, pop)) { - if (!pop.m_h3.data() || res) + if (!pop.m_h3 || res) { return res; } diff --git a/rpcs3/Emu/SysCalls/Modules/cellSync.h b/rpcs3/Emu/SysCalls/Modules/cellSync.h index c6b006ff42..ef5a8c26a3 100644 --- a/rpcs3/Emu/SysCalls/Modules/cellSync.h +++ b/rpcs3/Emu/SysCalls/Modules/cellSync.h @@ -111,7 +111,7 @@ struct sync_rwm_t // CellSyncRwm sync var bool try_read_begin() { - if (writers.data()) + if (writers) { return false; } @@ -122,7 +122,7 @@ struct sync_rwm_t // CellSyncRwm sync var bool try_read_end() { - if (!readers.data()) + if (!readers) { return false; } @@ -133,7 +133,7 @@ struct sync_rwm_t // CellSyncRwm sync var bool try_write_begin() { - if (writers.data()) + if (writers) { return false; } diff --git a/rpcs3/Emu/SysCalls/Modules/sys_lwmutex_.cpp b/rpcs3/Emu/SysCalls/Modules/sys_lwmutex_.cpp index 85ba7abeb0..1549515d15 100644 --- a/rpcs3/Emu/SysCalls/Modules/sys_lwmutex_.cpp +++ b/rpcs3/Emu/SysCalls/Modules/sys_lwmutex_.cpp @@ -86,7 +86,7 @@ s32 sys_lwmutex_lock(PPUThread& ppu, vm::ptr lwmutex, u64 timeout return CELL_OK; } - if (old_owner.data() == tid.data()) + if (old_owner == tid) { // recursive locking @@ -96,7 +96,7 @@ s32 sys_lwmutex_lock(PPUThread& ppu, vm::ptr lwmutex, u64 timeout return CELL_EDEADLK; } - if (lwmutex->recursive_count.data() == -1) + if (lwmutex->recursive_count == -1) { // if recursion limit reached return CELL_EKRESOURCE; @@ -180,7 +180,7 @@ s32 sys_lwmutex_trylock(PPUThread& ppu, vm::ptr lwmutex) return CELL_OK; } - if (old_owner.data() == tid.data()) + if (old_owner == tid) { // recursive locking @@ -190,7 +190,7 @@ s32 sys_lwmutex_trylock(PPUThread& ppu, vm::ptr lwmutex) return CELL_EDEADLK; } - if (lwmutex->recursive_count.data() == -1) + if (lwmutex->recursive_count == -1) { // if recursion limit reached return CELL_EKRESOURCE; @@ -244,7 +244,7 @@ s32 sys_lwmutex_unlock(PPUThread& ppu, vm::ptr lwmutex) return CELL_EPERM; } - if (lwmutex->recursive_count.data()) + if (lwmutex->recursive_count) { // recursive unlocking succeeded lwmutex->recursive_count--; diff --git a/rpcs3/Emu/SysCalls/Modules/sys_spinlock.cpp b/rpcs3/Emu/SysCalls/Modules/sys_spinlock.cpp index cc80543c9b..e1744e31bb 100644 --- a/rpcs3/Emu/SysCalls/Modules/sys_spinlock.cpp +++ b/rpcs3/Emu/SysCalls/Modules/sys_spinlock.cpp @@ -19,14 +19,14 @@ void sys_spinlock_lock(PPUThread& ppu, vm::ptr> lock) sysPrxForUser.Log("sys_spinlock_lock(lock=*0x%x)", lock); // prx: exchange with 0xabadcafe, repeat until exchanged with 0 - vm::wait_op(ppu, lock.addr(), 4, WRAP_EXPR(!lock->exchange(0xabadcafe).data())); + vm::wait_op(ppu, lock.addr(), 4, WRAP_EXPR(!lock->exchange(0xabadcafe))); } s32 sys_spinlock_trylock(vm::ptr> lock) { sysPrxForUser.Log("sys_spinlock_trylock(lock=*0x%x)", lock); - if (lock->exchange(0xabadcafe).data()) + if (lock->exchange(0xabadcafe)) { return CELL_EBUSY; } diff --git a/rpcs3/Emu/SysCalls/lv2/sys_cond.cpp b/rpcs3/Emu/SysCalls/lv2/sys_cond.cpp index 5b5c8de7d2..6a0ccc7219 100644 --- a/rpcs3/Emu/SysCalls/lv2/sys_cond.cpp +++ b/rpcs3/Emu/SysCalls/lv2/sys_cond.cpp @@ -46,7 +46,7 @@ s32 sys_cond_create(vm::ptr cond_id, u32 mutex_id, vm::ptrpshared != SYS_SYNC_NOT_PROCESS_SHARED || attr->ipc_key.data() || attr->flags.data()) + if (attr->pshared != SYS_SYNC_NOT_PROCESS_SHARED || attr->ipc_key || attr->flags) { sys_cond.Error("sys_cond_create(): unknown attributes (pshared=0x%x, ipc_key=0x%llx, flags=0x%x)", attr->pshared, attr->ipc_key, attr->flags); return CELL_EINVAL; diff --git a/rpcs3/Emu/SysCalls/lv2/sys_event_flag.cpp b/rpcs3/Emu/SysCalls/lv2/sys_event_flag.cpp index 1425a2d141..a788aacc3b 100644 --- a/rpcs3/Emu/SysCalls/lv2/sys_event_flag.cpp +++ b/rpcs3/Emu/SysCalls/lv2/sys_event_flag.cpp @@ -62,7 +62,7 @@ s32 sys_event_flag_create(vm::ptr id, vm::ptr a return CELL_EINVAL; } - if (attr->pshared != SYS_SYNC_NOT_PROCESS_SHARED || attr->ipc_key.data() || attr->flags.data()) + if (attr->pshared != SYS_SYNC_NOT_PROCESS_SHARED || attr->ipc_key || attr->flags) { sys_event_flag.Error("sys_event_flag_create(): unknown attributes (pshared=0x%x, ipc_key=0x%llx, flags=0x%x)", attr->pshared, attr->ipc_key, attr->flags); return CELL_EINVAL; diff --git a/rpcs3/Emu/SysCalls/lv2/sys_mutex.cpp b/rpcs3/Emu/SysCalls/lv2/sys_mutex.cpp index a34c81fde6..0545db9b4e 100644 --- a/rpcs3/Emu/SysCalls/lv2/sys_mutex.cpp +++ b/rpcs3/Emu/SysCalls/lv2/sys_mutex.cpp @@ -56,7 +56,7 @@ s32 sys_mutex_create(vm::ptr mutex_id, vm::ptr attr) const bool recursive = attr->recursive == SYS_SYNC_RECURSIVE; - if ((!recursive && attr->recursive != SYS_SYNC_NOT_RECURSIVE) || attr->pshared != SYS_SYNC_NOT_PROCESS_SHARED || attr->adaptive != SYS_SYNC_NOT_ADAPTIVE || attr->ipc_key.data() || attr->flags.data()) + if ((!recursive && attr->recursive != SYS_SYNC_NOT_RECURSIVE) || attr->pshared != SYS_SYNC_NOT_PROCESS_SHARED || attr->adaptive != SYS_SYNC_NOT_ADAPTIVE || attr->ipc_key || attr->flags) { sys_mutex.Error("sys_mutex_create(): unknown attributes (recursive=0x%x, pshared=0x%x, adaptive=0x%x, ipc_key=0x%llx, flags=0x%x)", attr->recursive, attr->pshared, attr->adaptive, attr->ipc_key, attr->flags); diff --git a/rpcs3/Emu/SysCalls/lv2/sys_rwlock.cpp b/rpcs3/Emu/SysCalls/lv2/sys_rwlock.cpp index c0fcfd21ae..b9ccab39e7 100644 --- a/rpcs3/Emu/SysCalls/lv2/sys_rwlock.cpp +++ b/rpcs3/Emu/SysCalls/lv2/sys_rwlock.cpp @@ -63,7 +63,7 @@ s32 sys_rwlock_create(vm::ptr rw_lock_id, vm::ptr a return CELL_EINVAL; } - if (attr->pshared != SYS_SYNC_NOT_PROCESS_SHARED || attr->ipc_key.data() || attr->flags.data()) + if (attr->pshared != SYS_SYNC_NOT_PROCESS_SHARED || attr->ipc_key || attr->flags) { sys_rwlock.Error("sys_rwlock_create(): unknown attributes (pshared=0x%x, ipc_key=0x%llx, flags=0x%x)", attr->pshared, attr->ipc_key, attr->flags); return CELL_EINVAL; diff --git a/rpcs3/Emu/SysCalls/lv2/sys_semaphore.cpp b/rpcs3/Emu/SysCalls/lv2/sys_semaphore.cpp index 99a4223dd3..8865deaaec 100644 --- a/rpcs3/Emu/SysCalls/lv2/sys_semaphore.cpp +++ b/rpcs3/Emu/SysCalls/lv2/sys_semaphore.cpp @@ -35,7 +35,7 @@ s32 sys_semaphore_create(vm::ptr sem_id, vm::ptr return CELL_EINVAL; } - if (attr->pshared != SYS_SYNC_NOT_PROCESS_SHARED || attr->ipc_key.data() || attr->flags.data()) + if (attr->pshared != SYS_SYNC_NOT_PROCESS_SHARED || attr->ipc_key || attr->flags) { sys_semaphore.Error("sys_semaphore_create(): unknown attributes (pshared=0x%x, ipc_key=0x%x, flags=0x%x)", attr->pshared, attr->ipc_key, attr->flags); return CELL_EINVAL; diff --git a/rpcs3/Emu/SysCalls/lv2/sys_spu.cpp b/rpcs3/Emu/SysCalls/lv2/sys_spu.cpp index 2ca96f6239..9bf5725603 100644 --- a/rpcs3/Emu/SysCalls/lv2/sys_spu.cpp +++ b/rpcs3/Emu/SysCalls/lv2/sys_spu.cpp @@ -230,7 +230,7 @@ s32 sys_spu_thread_group_create(vm::ptr id, u32 num, s32 prio, vm::ptrtype.data()) + if (attr->type) { sys_spu.Todo("Unsupported SPU Thread Group type (0x%x)", attr->type); }