rpcs3/rpcs3/Emu/SysCalls/lv2/sys_cond.h
Alexandro Sánchez Bach 08d61163ea Removed external functions from SysCalls.h
* Replace `int` with `s32` as return type for syscalls.
* Renamed `SC_Something.*` files with the proper lv2 name
`sys_something.*`.
* Moving away from the lv2, those functions and folders that doesn't
correspond to lv2 functions. E.g. module functions from sys_io,
sysPrxForUser, cellGcmSys.
* Splitted some files (memory -> memory+mmapper) and merged other ones
(event+event_flag ->event, spu+spu_thread -> spu), according to common
sense, PSDevWiki docs, and checking firmware files.
* Removed external functions from `SysCalls.h`.

NOTE: What should we do about: cellGcmCallback? It's not a lv2 syscall
but it appears on the sc_table and it is actually called in games. Is
this some kind of hack?
2014-07-06 16:23:37 +02:00

40 lines
734 B
C

#pragma once
#include "sys_mutex.h"
struct sys_cond_attribute
{
be_t<u32> pshared;
be_t<u64> ipc_key;
be_t<int> flags;
union
{
char name[8];
u64 name_u64;
};
};
struct Cond
{
Mutex* mutex; // associated with mutex
SMutex signal;
u32 signaler; // signaler thread id (for signal_all)
SleepQueue m_queue;
u64 signal_stamp;
Cond(Mutex* mutex, u64 name)
: mutex(mutex)
, m_queue(name)
, signaler(0)
{
}
};
// SysCalls
s32 sys_cond_create(mem32_t cond_id, u32 mutex_id, mem_ptr_t<sys_cond_attribute> attr);
s32 sys_cond_destroy(u32 cond_id);
s32 sys_cond_wait(u32 cond_id, u64 timeout);
s32 sys_cond_signal(u32 cond_id);
s32 sys_cond_signal_all(u32 cond_id);
s32 sys_cond_signal_to(u32 cond_id, u32 thread_id);