2019-02-01 12:00:30 +01:00
|
|
|
|
#include "stdafx.h"
|
2018-09-29 00:12:00 +02:00
|
|
|
|
#include "sys_lwcond.h"
|
|
|
|
|
|
|
2015-03-06 23:58:42 +01:00
|
|
|
|
#include "Emu/IdManager.h"
|
2014-08-23 16:51:51 +02:00
|
|
|
|
|
2016-04-14 00:23:53 +02:00
|
|
|
|
#include "Emu/Cell/ErrorCodes.h"
|
2014-08-23 16:51:51 +02:00
|
|
|
|
#include "Emu/Cell/PPUThread.h"
|
2014-06-25 00:38:34 +02:00
|
|
|
|
#include "sys_lwmutex.h"
|
2014-01-29 21:31:09 +01:00
|
|
|
|
|
2018-08-25 14:39:00 +02:00
|
|
|
|
LOG_CHANNEL(sys_lwcond);
|
2014-01-29 21:31:09 +01:00
|
|
|
|
|
2020-03-17 08:59:28 +01:00
|
|
|
|
error_code _sys_lwcond_create(ppu_thread& ppu, vm::ptr<u32> lwcond_id, u32 lwmutex_id, vm::ptr<sys_lwcond_t> control, u64 name)
|
2015-07-21 18:35:55 +02:00
|
|
|
|
{
|
2019-06-20 13:45:17 +02:00
|
|
|
|
vm::temporary_unlock(ppu);
|
|
|
|
|
|
|
2020-03-18 15:47:44 +01:00
|
|
|
|
sys_lwcond.warning(u8"_sys_lwcond_create(lwcond_id=*0x%x, lwmutex_id=0x%x, control=*0x%x, name=0x%llx (“%s”))", lwcond_id, lwmutex_id, control, name, lv2_obj::name64(std::bit_cast<be_t<u64>>(name)));
|
2015-07-21 18:35:55 +02:00
|
|
|
|
|
2019-05-07 21:05:16 +02:00
|
|
|
|
u32 protocol;
|
|
|
|
|
|
|
|
|
|
|
|
// Extract protocol from lwmutex
|
|
|
|
|
|
if (!idm::check<lv2_obj, lv2_lwmutex>(lwmutex_id, [&protocol](lv2_lwmutex& mutex)
|
|
|
|
|
|
{
|
|
|
|
|
|
protocol = mutex.protocol;
|
|
|
|
|
|
}))
|
2015-07-21 18:35:55 +02:00
|
|
|
|
{
|
2017-02-03 00:16:09 +01:00
|
|
|
|
return CELL_ESRCH;
|
2015-07-21 18:35:55 +02:00
|
|
|
|
}
|
|
|
|
|
|
|
2019-05-07 21:05:16 +02:00
|
|
|
|
if (protocol == SYS_SYNC_RETRY)
|
|
|
|
|
|
{
|
2019-08-17 22:53:49 +02:00
|
|
|
|
// Lwcond can't have SYS_SYNC_RETRY protocol
|
2019-05-07 21:05:16 +02:00
|
|
|
|
protocol = SYS_SYNC_PRIORITY;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (const u32 id = idm::make<lv2_obj, lv2_lwcond>(name, lwmutex_id, protocol, control))
|
2017-02-03 00:16:09 +01:00
|
|
|
|
{
|
|
|
|
|
|
*lwcond_id = id;
|
|
|
|
|
|
return CELL_OK;
|
|
|
|
|
|
}
|
2014-01-29 21:31:09 +01:00
|
|
|
|
|
2017-02-03 00:16:09 +01:00
|
|
|
|
return CELL_EAGAIN;
|
2014-01-29 21:31:09 +01:00
|
|
|
|
}
|
|
|
|
|
|
|
2019-06-20 13:45:17 +02:00
|
|
|
|
error_code _sys_lwcond_destroy(ppu_thread& ppu, u32 lwcond_id)
|
2014-01-29 21:31:09 +01:00
|
|
|
|
{
|
2019-06-20 13:45:17 +02:00
|
|
|
|
vm::temporary_unlock(ppu);
|
|
|
|
|
|
|
2016-01-12 22:57:16 +01:00
|
|
|
|
sys_lwcond.warning("_sys_lwcond_destroy(lwcond_id=0x%x)", lwcond_id);
|
2014-01-29 21:31:09 +01:00
|
|
|
|
|
2017-02-03 00:16:09 +01:00
|
|
|
|
const auto cond = idm::withdraw<lv2_obj, lv2_lwcond>(lwcond_id, [&](lv2_lwcond& cond) -> CellError
|
|
|
|
|
|
{
|
|
|
|
|
|
if (cond.waiters)
|
|
|
|
|
|
{
|
|
|
|
|
|
return CELL_EBUSY;
|
|
|
|
|
|
}
|
2015-03-09 20:56:55 +01:00
|
|
|
|
|
2017-02-03 00:16:09 +01:00
|
|
|
|
return {};
|
|
|
|
|
|
});
|
2015-03-11 16:30:50 +01:00
|
|
|
|
|
2015-04-12 03:36:25 +02:00
|
|
|
|
if (!cond)
|
2014-02-14 12:40:41 +01:00
|
|
|
|
{
|
|
|
|
|
|
return CELL_ESRCH;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2017-02-03 00:16:09 +01:00
|
|
|
|
if (cond.ret)
|
2014-02-14 12:40:41 +01:00
|
|
|
|
{
|
2017-02-03 00:16:09 +01:00
|
|
|
|
return cond.ret;
|
2014-02-14 12:40:41 +01:00
|
|
|
|
}
|
|
|
|
|
|
|
2014-01-29 21:31:09 +01:00
|
|
|
|
return CELL_OK;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2017-02-06 19:36:46 +01:00
|
|
|
|
error_code _sys_lwcond_signal(ppu_thread& ppu, u32 lwcond_id, u32 lwmutex_id, u32 ppu_thread_id, u32 mode)
|
2014-01-29 21:31:09 +01:00
|
|
|
|
{
|
2019-06-20 13:45:17 +02:00
|
|
|
|
vm::temporary_unlock(ppu);
|
|
|
|
|
|
|
2016-01-12 22:57:16 +01:00
|
|
|
|
sys_lwcond.trace("_sys_lwcond_signal(lwcond_id=0x%x, lwmutex_id=0x%x, ppu_thread_id=0x%x, mode=%d)", lwcond_id, lwmutex_id, ppu_thread_id, mode);
|
2015-03-10 15:42:08 +01:00
|
|
|
|
|
2017-02-03 00:16:09 +01:00
|
|
|
|
// Mode 1: lwmutex was initially owned by the calling thread
|
|
|
|
|
|
// Mode 2: lwmutex was not owned by the calling thread and waiter hasn't been increased
|
|
|
|
|
|
// Mode 3: lwmutex was forcefully owned by the calling thread
|
2015-03-10 15:42:08 +01:00
|
|
|
|
|
2017-02-03 00:16:09 +01:00
|
|
|
|
if (mode < 1 || mode > 3)
|
2015-03-10 15:42:08 +01:00
|
|
|
|
{
|
2016-08-08 18:01:06 +02:00
|
|
|
|
fmt::throw_exception("Unknown mode (%d)" HERE, mode);
|
2015-03-10 15:42:08 +01:00
|
|
|
|
}
|
|
|
|
|
|
|
2019-08-28 00:22:31 +02:00
|
|
|
|
const auto cond = idm::check<lv2_obj, lv2_lwcond>(lwcond_id, [&](lv2_lwcond& cond) -> int
|
2015-03-10 15:42:08 +01:00
|
|
|
|
{
|
2020-02-19 18:03:59 +01:00
|
|
|
|
if (ppu_thread_id != umax && !idm::check_unlocked<named_thread<ppu_thread>>(ppu_thread_id))
|
2019-02-01 12:00:30 +01:00
|
|
|
|
{
|
2019-08-28 00:22:31 +02:00
|
|
|
|
return -1;
|
2019-02-01 12:00:30 +01:00
|
|
|
|
}
|
2015-03-10 15:42:08 +01:00
|
|
|
|
|
2019-02-01 12:00:30 +01:00
|
|
|
|
lv2_lwmutex* mutex;
|
|
|
|
|
|
|
|
|
|
|
|
if (mode != 2)
|
2018-10-14 20:54:41 +02:00
|
|
|
|
{
|
2019-02-01 12:00:30 +01:00
|
|
|
|
mutex = idm::check_unlocked<lv2_obj, lv2_lwmutex>(lwmutex_id);
|
|
|
|
|
|
|
|
|
|
|
|
if (!mutex)
|
|
|
|
|
|
{
|
2019-08-28 00:22:31 +02:00
|
|
|
|
return -1;
|
2019-02-01 12:00:30 +01:00
|
|
|
|
}
|
2018-10-14 20:54:41 +02:00
|
|
|
|
}
|
|
|
|
|
|
|
2017-07-29 20:24:57 +02:00
|
|
|
|
if (cond.waiters)
|
2015-03-10 15:42:08 +01:00
|
|
|
|
{
|
2018-09-03 21:28:33 +02:00
|
|
|
|
std::lock_guard lock(cond.mutex);
|
2017-02-03 00:16:09 +01:00
|
|
|
|
|
|
|
|
|
|
cpu_thread* result = nullptr;
|
|
|
|
|
|
|
2020-02-19 18:03:59 +01:00
|
|
|
|
if (ppu_thread_id != umax)
|
2017-02-03 00:16:09 +01:00
|
|
|
|
{
|
|
|
|
|
|
for (auto cpu : cond.sq)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (cpu->id == ppu_thread_id)
|
|
|
|
|
|
{
|
|
|
|
|
|
verify(HERE), cond.unqueue(cond.sq, cpu);
|
|
|
|
|
|
result = cpu;
|
|
|
|
|
|
break;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
2019-05-07 21:05:16 +02:00
|
|
|
|
result = cond.schedule<ppu_thread>(cond.sq, cond.protocol);
|
2017-02-03 00:16:09 +01:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (result)
|
|
|
|
|
|
{
|
|
|
|
|
|
cond.waiters--;
|
|
|
|
|
|
|
2017-02-06 19:36:46 +01:00
|
|
|
|
if (mode == 2)
|
|
|
|
|
|
{
|
|
|
|
|
|
static_cast<ppu_thread*>(result)->gpr[3] = CELL_EBUSY;
|
|
|
|
|
|
}
|
2017-02-03 00:16:09 +01:00
|
|
|
|
|
2017-07-29 20:24:57 +02:00
|
|
|
|
if (mode == 1)
|
2017-02-03 00:16:09 +01:00
|
|
|
|
{
|
2017-07-29 20:24:57 +02:00
|
|
|
|
verify(HERE), !mutex->signaled;
|
2018-09-03 21:28:33 +02:00
|
|
|
|
std::lock_guard lock(mutex->mutex);
|
2017-02-03 00:16:09 +01:00
|
|
|
|
mutex->sq.emplace_back(result);
|
|
|
|
|
|
}
|
2019-08-28 00:22:31 +02:00
|
|
|
|
else
|
|
|
|
|
|
{
|
|
|
|
|
|
cond.awake(result);
|
|
|
|
|
|
}
|
2017-02-03 00:16:09 +01:00
|
|
|
|
|
2019-08-28 00:22:31 +02:00
|
|
|
|
return 1;
|
2017-02-03 00:16:09 +01:00
|
|
|
|
}
|
2015-03-10 15:42:08 +01:00
|
|
|
|
}
|
|
|
|
|
|
|
2019-08-28 00:22:31 +02:00
|
|
|
|
return 0;
|
2017-02-03 00:16:09 +01:00
|
|
|
|
});
|
2018-02-09 15:49:37 +01:00
|
|
|
|
|
2019-08-28 00:22:31 +02:00
|
|
|
|
if (!cond || cond.ret == -1)
|
2017-02-03 00:16:09 +01:00
|
|
|
|
{
|
|
|
|
|
|
return CELL_ESRCH;
|
|
|
|
|
|
}
|
2015-07-21 18:35:55 +02:00
|
|
|
|
|
2019-02-01 12:00:30 +01:00
|
|
|
|
if (!cond.ret)
|
2017-02-03 00:16:09 +01:00
|
|
|
|
{
|
2020-02-19 18:03:59 +01:00
|
|
|
|
if (ppu_thread_id == umax)
|
2019-02-01 12:00:30 +01:00
|
|
|
|
{
|
|
|
|
|
|
if (mode == 3)
|
|
|
|
|
|
{
|
|
|
|
|
|
return not_an_error(CELL_ENOENT);
|
|
|
|
|
|
}
|
|
|
|
|
|
else if (mode == 2)
|
|
|
|
|
|
{
|
|
|
|
|
|
return CELL_OK;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2017-02-03 00:16:09 +01:00
|
|
|
|
return not_an_error(CELL_EPERM);
|
|
|
|
|
|
}
|
2019-02-01 12:00:30 +01:00
|
|
|
|
|
2014-01-29 21:31:09 +01:00
|
|
|
|
return CELL_OK;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2017-02-06 19:36:46 +01:00
|
|
|
|
error_code _sys_lwcond_signal_all(ppu_thread& ppu, u32 lwcond_id, u32 lwmutex_id, u32 mode)
|
2014-01-29 21:31:09 +01:00
|
|
|
|
{
|
2019-06-20 13:45:17 +02:00
|
|
|
|
vm::temporary_unlock(ppu);
|
|
|
|
|
|
|
2016-01-12 22:57:16 +01:00
|
|
|
|
sys_lwcond.trace("_sys_lwcond_signal_all(lwcond_id=0x%x, lwmutex_id=0x%x, mode=%d)", lwcond_id, lwmutex_id, mode);
|
2014-02-14 12:40:41 +01:00
|
|
|
|
|
2017-02-03 00:16:09 +01:00
|
|
|
|
// Mode 1: lwmutex was initially owned by the calling thread
|
|
|
|
|
|
// Mode 2: lwmutex was not owned by the calling thread and waiter hasn't been increased
|
2015-03-10 15:42:08 +01:00
|
|
|
|
|
2017-02-03 00:16:09 +01:00
|
|
|
|
if (mode < 1 || mode > 2)
|
2015-03-10 22:47:13 +01:00
|
|
|
|
{
|
2017-02-03 00:16:09 +01:00
|
|
|
|
fmt::throw_exception("Unknown mode (%d)" HERE, mode);
|
2015-03-10 22:47:13 +01:00
|
|
|
|
}
|
2015-03-10 15:42:08 +01:00
|
|
|
|
|
2019-08-17 22:53:49 +02:00
|
|
|
|
bool need_awake = false;
|
|
|
|
|
|
|
2019-02-01 12:00:30 +01:00
|
|
|
|
const auto cond = idm::check<lv2_obj, lv2_lwcond>(lwcond_id, [&](lv2_lwcond& cond) -> s32
|
2015-03-10 15:42:08 +01:00
|
|
|
|
{
|
2019-02-01 12:00:30 +01:00
|
|
|
|
lv2_lwmutex* mutex;
|
2017-02-03 00:16:09 +01:00
|
|
|
|
|
2019-02-01 12:00:30 +01:00
|
|
|
|
if (mode != 2)
|
2018-10-14 20:54:41 +02:00
|
|
|
|
{
|
2019-02-01 12:00:30 +01:00
|
|
|
|
mutex = idm::check_unlocked<lv2_obj, lv2_lwmutex>(lwmutex_id);
|
|
|
|
|
|
|
|
|
|
|
|
if (!mutex)
|
|
|
|
|
|
{
|
|
|
|
|
|
return -1;
|
|
|
|
|
|
}
|
2018-10-14 20:54:41 +02:00
|
|
|
|
}
|
|
|
|
|
|
|
2017-07-29 20:24:57 +02:00
|
|
|
|
if (cond.waiters)
|
2017-02-03 00:16:09 +01:00
|
|
|
|
{
|
2018-09-03 21:28:33 +02:00
|
|
|
|
std::lock_guard lock(cond.mutex);
|
2017-02-03 00:16:09 +01:00
|
|
|
|
|
|
|
|
|
|
u32 result = 0;
|
2015-03-10 15:42:08 +01:00
|
|
|
|
|
2019-05-07 21:05:16 +02:00
|
|
|
|
while (const auto cpu = cond.schedule<ppu_thread>(cond.sq, cond.protocol))
|
2017-02-03 00:16:09 +01:00
|
|
|
|
{
|
|
|
|
|
|
cond.waiters--;
|
|
|
|
|
|
|
2017-02-06 19:36:46 +01:00
|
|
|
|
if (mode == 2)
|
|
|
|
|
|
{
|
|
|
|
|
|
static_cast<ppu_thread*>(cpu)->gpr[3] = CELL_EBUSY;
|
|
|
|
|
|
}
|
2017-02-03 00:16:09 +01:00
|
|
|
|
|
2017-07-29 20:24:57 +02:00
|
|
|
|
if (mode == 1)
|
2017-02-03 00:16:09 +01:00
|
|
|
|
{
|
2017-07-29 20:24:57 +02:00
|
|
|
|
verify(HERE), !mutex->signaled;
|
2018-09-03 21:28:33 +02:00
|
|
|
|
std::lock_guard lock(mutex->mutex);
|
2017-02-03 00:16:09 +01:00
|
|
|
|
mutex->sq.emplace_back(cpu);
|
|
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
2019-04-25 16:27:50 +02:00
|
|
|
|
lv2_obj::append(cpu);
|
2019-08-17 22:53:49 +02:00
|
|
|
|
need_awake = true;
|
2017-02-03 00:16:09 +01:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
result++;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2019-08-28 00:22:31 +02:00
|
|
|
|
if (need_awake)
|
|
|
|
|
|
{
|
|
|
|
|
|
lv2_obj::awake_all();
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2017-02-03 00:16:09 +01:00
|
|
|
|
return result;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
|
|
});
|
2015-03-11 16:30:50 +01:00
|
|
|
|
|
2019-02-01 12:00:30 +01:00
|
|
|
|
if (!cond || cond.ret == -1)
|
2015-03-11 16:30:50 +01:00
|
|
|
|
{
|
2017-02-03 00:16:09 +01:00
|
|
|
|
return CELL_ESRCH;
|
2015-03-11 16:30:50 +01:00
|
|
|
|
}
|
2015-03-10 15:42:08 +01:00
|
|
|
|
|
2017-02-03 00:16:09 +01:00
|
|
|
|
if (mode == 1)
|
|
|
|
|
|
{
|
|
|
|
|
|
// Mode 1: return the amount of threads (TODO)
|
|
|
|
|
|
return not_an_error(cond.ret);
|
|
|
|
|
|
}
|
2015-03-10 15:42:08 +01:00
|
|
|
|
|
2017-02-03 00:16:09 +01:00
|
|
|
|
return CELL_OK;
|
2014-01-29 21:31:09 +01:00
|
|
|
|
}
|
|
|
|
|
|
|
2017-02-03 00:16:09 +01:00
|
|
|
|
error_code _sys_lwcond_queue_wait(ppu_thread& ppu, u32 lwcond_id, u32 lwmutex_id, u64 timeout)
|
2014-01-29 21:31:09 +01:00
|
|
|
|
{
|
2019-06-20 13:45:17 +02:00
|
|
|
|
vm::temporary_unlock(ppu);
|
|
|
|
|
|
|
2016-01-12 22:57:16 +01:00
|
|
|
|
sys_lwcond.trace("_sys_lwcond_queue_wait(lwcond_id=0x%x, lwmutex_id=0x%x, timeout=0x%llx)", lwcond_id, lwmutex_id, timeout);
|
2014-03-22 22:04:55 +01:00
|
|
|
|
|
2019-02-16 19:15:54 +01:00
|
|
|
|
ppu.gpr[3] = CELL_OK;
|
|
|
|
|
|
|
2017-02-03 00:16:09 +01:00
|
|
|
|
std::shared_ptr<lv2_lwmutex> mutex;
|
|
|
|
|
|
|
2019-04-25 16:27:50 +02:00
|
|
|
|
const auto cond = idm::get<lv2_obj, lv2_lwcond>(lwcond_id, [&](lv2_lwcond& cond)
|
2017-02-03 00:16:09 +01:00
|
|
|
|
{
|
|
|
|
|
|
mutex = idm::get_unlocked<lv2_obj, lv2_lwmutex>(lwmutex_id);
|
|
|
|
|
|
|
|
|
|
|
|
if (!mutex)
|
|
|
|
|
|
{
|
2019-08-17 23:00:22 +02:00
|
|
|
|
return;
|
2017-02-03 00:16:09 +01:00
|
|
|
|
}
|
2015-03-10 15:42:08 +01:00
|
|
|
|
|
2018-09-03 21:28:33 +02:00
|
|
|
|
std::lock_guard lock(cond.mutex);
|
2017-02-03 00:16:09 +01:00
|
|
|
|
|
|
|
|
|
|
// Add a waiter
|
|
|
|
|
|
cond.waiters++;
|
|
|
|
|
|
cond.sq.emplace_back(&ppu);
|
|
|
|
|
|
|
|
|
|
|
|
{
|
2019-04-25 16:27:50 +02:00
|
|
|
|
std::lock_guard lock2(mutex->mutex);
|
|
|
|
|
|
|
|
|
|
|
|
// Process lwmutex sleep queue
|
|
|
|
|
|
if (const auto cpu = mutex->schedule<ppu_thread>(mutex->sq, mutex->protocol))
|
|
|
|
|
|
{
|
|
|
|
|
|
cond.append(cpu);
|
|
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
|
|
|
|
|
mutex->signaled |= 1;
|
|
|
|
|
|
}
|
2017-02-03 00:16:09 +01:00
|
|
|
|
}
|
|
|
|
|
|
|
2019-04-25 16:27:50 +02:00
|
|
|
|
// Sleep current thread and schedule lwmutex waiter
|
|
|
|
|
|
cond.sleep(ppu, timeout);
|
2017-02-03 00:16:09 +01:00
|
|
|
|
});
|
2015-03-11 16:30:50 +01:00
|
|
|
|
|
2015-04-12 03:36:25 +02:00
|
|
|
|
if (!cond || !mutex)
|
2015-03-10 22:47:13 +01:00
|
|
|
|
{
|
|
|
|
|
|
return CELL_ESRCH;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2016-08-09 16:14:41 +02:00
|
|
|
|
while (!ppu.state.test_and_reset(cpu_flag::signal))
|
2015-03-10 15:42:08 +01:00
|
|
|
|
{
|
2018-10-11 00:17:19 +02:00
|
|
|
|
if (ppu.is_stopped())
|
|
|
|
|
|
{
|
|
|
|
|
|
return 0;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2017-02-03 00:16:09 +01:00
|
|
|
|
if (timeout)
|
2015-03-10 15:42:08 +01:00
|
|
|
|
{
|
2019-07-14 05:55:11 +02:00
|
|
|
|
if (lv2_obj::wait_timeout(timeout, &ppu))
|
2015-04-12 03:36:25 +02:00
|
|
|
|
{
|
2018-09-03 21:28:33 +02:00
|
|
|
|
std::lock_guard lock(cond->mutex);
|
2015-07-21 18:35:55 +02:00
|
|
|
|
|
2017-02-03 00:16:09 +01:00
|
|
|
|
if (!cond->unqueue(cond->sq, &ppu))
|
|
|
|
|
|
{
|
|
|
|
|
|
timeout = 0;
|
|
|
|
|
|
continue;
|
2015-04-12 03:36:25 +02:00
|
|
|
|
}
|
2017-02-03 00:16:09 +01:00
|
|
|
|
|
|
|
|
|
|
cond->waiters--;
|
|
|
|
|
|
|
2017-02-06 19:36:46 +01:00
|
|
|
|
ppu.gpr[3] = CELL_ETIMEDOUT;
|
|
|
|
|
|
break;
|
2015-04-12 03:36:25 +02:00
|
|
|
|
}
|
2015-07-21 18:35:55 +02:00
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
2017-02-03 00:16:09 +01:00
|
|
|
|
thread_ctrl::wait();
|
2015-03-10 15:42:08 +01:00
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2017-02-03 00:16:09 +01:00
|
|
|
|
// Return cause
|
2017-02-06 19:36:46 +01:00
|
|
|
|
return not_an_error(ppu.gpr[3]);
|
2014-01-29 21:31:09 +01:00
|
|
|
|
}
|