1
0
mirror of https://github.com/RPCS3/rpcs3.git synced 2025-01-31 12:31:45 +01:00

Check start status in sys_prx_start/stop_module

This commit is contained in:
eladash 2019-03-17 19:51:24 +02:00 committed by Ivan
parent af86d1d77a
commit d555eeb0f4
2 changed files with 5 additions and 7 deletions

View File

@ -236,10 +236,9 @@ error_code _sys_prx_start_module(u32 id, u64 flags, vm::ptr<sys_prx_start_stop_m
return CELL_ESRCH;
}
//if (prx->is_started)
// return CELL_PRX_ERROR_ALREADY_STARTED;
if (prx->is_started.exchange(true))
return not_an_error(CELL_PRX_ERROR_ALREADY_STARTED);
//prx->is_started = true;
pOpt->entry.set(prx->start ? prx->start.addr() : ~0ull);
pOpt->entry2.set(prx->prologue ? prx->prologue.addr() : ~0ull);
return CELL_OK;
@ -256,10 +255,9 @@ error_code _sys_prx_stop_module(u32 id, u64 flags, vm::ptr<sys_prx_start_stop_mo
return CELL_ESRCH;
}
//if (!prx->is_started)
// return CELL_PRX_ERROR_ALREADY_STOPPED;
if (!prx->is_started.exchange(false))
return not_an_error(CELL_PRX_ERROR_ALREADY_STOPPED);
//prx->is_started = false;
pOpt->entry.set(prx->stop ? prx->stop.addr() : ~0ull);
pOpt->entry2.set(prx->epilogue ? prx->epilogue.addr() : ~0ull);

View File

@ -119,7 +119,7 @@ struct lv2_prx final : lv2_obj, ppu_module
{
static const u32 id_base = 0x23000000;
bool is_started = false;
atomic_t<bool> is_started = false;
std::unordered_map<u32, u32> specials;
std::unordered_map<u32, void*> imports;