vitasdk
Documentation of the vitasdk
threadmgr.h
Go to the documentation of this file.
1
6#ifndef _PSP2COMMON_KERNEL_THREADMGR_H_
7#define _PSP2COMMON_KERNEL_THREADMGR_H_
8
9#include <psp2common/types.h>
10
11#ifdef __cplusplus
12extern "C" {
13#endif
14
33
34typedef enum SceThreadStatus {
39 SCE_THREAD_SUSPEND = 8, /* Compatibility */
41 SCE_THREAD_STOPPED = 16, /* Compatibility */
42 SCE_THREAD_DELETED = 32, /* Thread manager has killed the thread (stack overflow) */
43 SCE_THREAD_KILLED = 32, /* Compatibility */
48
53
59
90VITASDK_BUILD_ASSERT_EQ(0x60, SceKernelTimerInfo); // size is from FW 3.60
91
104
105typedef int (* SceKernelThreadEntry)(SceSize args, void *argp);
106
107typedef int (* SceKernelThreadEventHandler)(SceInt32 type, SceUID threadId, SceInt32 arg, void *pCommon);
108
122
177
179#define SCE_KERNEL_THREAD_CPU_AFFINITY_MASK_DEFAULT (0)
180
181
182
184typedef int (* SceKernelCallbackFunction)(int notifyId, int notifyCount, int notifyArg, void *userData);
185
206
207
208
209
216
239
240
241
247
256
261
273
285
286
287
292
297
298
299
304
309
310
311
312
317
325
353
354
355
362
381
382/*
383 * Value linked to fpcsr
384 */
385#define SCE_KERNEL_VFP_EXCP_IOC (0x00000001)
386#define SCE_KERNEL_VFP_EXCP_DZC (0x00000002)
387#define SCE_KERNEL_VFP_EXCP_OFC (0x00000004)
388#define SCE_KERNEL_VFP_EXCP_UFC (0x00000008)
389#define SCE_KERNEL_VFP_EXCP_IXC (0x00000010)
390#define SCE_KERNEL_VFP_EXCP_IDC (0x00000080)
391#define SCE_KERNEL_VFP_EXCP_QC (0x08000000)
392#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)
393
394
395#ifdef __cplusplus
396}
397#endif
398
399#endif /* _PSP2COMMON_KERNEL_THREADMGR_H_ */
400
#define VITASDK_BUILD_ASSERT_EQ(__size__, __name__)
Definition build_utils.h:13
SceInt32 type
Must be 100 when passed to sceLsdbReplaceTheme on FW 3.60.
Definition lsdb.h:2
SceInt32 changeCpuCount
Number of CPUs to which the thread is moved.
Definition threadmgr.h:170
SceSize size
Size of the SceKernelCondInfo structure.
Definition threadmgr.h:368
char name[32]
NUL-terminated name of the semaphore.
Definition threadmgr.h:226
int numWaitThreads
Definition threadmgr.h:270
SceKernelSysClock schedule
Logical timer time at which the armed event will next occur, or zero when no event is armed.
Definition threadmgr.h:78
SceUInt32 attr
Timer attributes.
Definition threadmgr.h:69
int(* SceKernelCallbackFunction)(int notifyId, int notifyCount, int notifyArg, void *userData)
Callback function prototype.
Definition threadmgr.h:184
void * common
User supplied argument for the callback.
Definition threadmgr.h:199
SceSize size
Definition threadmgr.h:294
SceUInt initPattern
Definition threadmgr.h:268
int notifyCount
Unknown.
Definition threadmgr.h:201
SceUID condId
The UID of the condition variable.
Definition threadmgr.h:370
SceUInt32 intrPreemptCount
Interrupt preemption count.
Definition threadmgr.h:164
SceUInt attr
Attributes.
Definition threadmgr.h:342
SceUInt currentPattern
Definition threadmgr.h:269
SceKernelSysClock current_time
Current logical timer time.
Definition threadmgr.h:75
SceUID waitId
Wait id.
Definition threadmgr.h:158
SceSize size
Number of bytes available in this structure.
Definition threadmgr.h:336
SceUInt32 kStackMemType
Definition threadmgr.h:115
SceSize size
Definition threadmgr.h:306
SceSize size
Definition threadmgr.h:258
SceUInt32 status
Thread status.
Definition threadmgr.h:136
int numWaitThreads
The number of threads waiting on the condition variable.
Definition threadmgr.h:378
SceUInt32 attr
Thread attributes.
Definition threadmgr.h:134
SceUID threadId
The thread id associated with the callback.
Definition threadmgr.h:195
SceEventFlagAttributes
Event flag creation attributes.
Definition threadmgr.h:249
SceKernelThreadEntry entry
Thread entry point.
Definition threadmgr.h:138
SceUID semaId
The UID of the semaphore.
Definition threadmgr.h:224
SceUInt32 uStackMemType
Definition threadmgr.h:116
char name[32]
The name given to the callback.
Definition threadmgr.h:193
SceUID threadId
Definition threadmgr.h:99
SceInt32 data[4]
Definition threadmgr.h:289
SceInt32 initPriority
Initial priority.
Definition threadmgr.h:144
SceThreadStatus
Definition threadmgr.h:34
SceUInt32 data_0x18
Definition threadmgr.h:119
SceBool active
Nonzero while the timer is running.
Definition threadmgr.h:71
SceUID timer_id
Timer identifier.
Definition threadmgr.h:65
SceSize size
Size of the SceKernelCondOptParam structure.
Definition threadmgr.h:359
SceSize size
Size of the structure.
Definition threadmgr.h:128
char name[32]
Definition threadmgr.h:266
SceInt32 initCpuAffinityMask
Initial CPU affinity mask.
Definition threadmgr.h:148
void * stack
Thread stack pointer.
Definition threadmgr.h:140
SceUID mutexId
Mutex associated with the condition variable.
Definition threadmgr.h:376
SceEventFlagWaitTypes
Event flag wait types.
Definition threadmgr.h:275
struct SceKernelThreadRunStatus::@17 cpuInfo[4]
SceKernelSysClock interval
Event interval.
Definition threadmgr.h:80
int numWaitThreads
The number of threads waiting on the semaphore.
Definition threadmgr.h:236
int priority
Definition threadmgr.h:100
SceSize size
Definition threadmgr.h:264
SceUInt attr
Attributes.
Definition threadmgr.h:374
SceInt32 reserved[1]
Set to 0 on FW 3.60.
Definition threadmgr.h:88
SceInt32 fNotifyCallback
Nonzero when callback notification is pending.
Definition threadmgr.h:172
SceUID currentOwnerId
The UID of the current owner of the mutex.
Definition threadmgr.h:348
SceUInt32 waitType
Wait type.
Definition threadmgr.h:156
char name[32]
NUL-terminated name of the mutex.
Definition threadmgr.h:340
SceKernelCallbackFunction callback
Pointer to the callback function.
Definition threadmgr.h:197
SceUInt32 uTLSMemType
Definition threadmgr.h:117
SceUInt32 num_wait_threads
Number of threads waiting on the timer.
Definition threadmgr.h:86
SceKernelThreadEventType
Definition threadmgr.h:49
SceUID mutexId
The UID of the mutex.
Definition threadmgr.h:338
SceUInt32 uStackMemid
Definition threadmgr.h:118
int notifyArg
Unknown.
Definition threadmgr.h:203
SceSize size
Size of the SceKernelSemaOptParam structure.
Definition threadmgr.h:213
SceKernelSysClock base_time
Time from which the timer is measured while running, or the stored timer time while stopped.
Definition threadmgr.h:73
SceUID evfId
Definition threadmgr.h:265
SceUInt attr
Attributes.
Definition threadmgr.h:228
SceInt64 data[4]
Definition threadmgr.h:301
SceKernelWaitableAttribute
Definition threadmgr.h:242
SceKernelSysClock runClocks
Number of clock cycles run.
Definition threadmgr.h:162
SceUInt32 threadReleaseCount
Thread release count.
Definition threadmgr.h:168
SceKernelIdListType
Threadmgr types.
Definition threadmgr.h:16
int numWaitThreads
Number of threads waiting on the mutex, as a SceUInt32 value.
Definition threadmgr.h:350
SceKernelTimerType
Timer event notification type.
Definition threadmgr.h:55
SceKernelTimerType type
One of SceKernelTimerType.
Definition threadmgr.h:82
int currentCount
The current count.
Definition threadmgr.h:346
SceSize size
Size of the SceKernelSemaInfo structure.
Definition threadmgr.h:222
SceKernelMutexAttribute
Definition threadmgr.h:313
int initCount
The initial count the mutex was created with.
Definition threadmgr.h:344
SceSize size
Size of the SceKernelMutexOptParam structure.
Definition threadmgr.h:321
SceInt32 currentPriority
Current priority.
Definition threadmgr.h:146
int currentCount
The current count.
Definition threadmgr.h:232
SceUInt32 threadPreemptCount
Thread preemption count.
Definition threadmgr.h:166
SceInt32 lastExecutedCpuId
Last executed CPU ID.
Definition threadmgr.h:154
SceBool repeat
Nonzero when the event repeats.
Definition threadmgr.h:84
int maxCount
The maximum count.
Definition threadmgr.h:234
SceUInt32 attr
Attributes.
Definition threadmgr.h:114
SceSize size
Number of bytes available in this structure.
Definition threadmgr.h:63
int(* SceKernelThreadEventHandler)(SceInt32 type, SceUID threadId, SceInt32 arg, void *pCommon)
Definition threadmgr.h:107
SceUInt attr
Definition threadmgr.h:267
SceUID callbackId
The UID of the callback.
Definition threadmgr.h:191
SceUID processId
The UID of the process where the thread belongs.
Definition threadmgr.h:130
int initCount
The initial count the semaphore was created with.
Definition threadmgr.h:230
char name[32]
Nul terminated name of the thread.
Definition threadmgr.h:132
SceSize size
Definition threadmgr.h:96
SceInt32 reserved
Set to 0 on FW 3.60.
Definition threadmgr.h:174
SceInt32 currentCpuId
Current CPU ID.
Definition threadmgr.h:152
SceInt32 exitStatus
Exit status of the thread.
Definition threadmgr.h:160
SceSize size
Size of the structure (i.e.
Definition threadmgr.h:189
int(* SceKernelThreadEntry)(SceSize args, void *argp)
Definition threadmgr.h:105
int ceilingPriority
Definition threadmgr.h:322
ScePID processId
Definition threadmgr.h:98
SceSize size
Size of the SceKernelThreadOptParam structure.
Definition threadmgr.h:112
SceInt32 stackSize
Thread stack size, as a SceSize value.
Definition threadmgr.h:142
char name[32]
NUL-terminated name of the condition variable.
Definition threadmgr.h:372
char name[SCE_UID_NAMELEN+1]
NUL-terminated timer name.
Definition threadmgr.h:67
SceInt32 currentCpuAffinityMask
Current CPU affinity mask.
Definition threadmgr.h:150
@ SCE_EVENT_THREAD_PRIO
Use SCE_KERNEL_ATTR_THREAD_PRIO.
Definition threadmgr.h:251
@ SCE_EVENT_WAITSINGLE
Sync object can only be waited upon by one thread.
Definition threadmgr.h:252
@ SCE_EVENT_OPENABLE
Use SCE_KERNEL_ATTR_OPENABLE.
Definition threadmgr.h:254
@ SCE_EVENT_WAITMULTIPLE
Sync object can be waited upon by multiple threads.
Definition threadmgr.h:253
@ SCE_EVENT_THREAD_FIFO
Use SCE_KERNEL_ATTR_THREAD_FIFO.
Definition threadmgr.h:250
@ SCE_THREAD_RUNNING
Definition threadmgr.h:35
@ SCE_THREAD_SUSPEND
Definition threadmgr.h:39
@ SCE_THREAD_SUSPENDED
Definition threadmgr.h:46
@ SCE_THREAD_STANDBY
Definition threadmgr.h:37
@ SCE_THREAD_READY
Definition threadmgr.h:36
@ SCE_THREAD_DORMANT
Definition threadmgr.h:40
@ SCE_THREAD_STOPPED
Definition threadmgr.h:41
@ SCE_THREAD_DEAD
Definition threadmgr.h:44
@ SCE_THREAD_STAGNANT
Definition threadmgr.h:45
@ SCE_THREAD_KILLED
Definition threadmgr.h:43
@ SCE_THREAD_WAITING
Definition threadmgr.h:38
@ SCE_THREAD_DELETED
Definition threadmgr.h:42
@ SCE_EVENT_WAITAND
Wait for all bits in the pattern to be set.
Definition threadmgr.h:277
@ SCE_EVENT_WAITCLEAR_PAT
Clear the wait pattern when it matches.
Definition threadmgr.h:283
@ SCE_EVENT_WAITCLEAR
Clear all the bits when it matches.
Definition threadmgr.h:281
@ SCE_EVENT_WAITOR
Wait for one or more bits in the pattern to be set.
Definition threadmgr.h:279
@ SCE_KERNEL_THREAD_EVENT_TYPE_START
Definition threadmgr.h:50
@ SCE_KERNEL_THREAD_EVENT_TYPE_EXIT
Definition threadmgr.h:51
@ SCE_KERNEL_ATTR_THREAD_PRIO
Waiting threads queued on priority basis.
Definition threadmgr.h:244
@ SCE_KERNEL_ATTR_THREAD_FIFO
Waiting threads First input First output.
Definition threadmgr.h:243
@ SCE_KERNEL_ATTR_OPENABLE
Sync object can be accessed by sceKernelOpenXxx.
Definition threadmgr.h:245
@ SCE_KERNEL_TMID_VTimer
Definition threadmgr.h:27
@ SCE_KERNEL_TMID_Callback
Definition threadmgr.h:24
@ SCE_KERNEL_TMID_ThreadEventHandler
Definition threadmgr.h:25
@ SCE_KERNEL_TMID_SleepThread
Definition threadmgr.h:28
@ SCE_KERNEL_TMID_DelayThread
Definition threadmgr.h:29
@ SCE_KERNEL_TMID_Fpl
Definition threadmgr.h:22
@ SCE_KERNEL_TMID_Mpipe
Definition threadmgr.h:23
@ SCE_KERNEL_TMID_Alarm
Definition threadmgr.h:26
@ SCE_KERNEL_TMID_Thread
Definition threadmgr.h:17
@ SCE_KERNEL_TMID_Semaphore
Definition threadmgr.h:18
@ SCE_KERNEL_TMID_DormantThread
Definition threadmgr.h:31
@ SCE_KERNEL_TMID_EventFlag
Definition threadmgr.h:19
@ SCE_KERNEL_TMID_SuspendThread
Definition threadmgr.h:30
@ SCE_KERNEL_TMID_Mbox
Definition threadmgr.h:20
@ SCE_KERNEL_TMID_Vpl
Definition threadmgr.h:21
@ SCE_KERNEL_TIMER_TYPE_SET_EVENT
Set the timer event state when the deadline expires.
Definition threadmgr.h:56
@ SCE_KERNEL_TIMER_TYPE_PULSE_EVENT
Wake threads currently waiting without leaving the event set.
Definition threadmgr.h:57
@ SCE_KERNEL_MUTEX_ATTR_RECURSIVE
Definition threadmgr.h:314
@ SCE_KERNEL_MUTEX_ATTR_CEILING
Definition threadmgr.h:315
Structure to hold the status information for a callback.
Definition threadmgr.h:187
Current state of a condition variable.
Definition threadmgr.h:366
Additional options used when creating condition variables.
Definition threadmgr.h:357
Structure to hold the event flag information.
Definition threadmgr.h:263
Definition threadmgr.h:257
Definition threadmgr.h:293
Definition threadmgr.h:288
Definition threadmgr.h:305
Definition threadmgr.h:300
Current state of a mutex.
Definition threadmgr.h:334
Additional options used when creating mutexes.
Definition threadmgr.h:319
Current state of a semaphore.
Definition threadmgr.h:220
Additional options used when creating semaphores.
Definition threadmgr.h:211
Structure to hold the status information for a thread.
Definition threadmgr.h:126
Additional options used when creating threads.
Definition threadmgr.h:110
Statistics about a running thread.
Definition threadmgr.h:95
Timer state.
Definition threadmgr.h:61
int ScePID
Process ID.
Definition types.h:91
#define SCE_UID_NAMELEN
Maximum length for kernel object names.
Definition types.h:101
int SceBool
Definition types.h:59
int32_t SceInt32
Definition types.h:44
unsigned int SceSize
Definition types.h:56
uint32_t SceUInt
Definition types.h:48
int SceUID
UIDs are used to describe many different kernel objects.
Definition types.h:90
int64_t SceInt64
Definition types.h:50
uint32_t SceUInt32
Definition types.h:45
SceUInt64 SceKernelSysClock
64-bit system clock type.
Definition types.h:97