vitasdk
Documentation of the vitasdk

Detailed Description

Exports for User.


Using this library in your project

Include the header file in your project:




Using this library in your project

Include the header file in your project:




Using this library in your project

Include the header file in your project:




Using this library in your project

Include the header file in your project:




Using this library in your project

Include the header file in your project:




Using this library in your project

Include the header file in your project:




Using this library in your project

Include the header file in your project:




Using this library in your project

Include the header file in your project:




Using this library in your project

Include the header file in your project:




Using this library in your project

Include the header file in your project:




Using this library in your project

Include the header file in your project:




Using this library in your project

Include the header file in your project:


Link the library to the executable:

SceKernelThreadMgr_stub




Using this library in your project

Include the header file in your project:



Functions

int sceKernelCreateCallback (const char *name, unsigned int attr, SceKernelCallbackFunction func, void *userData)
 Create callback. More...
 
int sceKernelGetCallbackInfo (SceUID cb, SceKernelCallbackInfo *infop)
 Gets the status of a specified callback. More...
 
int sceKernelDeleteCallback (SceUID cb)
 Delete a callback. More...
 
int sceKernelNotifyCallback (SceUID cb, int arg2)
 Notify a callback. More...
 
int sceKernelCancelCallback (SceUID cb)
 Cancel a callback ? More...
 
int sceKernelGetCallbackCount (SceUID cb)
 Get the callback count. More...
 
int sceKernelCheckCallback (void)
 Check callback ? More...
 
SceUID sceKernelCreateCond (const char *name, SceUInt attr, SceUID mutexId, const SceKernelCondOptParam *option)
 Creates a new condition variable. More...
 
int sceKernelDeleteCond (SceUID condId)
 Destroy a condition variable. More...
 
int sceKernelOpenCond (const char *name)
 Open a condition variable. More...
 
int sceKernelCloseCond (SceUID condId)
 Close a condition variable. More...
 
int sceKernelWaitCond (SceUID condId, unsigned int *timeout)
 Waits for a signal of a condition variable. More...
 
int sceKernelWaitCondCB (SceUID condId, unsigned int *timeout)
 Waits for a signal of a condition variable (with callbacks) More...
 
int sceKernelSignalCond (SceUID condId)
 Signals a condition variable. More...
 
int sceKernelSignalCondAll (SceUID condId)
 Signals a condition variable to all threads waiting for it. More...
 
int sceKernelSignalCondTo (SceUID condId, SceUID threadId)
 Signals a condition variable to a specific thread waiting for it. More...
 
SceUID sceKernelCreateEventFlag (const char *name, int attr, int bits, SceKernelEventFlagOptParam *opt)
 Create an event flag. More...
 
int sceKernelSetEventFlag (SceUID evid, unsigned int bits)
 Set an event flag bit pattern. More...
 
int sceKernelClearEventFlag (SceUID evid, unsigned int bits)
 Clear a event flag bit pattern. More...
 
int sceKernelPollEventFlag (int evid, unsigned int bits, unsigned int wait, unsigned int *outBits)
 Poll an event flag for a given bit pattern. More...
 
int sceKernelWaitEventFlag (int evid, unsigned int bits, unsigned int wait, unsigned int *outBits, SceUInt *timeout)
 Wait for an event flag for a given bit pattern. More...
 
int sceKernelWaitEventFlagCB (int evid, unsigned int bits, unsigned int wait, unsigned int *outBits, SceUInt *timeout)
 Wait for an event flag for a given bit pattern with callback. More...
 
int sceKernelDeleteEventFlag (int evid)
 Delete an event flag. More...
 
int sceKernelGetEventFlagInfo (SceUID event, SceKernelEventFlagInfo *info)
 Get the status of an event flag. More...
 
int sceKernelCreateLwCond (SceKernelLwCondWork *pWork, const char *pName, unsigned int attr, SceKernelLwMutexWork *pLwMutex, const SceKernelLwCondOptParam *pOptParam)
 
int sceKernelDeleteLwCond (SceKernelLwCondWork *pWork)
 
int sceKernelSignalLwCond (SceKernelLwCondWork *pWork)
 
int sceKernelSignalLwCondAll (SceKernelLwCondWork *pWork)
 
int sceKernelSignalLwCondTo (SceKernelLwCondWork *pWork, SceUID threadId)
 
int sceKernelWaitLwCond (SceKernelLwCondWork *pWork, unsigned int *pTimeout)
 
int sceKernelCreateLwMutex (SceKernelLwMutexWork *pWork, const char *pName, unsigned int attr, int initCount, const SceKernelLwMutexOptParam *pOptParam)
 
int sceKernelDeleteLwMutex (SceKernelLwMutexWork *pWork)
 
int sceKernelLockLwMutex (SceKernelLwMutexWork *pWork, int lockCount, unsigned int *pTimeout)
 
int sceKernelTryLockLwMutex (SceKernelLwMutexWork *pWork, int lockCount)
 
int sceKernelUnlockLwMutex (SceKernelLwMutexWork *pWork, int unlockCount)
 
SceUID sceKernelCreateMsgPipe (const char *name, int type, int attr, unsigned int bufSize, void *opt)
 Create a message pipe. More...
 
int sceKernelDeleteMsgPipe (SceUID uid)
 Delete a message pipe. More...
 
int sceKernelSendMsgPipe (SceUID uid, void *message, unsigned int size, int unk1, void *unk2, unsigned int *timeout)
 Send a message to a pipe. More...
 
int sceKernelSendMsgPipeCB (SceUID uid, void *message, unsigned int size, int unk1, void *unk2, unsigned int *timeout)
 Send a message to a pipe (with callback) More...
 
int sceKernelTrySendMsgPipe (SceUID uid, void *message, SceSize size, int unk1, void *unk2)
 Try to send a message to a pipe. More...
 
int sceKernelReceiveMsgPipe (SceUID uid, void *message, SceSize size, int unk1, void *unk2, unsigned int *timeout)
 Receive a message from a pipe. More...
 
int sceKernelReceiveMsgPipeCB (SceUID uid, void *message, SceSize size, int unk1, void *unk2, unsigned int *timeout)
 Receive a message from a pipe (with callback) More...
 
int sceKernelTryReceiveMsgPipe (SceUID uid, void *message, SceSize size, int unk1, void *unk2)
 Receive a message from a pipe. More...
 
int sceKernelCancelMsgPipe (SceUID uid, int *psend, int *precv)
 Cancel a message pipe. More...
 
 VITASDK_BUILD_ASSERT_EQ (0x3C, SceKernelMppInfo)
 
int sceKernelGetMsgPipeInfo (SceUID uid, SceKernelMppInfo *info)
 Get the status of a Message Pipe. More...
 
SceUID sceKernelCreateMutex (const char *name, SceUInt attr, int initCount, SceKernelMutexOptParam *option)
 Creates a new mutex. More...
 
int sceKernelDeleteMutex (SceUID mutexid)
 Destroy a mutex. More...
 
int sceKernelOpenMutex (const char *name)
 Open a mutex. More...
 
int sceKernelCloseMutex (SceUID mutexid)
 Close a mutex. More...
 
int sceKernelLockMutex (SceUID mutexid, int lockCount, unsigned int *timeout)
 Lock a mutex. More...
 
int sceKernelLockMutexCB (SceUID mutexid, int lockCount, unsigned int *timeout)
 Lock a mutex and handle callbacks if necessary. More...
 
int sceKernelTryLockMutex (SceUID mutexid, int lockCount)
 Try to lock a mutex (non-blocking) More...
 
int sceKernelUnlockMutex (SceUID mutexid, int unlockCount)
 Try to unlock a mutex (non-blocking) More...
 
int sceKernelCancelMutex (SceUID mutexid, int newCount, int *numWaitThreads)
 Cancels a mutex. More...
 
int sceKernelGetMutexInfo (SceUID mutexid, SceKernelMutexInfo *info)
 Retrieve information about a mutex. More...
 
 VITASDK_BUILD_ASSERT_EQ (4, SceKernelRWLockOptParam)
 
 VITASDK_BUILD_ASSERT_EQ (0x3C, SceKernelRWLockInfo)
 
SceUID sceKernelCreateRWLock (const char *name, SceUInt32 attr, const SceKernelRWLockOptParam *opt_param)
 Creates a new rwlock. More...
 
int sceKernelDeleteRWLock (SceUID rwlock_id)
 Destroy a rwlock. More...
 
SceUID sceKernelOpenRWLock (const char *name)
 Open a rwlock. More...
 
int sceKernelCloseRWLock (SceUID rwlock_id)
 Close a rwlock. More...
 
int sceKernelLockReadRWLock (SceUID rwlock_id, unsigned int *timeout)
 Lock a rwlock with read access. More...
 
int sceKernelLockWriteRWLock (SceUID rwlock_id, unsigned int *timeout)
 Lock a rwlock with write access. More...
 
int sceKernelLockReadRWLockCB (SceUID rwlock_id, unsigned int *timeout)
 Lock a rwlock with read access and handle callbacks. More...
 
int sceKernelLockWriteRWLockCB (SceUID rwlock_id, unsigned int *timeout)
 Lock a rwlock with write access and handle callbacks. More...
 
int sceKernelTryLockReadRWLock (SceUID rwlock_id)
 Try to lock a rwlock with read access (non-blocking) More...
 
int sceKernelTryLockWriteRWLock (SceUID rwlock_id)
 Try to lock a rwlock with write access (non-blocking) More...
 
int sceKernelUnlockReadRWLock (SceUID rwlock_id)
 Try to unlock a rwlock with read access (non-blocking) More...
 
int sceKernelUnlockWriteRWLock (SceUID rwlock_id)
 Try to unlock a rwlock with write access (non-blocking) More...
 
int sceKernelGetRWLockInfo (SceUID rwlock_id, SceKernelRWLockInfo *info)
 Retrieve information about a rwlock. More...
 
SceUID sceKernelCreateSema (const char *name, SceUInt attr, int initVal, int maxVal, SceKernelSemaOptParam *option)
 Creates a new semaphore. More...
 
int sceKernelDeleteSema (SceUID semaid)
 Destroy a semaphore. More...
 
int sceKernelSignalSema (SceUID semaid, int signal)
 Send a signal to a semaphore. More...
 
int sceKernelWaitSema (SceUID semaid, int signal, SceUInt *timeout)
 Lock a semaphore. More...
 
int sceKernelWaitSemaCB (SceUID semaid, int signal, SceUInt *timeout)
 Lock a semaphore and handle callbacks if necessary. More...
 
int sceKernelPollSema (SceUID semaid, int signal)
 Poll a semaphore. More...
 
int sceKernelCancelSema (SceUID semaid, int setCount, int *numWaitThreads)
 Cancels a semaphore. More...
 
int sceKernelGetSemaInfo (SceUID semaid, SceKernelSemaInfo *info)
 Retrieve information about a semaphore. More...
 
SceUID sceKernelOpenSema (const char *name)
 
int sceKernelCloseSema (SceUID semaid)
 
int sceKernelWaitSignal (SceUInt32 unk0, SceUInt32 delay, SceUInt32 *timeout)
 Sleep current thread and wait for a signal. More...
 
int sceKernelSendSignal (SceUID thid)
 Send a signal to the thread specified by thid. More...
 
SceUID sceKernelCreateThread (const char *name, SceKernelThreadEntry entry, int initPriority, SceSize stackSize, SceUInt attr, int cpuAffinityMask, const SceKernelThreadOptParam *option)
 Create a thread. More...
 
int sceKernelDeleteThread (SceUID thid)
 Delate a thread. More...
 
int sceKernelStartThread (SceUID thid, SceSize arglen, void *argp)
 Start a created thread. More...
 
int sceKernelExitThread (int status)
 Exit a thread. More...
 
int sceKernelExitDeleteThread (int status)
 Exit a thread and delete itself. More...
 
int sceKernelWaitThreadEnd (SceUID thid, int *stat, SceUInt *timeout)
 Wait until a thread has ended. More...
 
int sceKernelWaitThreadEndCB (SceUID thid, int *stat, SceUInt *timeout)
 Wait until a thread has ended and handle callbacks if necessary. More...
 
int sceKernelDelayThread (SceUInt delay)
 Delay the current thread by a specified number of microseconds. More...
 
int sceKernelDelayThreadCB (SceUInt delay)
 Delay the current thread by a specified number of microseconds and handle any callbacks. More...
 
int sceKernelChangeCurrentThreadAttr (SceUInt clearAttr, SceUInt setAttr)
 Modify the attributes of the current thread. More...
 
int sceKernelChangeThreadPriority (SceUID thid, int priority)
 Change the threads current priority. More...
 
int sceKernelGetThreadCurrentPriority (void)
 Get the current priority of the thread you are in. More...
 
int sceKernelGetThreadExitStatus (SceUID thid, int *status)
 Get the exit status of a thread. More...
 
int sceKernelCheckThreadStack (void)
 Check the thread stack? More...
 
int sceKernelGetThreadStackFreeSize (SceUID thid)
 Get the free stack size for a thread. More...
 
int sceKernelGetThreadInfo (SceUID thid, SceKernelThreadInfo *info)
 Get the status information for the specified thread. More...
 
int sceKernelGetThreadRunStatus (SceUID thid, SceKernelThreadRunStatus *status)
 Retrive the runtime status of a thread. More...
 
int sceKernelGetThreadCpuAffinityMask (SceUID thid)
 Retrive the cpu affinity mask of a thread. More...
 
int sceKernelChangeThreadCpuAffinityMask (SceUID thid, int mask)
 Set the cpu affinity mask of a thread. More...
 
int sceKernelGetThreadId (void)
 Get the current thread Id. More...
 
SceUID sceKernelGetProcessId (void)
 Get the process ID of in the running thread. More...
 
 VITASDK_BUILD_ASSERT_EQ (0x48, SceKernelSystemInfo)
 
int sceKernelGetSystemInfo (SceKernelSystemInfo *info)
 Get the system information. More...
 
SceKernelIdListType sceKernelGetThreadmgrUIDClass (SceUID uid)
 Get the type of a Threadmgr uid. More...
 
void * sceKernelGetThreadTLSAddr (SceUID thid, int key)
 sceKernelGetThreadTLSAddr gets an address to a 4 bytes area of TLS memory for the specified thread More...
 
void * sceKernelGetTLSAddr (int key)
 sceKernelGetTLSAddr get pointer to TLS key area for current thread More...
 
SceInt64 sceKernelGetSystemTimeWide (void)
 Get the system time (wide version) More...
 
 VITASDK_BUILD_ASSERT_EQ (0x34, SceKernelThreadRunStatus)
 
 VITASDK_BUILD_ASSERT_EQ (0x1C, SceKernelThreadOptParam)
 
 VITASDK_BUILD_ASSERT_EQ (0x80, SceKernelThreadInfo)
 
 VITASDK_BUILD_ASSERT_EQ (0x3C, SceKernelCallbackInfo)
 
 VITASDK_BUILD_ASSERT_EQ (4, SceKernelSemaOptParam)
 
 VITASDK_BUILD_ASSERT_EQ (0x3C, SceKernelSemaInfo)
 
 VITASDK_BUILD_ASSERT_EQ (4, SceKernelEventFlagOptParam)
 
 VITASDK_BUILD_ASSERT_EQ (0x38, SceKernelEventFlagInfo)
 
 VITASDK_BUILD_ASSERT_EQ (0x10, SceKernelLwCondWork)
 
 VITASDK_BUILD_ASSERT_EQ (4, SceKernelLwCondOptParam)
 
 VITASDK_BUILD_ASSERT_EQ (0x20, SceKernelLwMutexWork)
 
 VITASDK_BUILD_ASSERT_EQ (4, SceKernelLwMutexOptParam)
 
 VITASDK_BUILD_ASSERT_EQ (8, SceKernelMutexOptParam)
 
 VITASDK_BUILD_ASSERT_EQ (0x3C, SceKernelMutexInfo)
 
 VITASDK_BUILD_ASSERT_EQ (4, SceKernelCondOptParam)
 
 VITASDK_BUILD_ASSERT_EQ (0x34, SceKernelCondInfo)
 

Typedefs

typedef int(* SceKernelThreadEntry) (SceSize args, void *argp)
 
typedef int(* SceKernelCallbackFunction) (int notifyId, int notifyCount, int notifyArg, void *userData)
 Callback function prototype. More...
 

Macros

#define SCE_KERNEL_THREAD_CPU_AFFINITY_MASK_DEFAULT   (0)
 Inherit calling thread affinity mask. More...
 

Data Structure Documentation

◆ SceKernelMppInfo

struct SceKernelMppInfo

Message Pipe status info.

Data Fields
SceSize size
SceUID mppId
char name[32]
SceUInt attr
int bufSize
int freeSize
int numSendWaitThreads
int numReceiveWaitThreads

◆ SceKernelRWLockOptParam

struct SceKernelRWLockOptParam

Additional options used when creating rwlock.

Data Fields
SceSize size Size of the SceKernelRWLockOptParam structure.

◆ SceKernelRWLockInfo

struct SceKernelRWLockInfo

Current state of a rwlock.

See also
sceKernelGetRWLockInfo
Data Fields
SceSize size Size of the SceKernelRWLockInfo structure.
SceUID rwLockId The UID of the rwlock.
char name[32] NULL-terminated name of the rwlock.
SceUInt32 attr Attributes.
SceInt32 lockCount The current lock count.
SceUID writeOwnerId The UID of the current owner of the rwlock with write access, 0 when locked for reads.
SceUInt32 numReadWaitThreads The number of threads waiting on the rwlock for read access.
SceUInt32 numWriteWaitThreads The number of threads waiting on the rwlock for write access.

◆ SceKernelSystemInfo

struct SceKernelSystemInfo
Data Fields
SceSize size
SceUInt32 activeCpuMask
struct SceKernelSystemInfo cpuInfo[4]

◆ SceKernelThreadRunStatus

struct SceKernelThreadRunStatus

Statistics about a running thread.

See also
sceKernelGetThreadRunStatus.
Data Fields
SceSize size
struct SceKernelThreadRunStatus cpuInfo[4]

◆ SceKernelThreadOptParam

struct SceKernelThreadOptParam

Additional options used when creating threads.

Data Fields
SceSize size Size of the SceKernelThreadOptParam structure.
SceUInt32 attr Attributes.
SceUInt32 kStackMemType
SceUInt32 uStackMemType
SceUInt32 uTLSMemType
SceUInt32 uStackMemid
SceUInt32 data_0x18

◆ SceKernelThreadInfo

struct SceKernelThreadInfo

Structure to hold the status information for a thread.

See also
sceKernelGetThreadInfo
Data Fields
SceSize size Size of the structure.
SceUID processId The UID of the process where the thread belongs.
char name[32] Nul terminated name of the thread.
SceUInt32 attr Thread attributes.
SceUInt32 status Thread status.
SceKernelThreadEntry entry Thread entry point.
void * stack Thread stack pointer.
SceInt32 stackSize Thread stack size.
SceInt32 initPriority Initial priority.
SceInt32 currentPriority Current priority.
SceInt32 initCpuAffinityMask Initial CPU affinity mask.
SceInt32 currentCpuAffinityMask Current CPU affinity mask.
SceInt32 currentCpuId Current CPU ID.
SceInt32 lastExecutedCpuId Last executed CPU ID.
SceUInt32 waitType Wait type.
SceUID waitId Wait id.
SceInt32 exitStatus Exit status of the thread.
SceKernelSysClock runClocks Number of clock cycles run.
SceUInt32 intrPreemptCount Interrupt preemption count.
SceUInt32 threadPreemptCount Thread preemption count.
SceUInt32 threadReleaseCount Thread release count.
SceInt32 changeCpuCount Number of CPUs to which the thread is moved.
SceInt32 fNotifyCallback Function notify callback UID.
SceInt32 reserved Reserved.

◆ SceKernelCallbackInfo

struct SceKernelCallbackInfo

Structure to hold the status information for a callback.

Data Fields
SceSize size Size of the structure (i.e.

sizeof(SceKernelCallbackInfo))

SceUID callbackId The UID of the callback.
char name[32] The name given to the callback.
SceUID threadId The thread id associated with the callback.
SceKernelCallbackFunction callback Pointer to the callback function.
void * common User supplied argument for the callback.
int notifyCount Unknown.
int notifyArg Unknown.

◆ SceKernelSemaOptParam

struct SceKernelSemaOptParam

Additional options used when creating semaphores.

Data Fields
SceSize size Size of the SceKernelSemaOptParam structure.

◆ SceKernelSemaInfo

struct SceKernelSemaInfo

Current state of a semaphore.

See also
sceKernelGetSemaInfo.
Data Fields
SceSize size Size of the SceKernelSemaInfo structure.
SceUID semaId The UID of the semaphore.
char name[32] NUL-terminated name of the semaphore.
SceUInt attr Attributes.
int initCount The initial count the semaphore was created with.
int currentCount The current count.
int maxCount The maximum count.
int numWaitThreads The number of threads waiting on the semaphore.

◆ SceKernelEventFlagOptParam

struct SceKernelEventFlagOptParam
Data Fields
SceSize size

◆ SceKernelEventFlagInfo

struct SceKernelEventFlagInfo

Structure to hold the event flag information.

Data Fields
SceSize size
SceUID evfId
char name[32]
SceUInt attr
SceUInt initPattern
SceUInt currentPattern
int numWaitThreads

◆ SceKernelLwCondWork

struct SceKernelLwCondWork
Data Fields
SceInt32 data[4]

◆ SceKernelLwCondOptParam

struct SceKernelLwCondOptParam
Data Fields
SceSize size

◆ SceKernelLwMutexWork

struct SceKernelLwMutexWork
Data Fields
SceInt64 data[4]

◆ SceKernelLwMutexOptParam

struct SceKernelLwMutexOptParam
Data Fields
SceSize size

◆ SceKernelMutexOptParam

struct SceKernelMutexOptParam

Additional options used when creating mutexes.

Data Fields
SceSize size Size of the SceKernelMutexOptParam structure.
int ceilingPriority

◆ SceKernelMutexInfo

struct SceKernelMutexInfo

Current state of a mutex.

See also
sceKernelGetMutexInfo.
Data Fields
SceSize size Size of the SceKernelMutexInfo structure.
SceUID mutexId The UID of the mutex.
char name[32] NUL-terminated name of the mutex.
SceUInt attr Attributes.
int initCount The initial count the mutex was created with.
int currentCount The current count.
SceUID currentOwnerId The UID of the current owner of the mutex.
int numWaitThreads The number of threads waiting on the mutex.

◆ SceKernelCondOptParam

struct SceKernelCondOptParam

Additional options used when creating condition variables.

Data Fields
SceSize size Size of the SceKernelCondOptParam structure.

◆ SceKernelCondInfo

struct SceKernelCondInfo

Current state of a condition variable.

See also
sceKernelGetCondInfo.
Data Fields
SceSize size Size of the SceKernelCondInfo structure.
SceUID condId The UID of the condition variable.
char name[32] NUL-terminated name of the condition variable.
SceUInt attr Attributes.
SceUID mutexId Mutex associated with the condition variable.
int numWaitThreads The number of threads waiting on the condition variable.

◆ SceKernelSystemInfo.cpuInfo

struct SceKernelSystemInfo.cpuInfo
Data Fields
SceKernelSysClock idleClock
SceUInt32 comesOutOfIdleCount
SceUInt32 threadSwitchCount

◆ SceKernelThreadRunStatus.cpuInfo

struct SceKernelThreadRunStatus.cpuInfo
Data Fields
SceUID processId
SceUID threadId
int priority

Macro Definition Documentation

◆ SCE_KERNEL_THREAD_CPU_AFFINITY_MASK_DEFAULT

#define SCE_KERNEL_THREAD_CPU_AFFINITY_MASK_DEFAULT   (0)

Inherit calling thread affinity mask.

Typedef Documentation

◆ SceKernelThreadEntry

typedef int(* SceKernelThreadEntry) (SceSize args, void *argp)

◆ SceKernelCallbackFunction

typedef int(* SceKernelCallbackFunction) (int notifyId, int notifyCount, int notifyArg, void *userData)

Callback function prototype.

Enumeration Type Documentation

◆ SceKernelIdListType

Threadmgr types.

Enumerator
SCE_KERNEL_TMID_Thread 
SCE_KERNEL_TMID_Semaphore 
SCE_KERNEL_TMID_EventFlag 
SCE_KERNEL_TMID_Mbox 
SCE_KERNEL_TMID_Vpl 
SCE_KERNEL_TMID_Fpl 
SCE_KERNEL_TMID_Mpipe 
SCE_KERNEL_TMID_Callback 
SCE_KERNEL_TMID_ThreadEventHandler 
SCE_KERNEL_TMID_Alarm 
SCE_KERNEL_TMID_VTimer 
SCE_KERNEL_TMID_SleepThread 
SCE_KERNEL_TMID_DelayThread 
SCE_KERNEL_TMID_SuspendThread 
SCE_KERNEL_TMID_DormantThread 

◆ SceThreadStatus

Enumerator
SCE_THREAD_RUNNING 
SCE_THREAD_READY 
SCE_THREAD_STANDBY 
SCE_THREAD_WAITING 
SCE_THREAD_SUSPEND 
SCE_THREAD_DORMANT 
SCE_THREAD_STOPPED 
SCE_THREAD_DELETED 
SCE_THREAD_KILLED 
SCE_THREAD_DEAD 
SCE_THREAD_STAGNANT 
SCE_THREAD_SUSPENDED 

◆ SceKernelWaitableAttribute

Enumerator
SCE_KERNEL_ATTR_THREAD_FIFO 

Waiting threads First input First output.

SCE_KERNEL_ATTR_THREAD_PRIO 

Waiting threads queued on priority basis.

SCE_KERNEL_ATTR_OPENABLE 

Sync object can be accessed by sceKernelOpenXxx.

◆ SceEventFlagAttributes

Event flag creation attributes.

Enumerator
SCE_EVENT_THREAD_FIFO 

Use SCE_KERNEL_ATTR_THREAD_FIFO.

SCE_EVENT_THREAD_PRIO 

Use SCE_KERNEL_ATTR_THREAD_PRIO.

SCE_EVENT_WAITSINGLE 

Sync object can only be waited upon by one thread.

SCE_EVENT_WAITMULTIPLE 

Sync object can be waited upon by multiple threads.

SCE_EVENT_OPENABLE 

Use SCE_KERNEL_ATTR_OPENABLE.

◆ SceEventFlagWaitTypes

Event flag wait types.

Enumerator
SCE_EVENT_WAITAND 

Wait for all bits in the pattern to be set.

SCE_EVENT_WAITOR 

Wait for one or more bits in the pattern to be set.

SCE_EVENT_WAITCLEAR 

Clear all the bits when it matches.

SCE_EVENT_WAITCLEAR_PAT 

Clear the wait pattern when it matches.

◆ SceKernelMutexAttribute

Enumerator
SCE_KERNEL_MUTEX_ATTR_RECURSIVE 
SCE_KERNEL_MUTEX_ATTR_CEILING 

Function Documentation

◆ sceKernelCreateCallback()

int sceKernelCreateCallback ( const char *  name,
unsigned int  attr,
SceKernelCallbackFunction  func,
void *  userData 
)

Create callback.

Example:
int cbid;
cbid = sceKernelCreateCallback("Exit Callback", 0, exit_cb, NULL);
int sceKernelCreateCallback(const char *name, unsigned int attr, SceKernelCallbackFunction func, void *userData)
Create callback.
Parameters
name- A textual name for the callback
attr- ?
func- A pointer to a function that will be called as the callback
userData- User defined data to be passed to the callback.
Returns
>= 0 A callback id which can be used in subsequent functions, < 0 an error.

◆ sceKernelGetCallbackInfo()

int sceKernelGetCallbackInfo ( SceUID  cb,
SceKernelCallbackInfo infop 
)

Gets the status of a specified callback.

Parameters
cb- The UID of the callback to retrieve info for.
status- Pointer to a status structure. The size parameter should be initialised before calling.
Returns
< 0 on error.

◆ sceKernelDeleteCallback()

int sceKernelDeleteCallback ( SceUID  cb)

Delete a callback.

Parameters
cb- The UID of the specified callback
Returns
0 on success, < 0 on error

◆ sceKernelNotifyCallback()

int sceKernelNotifyCallback ( SceUID  cb,
int  arg2 
)

Notify a callback.

Parameters
cb- The UID of the specified callback
arg2- Passed as arg2 into the callback function
Returns
0 on success, < 0 on error

◆ sceKernelCancelCallback()

int sceKernelCancelCallback ( SceUID  cb)

Cancel a callback ?

Parameters
cb- The UID of the specified callback
Returns
0 on success, < 0 on error

◆ sceKernelGetCallbackCount()

int sceKernelGetCallbackCount ( SceUID  cb)

Get the callback count.

Parameters
cb- The UID of the specified callback
Returns
The callback count, < 0 on error

◆ sceKernelCheckCallback()

int sceKernelCheckCallback ( void  )

Check callback ?

Returns
Something or another

◆ sceKernelCreateCond()

SceUID sceKernelCreateCond ( const char *  name,
SceUInt  attr,
SceUID  mutexId,
const SceKernelCondOptParam option 
)

Creates a new condition variable.

Example:
SceUID condId;
condId = sceKernelCreateCond("MyCond", 0, mutexId, NULL);
SceUID sceKernelCreateCond(const char *name, SceUInt attr, SceUID mutexId, const SceKernelCondOptParam *option)
Creates a new condition variable.
int SceUID
UIDs are used to describe many different kernel objects.
Definition: types.h:90
Parameters
name- Specifies the name of the condition variable
attr- Condition variable attribute flags (normally set to 0)
mutexId- Mutex to be related to the condition variable
option- Condition variable options (normally set to 0)
Returns
A condition variable id

◆ sceKernelDeleteCond()

int sceKernelDeleteCond ( SceUID  condId)

Destroy a condition variable.

Parameters
conditionvariableid - The condition variable id returned from sceKernelCreateCond
Returns
Returns the value 0 if it's successful, otherwise -1

◆ sceKernelOpenCond()

int sceKernelOpenCond ( const char *  name)

Open a condition variable.

Parameters
name- The name of the condition variable to open
Returns
Returns the value 0 if it's successful, otherwise -1

◆ sceKernelCloseCond()

int sceKernelCloseCond ( SceUID  condId)

Close a condition variable.

Parameters
conditionvariableid - The condition variable id returned from sceKernelCreateCond
Returns
Returns the value 0 if it's successful, otherwise -1

◆ sceKernelWaitCond()

int sceKernelWaitCond ( SceUID  condId,
unsigned int *  timeout 
)

Waits for a signal of a condition variable.

Parameters
condId- The condition variable id returned from sceKernelCreateCond
timeout- Timeout in microseconds (assumed)
Returns
< 0 On error.

◆ sceKernelWaitCondCB()

int sceKernelWaitCondCB ( SceUID  condId,
unsigned int *  timeout 
)

Waits for a signal of a condition variable (with callbacks)

Parameters
condId- The condition variable id returned from sceKernelCreateCond
timeout- Timeout in microseconds (assumed)
Returns
< 0 On error.

◆ sceKernelSignalCond()

int sceKernelSignalCond ( SceUID  condId)

Signals a condition variable.

Parameters
condId- The condition variable id returned from sceKernelCreateCond
Returns
< 0 On error.

◆ sceKernelSignalCondAll()

int sceKernelSignalCondAll ( SceUID  condId)

Signals a condition variable to all threads waiting for it.

Parameters
condId- The condition variable id returned from sceKernelCreateCond
Returns
< 0 On error.

◆ sceKernelSignalCondTo()

int sceKernelSignalCondTo ( SceUID  condId,
SceUID  threadId 
)

Signals a condition variable to a specific thread waiting for it.

Parameters
condId- The condition variable id returned from sceKernelCreateCond
threadId- The thread id returned from sceKernelCreateThread
Returns
< 0 On error.

◆ sceKernelCreateEventFlag()

SceUID sceKernelCreateEventFlag ( const char *  name,
int  attr,
int  bits,
SceKernelEventFlagOptParam opt 
)

Create an event flag.

Parameters
name- The name of the event flag.
attr- Attributes from SceEventFlagAttributes
bits- Initial bit pattern.
opt- Options, set to NULL
Returns
< 0 on error. >= 0 event flag id.
Example:
int evid;
evid = sceKernelCreateEventFlag("wait_event", 0, 0, NULL);
SceUID sceKernelCreateEventFlag(const char *name, int attr, int bits, SceKernelEventFlagOptParam *opt)
Create an event flag.

◆ sceKernelSetEventFlag()

int sceKernelSetEventFlag ( SceUID  evid,
unsigned int  bits 
)

Set an event flag bit pattern.

Parameters
evid- The event id returned by sceKernelCreateEventFlag.
bits- The bit pattern to set.
Returns
< 0 On error

◆ sceKernelClearEventFlag()

int sceKernelClearEventFlag ( SceUID  evid,
unsigned int  bits 
)

Clear a event flag bit pattern.

Parameters
evid- The event id returned by sceKernelCreateEventFlag
bits- The bits to clean
Returns
< 0 on Error

◆ sceKernelPollEventFlag()

int sceKernelPollEventFlag ( int  evid,
unsigned int  bits,
unsigned int  wait,
unsigned int *  outBits 
)

Poll an event flag for a given bit pattern.

Parameters
evid- The event id returned by sceKernelCreateEventFlag.
bits- The bit pattern to poll for.
wait- Wait type, one or more of SceEventFlagWaitTypes or'ed together
outBits- The bit pattern that was matched.
Returns
< 0 On error

◆ sceKernelWaitEventFlag()

int sceKernelWaitEventFlag ( int  evid,
unsigned int  bits,
unsigned int  wait,
unsigned int *  outBits,
SceUInt timeout 
)

Wait for an event flag for a given bit pattern.

Parameters
evid- The event id returned by sceKernelCreateEventFlag.
bits- The bit pattern to poll for.
wait- Wait type, one or more of SceEventFlagWaitTypes or'ed together
outBits- The bit pattern that was matched.
timeout- Timeout in microseconds
Returns
< 0 On error

◆ sceKernelWaitEventFlagCB()

int sceKernelWaitEventFlagCB ( int  evid,
unsigned int  bits,
unsigned int  wait,
unsigned int *  outBits,
SceUInt timeout 
)

Wait for an event flag for a given bit pattern with callback.

Parameters
evid- The event id returned by sceKernelCreateEventFlag.
bits- The bit pattern to poll for.
wait- Wait type, one or more of SceEventFlagWaitTypes or'ed together
outBits- The bit pattern that was matched.
timeout- Timeout in microseconds
Returns
< 0 On error

◆ sceKernelDeleteEventFlag()

int sceKernelDeleteEventFlag ( int  evid)

Delete an event flag.

Parameters
evid- The event id returned by sceKernelCreateEventFlag.
Returns
< 0 On error

◆ sceKernelGetEventFlagInfo()

int sceKernelGetEventFlagInfo ( SceUID  event,
SceKernelEventFlagInfo info 
)

Get the status of an event flag.

Parameters
event- The UID of the event.
status- A pointer to a SceKernelEventFlagInfo structure.
Returns
< 0 on error.

◆ sceKernelCreateLwCond()

int sceKernelCreateLwCond ( SceKernelLwCondWork pWork,
const char *  pName,
unsigned int  attr,
SceKernelLwMutexWork pLwMutex,
const SceKernelLwCondOptParam pOptParam 
)

◆ sceKernelDeleteLwCond()

int sceKernelDeleteLwCond ( SceKernelLwCondWork pWork)

◆ sceKernelSignalLwCond()

int sceKernelSignalLwCond ( SceKernelLwCondWork pWork)

◆ sceKernelSignalLwCondAll()

int sceKernelSignalLwCondAll ( SceKernelLwCondWork pWork)

◆ sceKernelSignalLwCondTo()

int sceKernelSignalLwCondTo ( SceKernelLwCondWork pWork,
SceUID  threadId 
)

◆ sceKernelWaitLwCond()

int sceKernelWaitLwCond ( SceKernelLwCondWork pWork,
unsigned int *  pTimeout 
)

◆ sceKernelCreateLwMutex()

int sceKernelCreateLwMutex ( SceKernelLwMutexWork pWork,
const char *  pName,
unsigned int  attr,
int  initCount,
const SceKernelLwMutexOptParam pOptParam 
)

◆ sceKernelDeleteLwMutex()

int sceKernelDeleteLwMutex ( SceKernelLwMutexWork pWork)

◆ sceKernelLockLwMutex()

int sceKernelLockLwMutex ( SceKernelLwMutexWork pWork,
int  lockCount,
unsigned int *  pTimeout 
)

◆ sceKernelTryLockLwMutex()

int sceKernelTryLockLwMutex ( SceKernelLwMutexWork pWork,
int  lockCount 
)

◆ sceKernelUnlockLwMutex()

int sceKernelUnlockLwMutex ( SceKernelLwMutexWork pWork,
int  unlockCount 
)

◆ sceKernelCreateMsgPipe()

SceUID sceKernelCreateMsgPipe ( const char *  name,
int  type,
int  attr,
unsigned int  bufSize,
void *  opt 
)

Create a message pipe.

Parameters
name- Name of the pipe
type- The type of memory attribute to use internally (set to 0x40)
attr- Set to 12
bufSize- The size of the internal buffer in multiples of 0x1000 (4KB)
opt- Message pipe options (set to NULL)
Returns
The UID of the created pipe, < 0 on error

◆ sceKernelDeleteMsgPipe()

int sceKernelDeleteMsgPipe ( SceUID  uid)

Delete a message pipe.

Parameters
uid- The UID of the pipe
Returns
0 on success, < 0 on error

◆ sceKernelSendMsgPipe()

int sceKernelSendMsgPipe ( SceUID  uid,
void *  message,
unsigned int  size,
int  unk1,
void *  unk2,
unsigned int *  timeout 
)

Send a message to a pipe.

Parameters
uid- The UID of the pipe
message- Pointer to the message
size- Size of the message
unk1- Unknown - async vs sync? use 0 for sync
unk2- Unknown - use NULL
timeout- Timeout for send in us. use NULL to wait indefinitely
Returns
0 on success, < 0 on error

◆ sceKernelSendMsgPipeCB()

int sceKernelSendMsgPipeCB ( SceUID  uid,
void *  message,
unsigned int  size,
int  unk1,
void *  unk2,
unsigned int *  timeout 
)

Send a message to a pipe (with callback)

Parameters
uid- The UID of the pipe
message- Pointer to the message
size- Size of the message
unk1- Unknown - async vs sync? use 0 for sync
unk2- Unknown - use NULL
timeout- Timeout for send in us. use NULL to wait indefinitely
Returns
0 on success, < 0 on error

◆ sceKernelTrySendMsgPipe()

int sceKernelTrySendMsgPipe ( SceUID  uid,
void *  message,
SceSize  size,
int  unk1,
void *  unk2 
)

Try to send a message to a pipe.

Parameters
uid- The UID of the pipe
message- Pointer to the message
size- Size of the message
unk1- Unknown - use 0
unk2- Unknown - use NULL
Returns
0 on success, < 0 on error

◆ sceKernelReceiveMsgPipe()

int sceKernelReceiveMsgPipe ( SceUID  uid,
void *  message,
SceSize  size,
int  unk1,
void *  unk2,
unsigned int *  timeout 
)

Receive a message from a pipe.

Parameters
uid- The UID of the pipe
message- Pointer to the message
size- Size of the message
unk1- Unknown - async vs sync? use 0 for sync
unk2- Unknown - use NULL
timeout- Timeout for receive in us. use NULL to wait indefinitely
Returns
0 on success, < 0 on error

◆ sceKernelReceiveMsgPipeCB()

int sceKernelReceiveMsgPipeCB ( SceUID  uid,
void *  message,
SceSize  size,
int  unk1,
void *  unk2,
unsigned int *  timeout 
)

Receive a message from a pipe (with callback)

Parameters
uid- The UID of the pipe
message- Pointer to the message
size- Size of the message
unk1- Unknown - async vs sync? use 0 for sync
unk2- Unknown - use NULL
timeout- Timeout for receive in us. use NULL to wait indefinitely
Returns
0 on success, < 0 on error

◆ sceKernelTryReceiveMsgPipe()

int sceKernelTryReceiveMsgPipe ( SceUID  uid,
void *  message,
SceSize  size,
int  unk1,
void *  unk2 
)

Receive a message from a pipe.

Parameters
uid- The UID of the pipe
message- Pointer to the message
size- Size of the message
unk1- Unknown - use 0
unk2- Unknown - use NULL
Returns
0 on success, < 0 on error

◆ sceKernelCancelMsgPipe()

int sceKernelCancelMsgPipe ( SceUID  uid,
int *  psend,
int *  precv 
)

Cancel a message pipe.

Parameters
uid- UID of the pipe to cancel
psend- Receive number of sending threads, NULL is valid
precv- Receive number of receiving threads, NULL is valid
Returns
0 on success, < 0 on error

◆ VITASDK_BUILD_ASSERT_EQ() [1/20]

VITASDK_BUILD_ASSERT_EQ ( 0x3C  ,
SceKernelMppInfo   
)

◆ sceKernelGetMsgPipeInfo()

int sceKernelGetMsgPipeInfo ( SceUID  uid,
SceKernelMppInfo info 
)

Get the status of a Message Pipe.

Parameters
uid- The uid of the Message Pipe
info- Pointer to a SceKernelMppInfo structure
Returns
0 on success, < 0 on error

◆ sceKernelCreateMutex()

SceUID sceKernelCreateMutex ( const char *  name,
SceUInt  attr,
int  initCount,
SceKernelMutexOptParam option 
)

Creates a new mutex.

Example:
int mutexid;
mutexid = sceKernelCreateMutex("MyMutex", 0, 1, NULL);
SceUID sceKernelCreateMutex(const char *name, SceUInt attr, int initCount, SceKernelMutexOptParam *option)
Creates a new mutex.
Parameters
name- Specifies the name of the mutex
attr- Mutex attribute flags (normally set to 0)
initCount- Mutex initial value
option- Mutex options (normally set to 0)
Returns
A mutex id

◆ sceKernelDeleteMutex()

int sceKernelDeleteMutex ( SceUID  mutexid)

Destroy a mutex.

Parameters
mutexid- The mutex id returned from sceKernelCreateMutex
Returns
Returns the value 0 if it's successful, otherwise -1

◆ sceKernelOpenMutex()

int sceKernelOpenMutex ( const char *  name)

Open a mutex.

Parameters
name- The name of the mutex to open
Returns
Returns the value 0 if it's successful, otherwise -1

◆ sceKernelCloseMutex()

int sceKernelCloseMutex ( SceUID  mutexid)

Close a mutex.

Parameters
mutexid- The mutex id returned from sceKernelCreateMutex
Returns
Returns the value 0 if it's successful, otherwise -1

◆ sceKernelLockMutex()

int sceKernelLockMutex ( SceUID  mutexid,
int  lockCount,
unsigned int *  timeout 
)

Lock a mutex.

Parameters
mutexid- The mutex id returned from sceKernelCreateMutex
lockCount- The value to increment to the lock count of the mutex
timeout- Timeout in microseconds (assumed)
Returns
< 0 On error.

◆ sceKernelLockMutexCB()

int sceKernelLockMutexCB ( SceUID  mutexid,
int  lockCount,
unsigned int *  timeout 
)

Lock a mutex and handle callbacks if necessary.

Parameters
mutexid- The mutex id returned from sceKernelCreateMutex
lockCount- The value to increment to the lock count of the mutex
timeout- Timeout in microseconds (assumed)
Returns
< 0 On error.

◆ sceKernelTryLockMutex()

int sceKernelTryLockMutex ( SceUID  mutexid,
int  lockCount 
)

Try to lock a mutex (non-blocking)

Parameters
mutexid- The mutex id returned from sceKernelCreateMutex
lockCount- The value to increment to the lock count of the mutex
Returns
< 0 On error.

◆ sceKernelUnlockMutex()

int sceKernelUnlockMutex ( SceUID  mutexid,
int  unlockCount 
)

Try to unlock a mutex (non-blocking)

Parameters
mutexid- The mutex id returned from sceKernelCreateMutex
unlockCount- The value to decrement to the lock count of the mutex
Returns
< 0 On error.

◆ sceKernelCancelMutex()

int sceKernelCancelMutex ( SceUID  mutexid,
int  newCount,
int *  numWaitThreads 
)

Cancels a mutex.

Parameters
mutexid- The mutex id returned from sceKernelCreateMutex
newCount- The new lock count of the mutex
numWaitThreads- Number of threads waiting for the mutex
Returns
< 0 On error.

◆ sceKernelGetMutexInfo()

int sceKernelGetMutexInfo ( SceUID  mutexid,
SceKernelMutexInfo info 
)

Retrieve information about a mutex.

Parameters
mutexid- UID of the mutex to retrieve info for.
info- Pointer to a SceKernelMutexInfo struct to receive the info.
Returns
< 0 on error.

◆ VITASDK_BUILD_ASSERT_EQ() [2/20]

VITASDK_BUILD_ASSERT_EQ ( ,
SceKernelRWLockOptParam   
)

◆ VITASDK_BUILD_ASSERT_EQ() [3/20]

VITASDK_BUILD_ASSERT_EQ ( 0x3C  ,
SceKernelRWLockInfo   
)

◆ sceKernelCreateRWLock()

SceUID sceKernelCreateRWLock ( const char *  name,
SceUInt32  attr,
const SceKernelRWLockOptParam opt_param 
)

Creates a new rwlock.

Example:
int rwlock_id;
rwlock_id = sceKernelCreateRWLock("MyRWLock", 0, NULL);
SceUID sceKernelCreateRWLock(const char *name, SceUInt32 attr, const SceKernelRWLockOptParam *opt_param)
Creates a new rwlock.
Parameters
name- Specifies the name of the rwlock
attr- RWLock attribute flags (normally set to 0)
option- RWLock options (normally set to NULL)
Returns
RWLock id on success, < 0 on error

◆ sceKernelDeleteRWLock()

int sceKernelDeleteRWLock ( SceUID  rwlock_id)

Destroy a rwlock.

Parameters
rwlock_id- The rwlock id returned from sceKernelCreateRWLock
Returns
0 on success, < 0 on error

◆ sceKernelOpenRWLock()

SceUID sceKernelOpenRWLock ( const char *  name)

Open a rwlock.

Parameters
name- The name of the rwlock to open
Returns
RWLock id on success, < 0 on error

◆ sceKernelCloseRWLock()

int sceKernelCloseRWLock ( SceUID  rwlock_id)

Close a rwlock.

Parameters
rwlock_id- The rwlock id returned from sceKernelCreateRWLock
Returns
0 on success, < 0 on error

◆ sceKernelLockReadRWLock()

int sceKernelLockReadRWLock ( SceUID  rwlock_id,
unsigned int *  timeout 
)

Lock a rwlock with read access.

Parameters
rwlock_id- The rwlock id returned from sceKernelCreateRWLock
timeout- Timeout in microseconds, use NULL to disable it
Returns
0 on success, < 0 on error

◆ sceKernelLockWriteRWLock()

int sceKernelLockWriteRWLock ( SceUID  rwlock_id,
unsigned int *  timeout 
)

Lock a rwlock with write access.

Parameters
rwlock_id- The rwlock id returned from sceKernelCreateRWLock
timeout- Timeout in microseconds, use NULL to disable it
Returns
0 on success, < 0 on error

◆ sceKernelLockReadRWLockCB()

int sceKernelLockReadRWLockCB ( SceUID  rwlock_id,
unsigned int *  timeout 
)

Lock a rwlock with read access and handle callbacks.

Parameters
rwlock_id- The rwlock id returned from sceKernelCreateRWLock
timeout- Timeout in microseconds, use NULL to disable it
Returns
0 on success, < 0 on error

◆ sceKernelLockWriteRWLockCB()

int sceKernelLockWriteRWLockCB ( SceUID  rwlock_id,
unsigned int *  timeout 
)

Lock a rwlock with write access and handle callbacks.

Parameters
rwlock_id- The rwlock id returned from sceKernelCreateRWLock
timeout- Timeout in microseconds, use NULL to disable it
Returns
0 on success, < 0 on error

◆ sceKernelTryLockReadRWLock()

int sceKernelTryLockReadRWLock ( SceUID  rwlock_id)

Try to lock a rwlock with read access (non-blocking)

Parameters
rwlock_id- The rwlock id returned from sceKernelCreateRWLock
Returns
0 on success, < 0 on error

◆ sceKernelTryLockWriteRWLock()

int sceKernelTryLockWriteRWLock ( SceUID  rwlock_id)

Try to lock a rwlock with write access (non-blocking)

Parameters
rwlock_id- The rwlock id returned from sceKernelCreateRWLock
Returns
0 on success, < 0 on error

◆ sceKernelUnlockReadRWLock()

int sceKernelUnlockReadRWLock ( SceUID  rwlock_id)

Try to unlock a rwlock with read access (non-blocking)

Parameters
rwlock_id- The rwlock id returned from sceKernelCreateRWLock
Returns
0 on success, < 0 on error

◆ sceKernelUnlockWriteRWLock()

int sceKernelUnlockWriteRWLock ( SceUID  rwlock_id)

Try to unlock a rwlock with write access (non-blocking)

Parameters
rwlock_id- The rwlock id returned from sceKernelCreateRWLock
Returns
0 on success, < 0 on error

◆ sceKernelGetRWLockInfo()

int sceKernelGetRWLockInfo ( SceUID  rwlock_id,
SceKernelRWLockInfo info 
)

Retrieve information about a rwlock.

Parameters
rwlock_id- UID of the rwlock to retrieve info for.
info- Pointer to a SceKernelRWLockInfo struct to receive the info.
Returns
0 on success, < 0 on error

◆ sceKernelCreateSema()

SceUID sceKernelCreateSema ( const char *  name,
SceUInt  attr,
int  initVal,
int  maxVal,
SceKernelSemaOptParam option 
)

Creates a new semaphore.

Example:
int semaid;
semaid = sceKernelCreateSema("MySema", 0, 1, 1, NULL);
SceUID sceKernelCreateSema(const char *name, SceUInt attr, int initVal, int maxVal, SceKernelSemaOptParam *option)
Creates a new semaphore.
Parameters
name- Specifies the name of the sema
attr- Sema attribute flags (normally set to 0)
initVal- Sema initial value
maxVal- Sema maximum value
option- Sema options (normally set to 0)
Returns
A semaphore id

◆ sceKernelDeleteSema()

int sceKernelDeleteSema ( SceUID  semaid)

Destroy a semaphore.

Parameters
semaid- The semaid returned from a previous create call.
Returns
Returns the value 0 if it's successful, otherwise -1

◆ sceKernelSignalSema()

int sceKernelSignalSema ( SceUID  semaid,
int  signal 
)

Send a signal to a semaphore.

Example:
// Signal the sema
int sceKernelSignalSema(SceUID semaid, int signal)
Send a signal to a semaphore.
Parameters
semaid- The sema id returned from sceKernelCreateSema
signal- The amount to signal the sema (i.e. if 2 then increment the sema by 2)
Returns
< 0 On error.

◆ sceKernelWaitSema()

int sceKernelWaitSema ( SceUID  semaid,
int  signal,
SceUInt timeout 
)

Lock a semaphore.

Example:
sceKernelWaitSema(semaid, 1, 0);
int sceKernelWaitSema(SceUID semaid, int signal, SceUInt *timeout)
Lock a semaphore.
Parameters
semaid- The sema id returned from sceKernelCreateSema
signal- The value to wait for (i.e. if 1 then wait till reaches a signal state of 1)
timeout- Timeout in microseconds (assumed).
Returns
< 0 on error.

◆ sceKernelWaitSemaCB()

int sceKernelWaitSemaCB ( SceUID  semaid,
int  signal,
SceUInt timeout 
)

Lock a semaphore and handle callbacks if necessary.

Example:
sceKernelWaitSemaCB(semaid, 1, 0);
int sceKernelWaitSemaCB(SceUID semaid, int signal, SceUInt *timeout)
Lock a semaphore and handle callbacks if necessary.
Parameters
semaid- The sema id returned from sceKernelCreateSema
signal- The value to wait for (i.e. if 1 then wait till reaches a signal state of 1)
timeout- Timeout in microseconds (assumed).
Returns
< 0 on error.

◆ sceKernelPollSema()

int sceKernelPollSema ( SceUID  semaid,
int  signal 
)

Poll a semaphore.

Parameters
semaid- UID of the semaphore to poll.
signal- The value to test for.
Returns
< 0 on error.

◆ sceKernelCancelSema()

int sceKernelCancelSema ( SceUID  semaid,
int  setCount,
int *  numWaitThreads 
)

Cancels a semaphore.

Parameters
semaid- The sema id returned from sceKernelCreateSema
setCount- The new lock count of the semaphore
numWaitThreads- Number of threads waiting for the semaphore
Returns
< 0 On error.

◆ sceKernelGetSemaInfo()

int sceKernelGetSemaInfo ( SceUID  semaid,
SceKernelSemaInfo info 
)

Retrieve information about a semaphore.

Parameters
semaid- UID of the semaphore to retrieve info for.
info- Pointer to a SceKernelSemaInfo struct to receive the info.
Returns
< 0 on error.

◆ sceKernelOpenSema()

SceUID sceKernelOpenSema ( const char *  name)

◆ sceKernelCloseSema()

int sceKernelCloseSema ( SceUID  semaid)

◆ sceKernelWaitSignal()

int sceKernelWaitSignal ( SceUInt32  unk0,
SceUInt32  delay,
SceUInt32 timeout 
)

Sleep current thread and wait for a signal.

After it receives a signal, the thread wakes up.

This is like a semphore with limit 1. If signal was sent before and not consumed before, the function will immediately return.

Parameters
unk0unknown parameter. 0 can be used.
delaythe delay before wating for a signal
timeoutthe timeout if it's null, it waits indefinitely.
Returns
0 on success

◆ sceKernelSendSignal()

int sceKernelSendSignal ( SceUID  thid)

Send a signal to the thread specified by thid.

Note that it can send a signal to the current thread as well.

Parameters
thid- the id of the thread to send a signal to
Returns
0 on success
SCE_KERNEL_ERROR_ALREADY_SENT if the last signal was not consumed by sceKernelWaitSignal

◆ sceKernelCreateThread()

SceUID sceKernelCreateThread ( const char *  name,
SceKernelThreadEntry  entry,
int  initPriority,
SceSize  stackSize,
SceUInt  attr,
int  cpuAffinityMask,
const SceKernelThreadOptParam option 
)

Create a thread.

Example:
SceUID thid;
thid = sceKernelCreateThread("my_thread", threadFunc, 0x10000100, 0x10000, 0, 0, NULL);
SceUID sceKernelCreateThread(const char *name, SceKernelThreadEntry entry, int initPriority, SceSize stackSize, SceUInt attr, int cpuAffinityMask, const SceKernelThreadOptParam *option)
Create a thread.
Parameters
name- An arbitrary thread name.
entry- The thread function to run when started.
initPriority- The initial priority of the thread. Less if higher priority.
stackSize- The size of the initial stack.
attr- The thread attributes, zero or more of ::SceThreadAttributes.
cpuAffinityMask- The CPU affinity mask A thread can run only on the cores specified in the CPU affinity mask. The CPU affinity mask can be specified by the logical sum of the following macros:
  • SCE_KERNEL_CPU_MASK_USER_0
  • SCE_KERNEL_CPU_MASK_USER_1
  • SCE_KERNEL_CPU_MASK_USER_2
  • SCE_KERNEL_CPU_MASK_SYSTEM (system-reserved core) The following macro are also available to represent all available in userland CPU cores:
  • SCE_KERNEL_CPU_MASK_USER_ALL The following macro are also available to inherit affinity mask of the calling process:
  • SCE_KERNEL_THREAD_CPU_AFFINITY_MASK_DEFAULT
option- Additional options specified by SceKernelThreadOptParam.
Returns
UID of the created thread, or an error code.

◆ sceKernelDeleteThread()

int sceKernelDeleteThread ( SceUID  thid)

Delate a thread.

Parameters
thid- UID of the thread to be deleted.
Returns
< 0 on error.

◆ sceKernelStartThread()

int sceKernelStartThread ( SceUID  thid,
SceSize  arglen,
void *  argp 
)

Start a created thread.

Parameters
thid- Thread id from sceKernelCreateThread
arglen- Length of the data pointed to by argp, in bytes
argp- Pointer to the arguments.

◆ sceKernelExitThread()

int sceKernelExitThread ( int  status)

Exit a thread.

Parameters
status- Exit status.

◆ sceKernelExitDeleteThread()

int sceKernelExitDeleteThread ( int  status)

Exit a thread and delete itself.

Parameters
status- Exit status

◆ sceKernelWaitThreadEnd()

int sceKernelWaitThreadEnd ( SceUID  thid,
int *  stat,
SceUInt timeout 
)

Wait until a thread has ended.

Parameters
thid- Id of the thread to wait for.
stat- Exit status.
timeout- Timeout in microseconds (assumed).
Returns
< 0 on error.

◆ sceKernelWaitThreadEndCB()

int sceKernelWaitThreadEndCB ( SceUID  thid,
int *  stat,
SceUInt timeout 
)

Wait until a thread has ended and handle callbacks if necessary.

Parameters
thid- Id of the thread to wait for.
stat- Exit status.
timeout- Timeout in microseconds (assumed).
Returns
< 0 on error.

◆ sceKernelDelayThread()

int sceKernelDelayThread ( SceUInt  delay)

Delay the current thread by a specified number of microseconds.

Parameters
delay- Delay in microseconds.
Example:
sceKernelDelayThread(1000000); // Delay for a second
int sceKernelDelayThread(SceUInt delay)
Delay the current thread by a specified number of microseconds.

◆ sceKernelDelayThreadCB()

int sceKernelDelayThreadCB ( SceUInt  delay)

Delay the current thread by a specified number of microseconds and handle any callbacks.

Parameters
delay- Delay in microseconds.
Example:
sceKernelDelayThread(1000000); // Delay for a second

◆ sceKernelChangeCurrentThreadAttr()

int sceKernelChangeCurrentThreadAttr ( SceUInt  clearAttr,
SceUInt  setAttr 
)

Modify the attributes of the current thread.

Parameters
clearAttr- The thread attributes to clear. One of ::SceThreadAttributes.
setAttr- The thread attributes to set. One of ::SceThreadAttributes.
Returns
< 0 on error.

◆ sceKernelChangeThreadPriority()

int sceKernelChangeThreadPriority ( SceUID  thid,
int  priority 
)

Change the threads current priority.

Parameters
thid- The ID of the thread (from sceKernelCreateThread or sceKernelGetThreadId)
priority- The new priority (the lower the number the higher the priority)
Example:
int thid = sceKernelGetThreadId();
// Change priority of current thread to 16
int sceKernelGetThreadId(void)
Get the current thread Id.
int sceKernelChangeThreadPriority(SceUID thid, int priority)
Change the threads current priority.
Returns
0 if successful, otherwise the error code.

◆ sceKernelGetThreadCurrentPriority()

int sceKernelGetThreadCurrentPriority ( void  )

Get the current priority of the thread you are in.

Returns
The current thread priority

◆ sceKernelGetThreadExitStatus()

int sceKernelGetThreadExitStatus ( SceUID  thid,
int *  status 
)

Get the exit status of a thread.

Parameters
[in]thid- The UID of the thread to check.
[out]status- Status out pointer
Returns
The exit status

◆ sceKernelCheckThreadStack()

int sceKernelCheckThreadStack ( void  )

Check the thread stack?

Returns
Unknown.

◆ sceKernelGetThreadStackFreeSize()

int sceKernelGetThreadStackFreeSize ( SceUID  thid)

Get the free stack size for a thread.

Parameters
thid- The thread ID
Returns
The free size.

◆ sceKernelGetThreadInfo()

int sceKernelGetThreadInfo ( SceUID  thid,
SceKernelThreadInfo info 
)

Get the status information for the specified thread.

Parameters
thid- Id of the thread to get status
info- Pointer to the info structure to receive the data. Note: The structures size field should be set to sizeof(SceKernelThreadInfo) before calling this function.
Example:
status.size = sizeof(SceKernelThreadInfo);
if(sceKernelGetThreadInfo(thid, &status) == 0)
{ Do something... }
SceSize size
Size of the structure.
Definition: threadmgr.h:83
int sceKernelGetThreadInfo(SceUID thid, SceKernelThreadInfo *info)
Get the status information for the specified thread.
Structure to hold the status information for a thread.
Definition: threadmgr.h:81
Returns
0 if successful, otherwise the error code.

◆ sceKernelGetThreadRunStatus()

int sceKernelGetThreadRunStatus ( SceUID  thid,
SceKernelThreadRunStatus status 
)

Retrive the runtime status of a thread.

Parameters
thid- UID of the thread to retrieve status.
status- Pointer to a SceKernelThreadRunStatus struct to receive the runtime status.
Returns
0 if successful, otherwise the error code.

◆ sceKernelGetThreadCpuAffinityMask()

int sceKernelGetThreadCpuAffinityMask ( SceUID  thid)

Retrive the cpu affinity mask of a thread.

Parameters
thid- UID of the thread to retrieve affinity mask for.
Returns
current affinity mask if >= 0, otherwise the error code.

◆ sceKernelChangeThreadCpuAffinityMask()

int sceKernelChangeThreadCpuAffinityMask ( SceUID  thid,
int  mask 
)

Set the cpu affinity mask of a thread.

Parameters
thid- UID of the thread to retrieve affinity mask for.
mask- New cpu affinity mask.
Returns
0 if successful, otherwise the error code.

◆ sceKernelGetThreadId()

int sceKernelGetThreadId ( void  )

Get the current thread Id.

Returns
The thread id of the calling thread.

◆ sceKernelGetProcessId()

SceUID sceKernelGetProcessId ( void  )

Get the process ID of in the running thread.

Returns
process ID of in the running thread

◆ VITASDK_BUILD_ASSERT_EQ() [4/20]

VITASDK_BUILD_ASSERT_EQ ( 0x48  ,
SceKernelSystemInfo   
)

◆ sceKernelGetSystemInfo()

int sceKernelGetSystemInfo ( SceKernelSystemInfo info)

Get the system information.

Parameters
info- Pointer to a SceKernelSystemInfo structure
Returns
0 on success, < 0 on error

◆ sceKernelGetThreadmgrUIDClass()

SceKernelIdListType sceKernelGetThreadmgrUIDClass ( SceUID  uid)

Get the type of a Threadmgr uid.

Parameters
uid- The uid to get the type from
Returns
The type, < 0 on error

◆ sceKernelGetThreadTLSAddr()

void* sceKernelGetThreadTLSAddr ( SceUID  thid,
int  key 
)

sceKernelGetThreadTLSAddr gets an address to a 4 bytes area of TLS memory for the specified thread

Parameters
thid- The UID of the thread to access TLS
key- the TLS keyslot index
Returns
pointer to TLS memory

◆ sceKernelGetTLSAddr()

void* sceKernelGetTLSAddr ( int  key)

sceKernelGetTLSAddr get pointer to TLS key area for current thread

Parameters
key- the TLS keyslot index
Returns
pointer to TLS key value

◆ sceKernelGetSystemTimeWide()

SceInt64 sceKernelGetSystemTimeWide ( void  )

Get the system time (wide version)

Returns
The system time

◆ VITASDK_BUILD_ASSERT_EQ() [5/20]

VITASDK_BUILD_ASSERT_EQ ( 0x34  ,
SceKernelThreadRunStatus   
)

◆ VITASDK_BUILD_ASSERT_EQ() [6/20]

VITASDK_BUILD_ASSERT_EQ ( 0x1C  ,
SceKernelThreadOptParam   
)

◆ VITASDK_BUILD_ASSERT_EQ() [7/20]

VITASDK_BUILD_ASSERT_EQ ( 0x80  ,
SceKernelThreadInfo   
)

◆ VITASDK_BUILD_ASSERT_EQ() [8/20]

VITASDK_BUILD_ASSERT_EQ ( 0x3C  ,
SceKernelCallbackInfo   
)

◆ VITASDK_BUILD_ASSERT_EQ() [9/20]

VITASDK_BUILD_ASSERT_EQ ( ,
SceKernelSemaOptParam   
)

◆ VITASDK_BUILD_ASSERT_EQ() [10/20]

VITASDK_BUILD_ASSERT_EQ ( 0x3C  ,
SceKernelSemaInfo   
)

◆ VITASDK_BUILD_ASSERT_EQ() [11/20]

VITASDK_BUILD_ASSERT_EQ ( ,
SceKernelEventFlagOptParam   
)

◆ VITASDK_BUILD_ASSERT_EQ() [12/20]

VITASDK_BUILD_ASSERT_EQ ( 0x38  ,
SceKernelEventFlagInfo   
)

◆ VITASDK_BUILD_ASSERT_EQ() [13/20]

VITASDK_BUILD_ASSERT_EQ ( 0x10  ,
SceKernelLwCondWork   
)

◆ VITASDK_BUILD_ASSERT_EQ() [14/20]

VITASDK_BUILD_ASSERT_EQ ( ,
SceKernelLwCondOptParam   
)

◆ VITASDK_BUILD_ASSERT_EQ() [15/20]

VITASDK_BUILD_ASSERT_EQ ( 0x20  ,
SceKernelLwMutexWork   
)

◆ VITASDK_BUILD_ASSERT_EQ() [16/20]

VITASDK_BUILD_ASSERT_EQ ( ,
SceKernelLwMutexOptParam   
)

◆ VITASDK_BUILD_ASSERT_EQ() [17/20]

VITASDK_BUILD_ASSERT_EQ ( ,
SceKernelMutexOptParam   
)

◆ VITASDK_BUILD_ASSERT_EQ() [18/20]

VITASDK_BUILD_ASSERT_EQ ( 0x3C  ,
SceKernelMutexInfo   
)

◆ VITASDK_BUILD_ASSERT_EQ() [19/20]

VITASDK_BUILD_ASSERT_EQ ( ,
SceKernelCondOptParam   
)

◆ VITASDK_BUILD_ASSERT_EQ() [20/20]

VITASDK_BUILD_ASSERT_EQ ( 0x34  ,
SceKernelCondInfo   
)