PSP2SDK
dirty-f9e4f2d
The free SDK for PSP2
|
Header file related to thread management. More...
#include <psp2/types.h>
Go to the source code of this file.
Data Structures | |
struct | SceKernelThreadOptParam |
struct | SceKernelThreadInfo |
struct | SceKernelThreadRunStatus |
struct | SceKernelSemaOptParam |
struct | SceKernelSemaInfo |
struct | SceKernelMutexOptParam |
struct | SceKernelMutexInfo |
struct | SceKernelEventFlagInfo |
struct | SceKernelEventFlagOptParam |
struct | SceKernelCallbackInfo |
struct | SceKernelMppInfo |
struct | SceKernelSystemInfo |
Typedefs | |
typedef SceUInt64 | SceKernelSysClock |
typedef int(* | SceKernelThreadEntry )(SceSize args, void *argp) |
typedef struct SceKernelThreadOptParam | SceKernelThreadOptParam |
typedef struct SceKernelThreadInfo | SceKernelThreadInfo |
typedef struct SceKernelThreadRunStatus | SceKernelThreadRunStatus |
typedef enum Psp2ThreadStatus | Psp2ThreadStatus |
typedef struct SceKernelSemaOptParam | SceKernelSemaOptParam |
typedef struct SceKernelSemaInfo | SceKernelSemaInfo |
typedef struct SceKernelMutexOptParam | SceKernelMutexOptParam |
typedef struct SceKernelMutexInfo | SceKernelMutexInfo |
typedef struct SceKernelEventFlagInfo | SceKernelEventFlagInfo |
typedef struct SceKernelEventFlagOptParam | SceKernelEventFlagOptParam |
typedef enum Psp2EventFlagAttributes | Psp2EventFlagAttributes |
typedef enum Psp2EventFlagWaitTypes | Psp2EventFlagWaitTypes |
typedef int(* | SceKernelCallbackFunction )(int notifyId, int notifyCount, int notifyArg, void *common) |
typedef struct SceKernelCallbackInfo | SceKernelCallbackInfo |
typedef struct SceKernelMppInfo | SceKernelMppInfo |
typedef struct SceKernelSystemInfo | SceKernelSystemInfo |
typedef enum SceKernelIdListType | SceKernelIdListType |
Enumerations | |
enum | Psp2ThreadStatus { PSP2_THREAD_RUNNING = 1, PSP2_THREAD_READY = 2, PSP2_THREAD_WAITING = 4, PSP2_THREAD_SUSPEND = 8, PSP2_THREAD_STOPPED = 16, PSP2_THREAD_KILLED = 32 } |
enum | Psp2EventFlagAttributes { PSP2_EVENT_WAITMULTIPLE = 0x200 } |
enum | Psp2EventFlagWaitTypes { PSP2_EVENT_WAITAND = 0, PSP2_EVENT_WAITOR = 1, PSP2_EVENT_WAITCLEAR = 0x20 } |
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 } |
Functions | |
SceUID | sceKernelCreateThread (const char *name, SceKernelThreadEntry entry, int initPriority, int stackSize, SceUInt attr, int cpuAffinityMask, const SceKernelThreadOptParam *option) |
int | sceKernelDeleteThread (SceUID thid) |
int | sceKernelStartThread (SceUID thid, SceSize arglen, void *argp) |
int | sceKernelExitThread (int status) |
int | sceKernelExitDeleteThread (int status) |
int | sceKernelWaitThreadEnd (SceUID thid, int *stat, SceUInt *timeout) |
int | sceKernelWaitThreadEndCB (SceUID thid, int *stat, SceUInt *timeout) |
int | sceKernelDelayThread (SceUInt delay) |
int | sceKernelDelayThreadCB (SceUInt delay) |
int | sceKernelChangeCurrentThreadAttr (int unknown, SceUInt attr) |
int | sceKernelChangeThreadPriority (SceUID thid, int priority) |
int | sceKernelRotateThreadReadyQueue (int priority) |
int | sceKernelReleaseWaitThread (SceUID thid) |
int | sceKernelGetThreadId (void) |
int | sceKernelGetThreadCurrentPriority (void) |
int | sceKernelGetThreadExitStatus (SceUID thid) |
int | sceKernelCheckThreadStack (void) |
int | sceKernelGetThreadStackFreeSize (SceUID thid) |
int | sceKernelGetThreadInfo (SceUID thid, SceKernelThreadInfo *info) |
int | sceKernelGetThreadRunStatus (SceUID thid, SceKernelThreadRunStatus *status) |
SceUID | sceKernelCreateSema (const char *name, SceUInt attr, int initVal, int maxVal, SceKernelSemaOptParam *option) |
int | sceKernelDeleteSema (SceUID semaid) |
int | sceKernelSignalSema (SceUID semaid, int signal) |
int | sceKernelWaitSema (SceUID semaid, int signal, SceUInt *timeout) |
int | sceKernelWaitSemaCB (SceUID semaid, int signal, SceUInt *timeout) |
int | sceKernelPollSema (SceUID semaid, int signal) |
int | sceKernelCancelSema (SceUID semaid, int setCount, int *numWaitThreads) |
int | sceKernelGetSemaInfo (SceUID semaid, SceKernelSemaInfo *info) |
SceUID | sceKernelCreateMutex (const char *name, SceUInt attr, int initCount, SceKernelMutexOptParam *option) |
int | sceKernelDeleteMutex (SceUID mutexid) |
int | sceKernelOpenMutex (const char *name) |
int | sceKernelCloseMutex (SceUID mutexid) |
int | sceKernelLockMutex (SceUID mutexid, int lockCount, unsigned int *timeout) |
int | sceKernelLockMutexCB (SceUID mutexid, int lockCount, unsigned int *timeout) |
int | sceKernelTryLockMutex (SceUID mutexid, int lockCount) |
int | sceKernelUnlockMutex (SceUID mutexid, int unlockCount) |
int | sceKernelCancelMutex (SceUID mutexid, int newCount, int *numWaitThreads) |
int | sceKernelGetMutexInfo (SceUID mutexid, SceKernelMutexInfo info) |
SceUID | sceKernelCreateEventFlag (const char *name, int attr, int bits, SceKernelEventFlagOptParam *opt) |
int | sceKernelSetEventFlag (SceUID evid, unsigned int bits) |
int | sceKernelClearEventFlag (SceUID evid, unsigned int bits) |
int | sceKernelPollEventFlag (int evid, unsigned int bits, unsigned int wait, unsigned int *outBits) |
int | sceKernelWaitEventFlag (int evid, unsigned int bits, unsigned int wait, unsigned int *outBits, SceUInt *timeout) |
int | sceKernelWaitEventFlagCB (int evid, unsigned int bits, unsigned int wait, unsigned int *outBits, SceUInt *timeout) |
int | sceKernelDeleteEventFlag (int evid) |
int | sceKernelGetEventFlagInfo (SceUID event, SceKernelEventFlagInfo *info) |
int | sceKernelCreateCallback (const char *name, unsigned int attr, SceKernelCallbackFunction func, void *arg) |
int | sceKernelGetCallbackInfo (SceUID cb, SceKernelCallbackInfo *infop) |
int | sceKernelDeleteCallback (SceUID cb) |
int | sceKernelNotifyCallback (SceUID cb, int arg2) |
int | sceKernelCancelCallback (SceUID cb) |
int | sceKernelGetCallbackCount (SceUID cb) |
int | sceKernelCheckCallback (void) |
SceUID | sceKernelCreateMsgPipe (const char *name, int part, int attr, void *unk1, void *opt) |
int | sceKernelDeleteMsgPipe (SceUID uid) |
int | sceKernelSendMsgPipe (SceUID uid, void *message, unsigned int size, int unk1, void *unk2, unsigned int *timeout) |
int | sceKernelSendMsgPipeCB (SceUID uid, void *message, unsigned int size, int unk1, void *unk2, unsigned int *timeout) |
int | sceKernelTrySendMsgPipe (SceUID uid, void *message, unsigned int size, int unk1, void *unk2) |
int | sceKernelReceiveMsgPipe (SceUID uid, void *message, unsigned int size, int unk1, void *unk2, unsigned int *timeout) |
int | sceKernelReceiveMsgPipeCB (SceUID uid, void *message, unsigned int size, int unk1, void *unk2, unsigned int *timeout) |
int | sceKernelTryReceiveMsgPipe (SceUID uid, void *message, unsigned int size, int unk1, void *unk2) |
int | sceKernelCancelMsgPipe (SceUID uid, int *psend, int *precv) |
int | sceKernelGetMsgPipeInfo (SceUID uid, SceKernelMppInfo *info) |
int | sceKernelGetSystemInfo (SceKernelSystemInfo *info) |
SceKernelIdListType | sceKernelGetThreadmgrUIDClass (SceUID uid) |
Header file related to thread management.
Copyright (C) 2015 PSP2SDK Project
This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
typedef enum Psp2EventFlagAttributes Psp2EventFlagAttributes |
Event flag creation attributes
typedef enum Psp2EventFlagWaitTypes Psp2EventFlagWaitTypes |
Event flag wait types
typedef int(* SceKernelCallbackFunction)(int notifyId, int notifyCount, int notifyArg, void *common) |
Callback function prototype
typedef struct SceKernelCallbackInfo SceKernelCallbackInfo |
Structure to hold the status information for a callback
typedef struct SceKernelEventFlagInfo SceKernelEventFlagInfo |
Structure to hold the event flag information
typedef enum SceKernelIdListType SceKernelIdListType |
Threadmgr types
typedef struct SceKernelMppInfo SceKernelMppInfo |
Message Pipe status info
typedef struct SceKernelMutexInfo SceKernelMutexInfo |
Current state of a mutex.
typedef struct SceKernelMutexOptParam SceKernelMutexOptParam |
Additional options used when creating mutexes.
typedef struct SceKernelSemaInfo SceKernelSemaInfo |
Current state of a semaphore.
typedef struct SceKernelSemaOptParam SceKernelSemaOptParam |
Additional options used when creating semaphores.
typedef SceUInt64 SceKernelSysClock |
64-bit system clock type.
typedef struct SceKernelThreadInfo SceKernelThreadInfo |
Structure to hold the status information for a thread
typedef struct SceKernelThreadOptParam SceKernelThreadOptParam |
Additional options used when creating threads.
typedef struct SceKernelThreadRunStatus SceKernelThreadRunStatus |
Statistics about a running thread.
enum SceKernelIdListType |
Threadmgr types
int sceKernelCancelCallback | ( | SceUID | cb | ) |
Cancel a callback ?
cb | - The UID of the specified callback |
int sceKernelCancelMsgPipe | ( | SceUID | uid, |
int * | psend, | ||
int * | precv | ||
) |
Cancel a message pipe
uid | - UID of the pipe to cancel |
psend | - Receive number of sending threads? |
precv | - Receive number of receiving threads? |
int sceKernelCancelMutex | ( | SceUID | mutexid, |
int | newCount, | ||
int * | numWaitThreads | ||
) |
Cancels a mutex
mutexid | - The mutex id returned from sceKernelCreateMutex |
newCount | - The new lock count of the mutex |
numWaitThreads | - Number of threads waiting for the mutex |
int sceKernelCancelSema | ( | SceUID | semaid, |
int | setCount, | ||
int * | numWaitThreads | ||
) |
Cancels a semaphore
semaid | - The sema id returned from sceKernelCreateSema |
setCount | - The new lock count of the semaphore |
numWaitThreads | - Number of threads waiting for the semaphore |
int sceKernelChangeCurrentThreadAttr | ( | int | unknown, |
SceUInt | attr | ||
) |
Modify the attributes of the current thread.
unknown | - Set to 0. |
attr | - The thread attributes to modify. One of ::Psp2ThreadAttributes. |
int sceKernelChangeThreadPriority | ( | SceUID | thid, |
int | priority | ||
) |
Change the threads current priority.
thid | - The ID of the thread (from sceKernelCreateThread or sceKernelGetThreadId) |
priority | - The new priority (the lower the number the higher the priority) |
int thid = sceKernelGetThreadId(); // Change priority of current thread to 16 sceKernelChangeThreadPriority(thid, 16);
int sceKernelCheckCallback | ( | void | ) |
Check callback ?
int sceKernelCheckThreadStack | ( | void | ) |
Check the thread stack?
int sceKernelClearEventFlag | ( | SceUID | evid, |
unsigned int | bits | ||
) |
Clear a event flag bit pattern
evid | - The event id returned by sceKernelCreateEventFlag |
bits | - The bits to clean |
int sceKernelCloseMutex | ( | SceUID | mutexid | ) |
Close a mutex
mutexid | - The mutex id returned from sceKernelCreateMutex |
int sceKernelCreateCallback | ( | const char * | name, |
unsigned int | attr, | ||
SceKernelCallbackFunction | func, | ||
void * | arg | ||
) |
Create callback
int cbid; cbid = sceKernelCreateCallback("Exit Callback", exit_cb, NULL);
name | - A textual name for the callback |
func | - A pointer to a function that will be called as the callback |
arg | - Argument for the callback ? |
SceUID sceKernelCreateEventFlag | ( | const char * | name, |
int | attr, | ||
int | bits, | ||
SceKernelEventFlagOptParam * | opt | ||
) |
Create an event flag.
name | - The name of the event flag. |
attr | - Attributes from Psp2EventFlagAttributes |
bits | - Initial bit pattern. |
opt | - Options, set to NULL |
int evid; evid = sceKernelCreateEventFlag("wait_event", 0, 0, 0);
SceUID sceKernelCreateMsgPipe | ( | const char * | name, |
int | part, | ||
int | attr, | ||
void * | unk1, | ||
void * | opt | ||
) |
Create a message pipe
name | - Name of the pipe |
part | - ID of the memory partition |
attr | - Set to 0? |
unk1 | - Unknown |
opt | - Message pipe options (set to NULL) |
SceUID sceKernelCreateMutex | ( | const char * | name, |
SceUInt | attr, | ||
int | initCount, | ||
SceKernelMutexOptParam * | option | ||
) |
Creates a new mutex
int mutexid; mutexid = sceKernelCreateMutex("MyMutex", 0, 1, 1, 0);
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) |
SceUID sceKernelCreateSema | ( | const char * | name, |
SceUInt | attr, | ||
int | initVal, | ||
int | maxVal, | ||
SceKernelSemaOptParam * | option | ||
) |
Creates a new semaphore
int semaid; semaid = sceKernelCreateSema("MyMutex", 0, 1, 1, 0);
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) |
SceUID sceKernelCreateThread | ( | const char * | name, |
SceKernelThreadEntry | entry, | ||
int | initPriority, | ||
int | stackSize, | ||
SceUInt | attr, | ||
int | cpuAffinityMask, | ||
const SceKernelThreadOptParam * | option | ||
) |
Create a thread
SceUID thid; thid = sceKernelCreateThread("my_thread", threadFunc, 0x10000100, 0x10000, 0, 0, NULL);
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 ::Psp2ThreadAttributes. |
cpuAffinityMask | - The CPU affinity mask |
option | - Additional options specified by SceKernelThreadOptParam. |
int sceKernelDelayThread | ( | SceUInt | delay | ) |
Delay the current thread by a specified number of microseconds
delay | - Delay in microseconds. |
sceKernelDelayThread(1000000); // Delay for a second
int sceKernelDelayThreadCB | ( | SceUInt | delay | ) |
Delay the current thread by a specified number of microseconds and handle any callbacks.
delay | - Delay in microseconds. |
sceKernelDelayThread(1000000); // Delay for a second
int sceKernelDeleteCallback | ( | SceUID | cb | ) |
Delete a callback
cb | - The UID of the specified callback |
int sceKernelDeleteEventFlag | ( | int | evid | ) |
Delete an event flag
evid | - The event id returned by sceKernelCreateEventFlag. |
int sceKernelDeleteMsgPipe | ( | SceUID | uid | ) |
Delete a message pipe
uid | - The UID of the pipe |
int sceKernelDeleteMutex | ( | SceUID | mutexid | ) |
Destroy a mutex
mutexid | - The mutex id returned from sceKernelCreateMutex |
int sceKernelDeleteSema | ( | SceUID | semaid | ) |
Destroy a semaphore
semaid | - The semaid returned from a previous create call. |
int sceKernelDeleteThread | ( | SceUID | thid | ) |
Delate a thread
thid | - UID of the thread to be deleted. |
int sceKernelExitDeleteThread | ( | int | status | ) |
Exit a thread and delete itself.
status | - Exit status |
int sceKernelExitThread | ( | int | status | ) |
Exit a thread
status | - Exit status. |
int sceKernelGetCallbackCount | ( | SceUID | cb | ) |
Get the callback count
cb | - The UID of the specified callback |
int sceKernelGetCallbackInfo | ( | SceUID | cb, |
SceKernelCallbackInfo * | infop | ||
) |
Gets the status of a specified callback.
cb | - The UID of the callback to retrieve info for. |
status | - Pointer to a status structure. The size parameter should be initialised before calling. |
int sceKernelGetEventFlagInfo | ( | SceUID | event, |
SceKernelEventFlagInfo * | info | ||
) |
Get the status of an event flag.
event | - The UID of the event. |
status | - A pointer to a SceKernelEventFlagInfo structure. |
int sceKernelGetMsgPipeInfo | ( | SceUID | uid, |
SceKernelMppInfo * | info | ||
) |
Get the status of a Message Pipe
uid | - The uid of the Message Pipe |
info | - Pointer to a SceKernelMppInfo structure |
int sceKernelGetMutexInfo | ( | SceUID | mutexid, |
SceKernelMutexInfo | info | ||
) |
Retrieve information about a mutex.
mutexid | - UID of the mutex to retrieve info for. |
info | - Pointer to a SceKernelMutexInfo struct to receive the info. |
int sceKernelGetSemaInfo | ( | SceUID | semaid, |
SceKernelSemaInfo * | info | ||
) |
Retrieve information about a semaphore.
semaid | - UID of the semaphore to retrieve info for. |
info | - Pointer to a SceKernelSemaInfo struct to receive the info. |
int sceKernelGetSystemInfo | ( | SceKernelSystemInfo * | info | ) |
Get the system information
info | - Pointer to a SceKernelSystemInfo structure |
int sceKernelGetThreadCurrentPriority | ( | void | ) |
Get the current priority of the thread you are in.
int sceKernelGetThreadExitStatus | ( | SceUID | thid | ) |
Get the exit status of a thread.
thid | - The UID of the thread to check. |
int sceKernelGetThreadId | ( | void | ) |
Get the current thread Id
int sceKernelGetThreadInfo | ( | SceUID | thid, |
SceKernelThreadInfo * | info | ||
) |
Get the status information for the specified thread.
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. |
SceKernelThreadInfo status; status.size = sizeof(SceKernelThreadInfo); if(sceKernelGetThreadInfo(thid, &status) == 0) { Do something... }
Get the type of a threadman uid
uid | - The uid to get the type from |
int sceKernelGetThreadRunStatus | ( | SceUID | thid, |
SceKernelThreadRunStatus * | status | ||
) |
Retrive the runtime status of a thread.
thid | - UID of the thread to retrive status. |
status | - Pointer to a SceKernelThreadRunStatus struct to receive the runtime status. |
int sceKernelGetThreadStackFreeSize | ( | SceUID | thid | ) |
Get the free stack size for a thread.
thid | - The thread ID. Seem to take current thread if set to 0. |
int sceKernelLockMutex | ( | SceUID | mutexid, |
int | lockCount, | ||
unsigned int * | timeout | ||
) |
Lock a mutex
mutexid | - The mutex id returned from sceKernelCreateMutex |
lockCount | - The value to increment to the lock count of the mutex |
timeout | - Timeout in microseconds (assumed) |
int sceKernelLockMutexCB | ( | SceUID | mutexid, |
int | lockCount, | ||
unsigned int * | timeout | ||
) |
Lock a mutex and handle callbacks if necessary.
mutexid | - The mutex id returned from sceKernelCreateMutex |
lockCount | - The value to increment to the lock count of the mutex |
timeout | - Timeout in microseconds (assumed) |
int sceKernelNotifyCallback | ( | SceUID | cb, |
int | arg2 | ||
) |
Notify a callback
cb | - The UID of the specified callback |
arg2 | - Passed as arg2 into the callback function |
int sceKernelOpenMutex | ( | const char * | name | ) |
Open a mutex
name | - The name of the mutex to open |
int sceKernelPollEventFlag | ( | int | evid, |
unsigned int | bits, | ||
unsigned int | wait, | ||
unsigned int * | outBits | ||
) |
Poll an event flag for a given bit pattern.
evid | - The event id returned by sceKernelCreateEventFlag. |
bits | - The bit pattern to poll for. |
wait | - Wait type, one or more of Psp2EventFlagWaitTypes or'ed together |
outBits | - The bit pattern that was matched. |
int sceKernelPollSema | ( | SceUID | semaid, |
int | signal | ||
) |
Poll a sempahore.
semaid | - UID of the semaphore to poll. |
signal | - The value to test for. |
int sceKernelReceiveMsgPipe | ( | SceUID | uid, |
void * | message, | ||
unsigned int | size, | ||
int | unk1, | ||
void * | unk2, | ||
unsigned int * | timeout | ||
) |
Receive a message from a pipe
uid | - The UID of the pipe |
message | - Pointer to the message |
size | - Size of the message |
unk1 | - Unknown |
unk2 | - Unknown |
timeout | - Timeout for receive |
int sceKernelReceiveMsgPipeCB | ( | SceUID | uid, |
void * | message, | ||
unsigned int | size, | ||
int | unk1, | ||
void * | unk2, | ||
unsigned int * | timeout | ||
) |
Receive a message from a pipe (with callback)
uid | - The UID of the pipe |
message | - Pointer to the message |
size | - Size of the message |
unk1 | - Unknown |
unk2 | - Unknown |
timeout | - Timeout for receive |
int sceKernelReleaseWaitThread | ( | SceUID | thid | ) |
Release a thread in the wait state.
thid | - The UID of the thread. |
int sceKernelRotateThreadReadyQueue | ( | int | priority | ) |
Rotate thread ready queue at a set priority
priority | - The priority of the queue |
int sceKernelSendMsgPipe | ( | SceUID | uid, |
void * | message, | ||
unsigned int | size, | ||
int | unk1, | ||
void * | unk2, | ||
unsigned int * | timeout | ||
) |
Send a message to a pipe
uid | - The UID of the pipe |
message | - Pointer to the message |
size | - Size of the message |
unk1 | - Unknown |
unk2 | - Unknown |
timeout | - Timeout for send |
int sceKernelSendMsgPipeCB | ( | SceUID | uid, |
void * | message, | ||
unsigned int | size, | ||
int | unk1, | ||
void * | unk2, | ||
unsigned int * | timeout | ||
) |
Send a message to a pipe (with callback)
uid | - The UID of the pipe |
message | - Pointer to the message |
size | - Size of the message |
unk1 | - Unknown |
unk2 | - Unknown |
timeout | - Timeout for send |
int sceKernelSetEventFlag | ( | SceUID | evid, |
unsigned int | bits | ||
) |
Set an event flag bit pattern.
evid | - The event id returned by sceKernelCreateEventFlag. |
bits | - The bit pattern to set. |
int sceKernelSignalSema | ( | SceUID | semaid, |
int | signal | ||
) |
Send a signal to a semaphore
// Signal the sema sceKernelSignalSema(semaid, 1);
semaid | - The sema id returned from sceKernelCreateSema |
signal | - The amount to signal the sema (i.e. if 2 then increment the sema by 2) |
int sceKernelStartThread | ( | SceUID | thid, |
SceSize | arglen, | ||
void * | argp | ||
) |
Start a created thread
thid | - Thread id from sceKernelCreateThread |
arglen | - Length of the data pointed to by argp, in bytes |
argp | - Pointer to the arguments. |
int sceKernelTryLockMutex | ( | SceUID | mutexid, |
int | lockCount | ||
) |
Try to lock a mutex (non-blocking)
mutexid | - The mutex id returned from sceKernelCreateMutex |
lockCount | - The value to increment to the lock count of the mutex |
int sceKernelTryReceiveMsgPipe | ( | SceUID | uid, |
void * | message, | ||
unsigned int | size, | ||
int | unk1, | ||
void * | unk2 | ||
) |
Receive a message from a pipe
uid | - The UID of the pipe |
message | - Pointer to the message |
size | - Size of the message |
unk1 | - Unknown |
unk2 | - Unknown |
int sceKernelTrySendMsgPipe | ( | SceUID | uid, |
void * | message, | ||
unsigned int | size, | ||
int | unk1, | ||
void * | unk2 | ||
) |
Try to send a message to a pipe
uid | - The UID of the pipe |
message | - Pointer to the message |
size | - Size of the message |
unk1 | - Unknown |
unk2 | - Unknown |
int sceKernelUnlockMutex | ( | SceUID | mutexid, |
int | unlockCount | ||
) |
Try to unlock a mutex (non-blocking)
mutexid | - The mutex id returned from sceKernelCreateMutex |
unlockCount | - The value to decrement to the lock count of the mutex |
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.
evid | - The event id returned by sceKernelCreateEventFlag. |
bits | - The bit pattern to poll for. |
wait | - Wait type, one or more of Psp2EventFlagWaitTypes or'ed together |
outBits | - The bit pattern that was matched. |
timeout | - Timeout in microseconds |
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.
evid | - The event id returned by sceKernelCreateEventFlag. |
bits | - The bit pattern to poll for. |
wait | - Wait type, one or more of Psp2EventFlagWaitTypes or'ed together |
outBits | - The bit pattern that was matched. |
timeout | - Timeout in microseconds |
int sceKernelWaitSema | ( | SceUID | semaid, |
int | signal, | ||
SceUInt * | timeout | ||
) |
Lock a semaphore
sceKernelWaitSema(semaid, 1, 0);
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). |
int sceKernelWaitSemaCB | ( | SceUID | semaid, |
int | signal, | ||
SceUInt * | timeout | ||
) |
Lock a semaphore and handle callbacks if necessary.
sceKernelWaitSemaCB(semaid, 1, 0);
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). |
int sceKernelWaitThreadEnd | ( | SceUID | thid, |
int * | stat, | ||
SceUInt * | timeout | ||
) |
Wait until a thread has ended.
thid | - Id of the thread to wait for. |
stat | - Exit status. |
timeout | - Timeout in microseconds (assumed). |
int sceKernelWaitThreadEndCB | ( | SceUID | thid, |
int * | stat, | ||
SceUInt * | timeout | ||
) |
Wait until a thread has ended and handle callbacks if necessary.
thid | - Id of the thread to wait for. |
stat | - Exit status. |
timeout | - Timeout in microseconds (assumed). |