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
66
67typedef int (* SceKernelThreadEntry)(SceSize args, void *argp);
68
69typedef int (* SceKernelThreadEventHandler)(SceInt32 type, SceUID threadId, SceInt32 arg, void *pCommon);
70
84
139
141#define SCE_KERNEL_THREAD_CPU_AFFINITY_MASK_DEFAULT (0)
142
143
144
146typedef int (* SceKernelCallbackFunction)(int notifyId, int notifyCount, int notifyArg, void *userData);
147
168
169
170
171
178
201
202
203
209
218
223
235
247
248
249
254
259
260
261
266
271
272
273
274
279
287
310
311
312
319
338
339/*
340 * Value linked to fpcsr
341 */
342#define SCE_KERNEL_VFP_EXCP_IOC (0x00000001)
343#define SCE_KERNEL_VFP_EXCP_DZC (0x00000002)
344#define SCE_KERNEL_VFP_EXCP_OFC (0x00000004)
345#define SCE_KERNEL_VFP_EXCP_UFC (0x00000008)
346#define SCE_KERNEL_VFP_EXCP_IXC (0x00000010)
347#define SCE_KERNEL_VFP_EXCP_IDC (0x00000080)
348#define SCE_KERNEL_VFP_EXCP_QC (0x08000000)
349#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)
350
351
352#ifdef __cplusplus
353}
354#endif
355
356#endif /* _PSP2COMMON_KERNEL_THREADMGR_H_ */
357
#define VITASDK_BUILD_ASSERT_EQ(__size__, __name__)
Definition build_utils.h:13
uint8_t type
0 = read?, 1 = write?, 2 = feature?, 3 = ?
Definition bt.h:2
SceInt32 changeCpuCount
Number of CPUs to which the thread is moved.
Definition threadmgr.h:132
SceSize size
Size of the SceKernelCondInfo structure.
Definition threadmgr.h:325
char name[32]
NUL-terminated name of the semaphore.
Definition threadmgr.h:188
int numWaitThreads
Definition threadmgr.h:232
int(* SceKernelCallbackFunction)(int notifyId, int notifyCount, int notifyArg, void *userData)
Callback function prototype.
Definition threadmgr.h:146
void * common
User supplied argument for the callback.
Definition threadmgr.h:161
SceSize size
Definition threadmgr.h:256
SceUInt initPattern
Definition threadmgr.h:230
int notifyCount
Unknown.
Definition threadmgr.h:163
SceUID condId
The UID of the condition variable.
Definition threadmgr.h:327
SceUInt32 intrPreemptCount
Interrupt preemption count.
Definition threadmgr.h:126
SceUInt attr
Attributes.
Definition threadmgr.h:299
SceUInt currentPattern
Definition threadmgr.h:231
SceUID waitId
Wait id.
Definition threadmgr.h:120
SceSize size
Size of the SceKernelMutexInfo structure.
Definition threadmgr.h:293
SceUInt32 kStackMemType
Definition threadmgr.h:77
SceSize size
Definition threadmgr.h:268
SceSize size
Definition threadmgr.h:220
SceUInt32 status
Thread status.
Definition threadmgr.h:98
int numWaitThreads
The number of threads waiting on the condition variable.
Definition threadmgr.h:335
SceUInt32 attr
Thread attributes.
Definition threadmgr.h:96
SceUID threadId
The thread id associated with the callback.
Definition threadmgr.h:157
int priority
Definition threadmgr.h:62
SceEventFlagAttributes
Event flag creation attributes.
Definition threadmgr.h:211
SceKernelThreadEntry entry
Thread entry point.
Definition threadmgr.h:100
struct SceKernelThreadRunStatus::@10 cpuInfo[4]
SceUID semaId
The UID of the semaphore.
Definition threadmgr.h:186
SceUInt32 uStackMemType
Definition threadmgr.h:78
char name[32]
The name given to the callback.
Definition threadmgr.h:155
SceInt32 data[4]
Definition threadmgr.h:251
SceInt32 initPriority
Initial priority.
Definition threadmgr.h:106
SceThreadStatus
Definition threadmgr.h:34
SceUInt32 data_0x18
Definition threadmgr.h:81
SceUID threadId
Definition threadmgr.h:61
SceSize size
Size of the SceKernelCondOptParam structure.
Definition threadmgr.h:316
SceSize size
Size of the structure.
Definition threadmgr.h:90
char name[32]
Definition threadmgr.h:228
SceInt32 initCpuAffinityMask
Initial CPU affinity mask.
Definition threadmgr.h:110
void * stack
Thread stack pointer.
Definition threadmgr.h:102
SceUID mutexId
Mutex associated with the condition variable.
Definition threadmgr.h:333
SceEventFlagWaitTypes
Event flag wait types.
Definition threadmgr.h:237
int numWaitThreads
The number of threads waiting on the semaphore.
Definition threadmgr.h:198
SceSize size
Definition threadmgr.h:226
SceUInt attr
Attributes.
Definition threadmgr.h:331
SceInt32 fNotifyCallback
Function notify callback UID.
Definition threadmgr.h:134
SceUID currentOwnerId
The UID of the current owner of the mutex.
Definition threadmgr.h:305
SceUInt32 waitType
Wait type.
Definition threadmgr.h:118
char name[32]
NUL-terminated name of the mutex.
Definition threadmgr.h:297
SceKernelCallbackFunction callback
Pointer to the callback function.
Definition threadmgr.h:159
SceUInt32 uTLSMemType
Definition threadmgr.h:79
SceKernelThreadEventType
Definition threadmgr.h:49
SceUID mutexId
The UID of the mutex.
Definition threadmgr.h:295
SceUInt32 uStackMemid
Definition threadmgr.h:80
int notifyArg
Unknown.
Definition threadmgr.h:165
SceSize size
Size of the SceKernelSemaOptParam structure.
Definition threadmgr.h:175
SceUID evfId
Definition threadmgr.h:227
SceUInt attr
Attributes.
Definition threadmgr.h:190
SceInt64 data[4]
Definition threadmgr.h:263
SceKernelWaitableAttribute
Definition threadmgr.h:204
SceKernelSysClock runClocks
Number of clock cycles run.
Definition threadmgr.h:124
SceUInt32 threadReleaseCount
Thread release count.
Definition threadmgr.h:130
SceUID processId
Definition threadmgr.h:60
SceKernelIdListType
Threadmgr types.
Definition threadmgr.h:16
int numWaitThreads
The number of threads waiting on the mutex.
Definition threadmgr.h:307
int currentCount
The current count.
Definition threadmgr.h:303
SceSize size
Size of the SceKernelSemaInfo structure.
Definition threadmgr.h:184
SceKernelMutexAttribute
Definition threadmgr.h:275
int initCount
The initial count the mutex was created with.
Definition threadmgr.h:301
SceSize size
Size of the SceKernelMutexOptParam structure.
Definition threadmgr.h:283
SceInt32 currentPriority
Current priority.
Definition threadmgr.h:108
int currentCount
The current count.
Definition threadmgr.h:194
SceUInt32 threadPreemptCount
Thread preemption count.
Definition threadmgr.h:128
SceInt32 lastExecutedCpuId
Last executed CPU ID.
Definition threadmgr.h:116
int maxCount
The maximum count.
Definition threadmgr.h:196
SceUInt32 attr
Attributes.
Definition threadmgr.h:76
int(* SceKernelThreadEventHandler)(SceInt32 type, SceUID threadId, SceInt32 arg, void *pCommon)
Definition threadmgr.h:69
SceUInt attr
Definition threadmgr.h:229
SceUID callbackId
The UID of the callback.
Definition threadmgr.h:153
SceUID processId
The UID of the process where the thread belongs.
Definition threadmgr.h:92
int initCount
The initial count the semaphore was created with.
Definition threadmgr.h:192
char name[32]
Nul terminated name of the thread.
Definition threadmgr.h:94
SceSize size
Definition threadmgr.h:58
SceInt32 reserved
Reserved.
Definition threadmgr.h:136
SceInt32 currentCpuId
Current CPU ID.
Definition threadmgr.h:114
SceInt32 exitStatus
Exit status of the thread.
Definition threadmgr.h:122
SceSize size
Size of the structure (i.e.
Definition threadmgr.h:151
int(* SceKernelThreadEntry)(SceSize args, void *argp)
Definition threadmgr.h:67
int ceilingPriority
Definition threadmgr.h:284
SceSize size
Size of the SceKernelThreadOptParam structure.
Definition threadmgr.h:74
SceInt32 stackSize
Thread stack size.
Definition threadmgr.h:104
char name[32]
NUL-terminated name of the condition variable.
Definition threadmgr.h:329
SceInt32 currentCpuAffinityMask
Current CPU affinity mask.
Definition threadmgr.h:112
@ SCE_EVENT_THREAD_PRIO
Use SCE_KERNEL_ATTR_THREAD_PRIO.
Definition threadmgr.h:213
@ SCE_EVENT_WAITSINGLE
Sync object can only be waited upon by one thread.
Definition threadmgr.h:214
@ SCE_EVENT_OPENABLE
Use SCE_KERNEL_ATTR_OPENABLE.
Definition threadmgr.h:216
@ SCE_EVENT_WAITMULTIPLE
Sync object can be waited upon by multiple threads.
Definition threadmgr.h:215
@ SCE_EVENT_THREAD_FIFO
Use SCE_KERNEL_ATTR_THREAD_FIFO.
Definition threadmgr.h:212
@ 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:239
@ SCE_EVENT_WAITCLEAR_PAT
Clear the wait pattern when it matches.
Definition threadmgr.h:245
@ SCE_EVENT_WAITCLEAR
Clear all the bits when it matches.
Definition threadmgr.h:243
@ SCE_EVENT_WAITOR
Wait for one or more bits in the pattern to be set.
Definition threadmgr.h:241
@ 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:206
@ SCE_KERNEL_ATTR_THREAD_FIFO
Waiting threads First input First output.
Definition threadmgr.h:205
@ SCE_KERNEL_ATTR_OPENABLE
Sync object can be accessed by sceKernelOpenXxx.
Definition threadmgr.h:207
@ 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_MUTEX_ATTR_RECURSIVE
Definition threadmgr.h:276
@ SCE_KERNEL_MUTEX_ATTR_CEILING
Definition threadmgr.h:277
Structure to hold the status information for a callback.
Definition threadmgr.h:149
Current state of a condition variable.
Definition threadmgr.h:323
Additional options used when creating condition variables.
Definition threadmgr.h:314
Structure to hold the event flag information.
Definition threadmgr.h:225
Definition threadmgr.h:219
Definition threadmgr.h:255
Definition threadmgr.h:250
Definition threadmgr.h:267
Definition threadmgr.h:262
Current state of a mutex.
Definition threadmgr.h:291
Additional options used when creating mutexes.
Definition threadmgr.h:281
Current state of a semaphore.
Definition threadmgr.h:182
Additional options used when creating semaphores.
Definition threadmgr.h:173
Structure to hold the status information for a thread.
Definition threadmgr.h:88
Additional options used when creating threads.
Definition threadmgr.h:72
Statistics about a running thread.
Definition threadmgr.h:57
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