Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sys_rwlock_wlock: Fix typo and more fixes #6873

Merged
merged 6 commits into from
Oct 29, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 3 additions & 3 deletions rpcs3/Emu/Cell/SPURecompiler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5991,9 +5991,9 @@ class spu_llvm_recompiler : public spu_recompiler_base, public cpu_translator
m_ir->CreateStore(size.value, _ptr<u16>(pmfc, ::offset32(&spu_mfc_cmd::size)));
m_ir->CreateStore(lsa.value, _ptr<u32>(pmfc, ::offset32(&spu_mfc_cmd::lsa)));
m_ir->CreateStore(eal.value, _ptr<u32>(pmfc, ::offset32(&spu_mfc_cmd::eal)));
m_ir->CreateStore(m_ir->CreateOr(m_ir->CreateLoad(pb), mask), pb);
if (cmd & MFC_FENCE_MASK)
m_ir->CreateStore(m_ir->CreateOr(m_ir->CreateLoad(pf), mask), pf);
m_ir->CreateStore(m_ir->CreateOr(m_ir->CreateLoad(pf), mask), pf);
if (cmd & MFC_BARRIER_MASK)
m_ir->CreateStore(m_ir->CreateOr(m_ir->CreateLoad(pb), mask), pb);
break;
}
case MFC_BARRIER_CMD:
Expand Down
2 changes: 1 addition & 1 deletion rpcs3/Emu/Cell/lv2/sys_cond.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ struct sys_cond_attribute_t

union
{
u64 name_u64;
nse_t<u64, 1> name_u64;
char name[sizeof(u64)];
};
};
Expand Down
26 changes: 12 additions & 14 deletions rpcs3/Emu/Cell/lv2/sys_config.h
Original file line number Diff line number Diff line change
Expand Up @@ -195,11 +195,9 @@ class lv2_config_handle
template <typename... Args>
static std::shared_ptr<lv2_config_handle> create(Args&&... args)
{
auto cfg = std::make_shared<lv2_config_handle>(std::forward<Args>(args)...);

if (const u32 idm_id = idm::import_existing<lv2_config_handle>(cfg))
if (auto cfg = idm::make_ptr<lv2_config_handle>(std::forward<Args>(args)...))
{
cfg->idm_id = idm_id;
cfg->idm_id = idm::last_id();
return cfg;
}
return nullptr;
Expand Down Expand Up @@ -253,12 +251,10 @@ class lv2_config_service
template <typename... Args>
static std::shared_ptr<lv2_config_service> create(Args&&... args)
{
auto service = std::make_shared<lv2_config_service>(std::forward<Args>(args)...);

if (const u32 idm_id = idm::import_existing<lv2_config_service>(service))
if (auto service = idm::make_ptr<lv2_config_service>(std::forward<Args>(args)...))
{
service->wkptr = service;
service->idm_id = idm_id;
service->idm_id = idm::last_id();
return service;
}

Expand Down Expand Up @@ -320,12 +316,10 @@ class lv2_config_service_listener
template <typename... Args>
static std::shared_ptr<lv2_config_service_listener> create(Args&&... args)
{
auto listener = std::make_shared<lv2_config_service_listener>(std::forward<Args>(args)...);

if (const u32 idm_id = idm::import_existing<lv2_config_service_listener>(listener))
if (auto listener = idm::make_ptr<lv2_config_service_listener>(std::forward<Args>(args)...))
{
listener->wkptr = listener;
listener->idm_id = idm_id;
listener->idm_id = idm::last_id();
return listener;
}

Expand Down Expand Up @@ -353,8 +347,12 @@ class lv2_config_service_event
{
static u32 get_next_id()
{
static atomic_t<u32> next_id = 0;
return next_id++;
struct service_event_id
{
atomic_t<u32> next_id = 0;
};

return g_fxo->get<service_event_id>()->next_id++;
}

public:
Expand Down
2 changes: 1 addition & 1 deletion rpcs3/Emu/Cell/lv2/sys_event.h
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ struct sys_event_queue_attribute_t

union
{
u64 name_u64;
nse_t<u64, 1> name_u64;
char name[sizeof(u64)];
};
};
Expand Down
2 changes: 1 addition & 1 deletion rpcs3/Emu/Cell/lv2/sys_event_flag.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ struct sys_event_flag_attribute_t

union
{
u64 name_u64;
nse_t<u64, 1> name_u64;
char name[sizeof(u64)];
};
};
Expand Down
2 changes: 1 addition & 1 deletion rpcs3/Emu/Cell/lv2/sys_lwcond.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ struct sys_lwcond_attribute_t
{
union
{
u64 name_u64;
nse_t<u64, 1> name_u64;
char name[sizeof(u64)];
};
};
Expand Down
2 changes: 1 addition & 1 deletion rpcs3/Emu/Cell/lv2/sys_lwmutex.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ struct sys_lwmutex_attribute_t

union
{
u64 name_u64;
nse_t<u64, 1> name_u64;
char name[sizeof(u64)];
};
};
Expand Down
2 changes: 1 addition & 1 deletion rpcs3/Emu/Cell/lv2/sys_mutex.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ struct sys_mutex_attribute_t

union
{
u64 name_u64;
nse_t<u64, 1> name_u64;
char name[sizeof(u64)];
};
};
Expand Down
2 changes: 1 addition & 1 deletion rpcs3/Emu/Cell/lv2/sys_rwlock.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -350,7 +350,7 @@ error_code sys_rwlock_wlock(ppu_thread& ppu, u32 rw_lock_id, u64 timeout)
{
rwlock->owner.atomic_op([&](s64& owner)
{
owner -= -2 * static_cast<s64>(rwlock->rq.size()); // Add readers to value
owner -= 2 * static_cast<s64>(rwlock->rq.size()); // Add readers to value
owner &= -2; // Clear wait bit
});

Expand Down
2 changes: 1 addition & 1 deletion rpcs3/Emu/Cell/lv2/sys_rwlock.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ struct sys_rwlock_attribute_t

union
{
u64 name_u64;
nse_t<u64, 1> name_u64;
char name[sizeof(u64)];
};
};
Expand Down
2 changes: 1 addition & 1 deletion rpcs3/Emu/Cell/lv2/sys_semaphore.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ struct sys_semaphore_attribute_t

union
{
u64 name_u64;
nse_t<u64, 1> name_u64;
char name[sizeof(u64)];
};
};
Expand Down
3 changes: 2 additions & 1 deletion rpcs3/rpcs3qt/kernel_explorer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,9 @@ void kernel_explorer::Update()
char string[8];

name64(u64 data)
: u64_data(data & 0x00ffffffffffffffull)
: u64_data(data)
{
string[7] = '\0';
}

const char* operator+() const
Expand Down