PSPSDK 2025-05-14
Loading...
Searching...
No Matches
pspthreadman.h
Go to the documentation of this file.
1/*
2 * PSP Software Development Kit - https://github.com/pspdev
3 * -----------------------------------------------------------------------
4 * Licensed under the BSD license, see LICENSE in PSPSDK root for details.
5 *
6 * pspthreadman.h - Library imports for the kernel threading library.
7 *
8 * Copyright (c) 2005 Marcus R. Brown <mrbrown@ocgnet.org>
9 * Copyright (c) 2005 James Forshaw <tyranid@gmail.com>
10 * Copyright (c) 2005 John Kelley <ps2dev@kelley.ca>
11 * Copyright (c) 2005 Florin Sasu
12 *
13 */
14#ifndef __THREADMAN_H__
15#define __THREADMAN_H__
16
17#include <psptypes.h>
18#include <pspkerneltypes.h>
19/* Include for profile register definitions */
20#include <pspdebug.h>
21
22/* Note: Some of the structures, types, and definitions in this file were
23 extrapolated from symbolic debugging information found in the Japanese
24 version of Puzzle Bobble. */
25
30#ifdef __cplusplus
31extern "C" {
32#endif
33
43
63
64/* Maintained for compatibility with older versions of PSPSDK. */
65#define THREAD_ATTR_VFPU PSP_THREAD_ATTR_VFPU
66#define THREAD_ATTR_USER PSP_THREAD_ATTR_USER
67
68
69/* Threads. */
70
71typedef int (*SceKernelThreadEntry)(SceSize args, void *argp);
72
80
122
138
139/* Sure there must be more than this, but haven't seen them */
141{
147 PSP_THREAD_KILLED = 32, /* Thread manager has killed the thread (stack overflow) */
148};
149
168SceUID sceKernelCreateThread(const char *name, SceKernelThreadEntry entry, int initPriority,
169 int stackSize, SceUInt attr, SceKernelThreadOptParam *option);
170
179
187int sceKernelStartThread(SceUID thid, SceSize arglen, void *argp);
188
194int sceKernelExitThread(int status);
195
202
211
220
227
237
244
255
264
273
282
291
301
311
323
335
344
354
364
380int sceKernelChangeThreadPriority(SceUID thid, int priority);
381
390
399
406
413
422
429
439
458
468
469
470/* Semaphores. */
471
477
497
514SceUID sceKernelCreateSema(const char *name, SceUInt attr, int initVal, int maxVal, SceKernelSemaOptParam *option);
515
523
538int sceKernelSignalSema(SceUID semaid, int signal);
539
554int sceKernelWaitSema(SceUID semaid, int signal, SceUInt *timeout);
555
570int sceKernelWaitSemaCB(SceUID semaid, int signal, SceUInt *timeout);
571
580int sceKernelPollSema(SceUID semaid, int signal);
581
591
602
618
630int sceKernelCreateLwMutex(SceLwMutexWorkarea *workarea, const char *name, SceUInt32 attr, int initialCount, u32 *optionsPtr);
631
640
649int sceKernelTryLockLwMutex(SceLwMutexWorkarea *workarea, int lockCount);
650
660int sceKernelLockLwMutex(SceLwMutexWorkarea *workarea, int lockCount, unsigned int *pTimeout);
661
670int sceKernelUnlockLwMutex(SceLwMutexWorkarea *workarea, int lockCount);
671
672/* Event flags. */
673
683
687
689
698
709
725SceUID sceKernelCreateEventFlag(const char *name, int attr, int bits, SceKernelEventFlagOptParam *opt);
726
736
746
756int sceKernelPollEventFlag(int evid, u32 bits, u32 wait, u32 *outBits);
757
768int sceKernelWaitEventFlag(int evid, u32 bits, u32 wait, u32 *outBits, SceUInt *timeout);
769
780int sceKernelWaitEventFlagCB(int evid, u32 bits, u32 wait, u32 *outBits, SceUInt *timeout);
781
790
800
801
802/* Message boxes. */
803
809
827
839
854SceUID sceKernelCreateMbx(const char *name, SceUInt attr, SceKernelMbxOptParam *option);
855
863
886int sceKernelSendMbx(SceUID mbxid, void *message);
887
904int sceKernelReceiveMbx(SceUID mbxid, void **pmessage, SceUInt *timeout);
905
922int sceKernelReceiveMbxCB(SceUID mbxid, void **pmessage, SceUInt *timeout);
923
939int sceKernelPollMbx(SceUID mbxid, void **pmessage);
940
956int sceKernelCancelReceiveMbx(SceUID mbxid, int *pnum);
957
967
968
969/* Alarms. */
970
972typedef SceUInt (*SceKernelAlarmHandler)(void *common);
973
986
996
1007
1016
1026
1027/* Callbacks. */
1028
1030typedef int (*SceKernelCallbackFunction)(int arg1, int arg2, void *arg);
1031
1049
1065int sceKernelCreateCallback(const char *name, SceKernelCallbackFunction func, void *arg);
1066
1077
1086
1096
1105
1114
1121
1122/* Misc. */
1123
1143
1155int sceKernelGetThreadmanIdList(enum SceKernelIdListType type, SceUID *readbuf, int readbufsize, int *idcount);
1156
1172
1181
1182
1194SceUID sceKernelCreateMsgPipe(const char *name, int part, int attr, void *unk1, void *opt);
1195
1204
1217int sceKernelSendMsgPipe(SceUID uid, void *message, unsigned int size, int unk1, void *unk2, unsigned int *timeout);
1218
1231int sceKernelSendMsgPipeCB(SceUID uid, void *message, unsigned int size, int unk1, void *unk2, unsigned int *timeout);
1232
1244int sceKernelTrySendMsgPipe(SceUID uid, void *message, unsigned int size, int unk1, void *unk2);
1245
1258int sceKernelReceiveMsgPipe(SceUID uid, void *message, unsigned int size, int unk1, void *unk2, unsigned int *timeout);
1259
1272int sceKernelReceiveMsgPipeCB(SceUID uid, void *message, unsigned int size, int unk1, void *unk2, unsigned int *timeout);
1273
1285int sceKernelTryReceiveMsgPipe(SceUID uid, void *message, unsigned int size, int unk1, void *unk2);
1286
1296int sceKernelCancelMsgPipe(SceUID uid, int *psend, int *precv);
1297
1308
1318
1319/* VPL Functions */
1320
1324
1336SceUID sceKernelCreateVpl(const char *name, int part, int attr, unsigned int size, struct SceKernelVplOptParam *opt);
1337
1346
1357int sceKernelAllocateVpl(SceUID uid, unsigned int size, void **data, unsigned int *timeout);
1358
1369int sceKernelAllocateVplCB(SceUID uid, unsigned int size, void **data, unsigned int *timeout);
1370
1380int sceKernelTryAllocateVpl(SceUID uid, unsigned int size, void **data);
1381
1390int sceKernelFreeVpl(SceUID uid, void *data);
1391
1400int sceKernelCancelVpl(SceUID uid, int *pnum);
1401
1411
1421
1422/* FPL Functions */
1423
1427
1440int sceKernelCreateFpl(const char *name, int part, int attr, unsigned int size, unsigned int blocks, struct SceKernelFplOptParam *opt);
1441
1450
1460int sceKernelAllocateFpl(SceUID uid, void **data, unsigned int *timeout);
1461
1471int sceKernelAllocateFplCB(SceUID uid, void **data, unsigned int *timeout);
1472
1481int sceKernelTryAllocateFpl(SceUID uid, void **data);
1482
1491int sceKernelFreeFpl(SceUID uid, void *data);
1492
1501int sceKernelCancelFpl(SceUID uid, int *pnum);
1502
1513
1523
1528
1534
1543int sceKernelUSec2SysClock(unsigned int usec, SceKernelSysClock *clock);
1544
1553
1563int sceKernelSysClock2USec(SceKernelSysClock *clock, unsigned int *low, unsigned int *high);
1564
1574int sceKernelSysClock2USecWide(SceInt64 clock, unsigned *low, unsigned int *high);
1575
1584
1591
1597unsigned int sceKernelGetSystemTimeLow(void);
1598
1602
1612
1621
1631
1640
1650
1659
1669
1679
1688
1697
1700
1712
1724
1733
1744
1754
1760
1769
1770typedef int (*SceKernelThreadEventHandler)(int mask, SceUID thid, void *common);
1771
1781
1789
1797
1809SceUID sceKernelRegisterThreadEventHandler(const char *name, SceUID threadID, int mask, SceKernelThreadEventHandler handler, void *common);
1810
1819
1829
1835
1841
1844#ifdef __cplusplus
1845}
1846#endif
1847
1848#endif
int sceKernelDeleteFpl(SceUID uid)
Delete a fixed pool.
int sceKernelReferVplStatus(SceUID uid, SceKernelVplInfo *info)
Get the status of an VPL.
int sceKernelDeleteCallback(SceUID cb)
Delete a callback.
unsigned int sceKernelGetSystemTimeLow(void)
Get the low 32bits of the current system time.
int sceKernelGetThreadmanIdList(enum SceKernelIdListType type, SceUID *readbuf, int readbufsize, int *idcount)
Get a list of UIDs from threadman.
int sceKernelDeleteMbx(SceUID mbxid)
Destroy a messagebox.
int sceKernelDelaySysClockThreadCB(SceKernelSysClock *delay)
Delay the current thread by a specified number of sysclocks handling callbacks.
int sceKernelStartVTimer(SceUID uid)
Start a virtual timer.
struct SceKernelSystemStatus SceKernelSystemStatus
Structure to contain the system status returned by sceKernelReferSystemStatus.
int sceKernelTerminateDeleteThread(SceUID thid)
Terminate and delete a thread.
struct SceKernelSysClock SceKernelSysClock
64-bit system clock type.
int sceKernelGetCallbackCount(SceUID cb)
Get the callback count.
int sceKernelCancelFpl(SceUID uid, int *pnum)
Cancel a pool.
struct SceKernelVTimerInfo SceKernelVTimerInfo
int sceKernelGetVTimerBase(SceUID uid, SceKernelSysClock *base)
Get the timer base.
int sceKernelExitDeleteThread(int status)
Exit a thread and delete itself.
int sceKernelTryLockLwMutex(SceLwMutexWorkarea *workarea, int lockCount)
Try to lock a lightweight mutex.
int sceKernelCancelVTimerHandler(SceUID uid)
Cancel the timer handler.
ThreadEventIds
Definition pspthreadman.h:1783
int sceKernelSuspendDispatchThread(void)
Suspend the dispatch thread.
int sceKernelSetVTimerHandler(SceUID uid, SceKernelSysClock *time, SceKernelVTimerHandler handler, void *common)
Set the timer handler.
struct SceKernelThreadEventHandlerInfo SceKernelThreadEventHandlerInfo
Struct for event handler info.
int(* SceKernelThreadEventHandler)(int mask, SceUID thid, void *common)
Definition pspthreadman.h:1770
ThreadEvents
Definition pspthreadman.h:1791
int sceKernelCancelWakeupThread(SceUID thid)
Cancel a thread that was to be woken with sceKernelWakeupThread.
int sceKernelAllocateVplCB(SceUID uid, unsigned int size, void **data, unsigned int *timeout)
Allocate from the pool (with callback)
int sceKernelReferThreadEventHandlerStatus(SceUID uid, struct SceKernelThreadEventHandlerInfo *info)
Refer the status of an thread event handler.
int sceKernelClearEventFlag(SceUID evid, u32 bits)
Clear a event flag bit pattern.
int sceKernelNotifyCallback(SceUID cb, int arg2)
Notify a callback.
int sceKernelStopVTimer(SceUID uid)
Stop a virtual timer.
int sceKernelWaitSemaCB(SceUID semaid, int signal, SceUInt *timeout)
Lock a semaphore a handle callbacks if necessary.
int sceKernelCreateCallback(const char *name, SceKernelCallbackFunction func, void *arg)
Create callback.
struct SceKernelMbxInfo SceKernelMbxInfo
Current state of a messagebox.
int sceKernelResumeThread(SceUID thid)
Resume a thread previously put into a suspended state with sceKernelSuspendThread.
int sceKernelExitThread(int status)
Exit a thread.
int sceKernelWaitEventFlag(int evid, u32 bits, u32 wait, u32 *outBits, SceUInt *timeout)
Wait for an event flag for a given bit pattern.
SceInt64 sceKernelGetVTimerBaseWide(SceUID uid)
Get the timer base (wide format)
int sceKernelGetSystemTime(SceKernelSysClock *time)
Get the system time.
struct SceKernelMsgPacket SceKernelMsgPacket
Header for a message box packet.
int sceKernelReferSystemStatus(SceKernelSystemStatus *status)
Get the current system status.
struct SceKernelCallbackInfo SceKernelCallbackInfo
Structure to hold the status information for a callback.
int sceKernelDeleteVpl(SceUID uid)
Delete a variable pool.
void _sceKernelExitThread(void)
Exit the thread (probably used as the syscall when the main thread returns.
int sceKernelPollSema(SceUID semaid, int signal)
Poll a sempahore.
int sceKernelCheckThreadStack(void)
Check the thread stack?
struct SceKernelMppInfo SceKernelMppInfo
Message Pipe status info.
int sceKernelGetThreadId(void)
Get the current thread Id.
int sceKernelSetVTimerHandlerWide(SceUID uid, SceInt64 time, SceKernelVTimerHandlerWide handler, void *common)
Set the timer handler (wide mode)
int sceKernelDeleteThread(SceUID thid)
Delate a thread.
enum SceKernelIdListType sceKernelGetThreadmanIdType(SceUID uid)
Get the type of a threadman uid.
int sceKernelGetThreadCurrentPriority(void)
Get the current priority of the thread you are in.
int sceKernelUSec2SysClock(unsigned int usec, SceKernelSysClock *clock)
Convert a number of microseconds to a SceKernelSysClock structure.
int sceKernelSysClock2USecWide(SceInt64 clock, unsigned *low, unsigned int *high)
Convert a wide time to microseconds.
PspEventFlagWaitTypes
Event flag wait types.
Definition pspthreadman.h:701
SceInt64 sceKernelGetSystemTimeWide(void)
Get the system time (wide version)
int sceKernelSendMbx(SceUID mbxid, void *message)
Send a message to a messagebox.
int sceKernelReceiveMbx(SceUID mbxid, void **pmessage, SceUInt *timeout)
Wait for a message to arrive in a messagebox.
SceInt64 sceKernelSetVTimerTimeWide(SceUID uid, SceInt64 time)
Set the timer time (wide format)
int sceKernelUnlockLwMutex(SceLwMutexWorkarea *workarea, int lockCount)
Lock a lightweight mutex.
PspEventFlagAttributes
Event flag creation attributes.
Definition pspthreadman.h:692
int sceKernelCancelMsgPipe(SceUID uid, int *psend, int *precv)
Cancel a message pipe.
struct SceKernelAlarmInfo SceKernelAlarmInfo
Struct containing alarm info.
int sceKernelResumeDispatchThread(int state)
Resume the dispatch thread.
int sceKernelDeleteMsgPipe(SceUID uid)
Delete a message pipe.
int sceKernelDelayThread(SceUInt delay)
Delay the current thread by a specified number of microseconds.
int sceKernelTryAllocateFpl(SceUID uid, void **data)
Try to allocate from the pool.
struct SceKernelSemaInfo SceKernelSemaInfo
Current state of a semaphore.
struct SceKernelMbxOptParam SceKernelMbxOptParam
Additional options used when creating messageboxes.
struct SceKernelSemaOptParam SceKernelSemaOptParam
Additional options used when creating semaphores.
SceUID sceKernelRegisterThreadEventHandler(const char *name, SceUID threadID, int mask, SceKernelThreadEventHandler handler, void *common)
Register a thread event handler.
int sceKernelDelayThreadCB(SceUInt delay)
Delay the current thread by a specified number of microseconds and handle any callbacks.
struct SceKernelThreadOptParam SceKernelThreadOptParam
Additional options used when creating threads.
int sceKernelCreateFpl(const char *name, int part, int attr, unsigned int size, unsigned int blocks, struct SceKernelFplOptParam *opt)
Create a fixed pool.
int sceKernelWakeupThread(SceUID thid)
Wake a thread previously put into the sleep state.
int sceKernelGetThreadExitStatus(SceUID thid)
Get the exit status of a thread.
int sceKernelTryAllocateVpl(SceUID uid, unsigned int size, void **data)
Try to allocate from the pool.
int sceKernelReferVTimerStatus(SceUID uid, SceKernelVTimerInfo *info)
Get the status of a VTimer.
int sceKernelReleaseWaitThread(SceUID thid)
Release a thread in the wait state.
int sceKernelReferThreadRunStatus(SceUID thid, SceKernelThreadRunStatus *status)
Retrive the runtime status of a thread.
int sceKernelSuspendThread(SceUID thid)
Suspend a thread.
PspThreadAttributes
Attribute for threads.
Definition pspthreadman.h:46
int sceKernelCancelAlarm(SceUID alarmid)
Cancel a pending alarm.
SceUID sceKernelCreateMsgPipe(const char *name, int part, int attr, void *unk1, void *opt)
Create a message pipe.
SceUID sceKernelSetAlarm(SceUInt clock, SceKernelAlarmHandler handler, void *common)
Set an alarm.
void _sceKernelReturnFromTimerHandler(void)
Return from a timer handler (doesn't seem to do alot)
PspDebugProfilerRegs * sceKernelReferThreadProfiler(void)
Get the thread profiler registers.
struct SceKernelFplInfo SceKernelFplInfo
Fixed pool status information.
struct SceKernelEventFlagInfo SceKernelEventFlagInfo
Structure to hold the event flag information.
PspThreadStatus
Definition pspthreadman.h:141
int sceKernelCancelReceiveMbx(SceUID mbxid, int *pnum)
Abort all wait operations on a messagebox.
int sceKernelChangeThreadPriority(SceUID thid, int priority)
Change the threads current priority.
int sceKernelSleepThread(void)
Sleep thread.
SceUID sceKernelCreateMbx(const char *name, SceUInt attr, SceKernelMbxOptParam *option)
Creates a new messagebox.
SceUID sceKernelCreateEventFlag(const char *name, int attr, int bits, SceKernelEventFlagOptParam *opt)
Create an event flag.
int sceKernelSetVTimerTime(SceUID uid, SceKernelSysClock *time)
Set the timer time.
PspDebugProfilerRegs * sceKernelReferGlobalProfiler(void)
Get the globile profiler registers.
int sceKernelSendMsgPipeCB(SceUID uid, void *message, unsigned int size, int unk1, void *unk2, unsigned int *timeout)
Send a message to a pipe (with callback)
struct SceKernelThreadInfo SceKernelThreadInfo
Structure to hold the status information for a thread.
int sceKernelStartThread(SceUID thid, SceSize arglen, void *argp)
Start a created thread.
int sceKernelDelaySysClockThread(SceKernelSysClock *delay)
Delay the current thread by a specified number of sysclocks.
int sceKernelReferMbxStatus(SceUID mbxid, SceKernelMbxInfo *info)
Retrieve information about a messagebox.
int sceKernelRotateThreadReadyQueue(int priority)
Rotate thread ready queue at a set priority.
int sceKernelDeleteLwMutex(SceLwMutexWorkarea *workarea)
Delete a lightweight mutex.
void _sceKernelReturnFromCallback(void)
Return from a callback (used as a syscall for the return of the callback function)
int sceKernelWaitThreadEnd(SceUID thid, SceUInt *timeout)
Wait until a thread has ended.
SceUID sceKernelCreateVTimer(const char *name, struct SceKernelVTimerOptParam *opt)
Create a virtual timer.
SceUInt(* SceKernelVTimerHandler)(SceUID uid, SceKernelSysClock *, SceKernelSysClock *, void *)
Definition pspthreadman.h:1698
PspLwMutexAttributes
Attribute for lightweight mutex.
Definition pspthreadman.h:594
int sceKernelCancelVpl(SceUID uid, int *pnum)
Cancel a pool.
SceKernelIdListType
Threadman types for sceKernelGetThreadmanIdList.
Definition pspthreadman.h:1126
int sceKernelPollMbx(SceUID mbxid, void **pmessage)
Check if a message has arrived in a messagebox.
int sceKernelSignalSema(SceUID semaid, int signal)
Send a signal to a semaphore.
int sceKernelWaitSema(SceUID semaid, int signal, SceUInt *timeout)
Lock a semaphore.
int sceKernelWaitThreadEndCB(SceUID thid, SceUInt *timeout)
Wait until a thread has ended and handle callbacks if necessary.
int sceKernelDeleteEventFlag(int evid)
Delete an event flag.
int sceKernelAllocateVpl(SceUID uid, unsigned int size, void **data, unsigned int *timeout)
Allocate from the pool.
int sceKernelDeleteSema(SceUID semaid)
Destroy a semaphore.
int sceKernelReferSemaStatus(SceUID semaid, SceKernelSemaInfo *info)
Retrieve information about a semaphore.
int sceKernelFreeVpl(SceUID uid, void *data)
Free a block.
int sceKernelSleepThreadCB(void)
Sleep thread but service any callbacks as necessary.
int sceKernelAllocateFplCB(SceUID uid, void **data, unsigned int *timeout)
Allocate from the pool (with callback)
int sceKernelReferMsgPipeStatus(SceUID uid, SceKernelMppInfo *info)
Get the status of a Message Pipe.
SceUID sceKernelSetSysClockAlarm(SceKernelSysClock *clock, SceKernelAlarmHandler handler, void *common)
Set an alarm using a SceKernelSysClock structure for the time.
SceUID sceKernelCreateVpl(const char *name, int part, int attr, unsigned int size, struct SceKernelVplOptParam *opt)
Create a variable pool.
int sceKernelCancelCallback(SceUID cb)
Cancel a callback ?
int sceKernelReleaseThreadEventHandler(SceUID uid)
Release a thread event handler.
int sceKernelReferCallbackStatus(SceUID cb, SceKernelCallbackInfo *status)
Gets the status of a specified callback.
int sceKernelSendMsgPipe(SceUID uid, void *message, unsigned int size, int unk1, void *unk2, unsigned int *timeout)
Send a message to a pipe.
int sceKernelWaitEventFlagCB(int evid, u32 bits, u32 wait, u32 *outBits, SceUInt *timeout)
Wait for an event flag for a given bit pattern with callback.
int sceKernelAllocateFpl(SceUID uid, void **data, unsigned int *timeout)
Allocate from the pool.
struct SceKernelThreadRunStatus SceKernelThreadRunStatus
Statistics about a running thread.
SceUID sceKernelCreateThread(const char *name, SceKernelThreadEntry entry, int initPriority, int stackSize, SceUInt attr, SceKernelThreadOptParam *option)
Create a thread.
SceUID sceKernelCreateSema(const char *name, SceUInt attr, int initVal, int maxVal, SceKernelSemaOptParam *option)
Creates a new semaphore.
int(* SceKernelCallbackFunction)(int arg1, int arg2, void *arg)
Callback function prototype.
Definition pspthreadman.h:1030
int sceKernelGetVTimerTime(SceUID uid, SceKernelSysClock *time)
Get the timer time.
int sceKernelSetEventFlag(SceUID evid, u32 bits)
Set an event flag bit pattern.
int sceKernelDeleteVTimer(SceUID uid)
Delete a virtual timer.
int sceKernelCreateLwMutex(SceLwMutexWorkarea *workarea, const char *name, SceUInt32 attr, int initialCount, u32 *optionsPtr)
Create a lightweight mutex.
struct SceKernelVplInfo SceKernelVplInfo
Variable pool status info.
int sceKernelReceiveMsgPipeCB(SceUID uid, void *message, unsigned int size, int unk1, void *unk2, unsigned int *timeout)
Receive a message from a pipe (with callback)
int sceKernelTryReceiveMsgPipe(SceUID uid, void *message, unsigned int size, int unk1, void *unk2)
Receive a message from a pipe.
int sceKernelReferThreadStatus(SceUID thid, SceKernelThreadInfo *info)
Get the status information for the specified thread.
int sceKernelFreeFpl(SceUID uid, void *data)
Free a block.
int sceKernelTerminateThread(SceUID thid)
Terminate a thread.
SceInt64 sceKernelGetVTimerTimeWide(SceUID uid)
Get the timer time (wide format)
int sceKernelSysClock2USec(SceKernelSysClock *clock, unsigned int *low, unsigned int *high)
Convert a SceKernelSysClock structure to microseconds.
int sceKernelReferEventFlagStatus(SceUID event, SceKernelEventFlagInfo *status)
Get the status of an event flag.
int sceKernelTrySendMsgPipe(SceUID uid, void *message, unsigned int size, int unk1, void *unk2)
Try to send a message to a pipe.
SceUInt(* SceKernelVTimerHandlerWide)(SceUID uid, SceInt64, SceInt64, void *)
Definition pspthreadman.h:1699
int sceKernelReceiveMsgPipe(SceUID uid, void *message, unsigned int size, int unk1, void *unk2, unsigned int *timeout)
Receive a message from a pipe.
int(* SceKernelThreadEntry)(SceSize args, void *argp)
Definition pspthreadman.h:71
SceInt64 sceKernelUSec2SysClockWide(unsigned int usec)
Convert a number of microseconds to a wide time.
int sceKernelPollEventFlag(int evid, u32 bits, u32 wait, u32 *outBits)
Poll an event flag for a given bit pattern.
int sceKernelCheckCallback(void)
Check callback ?
int sceKernelLockLwMutex(SceLwMutexWorkarea *workarea, int lockCount, unsigned int *pTimeout)
Lock a lightweight mutex.
int sceKernelReferAlarmStatus(SceUID alarmid, SceKernelAlarmInfo *info)
Refer the status of a created alarm.
int sceKernelReferFplStatus(SceUID uid, SceKernelFplInfo *info)
Get the status of an FPL.
int sceKernelChangeCurrentThreadAttr(int unknown, SceUInt attr)
Modify the attributes of the current thread.
int sceKernelReceiveMbxCB(SceUID mbxid, void **pmessage, SceUInt *timeout)
Wait for a message to arrive in a messagebox and handle callbacks if necessary.
SceUInt(* SceKernelAlarmHandler)(void *common)
Prototype for alarm handlers.
Definition pspthreadman.h:972
int sceKernelGetThreadStackFreeSize(SceUID thid)
Get the free stack size for a thread.
@ THREADEVENT_CURRENT
Definition pspthreadman.h:1787
@ THREADEVENT_USER
Definition pspthreadman.h:1786
@ THREADEVENT_KERN
Definition pspthreadman.h:1785
@ THREADEVENT_ALL
Definition pspthreadman.h:1784
@ THREAD_CREATE
Definition pspthreadman.h:1792
@ THREAD_DELETE
Definition pspthreadman.h:1795
@ THREAD_EXIT
Definition pspthreadman.h:1794
@ THREAD_START
Definition pspthreadman.h:1793
@ PSP_EVENT_WAITOR
Wait for one or more bits in the pattern to be set.
Definition pspthreadman.h:705
@ PSP_EVENT_WAITCLEAR
Clear the wait pattern when it matches.
Definition pspthreadman.h:707
@ PSP_EVENT_WAITAND
Wait for all bits in the pattern to be set.
Definition pspthreadman.h:703
@ PSP_EVENT_WAITMULTIPLE
Allow the event flag to be waited upon by multiple threads.
Definition pspthreadman.h:696
@ PSP_EVENT_WAITSINGLE
Allow the event flag to be waited upon by a single thread.
Definition pspthreadman.h:694
@ PSP_THREAD_ATTR_SCRATCH_SRAM
Allow using scratchpad memory for a thread, NOT USABLE ON V1.0.
Definition pspthreadman.h:57
@ PSP_THREAD_ATTR_VSH
Thread is part of the VSH API.
Definition pspthreadman.h:55
@ PSP_THREAD_ATTR_USBWLAN
Thread is part of the USB/WLAN API.
Definition pspthreadman.h:53
@ PSP_THREAD_ATTR_CLEAR_STACK
Clear the stack when the thread is deleted.
Definition pspthreadman.h:61
@ PSP_THREAD_ATTR_VFPU
Enable VFPU access for the thread.
Definition pspthreadman.h:48
@ PSP_THREAD_ATTR_USER
Start the thread in user mode (done automatically if the thread creating it is in user mode).
Definition pspthreadman.h:51
@ PSP_THREAD_ATTR_NO_FILLSTACK
Disables filling the stack with 0xFF on creation.
Definition pspthreadman.h:59
@ PSP_THREAD_RUNNING
Definition pspthreadman.h:142
@ PSP_THREAD_KILLED
Definition pspthreadman.h:147
@ PSP_THREAD_SUSPEND
Definition pspthreadman.h:145
@ PSP_THREAD_READY
Definition pspthreadman.h:143
@ PSP_THREAD_STOPPED
Definition pspthreadman.h:146
@ PSP_THREAD_WAITING
Definition pspthreadman.h:144
@ PSP_LW_MUTEX_ATTR_RECURSIVE
A recursive lock is allowed by the thread that acquired the lightweight mutex.
Definition pspthreadman.h:600
@ PSP_LW_MUTEX_ATTR_THPRI
The wait thread is queued by thread priority .
Definition pspthreadman.h:598
@ PSP_LW_MUTEX_ATTR_THFIFO
The wait thread is queued using FIFO.
Definition pspthreadman.h:596
@ SCE_KERNEL_TMID_VTimer
Definition pspthreadman.h:1137
@ SCE_KERNEL_TMID_Callback
Definition pspthreadman.h:1134
@ SCE_KERNEL_TMID_ThreadEventHandler
Definition pspthreadman.h:1135
@ SCE_KERNEL_TMID_SleepThread
Definition pspthreadman.h:1138
@ SCE_KERNEL_TMID_DelayThread
Definition pspthreadman.h:1139
@ SCE_KERNEL_TMID_Fpl
Definition pspthreadman.h:1132
@ SCE_KERNEL_TMID_Mpipe
Definition pspthreadman.h:1133
@ SCE_KERNEL_TMID_Alarm
Definition pspthreadman.h:1136
@ SCE_KERNEL_TMID_Thread
Definition pspthreadman.h:1127
@ SCE_KERNEL_TMID_Semaphore
Definition pspthreadman.h:1128
@ SCE_KERNEL_TMID_DormantThread
Definition pspthreadman.h:1141
@ SCE_KERNEL_TMID_EventFlag
Definition pspthreadman.h:1129
@ SCE_KERNEL_TMID_SuspendThread
Definition pspthreadman.h:1140
@ SCE_KERNEL_TMID_Mbox
Definition pspthreadman.h:1130
@ SCE_KERNEL_TMID_Vpl
Definition pspthreadman.h:1131
unsigned int SceUInt
Definition pspkerneltypes.h:31
int SceUID
UIDs are used to describe many different kernel objects.
Definition pspkerneltypes.h:24
unsigned char SceUChar
Definition pspkerneltypes.h:30
unsigned int SceSize
Definition psptypes.h:103
int64_t SceInt64
Definition psptypes.h:88
uint32_t SceUInt32
Definition psptypes.h:80
uint32_t u32
Definition psptypes.h:41
Struct containing alarm info.
Definition pspthreadman.h:975
SceSize size
Size of the structure (should be set before calling :: sceKernelReferAlarmStatus.
Definition pspthreadman.h:978
SceKernelSysClock schedule
Definition pspthreadman.h:980
SceKernelAlarmHandler handler
Pointer to the alarm handler.
Definition pspthreadman.h:982
void * common
Common pointer argument.
Definition pspthreadman.h:984
Structure to hold the status information for a callback.
Definition pspthreadman.h:1033
void * common
User supplied argument for the callback.
Definition pspthreadman.h:1043
int notifyCount
Unknown.
Definition pspthreadman.h:1045
SceUID threadId
The thread id associated with the callback.
Definition pspthreadman.h:1039
char name[32]
The name given to the callback.
Definition pspthreadman.h:1037
SceKernelCallbackFunction callback
Pointer to the callback function.
Definition pspthreadman.h:1041
int notifyArg
Unknown.
Definition pspthreadman.h:1047
SceSize size
Size of the structure (i.e.
Definition pspthreadman.h:1035
Structure to hold the event flag information.
Definition pspthreadman.h:675
int numWaitThreads
Definition pspthreadman.h:681
SceUInt initPattern
Definition pspthreadman.h:679
SceUInt currentPattern
Definition pspthreadman.h:680
char name[32]
Definition pspthreadman.h:677
SceSize size
Definition pspthreadman.h:676
SceUInt attr
Definition pspthreadman.h:678
Definition pspthreadman.h:684
SceSize size
Definition pspthreadman.h:685
Fixed pool status information.
Definition pspthreadman.h:1504
int numWaitThreads
Definition pspthreadman.h:1511
char name[32]
Definition pspthreadman.h:1506
int numBlocks
Definition pspthreadman.h:1509
SceUInt attr
Definition pspthreadman.h:1507
SceSize size
Definition pspthreadman.h:1505
int freeBlocks
Definition pspthreadman.h:1510
int blockSize
Definition pspthreadman.h:1508
Definition pspthreadman.h:1424
SceSize size
Definition pspthreadman.h:1425
Current state of a messagebox.
Definition pspthreadman.h:813
SceUInt attr
Attributes.
Definition pspthreadman.h:819
char name[32]
NUL-terminated name of the messagebox.
Definition pspthreadman.h:817
SceSize size
Size of the SceKernelMbxInfo structure.
Definition pspthreadman.h:815
int numMessages
Number of messages currently in the messagebox.
Definition pspthreadman.h:823
int numWaitThreads
The number of threads waiting on the messagebox.
Definition pspthreadman.h:821
void * firstMessage
The message currently at the head of the queue.
Definition pspthreadman.h:825
Additional options used when creating messageboxes.
Definition pspthreadman.h:805
SceSize size
Size of the SceKernelMbxOptParam structure.
Definition pspthreadman.h:807
Message Pipe status info.
Definition pspthreadman.h:1299
int bufSize
Definition pspthreadman.h:1303
SceSize size
Definition pspthreadman.h:1300
int numSendWaitThreads
Definition pspthreadman.h:1305
char name[32]
Definition pspthreadman.h:1301
int numReceiveWaitThreads
Definition pspthreadman.h:1306
SceUInt attr
Definition pspthreadman.h:1302
int freeSize
Definition pspthreadman.h:1304
Header for a message box packet.
Definition pspthreadman.h:831
struct SceKernelMsgPacket * next
Pointer to next msg (used by the kernel)
Definition pspthreadman.h:833
SceUChar msgPriority
Priority ?
Definition pspthreadman.h:835
SceUChar dummy[3]
Definition pspthreadman.h:836
Current state of a semaphore.
Definition pspthreadman.h:481
char name[32]
NUL-terminated name of the semaphore.
Definition pspthreadman.h:485
int numWaitThreads
The number of threads waiting on the semaphore.
Definition pspthreadman.h:495
SceUInt attr
Attributes.
Definition pspthreadman.h:487
SceSize size
Size of the SceKernelSemaInfo structure.
Definition pspthreadman.h:483
int currentCount
The current count.
Definition pspthreadman.h:491
int maxCount
The maximum count.
Definition pspthreadman.h:493
int initCount
The initial count the semaphore was created with.
Definition pspthreadman.h:489
Additional options used when creating semaphores.
Definition pspthreadman.h:473
SceSize size
Size of the SceKernelSemaOptParam structure.
Definition pspthreadman.h:475
64-bit system clock type.
Definition pspthreadman.h:39
SceUInt32 low
Definition pspthreadman.h:40
SceUInt32 hi
Definition pspthreadman.h:41
Structure to contain the system status returned by sceKernelReferSystemStatus.
Definition pspthreadman.h:1158
SceSize size
Size of the structure (should be set prior to the call)
Definition pspthreadman.h:1160
SceUInt vfpuSwitchCount
Number of vfpu switches ?
Definition pspthreadman.h:1170
SceKernelSysClock idleClocks
The number of cpu clocks in the idle thread.
Definition pspthreadman.h:1164
SceUInt threadSwitchCount
Number of thread context switches.
Definition pspthreadman.h:1168
SceUInt status
The status ?
Definition pspthreadman.h:1162
SceUInt comesOutOfIdleCount
Number of times we resumed from idle.
Definition pspthreadman.h:1166
Struct for event handler info.
Definition pspthreadman.h:1773
void * common
Definition pspthreadman.h:1779
SceKernelThreadEventHandler handler
Definition pspthreadman.h:1778
SceUID threadId
Definition pspthreadman.h:1776
SceSize size
Definition pspthreadman.h:1774
int mask
Definition pspthreadman.h:1777
char name[32]
Definition pspthreadman.h:1775
Structure to hold the status information for a thread.
Definition pspthreadman.h:84
int wakeupCount
Wakeup count.
Definition pspthreadman.h:110
int exitStatus
Exit status of the thread.
Definition pspthreadman.h:112
SceUInt threadPreemptCount
Thread preemption count.
Definition pspthreadman.h:118
SceUID waitId
Wait id.
Definition pspthreadman.h:108
SceKernelThreadEntry entry
Thread entry point.
Definition pspthreadman.h:94
int stackSize
Thread stack size.
Definition pspthreadman.h:98
SceUInt releaseCount
Release count.
Definition pspthreadman.h:120
int status
Thread status.
Definition pspthreadman.h:92
SceSize size
Size of the structure.
Definition pspthreadman.h:86
SceUInt intrPreemptCount
Interrupt preemption count.
Definition pspthreadman.h:116
void * stack
Thread stack pointer.
Definition pspthreadman.h:96
SceUInt attr
Thread attributes.
Definition pspthreadman.h:90
SceKernelSysClock runClocks
Number of clock cycles run.
Definition pspthreadman.h:114
int currentPriority
Current priority.
Definition pspthreadman.h:104
void * gpReg
Pointer to the gp.
Definition pspthreadman.h:100
int initPriority
Initial priority.
Definition pspthreadman.h:102
int waitType
Wait type.
Definition pspthreadman.h:106
char name[32]
Nul terminated name of the thread.
Definition pspthreadman.h:88
Additional options used when creating threads.
Definition pspthreadman.h:74
SceUID stackMpid
UID of the memory block (?) allocated for the thread's stack.
Definition pspthreadman.h:78
SceSize size
Size of the SceKernelThreadOptParam structure.
Definition pspthreadman.h:76
Statistics about a running thread.
Definition pspthreadman.h:126
SceUInt threadPreemptCount
Definition pspthreadman.h:135
SceUInt intrPreemptCount
Definition pspthreadman.h:134
SceUInt releaseCount
Definition pspthreadman.h:136
int waitType
Definition pspthreadman.h:130
int waitId
Definition pspthreadman.h:131
int wakeupCount
Definition pspthreadman.h:132
int status
Definition pspthreadman.h:128
SceKernelSysClock runClocks
Definition pspthreadman.h:133
int currentPriority
Definition pspthreadman.h:129
SceSize size
Definition pspthreadman.h:127
Definition pspthreadman.h:1734
SceSize size
Definition pspthreadman.h:1735
void * common
Definition pspthreadman.h:1742
int active
Definition pspthreadman.h:1737
SceKernelSysClock current
Definition pspthreadman.h:1739
SceKernelSysClock schedule
Definition pspthreadman.h:1740
char name[32]
Definition pspthreadman.h:1736
SceKernelSysClock base
Definition pspthreadman.h:1738
SceKernelVTimerHandler handler
Definition pspthreadman.h:1741
Definition pspthreadman.h:1599
SceSize size
Definition pspthreadman.h:1600
Variable pool status info.
Definition pspthreadman.h:1403
int poolSize
Definition pspthreadman.h:1407
SceUInt attr
Definition pspthreadman.h:1406
int numWaitThreads
Definition pspthreadman.h:1409
char name[32]
Definition pspthreadman.h:1405
int freeSize
Definition pspthreadman.h:1408
SceSize size
Definition pspthreadman.h:1404
Definition pspthreadman.h:1321
SceSize size
Definition pspthreadman.h:1322
Struct as workarea for lightweight mutex.
Definition pspthreadman.h:604
int attr
Attribute.
Definition pspthreadman.h:610
SceUID uid
UID.
Definition pspthreadman.h:614
int numWaitThreads
Number of waiting threads.
Definition pspthreadman.h:612
SceUID lockThread
Locking thread.
Definition pspthreadman.h:608
int lockLevel
Count.
Definition pspthreadman.h:606
Structure to hold the psp profiler register values.
Definition pspdebug.h:275