vitasdk
Documentation of the vitasdk

Exports for User. More...

Data Structures

struct  SceKernelMppInfo
 Message Pipe status info. More...
 
struct  SceKernelRWLockOptParam
 Additional options used when creating rwlock. More...
 
struct  SceKernelRWLockInfo
 Current state of a rwlock. More...
 
struct  SceKernelSystemInfo
 
struct  SceKernelThreadRunStatus
 Statistics about a running thread. More...
 
struct  SceKernelThreadOptParam
 Additional options used when creating threads. More...
 
struct  SceKernelThreadInfo
 Structure to hold the status information for a thread. More...
 
struct  SceKernelCallbackInfo
 Structure to hold the status information for a callback. More...
 
struct  SceKernelSemaOptParam
 Additional options used when creating semaphores. More...
 
struct  SceKernelSemaInfo
 Current state of a semaphore. More...
 
struct  SceKernelEventFlagOptParam
 
struct  SceKernelEventFlagInfo
 Structure to hold the event flag information. More...
 
struct  SceKernelLwCondWork
 
struct  SceKernelLwCondOptParam
 
struct  SceKernelLwMutexWork
 
struct  SceKernelLwMutexOptParam
 
struct  SceKernelMutexOptParam
 Additional options used when creating mutexes. More...
 
struct  SceKernelMutexInfo
 Current state of a mutex. More...
 
struct  SceKernelCondOptParam
 Additional options used when creating condition variables. More...
 
struct  SceKernelCondInfo
 Current state of a condition variable. More...
 
struct  SceKernelSystemInfo.cpuInfo
 
struct  SceKernelThreadRunStatus.cpuInfo
 

Macros

#define SCE_KERNEL_THREAD_CPU_AFFINITY_MASK_DEFAULT   (0)
 Inherit calling thread affinity mask.
 
#define SCE_KERNEL_VFP_EXCP_IOC   (0x00000001)
 
#define SCE_KERNEL_VFP_EXCP_DZC   (0x00000002)
 
#define SCE_KERNEL_VFP_EXCP_OFC   (0x00000004)
 
#define SCE_KERNEL_VFP_EXCP_UFC   (0x00000008)
 
#define SCE_KERNEL_VFP_EXCP_IXC   (0x00000010)
 
#define SCE_KERNEL_VFP_EXCP_IDC   (0x00000080)
 
#define SCE_KERNEL_VFP_EXCP_QC   (0x08000000)
 
#define SCE_KERNEL_VFP_EXCP_ALL   (SCE_KERNEL_VFP_EXCP_IOC | SCE_KERNEL_VFP_EXCP_DZC | SCE_KERNEL_VFP_EXCP_OFC | SCE_KERNEL_VFP_EXCP_UFC | SCE_KERNEL_VFP_EXCP_IXC | SCE_KERNEL_VFP_EXCP_IDC | SCE_KERNEL_VFP_EXCP_QC)
 

Typedefs

typedef int(* SceKernelThreadEntry) (SceSize args, void *argp)
 
typedef int(* SceKernelThreadEventHandler) (SceInt32 type, SceUID threadId, SceInt32 arg, void *pCommon)
 
typedef int(* SceKernelCallbackFunction) (int notifyId, int notifyCount, int notifyArg, void *userData)
 Callback function prototype.
 

Enumerations

enum  SceKernelIdListType {
  SCE_KERNEL_TMID_Thread = 1 , SCE_KERNEL_TMID_Semaphore = 2 , SCE_KERNEL_TMID_EventFlag = 3 , SCE_KERNEL_TMID_Mbox = 4 ,
  SCE_KERNEL_TMID_Vpl = 5 , SCE_KERNEL_TMID_Fpl = 6 , SCE_KERNEL_TMID_Mpipe = 7 , SCE_KERNEL_TMID_Callback = 8 ,
  SCE_KERNEL_TMID_ThreadEventHandler = 9 , SCE_KERNEL_TMID_Alarm = 10 , SCE_KERNEL_TMID_VTimer = 11 , SCE_KERNEL_TMID_SleepThread = 64 ,
  SCE_KERNEL_TMID_DelayThread = 65 , SCE_KERNEL_TMID_SuspendThread = 66 , SCE_KERNEL_TMID_DormantThread = 67
}
 Threadmgr types. More...
 
enum  SceThreadStatus {
  SCE_THREAD_RUNNING = 1 , SCE_THREAD_READY = 2 , SCE_THREAD_STANDBY = 4 , SCE_THREAD_WAITING = 8 ,
  SCE_THREAD_SUSPEND = 8 , SCE_THREAD_DORMANT = 16 , SCE_THREAD_STOPPED = 16 , SCE_THREAD_DELETED = 32 ,
  SCE_THREAD_KILLED = 32 , SCE_THREAD_DEAD = 64 , SCE_THREAD_STAGNANT = 128 , SCE_THREAD_SUSPENDED = 256
}
 
enum  SceKernelThreadEventType { SCE_KERNEL_THREAD_EVENT_TYPE_START = 0x00000004 , SCE_KERNEL_THREAD_EVENT_TYPE_EXIT = 0x00000008 }
 
enum  SceKernelWaitableAttribute { SCE_KERNEL_ATTR_THREAD_FIFO = 0x00000000 , SCE_KERNEL_ATTR_THREAD_PRIO = 0x00002000 , SCE_KERNEL_ATTR_OPENABLE = 0x00000080 }
 
enum  SceEventFlagAttributes {
  SCE_EVENT_THREAD_FIFO = SCE_KERNEL_ATTR_THREAD_FIFO , SCE_EVENT_THREAD_PRIO = SCE_KERNEL_ATTR_THREAD_PRIO , SCE_EVENT_WAITSINGLE = 0 , SCE_EVENT_WAITMULTIPLE = 0x00001000 ,
  SCE_EVENT_OPENABLE = SCE_KERNEL_ATTR_OPENABLE
}
 Event flag creation attributes. More...
 
enum  SceEventFlagWaitTypes { SCE_EVENT_WAITAND = 0 , SCE_EVENT_WAITOR = 1 , SCE_EVENT_WAITCLEAR = 2 , SCE_EVENT_WAITCLEAR_PAT = 4 }
 Event flag wait types. More...
 
enum  SceKernelMutexAttribute { SCE_KERNEL_MUTEX_ATTR_RECURSIVE = 0x02 , SCE_KERNEL_MUTEX_ATTR_CEILING = 0x04 }
 

Functions

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

Variables

SceSize SceKernelMppInfo::size
 
SceUID SceKernelMppInfo::mppId
 
char SceKernelMppInfo::name [32]
 
SceUInt SceKernelMppInfo::attr
 
int SceKernelMppInfo::bufSize
 
int SceKernelMppInfo::freeSize
 
int SceKernelMppInfo::numSendWaitThreads
 
int SceKernelMppInfo::numReceiveWaitThreads
 
SceSize SceKernelRWLockOptParam::size
 Size of the SceKernelRWLockOptParam structure.
 
SceSize SceKernelRWLockInfo::size
 Size of the SceKernelRWLockInfo structure.
 
SceUID SceKernelRWLockInfo::rwLockId
 The UID of the rwlock.
 
char SceKernelRWLockInfo::name [32]
 NULL-terminated name of the rwlock.
 
SceUInt32 SceKernelRWLockInfo::attr
 Attributes.
 
SceInt32 SceKernelRWLockInfo::lockCount
 The current lock count.
 
SceUID SceKernelRWLockInfo::writeOwnerId
 The UID of the current owner of the rwlock with write access, 0 when locked for reads.
 
SceUInt32 SceKernelRWLockInfo::numReadWaitThreads
 The number of threads waiting on the rwlock for read access.
 
SceUInt32 SceKernelRWLockInfo::numWriteWaitThreads
 The number of threads waiting on the rwlock for write access.
 
SceSize SceKernelSystemInfo::size
 
SceUInt32 SceKernelSystemInfo::activeCpuMask
 
SceKernelSysClock SceKernelSystemInfo::idleClock
 
SceUInt32 SceKernelSystemInfo::comesOutOfIdleCount
 
SceUInt32 SceKernelSystemInfo::threadSwitchCount
 
struct { 
 
SceKernelSysClock idleClock
 
SceUInt32 comesOutOfIdleCount
 
SceUInt32 threadSwitchCount
 
SceKernelSystemInfo::cpuInfo [4] 
 
SceSize SceKernelThreadRunStatus::size
 
SceUID SceKernelThreadRunStatus::processId
 
SceUID SceKernelThreadRunStatus::threadId
 
int SceKernelThreadRunStatus::priority
 
struct { 
 
SceUID processId
 
SceUID threadId
 
int priority
 
SceKernelThreadRunStatus::cpuInfo [4] 
 
SceSize SceKernelThreadOptParam::size
 Size of the SceKernelThreadOptParam structure.
 
SceUInt32 SceKernelThreadOptParam::attr
 Attributes.
 
SceUInt32 SceKernelThreadOptParam::kStackMemType
 
SceUInt32 SceKernelThreadOptParam::uStackMemType
 
SceUInt32 SceKernelThreadOptParam::uTLSMemType
 
SceUInt32 SceKernelThreadOptParam::uStackMemid
 
SceUInt32 SceKernelThreadOptParam::data_0x18
 
SceSize SceKernelThreadInfo::size
 Size of the structure.
 
SceUID SceKernelThreadInfo::processId
 The UID of the process where the thread belongs.
 
char SceKernelThreadInfo::name [32]
 Nul terminated name of the thread.
 
SceUInt32 SceKernelThreadInfo::attr
 Thread attributes.
 
SceUInt32 SceKernelThreadInfo::status
 Thread status.
 
SceKernelThreadEntry SceKernelThreadInfo::entry
 Thread entry point.
 
void * SceKernelThreadInfo::stack
 Thread stack pointer.
 
SceInt32 SceKernelThreadInfo::stackSize
 Thread stack size.
 
SceInt32 SceKernelThreadInfo::initPriority
 Initial priority.
 
SceInt32 SceKernelThreadInfo::currentPriority
 Current priority.
 
SceInt32 SceKernelThreadInfo::initCpuAffinityMask
 Initial CPU affinity mask.
 
SceInt32 SceKernelThreadInfo::currentCpuAffinityMask
 Current CPU affinity mask.
 
SceInt32 SceKernelThreadInfo::currentCpuId
 Current CPU ID.
 
SceInt32 SceKernelThreadInfo::lastExecutedCpuId
 Last executed CPU ID.
 
SceUInt32 SceKernelThreadInfo::waitType
 Wait type.
 
SceUID SceKernelThreadInfo::waitId
 Wait id.
 
SceInt32 SceKernelThreadInfo::exitStatus
 Exit status of the thread.
 
SceKernelSysClock SceKernelThreadInfo::runClocks
 Number of clock cycles run.
 
SceUInt32 SceKernelThreadInfo::intrPreemptCount
 Interrupt preemption count.
 
SceUInt32 SceKernelThreadInfo::threadPreemptCount
 Thread preemption count.
 
SceUInt32 SceKernelThreadInfo::threadReleaseCount
 Thread release count.
 
SceInt32 SceKernelThreadInfo::changeCpuCount
 Number of CPUs to which the thread is moved.
 
SceInt32 SceKernelThreadInfo::fNotifyCallback
 Function notify callback UID.
 
SceInt32 SceKernelThreadInfo::reserved
 Reserved.
 
SceSize SceKernelCallbackInfo::size
 Size of the structure (i.e.
 
SceUID SceKernelCallbackInfo::callbackId
 The UID of the callback.
 
char SceKernelCallbackInfo::name [32]
 The name given to the callback.
 
SceUID SceKernelCallbackInfo::threadId
 The thread id associated with the callback.
 
SceKernelCallbackFunction SceKernelCallbackInfo::callback
 Pointer to the callback function.
 
void * SceKernelCallbackInfo::common
 User supplied argument for the callback.
 
int SceKernelCallbackInfo::notifyCount
 Unknown.
 
int SceKernelCallbackInfo::notifyArg
 Unknown.
 
SceSize SceKernelSemaOptParam::size
 Size of the SceKernelSemaOptParam structure.
 
SceSize SceKernelSemaInfo::size
 Size of the SceKernelSemaInfo structure.
 
SceUID SceKernelSemaInfo::semaId
 The UID of the semaphore.
 
char SceKernelSemaInfo::name [32]
 NUL-terminated name of the semaphore.
 
SceUInt SceKernelSemaInfo::attr
 Attributes.
 
int SceKernelSemaInfo::initCount
 The initial count the semaphore was created with.
 
int SceKernelSemaInfo::currentCount
 The current count.
 
int SceKernelSemaInfo::maxCount
 The maximum count.
 
int SceKernelSemaInfo::numWaitThreads
 The number of threads waiting on the semaphore.
 
SceSize SceKernelEventFlagOptParam::size
 
SceSize SceKernelEventFlagInfo::size
 
SceUID SceKernelEventFlagInfo::evfId
 
char SceKernelEventFlagInfo::name [32]
 
SceUInt SceKernelEventFlagInfo::attr
 
SceUInt SceKernelEventFlagInfo::initPattern
 
SceUInt SceKernelEventFlagInfo::currentPattern
 
int SceKernelEventFlagInfo::numWaitThreads
 
SceInt32 SceKernelLwCondWork::data [4]
 
SceSize SceKernelLwCondOptParam::size
 
SceInt64 SceKernelLwMutexWork::data [4]
 
SceSize SceKernelLwMutexOptParam::size
 
SceSize SceKernelMutexOptParam::size
 Size of the SceKernelMutexOptParam structure.
 
int SceKernelMutexOptParam::ceilingPriority
 
SceSize SceKernelMutexInfo::size
 Size of the SceKernelMutexInfo structure.
 
SceUID SceKernelMutexInfo::mutexId
 The UID of the mutex.
 
char SceKernelMutexInfo::name [32]
 NUL-terminated name of the mutex.
 
SceUInt SceKernelMutexInfo::attr
 Attributes.
 
int SceKernelMutexInfo::initCount
 The initial count the mutex was created with.
 
int SceKernelMutexInfo::currentCount
 The current count.
 
SceUID SceKernelMutexInfo::currentOwnerId
 The UID of the current owner of the mutex.
 
int SceKernelMutexInfo::numWaitThreads
 The number of threads waiting on the mutex.
 
SceSize SceKernelCondOptParam::size
 Size of the SceKernelCondOptParam structure.
 
SceSize SceKernelCondInfo::size
 Size of the SceKernelCondInfo structure.
 
SceUID SceKernelCondInfo::condId
 The UID of the condition variable.
 
char SceKernelCondInfo::name [32]
 NUL-terminated name of the condition variable.
 
SceUInt SceKernelCondInfo::attr
 Attributes.
 
SceUID SceKernelCondInfo::mutexId
 Mutex associated with the condition variable.
 
int SceKernelCondInfo::numWaitThreads
 The number of threads waiting on the condition variable.
 

Detailed Description

Exports for User.


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:




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:




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 cpuInfo[4]

◆ SceKernelThreadRunStatus

struct SceKernelThreadRunStatus

Statistics about a running thread.

See also
sceKernelGetThreadRunStatus.
Data Fields
SceSize size
struct SceKernelThreadRunStatus.cpuInfo 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.

◆ SCE_KERNEL_VFP_EXCP_IOC

#define SCE_KERNEL_VFP_EXCP_IOC   (0x00000001)

◆ SCE_KERNEL_VFP_EXCP_DZC

#define SCE_KERNEL_VFP_EXCP_DZC   (0x00000002)

◆ SCE_KERNEL_VFP_EXCP_OFC

#define SCE_KERNEL_VFP_EXCP_OFC   (0x00000004)

◆ SCE_KERNEL_VFP_EXCP_UFC

#define SCE_KERNEL_VFP_EXCP_UFC   (0x00000008)

◆ SCE_KERNEL_VFP_EXCP_IXC

#define SCE_KERNEL_VFP_EXCP_IXC   (0x00000010)

◆ SCE_KERNEL_VFP_EXCP_IDC

#define SCE_KERNEL_VFP_EXCP_IDC   (0x00000080)

◆ SCE_KERNEL_VFP_EXCP_QC

#define SCE_KERNEL_VFP_EXCP_QC   (0x08000000)

◆ SCE_KERNEL_VFP_EXCP_ALL

Typedef Documentation

◆ SceKernelThreadEntry

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

◆ SceKernelThreadEventHandler

typedef int(* SceKernelThreadEventHandler) (SceInt32 type, SceUID threadId, SceInt32 arg, void *pCommon)

◆ 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 

◆ SceKernelThreadEventType

Enumerator
SCE_KERNEL_THREAD_EVENT_TYPE_START 
SCE_KERNEL_THREAD_EVENT_TYPE_EXIT 

◆ 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:90
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:88
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

◆ sceKernelRegisterThreadEventHandler()

SceUID sceKernelRegisterThreadEventHandler ( const char *  name,
SceUID  thid,
SceInt32  eventMask,
SceKernelThreadEventHandler  handler,
void *  common 
)

Register a handler for thread events.

Parameters
name- Name of the thread event object
thid- Thread ID of the target thread. Use 0x10027 to target all threads in the process
eventMask- Mask of SceKernelThreadEventType for this handler's valid events.
handler- Handler function
userData- User data to pass to the handler
Returns
ID of the thread event handler on success, < 0 on error

◆ sceKernelUnregisterThreadEventHandler()

SceUID sceKernelUnregisterThreadEventHandler ( SceUID  id)

Unregister a thread event handler.

Parameters
id- The thread event handler to unregister
Returns
0 on success, < 0 on error

◆ 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   
)

Variable Documentation

◆ size [1/18]

SceSize SceKernelMppInfo::size

◆ mppId

SceUID SceKernelMppInfo::mppId

◆ name [1/8]

char SceKernelMppInfo::name[32]

◆ attr [1/8]

SceUInt SceKernelMppInfo::attr

◆ bufSize

int SceKernelMppInfo::bufSize

◆ freeSize

int SceKernelMppInfo::freeSize

◆ numSendWaitThreads

int SceKernelMppInfo::numSendWaitThreads

◆ numReceiveWaitThreads

int SceKernelMppInfo::numReceiveWaitThreads

◆ size [2/18]

SceSize SceKernelRWLockOptParam::size

Size of the SceKernelRWLockOptParam structure.

◆ size [3/18]

SceSize SceKernelRWLockInfo::size

Size of the SceKernelRWLockInfo structure.

◆ rwLockId

SceUID SceKernelRWLockInfo::rwLockId

The UID of the rwlock.

◆ name [2/8]

char SceKernelRWLockInfo::name[32]

NULL-terminated name of the rwlock.

◆ attr [2/8]

SceUInt32 SceKernelRWLockInfo::attr

Attributes.

◆ lockCount

SceInt32 SceKernelRWLockInfo::lockCount

The current lock count.

◆ writeOwnerId

SceUID SceKernelRWLockInfo::writeOwnerId

The UID of the current owner of the rwlock with write access, 0 when locked for reads.

◆ numReadWaitThreads

SceUInt32 SceKernelRWLockInfo::numReadWaitThreads

The number of threads waiting on the rwlock for read access.

◆ numWriteWaitThreads

SceUInt32 SceKernelRWLockInfo::numWriteWaitThreads

The number of threads waiting on the rwlock for write access.

◆ size [4/18]

SceSize SceKernelSystemInfo::size

◆ activeCpuMask

SceUInt32 SceKernelSystemInfo::activeCpuMask

◆ []

SceKernelSysClock { ... } ::idleClock

◆ []

SceUInt32 { ... } ::comesOutOfIdleCount

◆ []

SceUInt32 { ... } ::threadSwitchCount

◆ [struct] [1/2]

struct { ... } SceKernelSystemInfo::cpuInfo[4]

◆ size [5/18]

SceSize SceKernelThreadRunStatus::size

◆ [] [1/2]

SceUID { ... } ::processId

◆ [] [1/2]

SceUID { ... } ::threadId

◆ []

int { ... } ::priority

◆ [struct] [2/2]

struct { ... } SceKernelThreadRunStatus::cpuInfo[4]

◆ size [6/18]

SceSize SceKernelThreadOptParam::size

Size of the SceKernelThreadOptParam structure.

◆ attr [3/8]

SceUInt32 SceKernelThreadOptParam::attr

Attributes.

◆ kStackMemType

SceUInt32 SceKernelThreadOptParam::kStackMemType

◆ uStackMemType

SceUInt32 SceKernelThreadOptParam::uStackMemType

◆ uTLSMemType

SceUInt32 SceKernelThreadOptParam::uTLSMemType

◆ uStackMemid

SceUInt32 SceKernelThreadOptParam::uStackMemid

◆ data_0x18

SceUInt32 SceKernelThreadOptParam::data_0x18

◆ size [7/18]

SceSize SceKernelThreadInfo::size

Size of the structure.

◆ processId [2/2]

SceUID SceKernelThreadInfo::processId

The UID of the process where the thread belongs.

◆ name [3/8]

char SceKernelThreadInfo::name[32]

Nul terminated name of the thread.

◆ attr [4/8]

SceUInt32 SceKernelThreadInfo::attr

Thread attributes.

◆ status

SceUInt32 SceKernelThreadInfo::status

Thread status.

◆ entry

SceKernelThreadEntry SceKernelThreadInfo::entry

Thread entry point.

◆ stack

void* SceKernelThreadInfo::stack

Thread stack pointer.

◆ stackSize

SceInt32 SceKernelThreadInfo::stackSize

Thread stack size.

◆ initPriority

SceInt32 SceKernelThreadInfo::initPriority

Initial priority.

◆ currentPriority

SceInt32 SceKernelThreadInfo::currentPriority

Current priority.

◆ initCpuAffinityMask

SceInt32 SceKernelThreadInfo::initCpuAffinityMask

Initial CPU affinity mask.

◆ currentCpuAffinityMask

SceInt32 SceKernelThreadInfo::currentCpuAffinityMask

Current CPU affinity mask.

◆ currentCpuId

SceInt32 SceKernelThreadInfo::currentCpuId

Current CPU ID.

◆ lastExecutedCpuId

SceInt32 SceKernelThreadInfo::lastExecutedCpuId

Last executed CPU ID.

◆ waitType

SceUInt32 SceKernelThreadInfo::waitType

Wait type.

◆ waitId

SceUID SceKernelThreadInfo::waitId

Wait id.

◆ exitStatus

SceInt32 SceKernelThreadInfo::exitStatus

Exit status of the thread.

◆ runClocks

SceKernelSysClock SceKernelThreadInfo::runClocks

Number of clock cycles run.

◆ intrPreemptCount

SceUInt32 SceKernelThreadInfo::intrPreemptCount

Interrupt preemption count.

◆ threadPreemptCount

SceUInt32 SceKernelThreadInfo::threadPreemptCount

Thread preemption count.

◆ threadReleaseCount

SceUInt32 SceKernelThreadInfo::threadReleaseCount

Thread release count.

◆ changeCpuCount

SceInt32 SceKernelThreadInfo::changeCpuCount

Number of CPUs to which the thread is moved.

◆ fNotifyCallback

SceInt32 SceKernelThreadInfo::fNotifyCallback

Function notify callback UID.

◆ reserved

SceInt32 SceKernelThreadInfo::reserved

Reserved.

◆ size [8/18]

SceSize SceKernelCallbackInfo::size

Size of the structure (i.e.

sizeof(SceKernelCallbackInfo))

◆ callbackId

SceUID SceKernelCallbackInfo::callbackId

The UID of the callback.

◆ name [4/8]

char SceKernelCallbackInfo::name[32]

The name given to the callback.

◆ threadId [2/2]

SceUID SceKernelCallbackInfo::threadId

The thread id associated with the callback.

◆ callback

SceKernelCallbackFunction SceKernelCallbackInfo::callback

Pointer to the callback function.

◆ common

void* SceKernelCallbackInfo::common

User supplied argument for the callback.

◆ notifyCount

int SceKernelCallbackInfo::notifyCount

Unknown.

◆ notifyArg

int SceKernelCallbackInfo::notifyArg

Unknown.

◆ size [9/18]

SceSize SceKernelSemaOptParam::size

Size of the SceKernelSemaOptParam structure.

◆ size [10/18]

SceSize SceKernelSemaInfo::size

Size of the SceKernelSemaInfo structure.

◆ semaId

SceUID SceKernelSemaInfo::semaId

The UID of the semaphore.

◆ name [5/8]

char SceKernelSemaInfo::name[32]

NUL-terminated name of the semaphore.

◆ attr [5/8]

SceUInt SceKernelSemaInfo::attr

Attributes.

◆ initCount [1/2]

int SceKernelSemaInfo::initCount

The initial count the semaphore was created with.

◆ currentCount [1/2]

int SceKernelSemaInfo::currentCount

The current count.

◆ maxCount

int SceKernelSemaInfo::maxCount

The maximum count.

◆ numWaitThreads [1/4]

int SceKernelSemaInfo::numWaitThreads

The number of threads waiting on the semaphore.

◆ size [11/18]

SceSize SceKernelEventFlagOptParam::size

◆ size [12/18]

SceSize SceKernelEventFlagInfo::size

◆ evfId

SceUID SceKernelEventFlagInfo::evfId

◆ name [6/8]

char SceKernelEventFlagInfo::name[32]

◆ attr [6/8]

SceUInt SceKernelEventFlagInfo::attr

◆ initPattern

SceUInt SceKernelEventFlagInfo::initPattern

◆ currentPattern

SceUInt SceKernelEventFlagInfo::currentPattern

◆ numWaitThreads [2/4]

int SceKernelEventFlagInfo::numWaitThreads

◆ data [1/2]

SceInt32 SceKernelLwCondWork::data[4]

◆ size [13/18]

SceSize SceKernelLwCondOptParam::size

◆ data [2/2]

SceInt64 SceKernelLwMutexWork::data[4]

◆ size [14/18]

SceSize SceKernelLwMutexOptParam::size

◆ size [15/18]

SceSize SceKernelMutexOptParam::size

Size of the SceKernelMutexOptParam structure.

◆ ceilingPriority

int SceKernelMutexOptParam::ceilingPriority

◆ size [16/18]

SceSize SceKernelMutexInfo::size

Size of the SceKernelMutexInfo structure.

◆ mutexId [1/2]

SceUID SceKernelMutexInfo::mutexId

The UID of the mutex.

◆ name [7/8]

char SceKernelMutexInfo::name[32]

NUL-terminated name of the mutex.

◆ attr [7/8]

SceUInt SceKernelMutexInfo::attr

Attributes.

◆ initCount [2/2]

int SceKernelMutexInfo::initCount

The initial count the mutex was created with.

◆ currentCount [2/2]

int SceKernelMutexInfo::currentCount

The current count.

◆ currentOwnerId

SceUID SceKernelMutexInfo::currentOwnerId

The UID of the current owner of the mutex.

◆ numWaitThreads [3/4]

int SceKernelMutexInfo::numWaitThreads

The number of threads waiting on the mutex.

◆ size [17/18]

SceSize SceKernelCondOptParam::size

Size of the SceKernelCondOptParam structure.

◆ size [18/18]

SceSize SceKernelCondInfo::size

Size of the SceKernelCondInfo structure.

◆ condId

SceUID SceKernelCondInfo::condId

The UID of the condition variable.

◆ name [8/8]

char SceKernelCondInfo::name[32]

NUL-terminated name of the condition variable.

◆ attr [8/8]

SceUInt SceKernelCondInfo::attr

Attributes.

◆ mutexId [2/2]

SceUID SceKernelCondInfo::mutexId

Mutex associated with the condition variable.

◆ numWaitThreads [4/4]

int SceKernelCondInfo::numWaitThreads

The number of threads waiting on the condition variable.