SceKernelThreadMgr: Difference between revisions

From Vita Development Wiki
Jump to navigation Jump to search
Line 3,440: Line 3,440:
| 3.60 || 0xE9A99C50  
| 3.60 || 0xE9A99C50  
|}
|}
=== sceKernelGetTHBPForDriver ===
{| class="wikitable"
! Version !! NID
|-
| 0.990-3.60 || 0x453B764A
|}
<source lang="C">int sceKernelGetTHBPForDriver(SceUID pid, SceUInt32 a2, int a3, int a4);</source>
=== sceKernelSetTHBPForDriver ===
{| class="wikitable"
! Version !! NID
|-
| 0.990-3.60 || 0x385831A1
|}
<source lang="C">int sceKernelSetTHBPForDriver(SceUID pid, SceUInt32 a2, int a3, int a4);</source>


== SceThreadmgrForKernel ==
== SceThreadmgrForKernel ==

Revision as of 12:31, 18 January 2020

PSVita supports multi-threading in the non-secure kernel but not the secure kernel. There is no user/POSIX threads; all threads are implemented as kernel threads and processes are the functionally the same as threads. Threads can be specified to run on a specific core with the CPU affinity mask option when creating the thread and by default, threads can run on any core. The kernel process can also run on any core. Additionally, the secure kernel can also run on any core.

Module

This module exists only in non-secure world. The SELF can be found in os0:kd/threadmgr.skprx.

Known NIDs

Version Name World Privilege NID
1.69 SceKernelThreadMgr Non-secure Kernel 0xA09CFA5C
3.57 SceKernelThreadMgr Non-secure Kernel 0x21530BE9
3.60 SceKernelThreadMgr Non-secure Kernel 0xF46ED7B2
3.65 SceKernelThreadMgr Non-secure Kernel 0x23A1B482

Libraries

This module is accessible by usermode.

Known NIDs

Version Name World Visibility NID
1.69-3.60 SceThreadmgrForDriver Non-secure Kernel 0xE2C40624
1.69-3.60 SceThreadmgrForKernel Non-secure Kernel 0xA8CA0EFD
3.65-3.67 SceThreadmgrForKernel Non-secure Kernel 0x7F8593BA
3.60 SceThreadmgrCoredumpTime Non-secure User 0x5E8D0E22
1.69-3.60 SceThreadmgr Non-secure User 0x859A24B1

Class Objects

Summary

class type size place of creation
SceUIDCacheClass SceCacheObj 0x10 used as uid class to create SceUIDWaitableClass
SceUIDWaitableClass SceWaitableObj 0x28 unknown
SceUIDFastMutexClass SceFastMutexObj 0x80 sceKernelInitializeFastMutexForDriver
SceUIDAlarmClass SceAlarmObj 0x80 sceKernelCreateAlarmForDriver, sceKernelRegisterTimerForDriver
SceUIDDelayClass SceDelayObj 0x80 sceKernelDelayThread, sceKernelDelayThread200, sceKernelDelayThreadCB, sceKernelDelayThreadCB200, sceKernelDelayThreadUnkForDriver, sceKernelDelayThreadUnkCBForDriver, sceKernelWaitSignal, sceKernelWaitSignalCB, 0x36f8e58a, 0x8c48e53b, sceKernelWaitMultipleEvents, sceKernelWaitMultipleEvents, sceKernelWaitThreadEndForDriver, sceKernelWaitThreadEndCBForDriver, 0xf282ae42, 0xe92c1784, sceKernelLockMutex_089ForDriver, sceKernelLockMutex_089ForKernel, sceKernelLockMutexCB_089ForDriver, sceKernelWaitCondForDriver, sceKernelWaitCondCB, sceKernelWaitEventFlagForDriver, sceKernelWaitEventFlagCBForDriver, sceKernelLockFastMutexForDriver, sceKernelWaitSemaForDriver, sceKernelWaitSemaForKernel, sceKernelWaitSemaCBForDriver, sceKernelSendMsgPipeVectorForDriver, 0x2fc0fff6, sceKernelReceiveMsgPipeVectorForDriver, sceKernelReceiveMsgPipeVectorCBForDriver, sceKernelWaitEventForDriver, sceKernelWaitEventCBForDriver, sceKernelWaitCondForDriver, sceKernelWaitCondCB, sceKernelLockLwMutex, sceKernelWaitLwCond, sceKernelWaitLwCondCB, sceKernelWaitLwCondCB, 0x3f5e1d56, 0xcfa2ffaf, 0xa64b00f6, 0x54566860, 0x154f2c2a, 0x48c06cd6, 0x12fc0fab, 0xb247ec4b, sceKernelWaitException, sceKernelWaitExceptionCB
SceUIDLwMutexClass SceLwMutexObj 0x80 __sceKernelCreateLwMutex
SceUIDCondClass SceCondObj 0x80 _sceKernelCreateCond, sceKernelCreateCondForDriver
SceUIDEventFlagClass SceEventFlagObj 0x80 _sceKernelCreateEventFlag, sceKernelCreateEventFlagForDriver
SceUIDLwCondClass SceLwCondObj 0x80 _sceKernelCreateLwCond
SceUIDMsgPipeClass SceMsgPipeObj 0x80 _sceKernelCreateMsgPipeWithLR, sceKernelCreateMsgPipeForDriver
SceUIDMutexClass SceMutexObj 0x80 _sceKernelCreateMutex, sceKernelCreateMutexForDriver, sceKernelCreateMutexForKernel
SceUIDRWLockClass SceRWLockObj 0x80 _sceKernelCreateRWLock, sceKernelCreateRWLockForDriver
SceUIDSemaphoreClass SceSemaObj 0x80 _sceKernelCreateSema, _sceKernelCreateSema_16XX, sceKernelCreateSemaForDriver, sceKernelCreateSemaForKernel
SceUIDSimpleEventClass SceSimpleEventObj 0x80 _sceKernelCreateSimpleEvent, sceKernelCreateSimpleEventForDriver
SceUIDTimerClass SceTimerObj 0x80 _sceKernelCreateTimer, sceKernelCreateTimerForDriver
SceUIDCpuTimerClass SceCpuTimerObj 0x58 used as uid class to create SceUIDDelayClass
SceUIDCallbackClass SceCallbackObj 0x80 sceKernelCreateCallback, sceKernelCreateCallbackForDriver
SceUIDRegisterCallbackClass SceRegisterCallbackObj 0x30 used as uid class to create SceUIDEventClass
SceUIDThreadClass SceThreadObj 0x200 sceKernelCreateThreadForUser, sceKernelCreateRemoteThreadForDriver, sceKernelCreateThreadForDriver
SceUIDThreadEventClass SceThreadEventObj 0x80 sceKernelRegisterThreadEventHandlerForDriver, sceKernelRegisterThreadEventHandlerForKernel
SceUIDWorkQueueClass SceWorkQueueObj 0x80 sceKernelCreateWorkQueueForDriver
SceUIDWorkTaskClass SceWorkTaskObj 0x80 sceKernelEnqueueWorkQueueForDriver
SceUIDExceptionClass SceExcpObj 0x80 sceKernelCreateExceptionForKernel
SceUIDEventClass SceEventObj 0x38 unknown
SceUIDProcessClass SceProcessObj at least 0x28 unknown

Class Types


// this is a generic type which is not specific for SceKernelThreadMgr. It is used in class creation in many modules.
typedef struct SceObjectBase {
	uint32_t sce_reserved[2];
	uint32_t data[];
} SceObjectBase;

typedef struct _SceCacheObj {
  SceObjectBase base;
  int unk8;
  int unkC;
} SceCacheObj;

typedef struct _SceWaitableObj {
  SceObjectBase base;
  int unk8;
  int unkC;
  int unk10;
  int unk14;
  int unk18;
  int unk1C;
  int unk20;
  int unk24;
} SceWaitableObj;

typedef struct _SceFastMutexObj {
  SceObjectBase base;
  int unk8;
  int unkC;
  int unk10;
  int unk14;
  int unk18;
  int unk1C;
  int unk20;
  int unk24;
  int unk28;
  int unk2C;
  int unk30;
  int unk34;
  int unk38;
  int unk3C;
  int unk40;
  int unk44;
  int unk48;
  int unk4C;
  int unk50;
  int unk54;
  int unk58;
  int unk5C;
  int unk60;
  int unk64;
  int unk68;
  int unk6C;
  int unk70;
  int unk74;
  int unk78;
  int unk7C;
} SceFastMutexObj;

typedef struct _SceAlarmObj {
  SceObjectBase base;
  int unk8;
  int unkC;
  int unk10;
  int unk14;
  int unk18;
  int unk1C;
  int unk20;
  int unk24;
  int unk28;
  int unk2C;
  int unk30;
  int unk34;
  int unk38;
  int unk3C;
  int unk40;
  int unk44;
  int unk48;
  int unk4C;
  int unk50;
  int unk54;
  int unk58;
  int unk5C;
  int unk60;
  int unk64;
  int unk68;
  int unk6C;
  int unk70;
  int unk74;
  int unk78;
  int unk7C;
} SceAlarmObj;

typedef struct _SceDelayObj {
  SceObjectBase base;
  int unk8;
  int unkC;
  int unk10;
  int unk14;
  int unk18;
  int unk1C;
  int unk20;
  int unk24;
  int unk28;
  int unk2C;
  int unk30;
  int unk34;
  int unk38;
  int unk3C;
  int unk40;
  int unk44;
  int unk48;
  int unk4C;
  int unk50;
  int unk54;
  int unk58;
  int unk5C;
  int unk60;
  int unk64;
  int unk68;
  int unk6C;
  int unk70;
  int unk74;
  int unk78;
  int unk7C;
} SceDelayObj;

typedef struct _SceLwMutexObj {
  SceObjectBase base;
  int unk8;
  int unkC;
  int unk10;
  int unk14;
  int unk18;
  int unk1C;
  int attr_20;
  int unk24;
  int unk28;
  int initCount_2C;
  SceKernelLwMutexWork* work_30;
  int unk34;
  int unk38;
  int unk3C;
  int unk40;
  int unk44;
  int unk48;
  int unk4C;
  int unk50;
  int unk54;
  int unk58;
  int unk5C;
  int unk60;
  int unk64;
  int unk68;
  int unk6C;
  int unk70;
  int unk74;
  int unk78;
  int unk7C;
} SceLwMutexObj;

typedef struct _SceCondObj {
  SceObjectBase base;
  int unk8;
  int unkC;
  int unk10;
  int unk14;
  int unk18;
  int unk1C;
  int attr_20;
  int unk24;
  SceKernelCondOptParam* option_28;
  SceUID mutexId_2C;
  int unk30;
  int unk34;
  int unk38;
  int unk3C;
  int unk40;
  int unk44;
  int unk48;
  int unk4C;
  int unk50;
  int unk54;
  int unk58;
  int unk5C;
  int unk60;
  int unk64;
  int unk68;
  int unk6C;
  int unk70;
  int unk74;
  int unk78;
  int unk7C;
} SceCondObj;

typedef struct _SceEventFlagObj {
  SceObjectBase base;
  int unk8;
  int unkC;
  int unk10;
  int unk14;
  int unk18;
  int unk1C;
  int attr_20;
  int unk24;
  int bits_28;
  int bits_2C;
  int unk30;
  int unk34;
  int unk38;
  int unk3C;
  int unk40;
  int unk44;
  int unk48;
  int unk4C;
  int unk50;
  int unk54;
  int unk58;
  int unk5C;
  int unk60;
  int unk64;
  int unk68;
  int unk6C;
  int unk70;
  int unk74;
  int unk78;
  int unk7C;
} SceEventFlagObj;

typedef struct _SceLwCondObj {
  SceObjectBase base;
  int unk8;
  int unkC;
  int unk10;
  int unk14;
  int unk18;
  int unk1C;
  int unk20;
  int unk24;
  int unk28;
  int unk2C;
  int unk30;
  int unk34;
  int unk38;
  int unk3C;
  int unk40;
  int unk44;
  int unk48;
  int unk4C;
  int unk50;
  int unk54;
  int unk58;
  int unk5C;
  int unk60;
  int unk64;
  int unk68;
  int unk6C;
  int unk70;
  int unk74;
  int unk78;
  int unk7C;
} SceLwCondObj;

typedef struct _SceMsgPipeObj {
  SceObjectBase base;
  int unk8;
  int unkC;
  int unk10;
  int unk14;
  int unk18;
  int unk1C;
  int unk20;
  int unk24;
  int unk28;
  int unk2C;
  int unk30;
  int unk34;
  int unk38;
  int unk3C;
  int unk40;
  int unk44;
  int unk48;
  int unk4C;
  int unk50;
  int unk54;
  int unk58;
  int unk5C;
  int unk60;
  int unk64;
  int unk68;
  int unk6C;
  int unk70;
  int unk74;
  int unk78;
  int unk7C;
} SceMsgPipeObj;

typedef struct _SceMutexObj {
  SceObjectBase base;
  int unk8;
  int unkC;
  int unk10;
  int unk14;
  int unk18;
  int unk1C;
  int attr_20;
  int unk24;
  int unk28;
  int unk2C;
  int unk30;
  int unk34;
  int initCount_38;
  int initCount_3C;
  int unk40;
  int ceilingPriority_44;
  int unk48;
  int unk4C;
  int unk50;
  int unk54;
  int unk58;
  int unk5C;
  int unk60;
  int unk64;
  int unk68;
  int unk6C;
  int unk70;
  int unk74;
  int unk78;
  int unk7C;
} SceMutexObj;

typedef struct _SceRWLockObj {
  SceObjectBase base;
  int unk8;
  int unkC;
  int unk10;
  int unk14;
  int unk18;
  int unk1C;
  int unk20;
  int unk24;
  int unk28;
  int unk2C;
  int unk30;
  int unk34;
  int unk38;
  int unk3C;
  int unk40;
  int unk44;
  int unk48;
  int unk4C;
  int unk50;
  int unk54;
  int unk58;
  int unk5C;
  int unk60;
  int unk64;
  int unk68;
  int unk6C;
  int unk70;
  int unk74;
  int unk78;
  int unk7C;
} SceRWLockObj;

typedef struct SceKernelSemaOptParam {
	/** Size of the ::SceKernelSemaOptParam structure. */
	SceSize 	size;
} SceKernelSemaOptParam;

typedef struct _SceSemaObj {
  SceObjectBase base;
  int unk8;
  int unkC;
  int unk10;
  int unk14;
  int unk18;
  int unk1C;
  int attr_20;
  int unk24;
  SceKernelSemaOptParam* option_28;
  int initVal_2C;
  int maxVal_30;
  int initVal_34;
  int unk_38;
  int unk_3C;
  int unk40;
  int unk44;
  int unk48;
  int unk4C;
  int unk50;
  int unk54;
  int unk58;
  int unk5C;
  int unk60;
  int unk64;
  int unk68;
  int unk6C;
  int unk70;
  int unk74;
  int unk78;
  int unk7C;
} SceSemaObj;

typedef struct _SceSimpleEventObj {
  SceObjectBase base;
  int unk8;
  int unkC;
  int unk10;
  int unk14;
  int unk18;
  int unk1C;
  int unk20;
  int unk24;
  int unk28;
  int unk2C;
  int unk30;
  int unk34;
  int unk38;
  int unk3C;
  int unk40;
  int unk44;
  int unk48;
  int unk4C;
  int unk50;
  int unk54;
  int unk58;
  int unk5C;
  int unk60;
  int unk64;
  int unk68;
  int unk6C;
  int unk70;
  int unk74;
  int unk78;
  int unk7C;
} SceSimpleEventObj;

typedef struct _SceTimerObj {
  SceObjectBase base;
  int unk8;
  int unkC;
  int unk10;
  int unk14;
  int unk18;
  int unk1C;
  int unk20;
  int unk24;
  int unk28;
  int unk2C;
  int unk30;
  int unk34;
  int unk38;
  int unk3C;
  int unk40;
  int unk44;
  int unk48;
  int unk4C;
  int unk50;
  int unk54;
  int unk58;
  int unk5C;
  int unk60;
  int unk64;
  int unk68;
  int unk6C;
  int unk70;
  int unk74;
  int unk78;
  int unk7C;
} SceTimerObj;

typedef struct _SceCpuTimerObj {
  SceObjectBase base;
  int unk8;
  int unkC;
  int unk10;
  int unk14;
  int unk18;
  int unk1C;
  int unk20;
  int unk24;
  int unk28;
  int unk2C;
  int unk30;
  int unk34;
  int unk38;
  int unk3C;
  int unk40;
  int unk44;
  int unk48;
  int unk4C;
  int unk50;
  int unk54;
} SceCpuTimerObj;

typedef int (*SceKernelCallbackFunction)(int notifyId, int notifyCount, int notifyArg, void *common);

typedef struct _SceCallbackObj
{
  SceObjectBase base;
  int unk8;
  int unkC;
  int unk10;
  int unk14;
  int unk18;
  int attr_1C;
  int unk20;
  int unk24;
  SceKernelCallbackFunction func_28;
  int unk2C;
  int unk30;
  int unk34;
  void *arg_38;
  int unk3C;
  int unk40;
  int unk44;
  int unk48;
  int unk4C;
  int unk50;
  int unk54;
  int unk58;
  int unk5C;
  int unk60;
  int unk64;
  int unk68;
  int unk6C;
  int unk70;
  int unk74;
  int unk78;
  int unk7C;
} SceCallbackObj;

typedef struct _SceRegisterCallbackObj
{
  SceObjectBase base;
  int unk8;
  int unkC;
  int unk10;
  int unk14;
  int unk18;
  int unk1C;
  int unk20;
  int unk24;
  int unk28;
  int unk2C;
} SceRegisterCallbackObj;

typedef struct _SceThreadObj
{
  SceObjectBase base;
  int unk8;
  int unkC;
  int unk10;
  int unk14;
  int unk18;
  int unk1C;
  int attr_unk20;
  int unk_24;
  int unk28;
  int unk2C;
  int unk30;
  int unk34;
  int unk38;
  int unk3C;
  int unk40;
  int unk44;
  int unk48;
  int unk4C;
  int unk50;
  int unk54;
  int unk58;
  int unk5C;
  SceUID pid_60;
  int unk_64;
  int unk68;
  int unk6C;
  int unk70;
  int unk74;
  int unk78;
  int unk7C;
  int unk80;
  int unk84;
  int unk88;
  int unk8C;
  int unk90;
  int unk94;
  int unk98;
  int unk9C;
  int unkA0;
  int unkA4;
  int unkA8;
  int unkAC;
  int unkB0;
  int unkB4;
  int unkB8;
  int unkBC;
  int unkC0;
  int unkC4;
  int unkC8;
  int attr_CC;
  int attr_D0;
  int priority_D4;
  int priority_D8;
  int unk_DC;
  int priority_E0;
  int unk_E4;
  int unkE8;
  int unkEC;
  int unkF0;
  int unkF4;
  int unkF8;
  int unkFC;
  int unk100;
  int unk104;
  int unk108;
  int unk10C;
  int unk110;
  int unk114;
  int unk118;
  int unk11C;
  int unk120;
  int unk124;
  int unk128;
  int unk12C;
  int unk130;
  int unk134;
  int unk138;
  int unk13C;
  int unk140;
  int unk144;
  int unk148;
  int unk14C;
  int unk150;
  int unk154;
  int unk158;
  int unk15C;
  int unk160;
  int unk164;
  int unk168;
  int unk16C;
  int unk170;
  int unk174;
  int unk178;
  int unk17C;
  int unk180;
  int unk184;
  int unk188;
  int unk18C;
  int unk190;
  int unk194;
  int unk198;
  int unk19C;
  int unk1A0;
  int unk1A4;
  int unk1A8;
  int unk1AC;
  int unk1B0;
  int unk1B4;
  int unk1B8;
  int unk1BC;
  int unk1C0;
  int unk1C4;
  int unk1C8;
  int unk1CC;
  int unk1D0;
  int unk1D4;
  int unk1D8;
  int unk1DC;
  int unk1E0;
  int unk1E4;
  int unk1E8;
  int unk1EC;
  int unk1F0;
  int unk1F4;
  int unk1F8;
  int unk1FC;
} SceThreadObj;

typedef struct _SceThreadEventObj
{
  SceObjectBase base;
  int unk8;
  int unkC;
  int unk10;
  int unk14;
  int unk18;
  int unk1C;
  int unk20;
  int unk24;
  int unk28;
  int unk2C;
  int unk30;
  int unk34;
  int unk38;
  int unk3C;
  int unk40;
  int unk44;
  int unk48;
  int unk4C;
  int unk50;
  int unk54;
  int unk58;
  int unk5C;
  int unk60;
  int unk64;
  int unk68;
  int unk6C;
  int unk70;
  int unk74;
  int unk78;
  int unk7C;
} SceThreadEventObj;

typedef struct _SceWorkQueueObj
{
  SceObjectBase base;
  int unk8;
  int unkC;
  int unk10;
  int unk14;
  int atomic_lock;
  int unk1C;
  int unk20;
  int unk24;
  int unk28;
  int unk2C;
  int unk30;
  int unk34;
  unsigned long long obj_counter;
  int unk40;
  int unk44;
  int unk48;
  int unk4C;
  int unk50;
  SceUID sema_uid;
  int unk58;
  int unk5C;
  int unk60;
  int unk64;
  int unk68;
  int unk6C;
  int unk70;
  int unk74;
  int unk78;
  int unk7C;
} SceWorkQueueObj;

typedef int (*SceKernelWorkQueueWorkFunction)(void *args);

typedef struct _SceWorkTaskObj
{
  SceObjectBase base;
  int unk8;
  int unkC;
  int unk10;
  int unk14;
  int atomic_lock;
  int unk1C;
  int unk20;
  int unk24;
  SceWorkQueueObj *queue_obj;
  int unk2C;
  int unk30;
  int unk34;
  SceUID task_uid;
  int unk3C;
  unsigned long long obj_counter;
  int unk48;
  int unk4C;
  int some_flag;
  int unk54;
  SceUID work_queue_uid;
  SceKernelWorkQueueWorkFunction func;
  void *args;
  SceUID current_thread_uid;
  int unk68;
  int unk6C;
  int unk70;
  SceUID pid;
  int unk78;
  int unk7C;
} SceWorkTaskObj;

typedef struct _SceExcpObj
{
  SceObjectBase base;
  int unk8;
  int unkC;
  int unk10;
  int unk14;
  int unk18;
  int unk1C;
  int unk20;
  int unk24;
  int unk28;
  int unk2C;
  int unk30;
  int unk34;
  int unk38;
  int unk3C;
  int unk40;
  int unk44;
  int unk48;
  int unk4C;
  int unk50;
  int unk54;
  int unk58;
  int unk5C;
  int unk60;
  int unk64;
  int unk68;
  int unk6C;
  int unk70;
  int unk74;
  int unk78;
  int unk7C;
} SceExcpObj;

typedef struct _SceEventObj
{
  SceObjectBase base;
  int unk8;
  int unkC;
  int unk10;
  int unk14;
  int unk18;
  int unk1C;
  int unk20;
  int unk24;
  int unk28;
  int unk2C;
  int unk30;
  int unk34;
} SceEventObj;

typedef unsigned long long SceKernelSysClock;

typedef struct _SceProcessObj
{
  SceObjectBase base;
  int unk8;
  int unkC;
  int unk10;
  int unk14;
  int unk18;
  int unk1C;
  SceKernelSysClock some_time_20;
};

Types

/** @name	Basic thread functions
 */
/*@{*/

/**
 * @defgroup	Thread attributes
 * Defining thread attributes
 * Specified in attr argument of sceKernelCreateThread()
 */
/*@{*/
#define SCE_KERNEL_THREAD_ATTR_NOUSE_VFP		(0x01000000U)		/**< Do not use VFP */
/*@}*/

/**
 * @defgroup	Thread priority
 * Defining thread priorities
 */
/*@{*/
#define SCE_KERNEL_HIGHEST_PRIORITY_USER		(64)		/**< Highest priority of user mode threads */
#define SCE_KERNEL_LOWEST_PRIORITY_USER			(191)		/**< Lowest priority of user mode threads */

#define SCE_KERNEL_DEFAULT_PRIORITY			((SceInt32)0x10000100)		/**< Default priority (whole system) */

#define SCE_KERNEL_INDIVIDUAL_QUEUE_HIGHEST_PRIORITY	(64)		/**< Highest priority of individual queue area */
#define SCE_KERNEL_INDIVIDUAL_QUEUE_LOWEST_PRIORITY	(127)		/**< Lowest priority of individual queue area */
#define SCE_KERNEL_COMMON_QUEUE_HIGHEST_PRIORITY	(128)		/**< Highest priority of common queue area */
#define SCE_KERNEL_COMMON_QUEUE_LOWEST_PRIORITY		(191)		/**< Lowest priority of common queue area */

/**
 * Default priority (for users)
 * The default priority for game applications is converted to 160 internally.
 * You can also specify the default value ± offset (SCE_KERNEL_DEFAULT_PRIORITY_USER-10).
 */
#define SCE_KERNEL_DEFAULT_PRIORITY_USER		SCE_KERNEL_DEFAULT_PRIORITY

#define SCE_KERNEL_CURRENT_THREAD_PRIORITY		(0)		/**< The priority of the currently executing thread */
/*@}*/

/**
 * @defgroup	Thread stack size
 * Defining thread stack size
 */
/*@{*/
#define SCE_KERNEL_STACK_SIZE_MAX			SCE_KERNEL_1MiB				/**< Maximum stack size */
#define SCE_KERNEL_STACK_SIZE_MIN			SCE_KERNEL_4KiB				/**< Minimum stack size */

#define SCE_KERNEL_STACK_SIZE_DEFAULT			SCE_KERNEL_STACK_SIZE_MIN		/**< Default stack size */
#define SCE_KERNEL_STACK_SIZE_DEFAULT_USER_MAIN		(0x00040000)				/**< Default stack size of user main thread (byte) */

#define SCE_KERNEL_THREAD_STACK_SIZE_MAX		SCE_KERNEL_32MiB			/**< Maximum stack size */
#define SCE_KERNEL_THREAD_STACK_SIZE_MIN		SCE_KERNEL_4KiB				/**< Minimum stack size */

#define SCE_KERNEL_THREAD_STACK_SIZE_DEFAULT		SCE_KERNEL_THREAD_STACK_SIZE_MIN	/**< Default stack size */
#define SCE_KERNEL_THREAD_STACK_SIZE_DEFAULT_USER_MAIN	SCE_KERNEL_256KiB			/**< Default stack size of user main thread (byte) */
/*@}*/

/**
 * @defgroup	Thread state
 * Defining thread state
 */
/*@{*/
#define SCE_KERNEL_THREAD_STATUS_RUNNING		(0x00000001U)	/**< RUNNING status */
#define SCE_KERNEL_THREAD_STATUS_READY			(0x00000002U)	/**< READY status */
#define SCE_KERNEL_THREAD_STATUS_STANDBY		(0x00000004U)	/**< STANDBY status */
#define SCE_KERNEL_THREAD_STATUS_WAITING		(0x00000008U)	/**< WAITING status */
#define SCE_KERNEL_THREAD_STATUS_DORMANT		(0x00000010U)	/**< DORMANT status */
#define SCE_KERNEL_THREAD_STATUS_DELETED		(0x00000020U)	/**< DELETED status */
#define SCE_KERNEL_THREAD_STATUS_DEAD			(0x00000040U)	/**< DEAD status */
#define SCE_KERNEL_THREAD_STATUS_STAGNANT		(0x00000080U)	/**< STAGNANT status */
#define SCE_KERNEL_THREAD_STATUS_SUSPENDED		(0x00000100U)	/**< SUSPENDED status */

#define SCE_KERNEL_THREAD_STATUS_MASK			(0x0000ffffU)	/**< Valid thread state mask */
/*@}*/

/**
 * @defgroup	Thread wait type
 * Defining thread wait types
 */
/*@{*/
#if SCE_PSP2_SDK_VERSION < 0x01000000
#define SCE_KERNEL_WAITTYPE_DELAY			(0x00000001)	/**< Thread delay */
#define SCE_KERNEL_WAITTYPE_WAITTHEND			(0x00000002)	/**< End of thread */
#define SCE_KERNEL_WAITTYPE_EVENTFLAG			(0x00000004)	/**< Event flag */
#define SCE_KERNEL_WAITTYPE_MUTEX			(0x00000008)	/**< Mutex */
#define SCE_KERNEL_WAITTYPE_FAST_MUTEX			(0x00000010)	/**< Fast mutex */
#define SCE_KERNEL_WAITTYPE_FAST_MUTEX_SPIN		(0x00000020)	/**< Fast mutex (spin) */
#define SCE_KERNEL_WAITTYPE_SEMAPHORE			(0x00000040)	/**< Semaphore */
#define SCE_KERNEL_WAITTYPE_EVENT			(0x00000080)	/**< Single event */
#define SCE_KERNEL_WAITTYPE_COND			(0x00000100)	/**< Condition variable */
#define SCE_KERNEL_WAITTYPE_MSG_PIPE			(0x00000200)	/**< Message pipe */
#define	SCE_KERNEL_WAITTYPE_RW_LOCK			(0x00000400)	/**< Reader / writer lock */
#define SCE_KERNEL_WAITTYPE_SIGNAL			(0x00000800)	/**< Signal */
#define SCE_KERNEL_WAITTYPE_LW_MUTEX			(0x00001000)	/**< Lightweight mutex */
#define SCE_KERNEL_WAITTYPE_LW_COND			(0x00002000)	/**< Lightweight condition variable */
#define SCE_KERNEL_WAITTYPE_MP_EVENTS			(0x00008000)	/**< Event multiplexing */

#define SCE_KERNEL_WAITTYPE_DELAY_CB			(0x00010001)	/**< With thread delay callback check */
#define SCE_KERNEL_WAITTYPE_WAITTHEND_CB		(0x00010002)	/**< With thread termination callback check */
#define SCE_KERNEL_WAITTYPE_EVENTFLAG_CB		(0x00010004)	/**< With event flag callback check */
#define SCE_KERNEL_WAITTYPE_MUTEX_CB			(0x00010008)	/**< With mutex callback check */
#define SCE_KERNEL_WAITTYPE_FAST_MUTEX_CB		(0x00010010)	/**< With fast mutex callback check */
#define SCE_KERNEL_WAITTYPE_FAST_MUTEX_SPIN_CB		(0x00010020)	/**< With fast mutex (spin) callback check */
#define SCE_KERNEL_WAITTYPE_SEMAPHORE_CB		(0x00010040)	/**< With semaphore callback check */
#define SCE_KERNEL_WAITTYPE_EVENT_CB			(0x00010080)	/**< With single event callback check */
#define SCE_KERNEL_WAITTYPE_COND_CB			(0x00010100)	/**< With condition variable callback check */
#define SCE_KERNEL_WAITTYPE_MSG_PIPE_CB			(0x00010200)	/**< With message pipe callback check */
#define	SCE_KERNEL_WAITTYPE_RW_LOCK_CB			(0x00010400)	/**< With reader / writer lock callback check */
#define SCE_KERNEL_WAITTYPE_SIGNAL_CB			(0x00010800)	/**< With signal callback check */
#define SCE_KERNEL_WAITTYPE_LW_MUTEX_CB			(0x00011000)	/**< With lightweight mutex callback check */
#define SCE_KERNEL_WAITTYPE_LW_COND_CB			(0x00012000)	/**< With lightweight condition variable callback check */
#define SCE_KERNEL_WAITTYPE_MP_EVENTS_CB		(0x00018000)	/**< With event multiplexing callback check */
#else
#define SCE_KERNEL_WAITTYPE_DELAY			(0x00000001U)	/**< Thread delay */
#define SCE_KERNEL_WAITTYPE_WAITTHEND			(0x00000002U)	/**< End of thread */
#define SCE_KERNEL_WAITTYPE_SIGNAL			(0x00000004U)	/**< Signal */
#define SCE_KERNEL_WAITTYPE_WAITTHSUSPEND		(0x00000008U)	/**< Suspend thread */
#define SCE_KERNEL_WAITTYPE_EVENTFLAG			(0x00000010U)	/**< Event flag */
#define SCE_KERNEL_WAITTYPE_SEMAPHORE			(0x00000020U)	/**< Semaphore */
#define SCE_KERNEL_WAITTYPE_MUTEX			(0x00000040U)	/**< Mutex */
#define SCE_KERNEL_WAITTYPE_RW_LOCK			(0x00000080U)	/**< Reader / writer lock */
#define SCE_KERNEL_WAITTYPE_COND_SIGNAL			(0x00000100U)	/**< Condition variable (signal) */
#define SCE_KERNEL_WAITTYPE_COND_MUTEX			(0x00000200U)	/**< Condition variable (mutex) */
#define SCE_KERNEL_WAITTYPE_FAST_MUTEX			(0x00001000U)	/**< Fast mutex */
#define SCE_KERNEL_WAITTYPE_FAST_MUTEX_SPIN		(0x00002000U)	/**< Fast mutex (spin) */
#define SCE_KERNEL_WAITTYPE_EVENT			(0x00010000U)	/**< Single event */
#define SCE_KERNEL_WAITTYPE_MP_EVENTS			(0x00020000U)	/**< Event multiplexing */
#define SCE_KERNEL_WAITTYPE_MSG_PIPE			(0x00040000U)	/**< Message pipe */
#define SCE_KERNEL_WAITTYPE_LW_MUTEX			(0x00100000U)	/**< Lightweight mutex */
#define SCE_KERNEL_WAITTYPE_LW_COND_SIGNAL		(0x00200000U)	/**< Lightweight condition variable (signal) */
#define SCE_KERNEL_WAITTYPE_LW_COND_LW_MUTEX		(0x00400000U)	/**< Lightweight condition variable (mutex) */

#define SCE_KERNEL_WAITTYPE_DELAY_CB			(0x80000001U)	/**< With thread delay callback check */
#define SCE_KERNEL_WAITTYPE_WAITTHEND_CB		(0x80000002U)	/**< With thread termination callback check */
#define SCE_KERNEL_WAITTYPE_SIGNAL_CB			(0x80000004U)	/**< With signal callback check */
#define SCE_KERNEL_WAITTYPE_WAITTHSUSPEND_CB		(0x80000008U)	/**< With suspend thread callback check */
#define SCE_KERNEL_WAITTYPE_EVENTFLAG_CB		(0x80000010U)	/**< With event flag callback check */
#define SCE_KERNEL_WAITTYPE_SEMAPHORE_CB		(0x80000020U)	/**< With semaphore callback check */
#define SCE_KERNEL_WAITTYPE_MUTEX_CB			(0x80000040U)	/**< With mutex callback check */
#define SCE_KERNEL_WAITTYPE_RW_LOCK_CB			(0x80000080U)	/**< With reader / writer lock callback check */
#define SCE_KERNEL_WAITTYPE_COND_SIGNAL_CB		(0x80000100U)	/**< With condition variable (signal) callback check */
#define SCE_KERNEL_WAITTYPE_COND_MUTEX_CB		(0x80000200U)	/**< With condition variable (mutex) callback check */
#define SCE_KERNEL_WAITTYPE_FAST_MUTEX_CB		(0x80001000U)	/**< With fast mutex callback check */
#define SCE_KERNEL_WAITTYPE_FAST_MUTEX_SPIN_CB		(0x80002000U)	/**< With fast mutex (spin) callback check */
#define SCE_KERNEL_WAITTYPE_EVENT_CB			(0x80010000U)	/**< With single event callback check */
#define SCE_KERNEL_WAITTYPE_MP_EVENTS_CB		(0x80020000U)	/**< With event multiplexing callback check */
#define SCE_KERNEL_WAITTYPE_MSG_PIPE_CB			(0x80040000U)	/**< With message pipe callback check */
#define SCE_KERNEL_WAITTYPE_LW_MUTEX_CB			(0x80100000U)	/**< With lightweight mutex callback check */
#define SCE_KERNEL_WAITTYPE_LW_COND_SIGNAL_CB		(0x80200000U)	/**< With lightweight condition variable (signal) callback check */
#define SCE_KERNEL_WAITTYPE_LW_COND_LW_MUTEX_CB		(0x80400000U)	/**< With lightweight condition variable (mutex) callback check */
#endif
/*@}*/

/**
 * @defgroup	UID
 * Thread ID definition
 */
/*@{*/
#define SCE_KERNEL_THREAD_ID_SELF			(0)	/**< UID representing own thread */
/*@}*/

/**
 * @defgroup	UID class
 * Class definition of UID managed by thread manager (for User)
 */
/*@{*/
#define SCE_KERNEL_THREADMGR_UID_CLASS_THREAD		(1)	/**< Thread class */
#define SCE_KERNEL_THREADMGR_UID_CLASS_SEMA		(2)	/**< Semaphore class */
#define SCE_KERNEL_THREADMGR_UID_CLASS_EVENT_FLAG	(3)	/**< Event flag class */
#define SCE_KERNEL_THREADMGR_UID_CLASS_MUTEX		(4)	/**< Mutex class */
#define SCE_KERNEL_THREADMGR_UID_CLASS_COND		(5)	/**< Condition variable class */
#define SCE_KERNEL_THREADMGR_UID_CLASS_TIMER		(6)	/**< Timer class */
#define SCE_KERNEL_THREADMGR_UID_CLASS_MSG_PIPE		(7)	/**< Message pipe class */
#define SCE_KERNEL_THREADMGR_UID_CLASS_CALLBACK		(8)	/**< Callback class */
#define SCE_KERNEL_THREADMGR_UID_CLASS_THREAD_EVENT	(9)	/**< Thread event class */
#define SCE_KERNEL_THREADMGR_UID_CLASS_LW_MUTEX		(10)	/**< Lightweight mutex class */
#define SCE_KERNEL_THREADMGR_UID_CLASS_LW_COND		(11)	/**< Lightweight condition variable class */
#define SCE_KERNEL_THREADMGR_UID_CLASS_RW_LOCK		(12)	/**< Reader / writer lock class */
#define SCE_KERNEL_THREADMGR_UID_CLASS_SIMPLE_EVENT	(13)	/**< Simple event class */
/*@}*/

/**
 * @defgroup	CPU affinity mask
 * CPU affinity mask definition
 */
/*@{*/
/**
 * @brief Default CPU affinity mask
 *
 * If the default CPU affinity mask is specified for a thread,
 * the CPU affinity mask specified for the process to which it belongs is inherited.
 */
#define SCE_KERNEL_THREAD_CPU_AFFINITY_MASK_DEFAULT	(0)
/*@}*/

/**
 * @brief Thread entry type
 *
 * Thread entry function type. Specify to sceKernelCreateThread().
 * The argument block of the thread given by the argument of sceKernelStartThread() is copied onto the
 * stack of the started thread, and is received from the started thread through the argument of the entry function.
 *
 * When a thread entry function is terminated with return, the thread terminates,
 * and the return value of the entry function becomes the termination status of that thread.
 * The thread exit status can be obtained with sceKernelWaitThreadEnd() or
 * sceKernelGetThreadExitStatus() if the thread is not deleted.
 *
 * @param	argSize		The argument size given by sceKernelStartThread() is passed.
 * @param	pArgBlock	The address on the stack where the argument block given by sceKernelStartThread() is copied is passed.
 * @return	Thread exit status
 */
typedef SceInt32	(*SceKernelThreadEntry)(SceSize argSize, void *pArgBlock);

/**
 * @brief Stack change function type
 *
 * The type of function to call when the stack changes. Specify to sceKernelCallWithChangeStack().
 *
 * With sceKernelCallWithChangeStack(), the stack is switched as soon as the stack change function is called.
 * As soon as the stack change function ends with return, it returns to the original stack.
 *
 * @param	pArg	Arbitrary pointer to pass to stack change function
 * @return	Return value of sceKernelCallWithChangeStack()
 */
typedef SceInt32	(*SceKernelChangeStackFunction)(void *pArg);

/**
 * @brief Thread additional data
 *
 * This structure is used to store additional data given when creating a thread with sceKernelCreateThread().
 *
 * Provided for future expansion.
 *
 */
typedef struct _SceKernelThreadOptParam { // Min size is 4 bytes. Max size is 0x14 bytes.
	SceSize				size;			/**< Size of this structure (sizeof(SceKernelThreadOptParam)) */
	SceUInt32			attr;			/**< A bit pattern that specifies valid members in a structure */
} SceKernelThreadOptParam;

/**
 * @brief Thread information structure
 *
 * A structure used to store thread information with sceKernelGetThreadInfo().
 */
typedef struct _SceKernelThreadInfo {
	SceSize				size;				/**< Size of this structure (sizeof(SceKernelThreadInfo)) */
	SceUID				processId;			/**< Process ID to which the thread belongs */
	char				name[SCE_UID_NAMELEN+1];	/**< Thread name */
	SceUInt32			attr;				/**< Thread attributes */
	SceUInt32			status;				/**< Thread state */
	SceKernelThreadEntry		entry;				/**< Thread entry function address */
	void				*pStack;			/**< Thread stack address (bottom) */
	SceSize				stackSize;			/**< Thread stack size */
	SceInt32			initPriority;			/**< Thread initial priority */
	SceInt32			currentPriority;		/**< Thread current priority */
	SceInt32			initCpuAffinityMask;		/**< Thread initial CPU affinity mask */
	SceInt32			currentCpuAffinityMask;		/**< Thread current CPU affinity mask */
	SceInt32			currentCpuId;			/**< CPU number to which the thread currently belongs */
	SceInt32			lastExecutedCpuId;		/**< CPU number to which the thread was last executed */
	SceUInt32			waitType;			/**< Type when the thread is waiting */
	SceUID				waitId;				/**< UID of the target synchronization object when the thread is waiting */
	SceInt32			exitStatus;			/**< Thread exit status */
	SceKernelSysClock		runClocks;			/**< Time (in microseconds) executed since the thread was created */
	SceUInt32			intrPreemptCount;		/**< Number of times the thread was preempted by interrupt handling */
	SceUInt32			threadPreemptCount;		/**< Number of times the thread has been preempted by other thread operations */
	SceUInt32			threadReleaseCount;		/**< Number of times the thread has relinquished execution */
	SceInt32			changeCpuCount;			/**< Number of CPUs to which the thread is moved */
	SceInt32			fNotifyCallback;		/**< A flag indicating whether the thread is notified of the callback */
	SceInt32			reserved;			/**< Reserved area */
} SceKernelThreadInfo;

/**
 * @brief Thread operating status on each CPU
 *
 * This structure is used by sceKernelGetThreadRunStatus() to obtain the operating status of threads on each CPU.
 *
 */
typedef struct _SceKernelThreadRunStatus {
	SceSize		size;			/**< Size of this structure (sizeof(SceKernelThreadRunStatus)) */
	struct {
		SceUID		processId;		/**< Process ID to which the running thread belongs */
		SceUID		threadId;		/**< Thread ID being executed */
		SceInt32	priority;		/**< Priority of the running thread */
	} cpuInfo[SCE_KERNEL_MAX_CPU];		/**< Information about individual CPUs */
} SceKernelThreadRunStatus;

/**
 * @brief System state
 *
 * This structure is used to get the system status with sceKernelGetSystemInfo().
 *
 */
typedef struct _SceKernelSystemInfo {
	SceSize			size;				/**< Size of this structure (sizeof(SceKernelSystemInfo)) */
	SceUInt32		activeCpuMask;			/**< Currently available CPU mask */
	struct	{
		SceKernelSysClock	idleClock;			/**< Time when there was no thread to execute */
		SceUInt32		comesOutOfIdleCount;		/**< Number of transitions from a state where there is no thread to execute to another state */
		SceUInt32		threadSwitchCount;		/**< Number of context switches that occurred */
	} cpuInfo[SCE_KERNEL_MAX_CPU];				/**< Information about individual CPUs */
} SceKernelSystemInfo;

/*@}*//* Basic thread functions */

/** @name	VFP exception
 */
/*@{*/

/**
 * @defgroup	Defining VFP exceptions
 * Bit pattern that specifies a VFP exception
 */
/*@{*/
#define SCE_KERNEL_VFP_EXCEPTION_MASK_QCE		(0x08000000U)		/**< QCE flag interrupt enable */
#define SCE_KERNEL_VFP_EXCEPTION_MASK_IDE		(0x00000080U)		/**< IDE flag interrupt enable */
#define SCE_KERNEL_VFP_EXCEPTION_MASK_IXE		(0x00000010U)		/**< IXE flag interrupt enable */
#define SCE_KERNEL_VFP_EXCEPTION_MASK_UFE		(0x00000008U)		/**< UFE flag interrupt enable */
#define SCE_KERNEL_VFP_EXCEPTION_MASK_OFE		(0x00000004U)		/**< OFE flag interrupt enable */
#define SCE_KERNEL_VFP_EXCEPTION_MASK_DZE		(0x00000002U)		/**< DZE flag interrupt enable */
#define SCE_KERNEL_VFP_EXCEPTION_MASK_IOE		(0x00000001U)		/**< IOE flag interrupt enable */

/**
 * Valid VFP exception mask
 */
#define SCE_KERNEL_VFP_EXCEPTION_MASK_ALL	(SCE_KERNEL_VFP_EXCEPTION_MASK_QCE | SCE_KERNEL_VFP_EXCEPTION_MASK_IDE | \
						SCE_KERNEL_VFP_EXCEPTION_MASK_IXE | SCE_KERNEL_VFP_EXCEPTION_MASK_UFE | \
						SCE_KERNEL_VFP_EXCEPTION_MASK_OFE | SCE_KERNEL_VFP_EXCEPTION_MASK_DZE | \
						SCE_KERNEL_VFP_EXCEPTION_MASK_IOE)
/*@}*/

/*@}*//* VFP exception */

/** @name	Common to synchronization
 */
/*@{*/

/**
 * @defgroup	Synchronization object common attributes
 * Attributes that can be set in common with synchronization objects
 */
/*@{*/
#define SCE_KERNEL_ATTR_SINGLE			(0x00000000U)	/**< Multiple threads cannot wait simultaneously (event flags only) */
#define SCE_KERNEL_ATTR_MULTI			(0x00001000U)	/**< Multiple threads can wait at the same time (event flags only) */
#define SCE_KERNEL_ATTR_TH_FIFO			(0x00000000U)	/**< Waiting thread queuing is FIFO */
#define SCE_KERNEL_ATTR_TH_PRIO			(0x00002000U)	/**< Queues for waiting threads are ordered by thread priority */
#define SCE_KERNEL_ATTR_MS_FIFO			(0x00000000U)	/**< Unused */
#define SCE_KERNEL_ATTR_MS_PRIO			(0x00000000U)	/**< Unused */
#define SCE_KERNEL_ATTR_OPENABLE		(0x00000080U)	/**< Object can be referenced */
/*@}*/

/**
 * @defgroup	Referencing synchronization objects
 * Definitions for references to synchronization objects
 */
/*@{*/
#define SCE_KERNEL_OPEN_LIMIT_MAX	(127)	/**< Maximum value that can be specified when limiting the number of simultaneous references of synchronization objects */
/*@}*/

/*@}*//* Common to synchronization */

/** @name	Callback
 */
/*@{*/

/**
 * @brief Callback function type
 *
 * After the callback function is notified by sceKernelNotifyCallback(), the callback function
 * confirms the notification by sceKernelCheckCallback() or executes a waiting function with a
 * function to check for notifications such as sceKernelWaitSemaCB().
 * It is possible to delete your own registration by returning a value other than 0 as the return value of the callback function.
 *
 * Note
 * - The callback function is called as the context of the thread that generated the callback.
 *   In other words, the callback function can be called only by the callback generated by the own thread by the explicit callback
 *   check by sceKernelCheckCallback() or the wait function with callback check such as sceKernelWaitSemaCB(). is. To receive
 *   the callback notification, the thread that generated the callback must use sceKernelCheckCallback(), sceKernelWaitSemaCB(), etc.
 * - The sceKernelCheckCallback() and sceKernelDeleteCallback() functions cannot be used inside the callback function.
 *   In addition, if you call a wait function with CB such as sceKernelWaitSemaCB() function in the callback function, nesting occurs, causing a stack overflow.
 *   Avoid processing that waits for more callbacks in the callback function.
 *
 * @param	notifyId		When a callback is notified from an event that registered a callback with sceKernelRegisterCallbackToEvent(),
 *					the identifier of the notification source event is passed.
 *					If not notified from the event, SCE_UID_INVALID_UID is passed.
 * @param	notifyCount		Number of callback notifications until this callback function is executed is passed.
 * @param	notifyArg		Argument given by sceKernelNotifyCallback() is passed.
 * @param	pCommon			Argument given by sceKernelCreateCallback() is passed.
 * @retval	0			Normal
 * @retval	Non-zero value		Remove this callback
 */
typedef SceInt32	(*SceKernelCallbackFunction)(SceUID notifyId, SceInt32 notifyCount, SceInt32 notifyArg, void *pCommon);

/**
 * @brief Callback state
 *
 * This structure is used to get the callback status with sceKernelGetCallbackInfo().
 */
typedef struct _SceKernelCallbackInfo {
	SceSize		size;				/**< Size of this structure (sizeof(SceKernelCallbackInfo) */
	SceUID		callbackId;			/**< Callback identifier */
	char		name[SCE_UID_NAMELEN + 1];	/**< Name of the callback specified with sceKernelCreateCallback() */
	SceUInt32	attr;				/**< Callback attribute specified by sceKernelCreateCallback() */
	SceUID		threadId;			/**< Identifier of the thread to which the callback belongs */
	SceKernelCallbackFunction	callbackFunc;	/**< Callback function registered with sceKernelCreateCallback() */
	SceUID		notifyId;			/**< Caller notification source identifier */
	SceInt32	notifyCount;			/**< Number of times sceKernelNotifyCallback() has been executed for this callback that is still delayed without the callback function being called */
	SceInt32	notifyArg;			/**< Argument given by sceKernelNotifyCallback() for this callback */
	void		*pCommon;			/**< pCommon argument registered with sceKernelCreateCallback() */
} SceKernelCallbackInfo;

/*@}*//* Callback */

/** @name	Thread event
 */
/*@{*/

/**
 * @defgroup	Thread event handler type
 * Defining thread events that trigger thread event handlers
 */
/*@{*/
#define SCE_KERNEL_THREAD_EVENT_TYPE_START		(0x04)	/**< Thread start event */
#define SCE_KERNEL_THREAD_EVENT_TYPE_EXIT		(0x08)	/**< Thread end event */

/**
 * Valid thread event mask
 */
#define SCE_KERNEL_THREAD_EVENT_TYPE_ALL		(SCE_KERNEL_THREAD_EVENT_TYPE_START | SCE_KERNEL_THREAD_EVENT_TYPE_EXIT)
/*@}*/

/**
 * @defgroup	Thread specification for thread event handler
 * Thread specification macro in sceKernelRegisterThreadEventHandler()
 */
/*@{*/
#define SCE_KERNEL_THREAD_ID_USER	((SceUID)0xfffffff0)	/**< Specify all user threads */
/*@}*/

/**
 * @brief Thread event handler type
 *
 * Thread event handler type.
 * @param	type		The thread event handler call cause is passed.
 *				- SCE_KERNEL_THREAD_EVENT_TYPE_START: thread started
 *				- SCE_KERNEL_THREAD_EVENT_TYPE_EXIT : thread terminated
 * @param	threadId	Identifier of the thread that caused the thread event handler to be called is passed.
 * @param	arg		Argument when calling the thread event handler is passed.
 * @param	pCommon		pCommon specified in sceKernelRegisterThreadEventHandler() is passed as it is.
 * @retval	SCE_OK		Success
 * @retval	Any value other than SCE_OK	Remove this thread event handler
 */
typedef SceInt32	(*SceKernelThreadEventHandler)(SceInt32 type, SceUID threadId, SceInt32 arg, void *pCommon);

/*@}*//* Thread event */

/** @name	An event
 */
/*@{*/

/**
 * @defgroup	Event object attributes
 * Definition of attributes to be specified when creating an event object
 */
/*@{*/
#define SCE_KERNEL_EVENT_ATTR_MANUAL_RESET	(0x00000000U)	/**< Each bit of the event remains in the event notification state until it is manually transitioned to the event non notification state. */
#define SCE_KERNEL_EVENT_ATTR_AUTO_RESET	(0x00000100U)	/**< Each bit of the event automatically returns to the event non notification state when one waiting thread is woken up. */

#define SCE_KERNEL_ATTR_NOTIFY_CB_ALL		(0x00000000U)	/**< When an event is notified, all callbacks registered in the event object are notified. */
#define SCE_KERNEL_ATTR_NOTIFY_CB_WAKEUP_ONLY	(0x00000800U)	/**< When an event is notified, only the callback of the thread that is waiting for the event and wakes up among the callbacks registered in the event object is notified. */
/*@}*/

/**
 * @defgroup	Event type
 * Definition of event to be notified
 */
/*@{*/
#define SCE_KERNEL_EVENT_IN			(0x00000001U)	/* Input event */
#define SCE_KERNEL_EVENT_OUT			(0x00000002U)	/* Output event */
#define SCE_KERNEL_EVENT_CREATE			(0x00000004U)	/* Generate event */
#define SCE_KERNEL_EVENT_DELETE			(0x00000008U)	/* Delete event */
#define SCE_KERNEL_EVENT_ERROR			(0x00000010U)	/* Error event */
#define SCE_KERNEL_EVENT_OPEN			(0x00000100U)	/* Reference event */
#define SCE_KERNEL_EVENT_CLOSE			(0x00000200U)	/* Reference end event */
#define SCE_KERNEL_EVENT_TIMER			(0x00008000U)	/* Timer event */
#define SCE_KERNEL_EVENT_DATA_EXIST		(0x00010000U)	/* Event that is notified when data exists in the message pipe buffer (level trigger) */

#define SCE_KERNEL_EVENT_USER_DEFINED_MASK	(0xff000000U)	/* User-defined event mask */

/*@}*/

/**
 * @brief Event object state
 *
 * This structure is used to acquire the event object status with sceKernelGetEventInfo().
 */
typedef struct _SceKernelEventInfo {
	SceSize		size;					/**< Size of this structure (sizeof(SceKernelEventInfo)) */
	SceUID		eventId;				/**< Event object identifier */
	char		name[SCE_UID_NAMELEN + 1];		/**< Name of the event specified when creating the event object */
	SceUInt32	attr;					/**< Event attributes specified when creating the event object */
	SceUInt32	eventPattern;				/**< Bit pattern of the current event */
	SceUInt64	userData;				/**< User data added to the last notified event */
	SceUInt32	numWaitThreads;				/**< Number of threads waiting for the event object */
	SceInt32	reserved[1];				/**< Reserved area */
} SceKernelEventInfo;

/**
 * @defgroup	Standby mode for event object multiple standby
 * Definition of standby mode specified in sceKernelWaitMultipleEvents()
 */
/*@{*/
#define SCE_KERNEL_EVENT_WAIT_MODE_OR	(0x00000001U)	/**< Wait until one of the waits specified in the event wait condition list is met */
#define SCE_KERNEL_EVENT_WAIT_MODE_AND	(0x00000002U)	/**< Wait until all waits specified in the event wait condition list are satisfied */
/*@}*/

/**
 * @brief Structure for event wait condition list
 *
 * Structure for event waiting condition list passed to sceKernelWaitMultipleEvents().
 */
typedef struct	_SceKernelWaitEvent {
	SceUID		eventId;			/**< Event object identifier */
	SceUInt32	eventPattern;			/**< Pattern of events to wait */
} SceKernelWaitEvent;

/**
 * @brief Structure for event waiting result acquisition list
 *
 * Structure for event waiting result acquisition list to be passed to sceKernelWaitMultipleEvents().
 */
typedef struct	_SceKernelResultEvent {
	SceUID		eventId;			/**< Event object identifier */
	SceInt32	result;				/**< Wait result (equivalent to return value of sceKernelWaitEvent()) */
	SceUInt32	resultPattern;			/**< Event pattern when waiting completes */
	SceInt32	reserved[1];			/**< Reserved area */
	SceUInt64	userData;			/**< User data received when waiting completed */
} SceKernelResultEvent;

/*@}*//* An event */

/**
 * @name	Event flag
 */
/*@{*/

/**
 * @defgroup	Event flag attributes
 * Definition of attributes to be specified when generating eventflags
 */
/*@{*/
#define SCE_KERNEL_EVF_ATTR_TH_FIFO		SCE_KERNEL_ATTR_TH_FIFO		/**< Event flag waiting thread queuing is FIFO */
#define SCE_KERNEL_EVF_ATTR_TH_PRIO		SCE_KERNEL_ATTR_TH_PRIO		/**< Event flag waiting threads are queued in order of thread priority. */
#define SCE_KERNEL_EVF_ATTR_SINGLE		SCE_KERNEL_ATTR_SINGLE		/**< Multiple threads cannot wait at the same time */
#define SCE_KERNEL_EVF_ATTR_MULTI		SCE_KERNEL_ATTR_MULTI		/**< Multiple threads can wait at the same time */
/*@}*/

/**
 * @defgroup	Event flag wait mode
 * Definition of standby mode specified for eventflag standby
 */
/*@{*/
#define SCE_KERNEL_EVF_WAITMODE_AND		(0x00000000U)	/**< Waiting for AND */
#define SCE_KERNEL_EVF_WAITMODE_OR		(0x00000001U)	/**< Waiting for OR */
#define SCE_KERNEL_EVF_WAITMODE_CLEAR_ALL	(0x00000002U)	/**< Clear all bits after waiting */
#define SCE_KERNEL_EVF_WAITMODE_CLEAR_PAT	(0x00000004U)	/**< After waiting, clear the bit specified in bitPattern */
/*@}*/

/**
 * @brief Additional data for event flag
 *
 * This structure is used to store additional data to be given when creating an event flag with sceKernelCreateEventFlag().
 *
 * 将来の拡張のために用意されています。
 *
 */
typedef struct _SceKernelEventFlagOptParam {
	SceSize	size;						/**< Size of this structure (sizeof(SceKernelEventFlagOptParam)) */
} SceKernelEventFlagOptParam;

/**
 * @brief Event flag status
 *
 * This structure is used to acquire the event flag status with sceKernelGetEventFlagInfo().
 *
 */
typedef struct _SceKernelEventFlagInfo {
	SceSize		size;					/**< Size of this structure (sizeof(SceKernelEventFlagInfo)) */
	SceUID		evfId;					/**< Event flag identifier */
	char		name[SCE_UID_NAMELEN + 1];		/**< Name of the eventflag specified by sceKernelCreateEventFlag() */
	SceUInt32	attr;					/**< Event flag attribute specified by sceKernelCreateEventFlag() */
	SceUInt32	initPattern;				/**< Initial bit pattern of event flag */
	SceUInt32	currentPattern;				/**< Current bit pattern of event flag */
	SceUInt32	numWaitThreads;				/**< Number of threads waiting for an event */
} SceKernelEventFlagInfo;

/*@}*//* Event flag */

/**
 * @name	Semaphore
 */
/*@{*/

/**
 * @defgroup	Semaphore attributes
 * Definition of attributes to be specified when creating a semaphore
 */
/*@{*/
#define SCE_KERNEL_SEMA_ATTR_TH_FIFO		SCE_KERNEL_ATTR_TH_FIFO		/**< Semaphore waiting thread queuing is FIFO */
#define SCE_KERNEL_SEMA_ATTR_TH_PRIO		SCE_KERNEL_ATTR_TH_PRIO		/**< Semaphore waiting thread queuing is ordered by thread priority */
/*@}*/

/**
 * @brief Additional semaphore data
 *
 * This structure is used to store additional data given when creating a semaphore with sceKernelCreateSema().
 *
 * Provided for future expansion.
 *
 */
typedef struct _SceKernelSemaOptParam {
	SceSize	size;			/**< Size of this structure (sizeof(SceKernelSemaOptParam)) */
} SceKernelSemaOptParam;

/**
 * @brief Semaphore state
 *
 * This structure is used to get the semaphore status with sceKernelGetSemaInfo().
 *
 */
typedef struct _SceKernelSemaInfo {
	SceSize		size;					/**< Size of this structure (sizeof(SceKernelSemaInfo)) */
	SceUID		semaId;					/**< Semaphore identifier */
	char		name[SCE_UID_NAMELEN + 1];		/**< Name of the semaphore specified by sceKernelCreateSema() */
	SceUInt32	attr;					/**< Semaphore attributes specified with sceKernelCreateSema() */
	SceInt32	initCount;				/**< Initial number of semaphores specified by sceKernelCreateSema() */
	SceInt32	currentCount;				/**< Current number of semaphore resources */
	SceInt32	maxCount;				/**< Maximum number of semaphore resources specified by sceKernelCreateSema() */
	SceInt32	numWaitThreads;				/**< Number of threads waiting for the semaphore */
} SceKernelSemaInfo;

/*@}*//* Semaphore */

/**
 * @name	Mutex
 */
/*@{*/

/**
 * @defgroup	Mutex attribute
 * Definition of attributes to be specified when creating a mutex
 */
/*@{*/
#define SCE_KERNEL_MUTEX_ATTR_TH_FIFO		SCE_KERNEL_ATTR_TH_FIFO		/**< Mutex wait thread queuing is FIFO */
#define SCE_KERNEL_MUTEX_ATTR_TH_PRIO		SCE_KERNEL_ATTR_TH_PRIO		/**< Mutes waiting threads are queued in order of thread priority */
#define SCE_KERNEL_MUTEX_ATTR_RECURSIVE		(0x00000002U)			/**< Mutex can be recursively locked */
#define SCE_KERNEL_MUTEX_ATTR_CEILING		(0x00000004U)			/**< Use the mutex priority sealing function */
/*@}*/

/**
 * @brief Mutex additional data
 *
 * This structure is used to store additional data given when creating mutexes with sceKernelCreateMutex().
 *
 * Provided for future expansion.
 *
 */
typedef struct _SceKernelMutexOptParam {
	SceSize		size;			/**< Size of this structure (sizeof(SceKernelMutexOptParam)) */
	SceInt32	ceilingPriority;	/**< Priority ceiling priority */
} SceKernelMutexOptParam;

/**
 * @brief Mutex state
 *
 * This structure is used to get the mutex status with sceKernelGetMutexInfo().
 *
 */
typedef struct _SceKernelMutexInfo {
	SceSize		size;					/**< Size of this structure (sizeof(SceKernelMutexInfo)) */
	SceUID		mutexId;				/**< Mutex identifier */
	char		name[SCE_UID_NAMELEN + 1];		/**< Name of the mutex specified by sceKernelCreateMutex() */
	SceUInt32	attr;					/**< Mutex attributes specified with sceKernelCreateMutex() */
	SceInt32	initCount;				/**< Initial lock count of mutex specified by sceKernelCreateMutex() */
	SceInt32	currentCount;				/**< Current number of mutex locks */
	SceUID		currentOwnerId;				/**< Identifier of the thread that currently owns the mutex */
	SceUInt32	numWaitThreads;				/**< Number of threads waiting for the mutex */
	SceInt32	ceilingPriority;			/**< Priority ceiling priority (0 if priority ceiling function is not used) */
} SceKernelMutexInfo;

/*@}*//* Mutex */


/**
 * @name	Lightweight mutex
 */
/*@{*/

/**
 * @defgroup	Lightweight mutex attribute
 * Definition of attributes to be specified when creating a lightweight mutex
 */
/*@{*/
#define SCE_KERNEL_LW_MUTEX_ATTR_TH_FIFO		SCE_KERNEL_ATTR_TH_FIFO	/**< Lightweight mutex wait thread queuing is FIFO */
#define SCE_KERNEL_LW_MUTEX_ATTR_TH_PRIO		SCE_KERNEL_ATTR_TH_PRIO	/**< Queues for lightweight mutex wait threads are ordered by thread priority */
#define SCE_KERNEL_LW_MUTEX_ATTR_RECURSIVE		(0x00000002U)           /**< Lightweight mutex can be recursively locked */
/*@}*/

/**
 * @brief Light mutex work area
 *
 * A structure used to store work areas used by lightweight mutexes.
 * The lightweight mutex work area must be reserved in the user memory space.
 * All operations on the lightweight mutex are performed via the SceKernelLwMutexWork structure.
 *
 * Since the SceKernelLwMutexWork structure is used as a work area by the kernel, after creating
 * a lightweight mutex with sceKernelCreateLwMutex(), the user program must not directly
 * reference / manage the contents until it is deleted with sceKernelDeleteLwMutex(). The address cannot be moved.
 *
 * The SceKernelLwMutexWork structure must be arranged with 8-byte alignment on the memory.
 *
 */
typedef struct	_SceKernelLwMutexWork {
	SceInt64	data[4];				/**< Light mutex work area */
} SceKernelLwMutexWork;

/**
 * @brief Additional data for lightweight mutex
 *
 * This structure is used to store additional data given when creating a lightweight mutex with sceKernelCreateLwMutex().
 *
 * Provided for future expansion.
 *
 */
typedef struct _SceKernelLwMutexOptParam {
	SceSize	size;						/**< Size of this structure (sizeof(SceKernelLwMutexOptParam)) */
} SceKernelLwMutexOptParam;

/**
 * @brief Light mutex state
 *
 * A structure used to obtain the status of a lightweight mutex with sceKernelGetLwMutexInfo().
 *
 */
typedef struct _SceKernelLwMutexInfo {
	SceSize			size;					/**< Size of this structure (sizeof(SceKernelLwMutexInfo)) */
	SceUID			uid;					/**< Lightweight mutex identifier */
	char			name[SCE_UID_NAMELEN + 1];		/**< Name of the mutex specified by sceKernelCreateLwMutex() */
	SceUInt32		attr;					/**< Mutex attributes specified with sceKernelCreateLwMutex() */
	SceKernelLwMutexWork	*pWork;					/**< Mutex work area specified by sceKernelCreateLwMutex() */
	SceInt32		initCount;				/**< Initial number of lw mutex locks specified by sceKernelCreateLwMutex() */
	SceInt32		currentCount;				/**< Current lock count of lightweight mutex */
	SceUID			currentOwnerId;				/**< Identifier of the thread that currently owns the lightweight mutex */
	SceUInt32		numWaitThreads;				/**< Number of threads waiting for the lightweight mutex */
} SceKernelLwMutexInfo;

/*@}*//* Lightweight mutex */

/** @name	Condition variable
 */
/*@{*/

/**
 * @defgroup	Condition variable attributes
 * Defining attributes to be specified when creating a condition variable
 */
/*@{*/
#define SCE_KERNEL_COND_ATTR_TH_FIFO		SCE_KERNEL_ATTR_TH_FIFO		/**< Condition variable wait thread queuing is FIFO */
#define SCE_KERNEL_COND_ATTR_TH_PRIO		SCE_KERNEL_ATTR_TH_PRIO		/**< Condition variable wait thread queuing is in order of thread priority */
/*@}*/

/**
 * @brief Additional data for condition variables
 *
 * This structure is used to store additional data given when creating a condition variable with sceKernelCreateCond().
 *
 * Provided for future expansion.
 *
 */
typedef struct _SceKernelCondOptParam {
	SceSize	size;						/**< Size of this structure (sizeof(SceKernelMutexOptParam)) */
} SceKernelCondOptParam;

/**
 * @brief Condition variable state
 *
 * This structure is used to acquire the condition variable status with sceKernelGetCondInfo().
 *
 */
typedef struct _SceKernelCondInfo {
	SceSize		size;					/**< Size of this structure (sizeof(SceKernelCondInfo)) */
	SceUID		condId;					/**< Condition variable identifier */
	char		name[SCE_UID_NAMELEN + 1];		/**< Condition variable name specified in sceKernelCreateCond() */
	SceUInt32	attr;					/**< Condition variable attribute specified in sceKernelCreateCond() */
	SceUID		mutexId;				/**< Mutex associated with the condition variable specified by sceKernelCreateCond() */
	SceUInt32	numWaitThreads;				/**< Number of threads waiting for the condition variable */
} SceKernelCondInfo;

/*@}*//* Condition variable */

/** @name	Lightweight condition variable
 */
/*@{*/

/**
 * @defgroup	Lightweight condition variable attributes
 * Definition of attributes to be specified when creating lightweight condition variables
 */
/*@{*/
#define SCE_KERNEL_LW_COND_ATTR_TH_FIFO		SCE_KERNEL_ATTR_TH_FIFO		/**< Lightweight condition variable waiting thread queuing is FIFO */
#define SCE_KERNEL_LW_COND_ATTR_TH_PRIO		SCE_KERNEL_ATTR_TH_PRIO		/**< Lightweight condition variable waiting thread queuing is ordered by thread priority */
/*@}*/

/**
 * @brief Lightweight condition variable work area
 *
 * A structure used to store the work area used by the lightweight condition variable.
 * The work area for lightweight condition variables must be allocated in the user memory space.
 * All operations on lightweight condition variables are done via the SceKernelLwCondWork structure.
 *
 * Since the SceKernelLwCondWork structure is used as a work area by the kernel, once a
 * lightweight condition variable is created with sceKernelCreateLwCond(), the contents must not be directly
 * referenced / operated by the user program until it is deleted with sceKernelDeleteLwCond(). The address cannot be moved.
 */
typedef struct	_SceKernelLwCondWork {
	SceInt32	data[4];				/**< Lightweight condition variable work area */
} SceKernelLwCondWork;

/**
 * @brief Additional data for lightweight condition variables
 *
 * This structure is used to store additional data given when creating a lightweight condition variable with sceKernelCreateLwCond().
 *
 * Provided for future expansion.
 *
 */
typedef struct _SceKernelLwCondOptParam {
	SceSize	size;						/**< Size of this structure (sizeof(SceKernelLwCondOptParam)) */
} SceKernelLwCondOptParam;

/**
 * @brief Lightweight condition variable state
 *
 * sceKernelGetLwCondInfo() is a structure used to obtain the status of a lightweight condition variable.
 *
 */
typedef struct _SceKernelLwCondInfo {
	SceSize			size;				/**< Size of this structure (sizeof(SceKernelLwCondInfo)) */
	SceUID			uid;				/**< Lightweight condition variable identifier */
	char			name[SCE_UID_NAMELEN + 1];	/**< Name of the lightweight condition variable specified with sceKernelCreateLwCond() */
	SceUInt32		attr;				/**< Attributes of lightweight condition variable specified by sceKernelCreateLwCond() */
	SceKernelLwCondWork	*pWork;				/**< Work area of lightweight condition variable specified by sceKernelCreateLwCond() */
	SceKernelLwMutexWork	*pLwMutex;			/**< Lightweight mutex work area associated with the lightweight condition variable specified by sceKernelCreateLwCond() */
	SceUInt32		numWaitThreads;			/**< Number of threads waiting for lightweight condition variables */
} SceKernelLwCondInfo;

/*@}*//* Lightweight condition variable */

/** @name	Timer
 */
/*@{*/

/**
 * @defgroup	Type of timer event notification
 * Defining timer event notification types
 */
/*@{*/
#define SCE_KERNEL_TIMER_TYPE_SET_EVENT		(0)	/**< Timer is notified by set type event */
#define SCE_KERNEL_TIMER_TYPE_PULSE_EVENT	(1)	/**< Timer is notified by pulse type event */
/*@}*/

/**
 * @brief Additional data for timer
 *
 * This structure is used to store additional data given when a timer is created with sceKernelCreateTimer().
 *
 * Provided for future expansion.
 */
typedef struct	_SceKernelTimerOptParam {
	SceSize				size;			/**< Size of this structure (sizeof(SceKernelTimerOptParam)) */
} SceKernelTimerOptParam;

/**
 * @brief Timer information
 *
 * Timer information acquisition structure.
 */
typedef struct	_SceKernelTimerInfo {
	SceSize			size;				/**< Size of this structure (sizeof(SceKernelTimerInfo)) */
	SceUID			timerId;			/**< Timer identifier */
	char			name[SCE_UID_NAMELEN + 1];	/**< Timer name specified by sceKernelCreateTimer() */
	SceUInt32		attr;				/**< Timer attribute specified by sceKernelCreateTimer() */
	SceInt32		fActive;			/**< Timer start flag (if 1, counter is running) */
	SceKernelSysClock	baseTime;			/**< Timer reference process time */
	SceKernelSysClock	currentTime;			/**< Timer current time */
	SceKernelSysClock	schedule;			/**< Timer next scheduled event notification time (if an event is set) */
	SceKernelSysClock	interval;			/**< Timer event notification interval specified by sceKernelSetTimerEvent() */
	SceInt32		type;				/**< Timer event notification type specified by sceKernelSetTimerEvent() */
	SceInt32		fRepeat;			/**< Timer repeat flag specified by sceKernelSetTimerEvent() (1: periodic timer) */
	SceUInt32		numWaitThreads;			/**< Number of threads waiting for timer */
	SceInt32		reserved[1];			/**< Reserved area */
} SceKernelTimerInfo;

/*@}*//* Timer */

/** @name	Simple event
 */
/*@{*/

/**
 * @brief Simple event additional data
 *
 * This structure is used to store additional data given when a simple event is generated with sceKernelCreateSimpleEvent().
 *
 * Provided for future expansion.
 *
 */
typedef struct _SceKernelSimpleEventOptParam {
	SceSize	size;				/**< Size of this structure (sizeof(SceKernelSimpleEventOptParam)) */
} SceKernelSimpleEventOptParam;

/*@}*//* Simple event */

/** @name	Message pipe
 */
/*@{*/

/**
 * @defgroup	Message pipe attributes
 * Defining message pipe attributes
 */
/*@{*/
#define SCE_KERNEL_MSG_PIPE_ATTR_TH_PRIO_S	(0x00000001U)	/**< The queue of the message sender's waiting thread is FIFO */
#define SCE_KERNEL_MSG_PIPE_ATTR_TH_PRIO_R	(0x00000002U)	/**< The queue of the message receiver standby thread is FIFO */
#define SCE_KERNEL_MSG_PIPE_ATTR_TH_PRIO	(SCE_KERNEL_MSG_PIPE_ATTR_TH_PRIO_S | SCE_KERNEL_MSG_PIPE_ATTR_TH_PRIO_R)	/**< Message queuing wait thread queuing is FIFO */

#define SCE_KERNEL_MSG_PIPE_ATTR_TH_FIFO_S	(0x00000004U)	/**< Queues for waiting threads on the message sender side are in order of thread priority */
#define SCE_KERNEL_MSG_PIPE_ATTR_TH_FIFO_R	(0x00000008U)	/**< Queues for message receiver standby threads are ordered by thread priority */
#define SCE_KERNEL_MSG_PIPE_ATTR_TH_FIFO	(SCE_KERNEL_MSG_PIPE_ATTR_TH_FIFO_S | SCE_KERNEL_MSG_PIPE_ATTR_TH_FIFO_R)	/**< Queues for message send / receive waiting threads are ordered by thread priority */
/*@}*/

/**
 * @defgroup	Message pipe wait mode
 * Message pipe wait mode
 */
/*@{*/
#define SCE_KERNEL_MSG_PIPE_MODE_ASAP			(0x00000000U)	/**< Complete if you can send and receive even 1 byte of data */
#define SCE_KERNEL_MSG_PIPE_MODE_FULL			(0x00000001U)	/**< Complete when all data of the specified size has been sent and received */

#define SCE_KERNEL_MSG_PIPE_MODE_WAIT			(0x00000000U)	/**< Block threads until send / receive processing is complete (synchronous mode) */
#define SCE_KERNEL_MSG_PIPE_MODE_DONT_WAIT		(0x00000010U)	/**< Issue a send / receive request and return immediately (asynchronous mode) */

#define SCE_KERNEL_MSG_PIPE_MODE_DONT_REMOVE		(0x00000100U)	/**< Do not delete received data from the pipe (peak processing) */
/*@}*/

/**
 * @defgroup	Message pipe type
 * Defining the pipe buffer type for a message pipe
 * Specify which budget to get memory from
 */
/*@{*/
#define SCE_KERNEL_MSG_PIPE_TYPE_USER_MAIN		(64)		/**< User main area */
#define SCE_KERNEL_MSG_PIPE_TYPE_USER_CDRAM		(66)		/**< User CDRAM area (not mounted) */
/*@}*/

/**
 * @defgroup	Message pipe optional attributes
 * Macros that can be specified in the attr member of SceKernelMsgPipeOptParam
 */
/*@{*/
#define SCE_KERNEL_MSG_PIPE_OPT_ATTR_OPEN_LIMITATION	(0x00000100U)	/**< Specify openLimit */
/*@}*/

/**
 * Buffer information for message pipe discontinuous data transmission / reception
 *
 * sceKernelSendMsgPipeVector(), sceKernelSendMsgPipeVectorCB(), sceKernelTrySendMsgPipeVector(),
 * sceKernelReceiveMsgPipeVector(), sceKernelReceiveMsgPipeVectorCB(), sceKernelTryReceiveMsgPipeVector()
 * are used to transmit and receive data.
 * This structure specifies a single contiguous memory range.
 *
 * Specify the base address in pBase.
 * Specify the size (byte) in bufSize.
 *
 */
typedef struct _SceKernelMsgPipeVector {
	void		*pBase;		/**< Buffer base address */
	SceSize		bufSize;	/**< Buffer size */
} SceKernelMsgPipeVector;

/**
 * @brief Message pipe status
 *
 * This structure is used to get the message pipe status with sceKernelGetMsgPipeInfo().
 *
 */
typedef struct	_SceKernelMsgPipeInfo {
	SceSize			size;				/**< Size of this structure (sizeof(SceKernelMsgPipeInfo)) */
	SceUID			msgPipeId;			/**< Message pipe identifier */
	char			name[SCE_UID_NAMELEN + 1];	/**< Name of the message pipe specified with sceKernelCreateMsgPipe() */
	SceUInt32		attr;				/**< Message pipe attribute specified by sceKernelCreateMsgPipe() */
	SceSize			bufferSize;			/**< Total size of message pipe pipe buffer (bytes) */
	SceSize			freeSize;			/**< Empty pipe buffer size of message pipe (byte) */
	SceUInt32		numSendWaitThreads;		/**< Number of threads waiting to be sent */
	SceUInt32		numReceiveWaitThreads;		/**< Number of threads waiting to receive */
} SceKernelMsgPipeInfo;

/**
 * @brief Additional data for the message pipe
 *
 * This structure is used to store additional data given when creating a message pipe with sceKernelCreateMsgPipe().
 *
 * Specify a bit pattern that represents a valid member in attr.
 * The following macros can be specified by logical OR.
 * - SCE_KERNEL_MSG_PIPE_OPT_ATTR_OPEN_LIMITATION: Specify the maximum number that can be referenced simultaneously with sceKernelOpenMsgPipe() (openLimit)
 *
 * In openLimit, the maximum number of simultaneous references by sceKernelOpenMsgPipe() can be specified.
 * The maximum number that can be specified is (0..SCE_KERNEL_OPEN_LIMIT_MAX (127)).
 * If not specified, the number of simultaneous references is not limited.
 *
 * Be sure to call sizeof(SceKernelMsgPipeOptParam) for size.
 *
 */
typedef struct _SceKernelMsgPipeOptParam {
	SceSize			size;		/**< Size of this structure (sizeof(SceKernelMsgPipeOptParam)) */
	SceUInt32		attr;		/**< A bit pattern that specifies a valid member of a structure */
	SceInt32		reserved[2];	/**< Reserved area */
	SceUInt32		openLimit;	/**< Maximum number that can be referenced simultaneously with sceKernelOpenMsgPipe() (0..SCE_KERNEL_OPEN_LIMIT_MAX (127)) can be specified. If not specified, unlimited */
} SceKernelMsgPipeOptParam;

/*@}*//* Message pipe */

/** @name	Reader / writer lock
 */
/*@{*/

/**
 * @defgroup	Reader / writer lock attribute
 * Definition of attributes to be specified when creating a reader / writer lock
 */
/*@{*/
#define SCE_KERNEL_RW_LOCK_ATTR_TH_FIFO		SCE_KERNEL_ATTR_TH_FIFO	/**< Reader / writer lock waiting thread queuing is FIFO */
#define SCE_KERNEL_RW_LOCK_ATTR_TH_PRIO		SCE_KERNEL_ATTR_TH_PRIO	/**< Queued reader / writer lock waiting threads are ordered by thread priority */
#define	SCE_KERNEL_RW_LOCK_ATTR_RECURSIVE	(0x00000002U)		/**< Reader / writer lock can be recursively locked */
#define SCE_KERNEL_RW_LOCK_ATTR_CEILING		(0x00000004U)		/**< Use the priority sealing function when the reader / writer lock is locked (not implemented) */
/*@}*/

/**
 * @defgroup	Reader / writer lock cancel flag
 * Definition of flag to be specified when canceling reader / writer lock
 */
/*@{*/
#define	SCE_KERNEL_RW_LOCK_CANCEL_WITH_WRITE_LOCK	(1)	/**< Acquire light lock atomically after cancellation */
/*@}*/

/**
 * @brief  Additional data for reader / writer lock
 *
 * This structure is used to store additional data given when creating a reader / writer lock with sceKernelCreateRWLock().
 *
 * Provided for future expansion.
 *
 */
typedef struct _SceKernelRWLockOptParam {
	SceSize	size;				/**< Size of this structure (sizeof(SceKernelRWLockOptParam)) */
} SceKernelRWLockOptParam;

/**
 * @brief  Reader / writer lock status
 *
 * This structure is used to acquire the reader / writer lock status with sceKernelGetRWLockInfo().
 *
 */
typedef struct _SceKernelRWLockInfo {
	SceSize		size;					/**< Size of this structure (sizeof(SceKernelRWLockInfo)) */
	SceUID		rwLockId;				/**< Reader / writer lock identifier */
	char		name[SCE_UID_NAMELEN + 1];		/**< Name of reader / writer lock specified by sceKernelCreateRWLock() */
	SceUInt32	attr;					/**< Reader / writer lock attribute specified by sceKernelCreateRWLock() */
	SceInt32	lockCount;				/**< Current number of locks of reader / writer lock */
	SceUID		writeOwnerId;				/**< Identifier of the thread that currently holds (owns) the reader / writer lock */
	SceUInt32	numReadWaitThreads;			/**< Number of threads waiting for reader / writer lock with read lock */
	SceUInt32	numWriteWaitThreads;			/**< Number of threads waiting for reader / writer lock with write lock */
} SceKernelRWLockInfo;

/*@}*//* Reader / writer lock */

Possible function names according to SceTestBridge

sceTestBridgeThreadMgrCallCoredumpHandler -> ??
sceTestBridgeThreadMgrClearThreadMgrTestMode -> sceKernelClearThreadMgrTestModeForKernel
sceTestBridgeThreadMgrDeleteStopThreadEvf -> ??
sceTestBridgeThreadMgrExitDeleteThreadInSyscall -> sceKernelExitDeleteThread
sceTestBridgeThreadMgrFastMutexLockUnlock -> ??
sceTestBridgeThreadMgrFastMutexShowStat -> ??
sceTestBridgeThreadMgrFastMutexStart -> ??
sceTestBridgeThreadMgrFastMutexStop -> ??
sceTestBridgeThreadMgrGetLwMutexInfoAll -> looks like _sceKernelGetLwMutexInfoById
sceTestBridgeThreadMgrIsCoredumpHandlerRegistered
sceTestBridgeThreadMgrRegisterCoredumpHandler -> sceCoredumpRegisterCoredumpHandler
sceTestBridgeThreadMgrResumeThread -> sceKernelResumeThreadForVM
sceTestBridgeThreadMgrRunningInSyscall -> ??
sceTestBridgeThreadMgrSetAndDeleteSuspendThreadEvf -> ??
sceTestBridgeThreadMgrSetThreadMgrTestMode -> sceKernelSetThreadMgrTestModeForKernel
sceTestBridgeThreadMgrSpawnPriorityThread -> ??
sceTestBridgeThreadMgrStopThread -> sceKernelStopThreadForKernel
sceTestBridgeThreadMgrSuspendThread -> sceKernelSuspendThreadForVM
sceTestBridgeThreadMgrUnregisterCoredumpHandler -> sceCoredumpUnregisterCoredumpHandler
sceTestBridgeThreadMgrWaitInSyscall -> ??
sceTestBridgeThreadMgrWaitInSyscall2 -> ??
sceTestbridgeApi -> ??

SceThreadmgrForDriver

sceKernelPMonSetControlRegisterForDriver

Version NID
0.990 present in ForKernel
3.60 0x1AAFA818

sceKernelPMonSetUserEnableRegisterForDriver

Version NID
0.990 present in ForKernel
3.60 0x5053B005

sceKernelWaitThreadEndCBForDriver

Version NID
3.60 0x9EF4F62C

sceKernelWaitThreadEndForDriver

Version NID
3.60 0x3E20216F

sceKernelWaitEventFlagCBForDriver

Version NID
3.60 0x8A35F714

sceKernelWaitEventFlagForDriver

Version NID
0.931-3.60 0x0C1D3F20
/**
 * @brief Event flag wait
 *
 * This system call waits for the event flag specified by evfId to be set according to the wait release condition specified by waitMode.
 * If the event flag specified by evfId already satisfies the wait release condition specified by waitMode,
 * the issuing thread continues execution without transitioning to the waiting state (WAITING).
 *
 * When SCE_KERNEL_EVF_WAITMODE_AND is specified for waitMode, it waits until all the bits specified by bitPattern become 1.
 * If SCE_KERNEL_EVF_WAITMODE_OR is specified for waitMode, wait until one of the bits specified in bitPattern becomes 1.
 * If SCE_KERNEL_EVF_WAITMODE_CLEAR_ALL is additionally specified for waitMode, all the eventflag bits
 * are cleared to 0 when the wait release condition is satisfied and this thread is released.
 * If SCE_KERNEL_EVF_WAITMODE_CLEAR_PAT is additionally specified for waitMode, the bit specified
 * by bitPattern is cleared to 0 when the wait release condition is satisfied and this thread is released.
 *
 * The event flag value is returned to pResultPat in the following cases. NULL can be specified if no value is required.
 * - If the wait release condition is satisfied (SCE_OK is returned),
 *   the event flag value before clearing by specifying SCE_KERNEL_EVF_WAITMODE_CLEAR_ALL,
 *   SCE_KERNEL_EVF_WAITMODE_CLEAR_PAT is returned immediately after the condition is satisfied.
 * - After exiting the wait state, the event flag value just before exiting from the wait state is returned when
 *   exiting except when the wait release condition is satisfied (when SCE_KERNEL_ERROR_WAIT_CANCEL,
 *   SCE_KERNEL_ERROR_WAIT_DELETE, SCE_KERNEL_ERROR_WAIT_TIMEOUT errors are returned).
 *   When canceling with sceKernelCancelEventFlag(), the eventflag value set at the time of cancellation is returned.
 *
 * When pTimeout is specified, the timeout operation specified in microseconds is set.
 * If pTimeout is NULL, timeout operation is not performed.
 * Note that if pTimeout is specified, the value pointed to by pTimeout is updated when the system call ends.
 * If the condition is met within the time, it is updated with the remaining time. If not established,
 * the value pointed to by pTimeout is updated with 0. In this case, error SCE_KERNEL_ERROR_WAIT_TIMEOUT is returned.
 *
 * Another thread cannot execute sceKernelWaitEventFlag() and sceKernelPollEventFlag() for an event flag with
 * the SCE_KERNEL_EVF_ATTR_SINGLE attribute that already has a waiting thread.
 * In this case, an error is returned immediately to the thread that executed sceKernelWaitEventFlag() or sceKernelPollEventFlag() later.
 *
 * If multiple threads are waiting for an event flag with the SCE_KERNEL_EVF_ATTR_MULTI attribute, a thread queue is created.
 * In this case, a single sceKernelSetEventFlag() may release the waiting status of multiple threads.
 *
 * In the case of the event flag of the SCE_KERNEL_EVF_ATTR_TH_FIFO attribute, the thread queue is
 * arranged in the order in which it waits first.
 * In the event flag of the SCE_KERNEL_EVF_ATTR_TH_PRIO attribute, the thread with the highest
 * priority among the waiting threads starts first and is arranged in the order of thread priority.
 *
 * If there is a thread with SCE_KERNEL_EVF_WAITMODE_CLEAR_ALL specified or SCE_KERNEL_EVF_WAITMODE_CLEAR_PAT specified in the
 * queue and the wait release condition for that thread is satisfied, the event flag is cleared at the same time as the wait release.
 * Threads that are lined up behind the thread that has specified SCE_KERNEL_EVF_WAITMODE_CLEAR_ALL or SCE_KERNEL_EVF_WAITMODE_CLEAR_PAT
 * will see the event flag after being cleared, so the wait may not be released.
 *
 * @param	evfId		Specifies the identifier of the event flag to wait for.
 * @param	bitPattern	Specify the comparison value with the eventflag.
 * @param	waitMode	Specifies the wait mode. Specify one of the following:
 *                      - SCE_KERNEL_EVF_WAITMODE_AND: Waiting for AND
 *                      - SCE_KERNEL_EVF_WAITMODE_OR : Wait for OR
 *                      In addition, you can optionally add either of the following specifications as a logical sum.
 *                      - SCE_KERNEL_EVF_WAITMODE_CLEAR_ALL: After waiting, clear all bits
 *                      - SCE_KERNEL_EVF_WAITMODE_CLEAR_PAT: After waiting, clear the bit specified in bitPattern
 * @param	pResultPat	Specifies a pointer to the SceUInt32 type variable that receives the eventflag value when waiting is established.
 *                      If NULL is specified, the event flag value is not received.
 * @param	pTimeout	Specify a pointer to the SceUInt32 type variable that stores the upper limit (microseconds) of the waiting time.
 *                      If NULL is specified, wait indefinitely. When the wait condition is satisfied, the remaining time is returned.
 * @retval	SCE_OK		Success
 * @retval	(<0)		Error code
 */
SceInt32 sceKernelWaitEventFlagForDriver(SceUID evfId, SceUInt32 bitPattern, SceUInt32 waitMode, SceUInt32 *pResultPat, SceUInt32 *pTimeout);

sceKernelWaitEventCBForDriver

Version NID
3.60 0x360C655C

sceKernelWaitEventForDriver

Version NID
3.60 0xC529EA32

sceKernelUnregisterThreadEventHandlerForDriver

Version NID
3.60 0x2C8ED6F0

sceKernelUnregisterCallbackFromEventAllForDriver

Version NID
3.60 0x8DADBD16

sceKernelUnregisterCallbackFromEventForDriver

Version NID
3.60 0x2E48D81C

sceKernelUnlockWriteRWLockForDriver

Version NID
3.60 0x94A73797

sceKernelUnlockReadRWLockForDriver

Version NID
3.60 0xDE1B9EEE

sceKernelTryLockWriteRWLockForDriver

Version NID
3.60 0xA96F2E5A

sceKernelTryLockReadRWLockForDriver

Version NID
3.60 0xFC2B5A50

sceKernelStopTimerForDriver

Version NID
3.60 0x474F214B

sceKernelStartTimerForDriver

Version NID
3.60 0x84C4CE4D

sceKernelSignalSemaForDriver

Version NID
3.60 0xD270498B

sceKernelSignalCondAllForDriver

Version NID
3.60 0x6EC78CD0

sceKernelSetTimerTimeWideForDriver

Version NID
3.60 0x85195A16

sceKernelSetEventFlagForDriver

Version NID
3.60 0xD4780C3E

sceKernelSetEventForDriver

Version NID
3.60 0x9EA3A45C

_sceKernelExtendKernelStackWideForDriver

Version NID
3.60 0xE54FD746

Temp name was sceKernelRunWithStackForDriver.

This takes a function and runs it exclusively on the current core on its own stack.

// stack_size should be 0x2000
int _sceKernelExtendKernelStackWideForDriver(int stack_size, void *func, void *args);

sceKernelExtendKernelStackWideForDriver

Version NID
3.60 0xA2C801A5

Temp name was sceKernelRunWithStack2ForDriver.

// stack_size should be 0x2000
int sceKernelExtendKernelStackWideForDriver(int stack_size, void *func, void *args);

sceKernelRegisterCallbackToEventForDriver

Version NID
3.60 0x832A7E0C

sceKernelPulseEventWithNotifyCallbackForDriver

Version NID
3.60 0x714A107A

sceKernelPulseEventForDriver

Version NID
3.60 0x2427C81B

sceKernelPollSemaForDriver

Version NID
3.60 0x4FDDFE24

sceKernelPollEventFlagForDriver

Version NID
0.990-3.60 0x76C6555B
/**
 * @brief Event flag polling
 *
 * Polls the event flag specified by evfId.
 *
 * sceKernelPollEventFlag() is a system call that removes the function to enter standby state from sceKernelWaitEventFlag().
 * Unlike sceKernelWaitEventFlag(), an error (SCE_KERNEL_ERROR_EVF_COND) is returned immediately if the wait release condition is not satisfied.
 * In this case, SCE_KERNEL_EVF_WAITMODE_CLEAR_ALL / SCE_KERNEL_EVF_WAITMODE_CLEAR_PAT specification is ignored.
 *
 * @param	evfId		Specify the event flag identifier to be polled.
 * @param	bitPattern	Specify the comparison value with the eventflag.
 * @param	waitMode	Specify the wait mode. Specify one of the following:
 *                      - SCE_KERNEL_EVF_WAITMODE_AND: Waiting for AND
 *                      - SCE_KERNEL_EVF_WAITMODE_OR : Wait for OR
 *                      In addition, you can optionally add one of the following specifications as a logical sum.
 *                      - SCE_KERNEL_EVF_WAITMODE_CLEAR_ALL: Clear all bits after waiting
 *                      - SCE_KERNEL_EVF_WAITMODE_CLEAR_PAT: After waiting, clear the bit specified in bitPattern
 * @param	pResultPat	Specify a pointer to the SceUInt32 type variable that receives the eventflag value when waiting is established.
 * @retval	SCE_OK		Success
 * @retval	(<0)		Error code
 */
SceInt32 sceKernelPollEventFlagForDriver(SceUID evfId, SceUInt32 bitPattern, SceUInt32 waitMode, SceUInt32 *pResultPat);

sceKernelNotifyCallbackForDriver

Version NID
3.60 0xC3E00919

sceKernelGetTimerTimeWideForDriver

Version NID
3.60 0xC1286004

sceKernelGetTimerBaseWideForDriver

Version NID
3.60 0xA6D11DD3

sceKernelGetThreadmgrUIDClassForDriver

Version NID
3.60 0x0A20775A

sceKernelGetThreadTLSAddrForDriver

Version NID
3.60 0x66EEA46A

sceKernelGetThreadStackFreeSizeForDriver

Version NID
3.60 0x7B278A0B

sceKernelGetThreadCpuAffinityMaskForDriver

Version NID
3.60 0x83DC703D

sceKernelGetCallbackCountForDriver

Version NID
3.60 0x0892D8DF

sceKernelEnqueueWorkQueueForDriver

Version NID
3.60 0xE50E1185

sceKernelDeleteThreadForDriver

Version NID
1.69-3.60 0xAC834F3F
/**
 * @brief Delete thread
 *
 * Deletes the thread specified by threadId.
 *
 * Accordingly, the stack area and thread management area are released. The target thread must be in the DORMANT state.
 *
 * Since the own thread cannot be in the DORMANT state, it cannot be set as the target thread
 * (this results in an SCE_KERNEL_ERROR_NOT_DORMANT error).
 * Use sceKernelExitDeleteThread() to delete your own thread.
 *
 * @param	threadId	Specify the identifier of the thread to be deleted.
 * @retval	SCE_OK		Success
 * @retval	Negative value	Error code
 */
SceInt32	sceKernelDeleteThreadForDriver(
	SceUID	threadId
);

sceKernelDeleteSemaForDriver

Version NID
3.60 0x16A35E58

sceKernelDeleteMutexForDriver

Version NID
3.60 0x0A912340
int sceKernelDeleteMutexForDriver(SceUID mutexid);

sceKernelDeleteEventFlagForDriver

Version NID
3.60 0x71ECB352

sceKernelCreateThreadForDriver

Version NID
1.69-3.60 0xC6674E7D
/**
 * @brief Thread generation that operates in the address space of its own process
 *
 * A thread that operates in the address space of its own process is created.
 *
 * Allocate a thread management area for the thread to be created, perform initialization, and secure a stack area.
 * The thread information to be created is specified as an argument, and the thread identifier (UID) is returned as the return value.
 *
 * The generated thread is in the DORMANT state.
 *
 * @param	pName		Specifies the name of the thread.
 *				The name of the thread does not have to be unique because it is
 *				used by the operator to identify it when debugging. The maximum name length is 31 bytes.
 * @param	entry		Specify the entry address of the thread. The thread entry point function
 * 				can receive memory block data with two arguments.
 *				The argument is given by sceKernelStartThread() described later.
 *				The thread is terminated by returning from this function, and the return value of the function is the thread termination status.
 * @param	initPriority	Specifies the initial priority of the thread. The smaller the number, the higher the priority.
 *				The range from SCE_KERNEL_HIGHEST_PRIORITY_USER (= 64) to SCE_KERNEL_LOWEST_PRIORITY_USER (= 191) can be used.
 *				By specifying SCE_KERNEL_DEFAULT_PRIORITY_USER, you can specify the default priority of the process to which the thread belongs.
 *				For the default priority, it is also possible to specify with SCE_KERNEL_DEFAULT_PRIORITY_USER ± offset.
 * @param	stackSize	Specify the required stack size of the thread in bytes. The argument block given by
 *				sceKernelStartThread () is copied onto the stack, so specify the stack size with this margin in mind.
 *				An error will occur if a stack size less than 4 KiB is specified.
 * @param	attr		You can specify multiple thread attributes by logical OR.
 * @param	cpuAffinityMask	Specifies the initial CPU affinity mask for the thread.
 *				A thread can run only on the thread 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
 *				The following macros are also available to represent all available CPUs.
 *				- SCE_KERNEL_CPU_MASK_USER_ALL
 * @param	pOptParam	Argument for future expansion. Please specify NULL. Max size is 0x14.
 * @retval	Positive value	Thread identifier (UID)
 * @retval	Negative value	Error code
 */
SceUID	sceKernelCreateThreadForDriver(
	const char	*pName,
	SceKernelThreadEntry		entry,
	SceInt32	initPriority,
	SceSize		stackSize,
	SceUInt32	attr,
	SceInt32	cpuAffinityMask,
	const SceKernelThreadOptParam	*pOptParam
);

sceKernelCreateSimpleEventForDriver

Version NID
3.60 0x357A8177

sceKernelCreateMutexForDriver

Version NID
3.60 0xFBAA026E
SceUID sceKernelCreateMutexForDriver(const char *pName, SceUInt attr, int initCount, const SceKernelMutexOptParam *pOptParam);

sceKernelCreateEventFlagForDriver

Version NID
0.990-3.60 0x4336BAA4
/**
 * @brief Event flag generation
 *
 * Generate an event flag and set the initial value of the event flag. Returns the identifier of the generated event flag as a return value.
 *
 * @param	pName		Specifies the name of the eventflag.
 *                      The name of the eventflag does not need to be unique because it is used only for the purpose of operator
 *                      identification when debugging without interprocess communication.
 *                      However, if the SCE_KERNEL_ATTR_OPENABLE attribute is specified for attr,
 *                      a unique name must be specified in the system.
 *                      The maximum name length is 31 bytes.
 * @param	attr		Specifies the event flag attribute.
 *                      Specify the queue order from one of the following.
 *                      - SCE_KERNEL_EVF_ATTR_TH_FIFO: Waiting thread queuing is FIFO
 *                      - SCE_KERNEL_EVF_ATTR_TH_PRIO: Waiting thread queuing is based on the priority of threads.
 *                      Specify whether to wait for multiple threads from either of the following.
 *                      - SCE_KERNEL_EVF_ATTR_SINGLE: Multiple threads cannot wait simultaneously
 *                      - SCE_KERNEL_EVF_ATTR_MULTI: To generate an event flag that can be referenced by
 *                      sceKernelOpenEventFlag() that allows multiple threads to wait simultaneously, specify the following:
 *                      - SCE_KERNEL_ATTR_OPENABLE
 * @param	initPattern	Specifies the initial value of the eventflag.
 * @param	pOptParam	Argument for future expansion. Please specify NULL.
 * @retval	(>=0)		Event flag identifier (UID)
 * @retval	(<0)		Error code
 */
SceUID sceKernelCreateEventFlagForDriver(const char *pName, SceUInt32 attr, SceUInt32 initPattern, const SceKernelEventFlagOptParam *pOptParam);

sceKernelClearEventFlagForDriver

Version NID
3.60 0x4F1DA3BE

sceKernelClearEventForDriver

Version NID
3.60 0x9C335818

sceKernelChangeThreadPriorityForDriver

Version NID
3.60 0x63DAB420

sceKernelCancelCallbackForDriver

Version NID
3.60 0xC040EC1C

sceKernelCancelMsgPipeForDriver

Version NID
3.60 0x9D6A2311

sceKernelCreateMsgPipeForDriver

Version NID
3.60 0xBF631145

sceKernelDeleteMsgPipeForDriver

Version NID
3.60 0xB3453F88

sceKernelSendMsgPipeVectorForDriver

Version NID
3.60 0x67DD3BAD

sceKernelTryReceiveMsgPipeVectorForDriver

Version NID
3.60 0xCE09221A

sceKernelTrySendMsgPipeVectorForDriver

Version NID
3.60 0x4CF1BE58

sceKernelIsThreadDebugSuspendedForDriver

Version NID
0.990-3.60 0xA0B1AB21

It seems to be used to get the cause state at the time of process crash.

used By SceCoredump.

/**
 * @param[in]   thid        thread id (kernel uid)
 * @return      suspend state, else < 0 on error.
 */
int sceKernelIsThreadDebugSuspendedForDriver(SceUID thid);

sceKernelDebugResumeThreadForDriver

Version NID
0.990-3.60 0xEC8343DF

sceKernelResumeThreadForDriver

Version NID
0.990-3.60 0xE3CE20AA

sceKernelCreateRemoteThreadForDriver

Version NID
0.990-3.60 0xC8E57BB4
/**
 * @brief Thread generation that does not operate in the address space of its own process
 *
 * A thread that does not operate in the address space of its own process is created.
 *
 * Allocate a thread management area for the thread to be created, perform initialization, and secure a stack area.
 * The thread information to be created is specified as an argument, and the thread identifier (UID) is returned as the return value.
 *
 * The generated thread is in the DORMANT state.
 *
 * @param	pid		Specifies the ID of the process the thread belongs to.
 * @param	pName		Specifies the name of the thread.
 *				The name of the thread does not have to be unique because it is
 *				used by the operator to identify it when debugging. The maximum name length is 31 bytes.
 * @param	entry		Specify the entry address of the thread. The thread entry point function
 * 				can receive memory block data with two arguments.
 *				The argument is given by sceKernelStartThread() described later.
 *				The thread is terminated by returning from this function, and the return value of the function is the thread termination status.
 * @param	initPriority	Specifies the initial priority of the thread. The smaller the number, the higher the priority.
 *				The range from SCE_KERNEL_HIGHEST_PRIORITY_USER (= 64) to SCE_KERNEL_LOWEST_PRIORITY_USER (= 191) can be used.
 *				By specifying SCE_KERNEL_DEFAULT_PRIORITY_USER, you can specify the default priority of the process to which the thread belongs.
 *				For the default priority, it is also possible to specify with SCE_KERNEL_DEFAULT_PRIORITY_USER ± offset.
 * @param	stackSize	Specify the required stack size of the thread in bytes. The argument block given by
 *				sceKernelStartThread () is copied onto the stack, so specify the stack size with this margin in mind.
 *				An error will occur if a stack size less than 4 KiB is specified.
 * @param	attr		You can specify multiple thread attributes by logical OR.
 * @param	cpuAffinityMask	Specifies the initial CPU affinity mask for the thread.
 *				A thread can run only on the thread 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
 *				The following macros are also available to represent all available CPUs.
 *				- SCE_KERNEL_CPU_MASK_USER_ALL
 * @param	pOptParam	Argument for future expansion. Please specify NULL. Max size is 0x14.
 * @retval	Positive value	Thread identifier (UID)
 * @retval	Negative value	Error code
 */
SceUID	sceKernelCreateRemoteThreadForDriver(
	SceUID		pid,
	const char	*pName,
	SceKernelThreadEntry		entry,
	SceInt32	initPriority,
	SceSize		stackSize,
	SceUInt32	attr,
	SceInt32	cpuAffinityMask,
	const SceKernelThreadOptParam	*pOptParam
);

sceKernelGetThreadIdListForDriver

Version NID
3.60 0xEA7B8AEF

This function is used to query and obtain the number of thread within a process.

/**
 * @brief       Retreive a list of all threads belonging to a process.
 * @param[in]   pid         The process to query.
 * @param[out]  ids         The list of thread ids. Can be NULL if output is not required.
 * @param[in]   n           The max number of thread ids to copy out.
 * @param[out]  copy_count  The number of thread ids copied.
 * @return      The number of threads within the process, else < 0 on error.
 */
int sceKernelGetThreadIdListForDriver(SceUID pid, SceUID *ids, int n, int *copy_count);

sceKernelGetThreadCpuRegistersForDriver

Version NID
3.60 0x5022689D

This function is used to get the state of the registers for a SUSPENDED thread. It returns the registers in a two part structure. It's uncertian what the difference is between the two parts. It seems like its a user/kernel separation, but it's uncertain. It could also be a current/exception difference, but it is unconvincing. In normal usage on a suspended thread it seems to be the user aspect that contains valid values. When you query a suspended thread that has no had the opportunity to start yet, the kernel side is filled.

/** Structure representing all ARM registers */
typedef struct ArmCpuRegisters
{
    uint32_t    r0;
    uint32_t    r1;
    uint32_t    r2;
    uint32_t    r3;
    uint32_t    r4;
    uint32_t    r5;
    uint32_t    r6;
    uint32_t    r7;
    uint32_t    r8;
    uint32_t    r9;
    uint32_t    r10;
    uint32_t    r11;
    uint32_t    r12;
    uint32_t    sp;
    uint32_t    lr;
    uint32_t    pc;
    uint32_t    cpsr;
    uint32_t    unk;
} ArmCpuRegisters;

/** Structure containing a threads register states. */
typedef struct ThreadCpuRegisters
{
    /** Set of registers used for user mode. */
    ArmCpuRegisters user;
     /** Set of registers used for kernel mode. */
    ArmCpuRegisters kernel;
} ThreadCpuRegisters;

/**
 * @brief       Query the state of the registers for a suspended thread.
 *
 * The registers returned are the user/kernel set for the requested thread.
 * It's not certain that user/kernel is correct representation, instead it could be current/exception.
 * The thread provided must be suspended for this function to succeed.
 *
 * @param[in]   thid        The thread to query.
 * @param[out]  registers   The set of registers belonging to the thread.
 * @return      Zero on success, else < 0 on error.
 */
int sceKernelGetThreadCpuRegistersForDriver(SceUID thid, ThreadCpuRegisters *registers);

sceKernelChangeThreadSuspendStatusForDriver

Version NID
3.60 0x04C6764B

This function allows you to change the status of a suspended thread. Most of the valid suspend bits are unknown, but some can be used to prevent the kernel rethrowing exceptions or pull threads into the running/ready state.

/**
 * @brief       Change the thread suspension status to another value.
 *
 * More research needs to be done to find out exactly what each status actually means. Some examples of useful scenarios:
 * When handling an exception changing the status to 0x1002 (on a newly suspended thread) will stop the kernel rethrowing the same exception.
 * When resuming a suspended thread changing the status to 2 will allow it to resume.
 *
 * @param[in]   thid    The thread to change.
 * @param[in]   status  The new status for suspension.
 * @return      Zero on success, else < 0 on error.
 */
int sceKernelChangeThreadSuspendStatusForDriver(SceUID thid, int status);

sceKernelChangeActiveCpuMaskForDriver

Version NID
1.69-3.60 0x001173F8

sceKernelGetThreadCurrentPriorityForDriver

Version NID
1.69-3.60 0x01414F0B

sceKernelCreateCallbackForDriver

Version NID
1.69-3.60 0x1C41614C

sceKernelWaitThreadEndCB_089ForDriver

Version NID
1.69 0x0373C5E3
3.60 not present

sceKernelDeleteCallbackForDriver

Version NID
1.69-3.60 0x3A7E17F6

sceKernelExitThreadForDriver

Version NID
1.69-3.60 0x0C8A38E1
/**
 * @brief End of own thread
 *
 * Terminates the own thread normally and shifts to the DORMANT state.
 * sceKernelExitThread() is a system call that does not return to the context of the issuer.
 *
 * Resources (memory, semaphores, etc.) acquired by the terminating thread are not automatically released.
 * However, for mutexes only, mutexes that have been locked by the terminating thread are automatically unlocked.
 * The mutex is unlocked and not deleted.
 *
 * When the terminated thread is restarted with sceKernelStartThread(), the information included in the thread
 * management area, such as thread priority, is reset.
 * It will not inherit the one at the end.
 *
 * When a thread exits, exitStatus becomes the exit status of that thread.
 *
 * If the thread is terminated by a return from the entry function without using
 * sceKernelExitThread(), the return value of the entry function becomes the termination status.
 *
 * The end status of a thread can be obtained by sceKernelGetThreadExitStatus() and sceKernelGetThreadInfo(),
 * and when another thread waits for the end of the thread by sceKernelWaitThreadEnd(), it can be obtained by the return value.
 *
 * The thread exit status is saved while the thread exits and is in the DORMANT state,
 * but the value is lost if the thread is restarted or deleted with sceKernelStartThread().
 *
 * @param	exitStatus	Specify the value to be set for the termination status of the local thread.
 * @retval	Negative value	Error code
 */
SceInt32	sceKernelExitThreadForDriver(
	SceInt32	exitStatus
);

sceKernelLockMutex_089ForDriver

Version NID
0.990-3.60 0x16AC80C5
int sceKernelLockMutex_089ForDriver(SceUID mutex_id, int unk1, int unk2);

sceKernelExitDeleteThreadForDriver

Version NID
1.69-3.60 0x1D17DECF
/**
 * @brief End and delete own thread
 *
 * Terminates the own thread normally and deletes it.
 * sceKernelExitDeleteThread() is a system call that does not return to the context of the issuer.
 *
 * Resources (memory, semaphores, etc.) acquired by the terminating thread are not automatically released.
 * However, for mutexes only, mutexes that have been locked by the terminating thread are automatically unlocked.
 * The mutex is unlocked and not deleted.
 *
 * When a thread exits, exitStatus becomes the exit status of that thread (sceKernelExitDeleteThread()
 * directly deletes the thread without going through the DORMANT state.
 * (It cannot be obtained by sceKernelGetThreadInfo(). The end status can be obtained by the return
 * value only when waiting for the end of the thread by sceKernelWaitThreadEnd().)
 *
 * @param	exitStatus	Specify the value to be set for the termination status of the local thread.
 * @retval	Negative value	Error code
 */
SceInt32	sceKernelExitDeleteThreadForDriver(
	SceInt32	exitStatus
);

sceKernelUnlockMutex_089ForDriver

Version NID
0.990-3.60 0x1E82E5D0
int sceKernelUnlockMutex_089ForDriver(SceUID mutex_id, int unk1);

sceKernelStartThread_089ForDriver

Version NID
1.69-3.60 0x21F5419B
/**
 * @brief Thread activation
 *
 * Starts the thread specified by threadId and puts it in READY state.
 *
 * The argument block specified by argSize and argBlock is copied onto the thread stack, argSize is
 * passed directly to the first argument of the thread entry function, and the second argument of
 * the entry function is the argument copied onto the stack. The block address is passed.
 *
 * This system call does not queue activation requests. In other words, if the target thread is not
 * in the DORMANT state, an SCE_KERNEL_ERROR_NOT_DORMANT error is returned to the calling thread.
 *
 * @param	threadId	Specify the identifier of the thread to be started.
 * @param	argSize		Specify the size (byte) of the argument to be passed to the thread.
 * @param	pArgBlock	Specify the address of the argument to be passed to the thread.
 * @retval	SCE_OK		Success
 * @retval	Negative value	Error code
 */
SceInt32	sceKernelStartThread_089ForDriver(
	SceUID		threadId,
	SceSize		argSize,
	const void	*pArgBlock
);

sceKernelTryLockMutex_089ForDriver

Version NID
1.69-3.60 0x270993A6

sceKernelGetSystemTimeLowForDriver

Version NID
1.69-3.60 0x47F6DE49

sceKernelDelayThreadForDriver

Version NID
1.69-3.60 0x4B675D05

sceKernelGetMutexInfo_089ForDriver

Version NID
1.69-3.60 0x69B78A12
int sceKernelGetMutexInfo_089ForDriver(SceUID mutexid, SceKernelMutexInfo *info);

sceKernelCancelMutex_089ForDriver

Version NID
1.69-3.60 0x7204B846

sceKernelChangeCurrentThreadAttrForDriver

Version NID
1.69-3.60 0x751C9B7A

sceKernelDelayThreadCBForDriver

Version NID
1.69-3.60 0x9C0180E1

sceKernelLockMutexCB_089ForDriver

Version NID
1.69-3.60 0xD06F2886

sceKernelCheckWaitableStatusForDriver

Version NID
1.69-3.60 0xD9BD74EB

sceKernelCheckCallbackForDriver

Version NID
1.69-3.60 0xE53E41F6

sceKernelWaitThreadEnd_089ForDriver

Version NID
1.69 0xF3489EF4
3.60 not present

sceKernelGetSystemTimeWideForDriver

Version NID
1.69-3.60 0xF4EE4FA9

sceKernelGetThreadInfoForDriver

Version NID
0.990-3.60 0x283807E2
 int sceKernelGetThreadInfoForDriver(SceUID thid, SceKernelThreadInfo *info)

sceKernelInitializeFastMutexForDriver

Version NID
0.990-3.60 0xAF8E1266
int sceKernelInitializeFastMutexForDriver(void* mutex, const char* name, uint32_t attr, int unk)

sceKernelLockFastMutexForDriver

Version NID
1.69-3.60 0x70627F3A
 int sceKernelLockFastMutexForDriver(void* mutex)

sceKernelUnlockFastMutexForDriver

Version NID
1.69-3.60 0xDB395782
 int sceKernelUnlockFastMutexForDriver(void* mutex)

sceKernelFinalizeFastMutexForDriver

Version NID
0.990-3.60 0x11FE84A1

Temp name was sceKernelDeleteFastMutexForDriver.

 int sceKernelFinalizeFastMutexForDriver(void* mutex)

sceKernelSignalCondToForDriver

Version NID
1.69-3.60 0x61533DA9
 int sceKernelSignalCondToForDriver(SceUID condId, SceUID threadId)

sceKernelCreateCondForDriver

Version NID
1.69-3.60 0xDB6CD34A
 SceUID sceKernelCreateCondForDriver(const char *name, SceUInt attr, SceUID mutexId, const SceKernelCondOptParam *option)

sceKernelWaitCondForDriver

Version NID
1.69-3.60 0xCC7E027D
 int sceKernelWaitCondForDriver(SceUID condId, unsigned int *timeout)

sceKernelReceiveMsgPipeVectorForDriver

Version NID
1.69-3.60 0xDA1F256B

sceKernelReceiveMsgPipeVectorCBForDriver

Version NID
1.69-3.60 0xDA5C9AC6

sceKernelGetThreadIdForDriver

Version NID
1.69-3.60 0x59D06540
 SceUID sceKernelGetThreadIdForDriver(void);

sceKernelDeleteCondForDriver

Version NID
1.69-3.60 0xAEE0D27C
 int sceKernelDeleteCondForDriver(SceUID cid);

sceKernelCreateSemaForDriver

Version NID
1.69-3.60 0x30E93C31
/**
 * Creates a new semaphore
 *
 * @par Example:
 * @code
 * int semaid;
 * semaid = sceKernelCreateSemaForDriver("MySema", 0, 1, 1, 0);
 * @endcode
 *
 * @param name - Specifies the name of the sema
 * @param attr - Sema attribute flags (normally set to 0)
 * @param initVal - Sema initial value
 * @param maxVal - Sema maximum value
 * @param option - Sema options (normally set to 0)
 * @return A semaphore id
 */
SceUID sceKernelCreateSemaForDriver(const char *name, SceUInt attr, int initVal, int maxVal, SceKernelSemaOptParam *option);

sceKernelWaitSemaCBForDriver

Version NID
1.69-3.60 0xF55E4D86
/**
 * Lock a semaphore
 *
 * @par Example:
 * @code
 * sceKernelWaitSemaCBForDriver(sema_id, 1, 0);
 * @endcode
 *
 * @param sema_id - The sema id returned from ::sceKernelCreateSemaForDriver
 * @param signal - The value to wait for (i.e. if 1 then wait till reaches a signal state of 1)
 * @param timeout - Timeout in microseconds (assumed).
 *
 * @return < 0 on error.
 */
int sceKernelWaitSemaCBForDriver(SceUID sema_id, int signal, SceUInt *timeout);

sceKernelWaitSemaForDriver

Version NID
1.69-3.60 0x3C8B55A9
/**
 * Lock a semaphore
 *
 * @par Example:
 * @code
 * sceKernelWaitSemaForDriver(sema_id, 1, 0);
 * @endcode
 *
 * @param sema_id - The sema id returned from ::sceKernelCreateSemaForDriver
 * @param signal - The value to wait for (i.e. if 1 then wait till reaches a signal state of 1)
 * @param timeout - Timeout in microseconds (assumed).
 *
 * @return < 0 on error.
 */
int sceKernelWaitSemaForDriver(SceUID sema_id, int signal, SceUInt *timeout);

sceKernelSignalCondForDriver

Version NID
1.69-3.60 0xAC616150
int sceKernelSignalCondForDriver(SceUID condId);

sceKernelChangeThreadCpuAffinityMaskForDriver

Version NID
1.69-3.60 0x6D0733A8
/**
 * @brief Thread CPU affinity mask setting
 *
 * Change the CPU affinity mask of the thread specified by threadId to cpuAffinityMask.
 * A thread can run only on the CPU specified by the CPU affinity mask.
 *
 * If the CPU affinity mask of a running thread is changed and cannot be executed on the current CPU, the thread is dispatched immediately.
 * As a result of scheduling, if a higher priority thread is running on the newly executable CPU, it is made to wait in the READY state.
 *
 * However, if the dispatch is disabled, the CPU affinity mask is changed immediately,
 * but the rescheduling process is delayed until dispatch is permitted.
 *
 * @param	threadId	Specify the identifier of the thread whose CPU affinity mask is to be changed.
 *				You can specify your own thread with SCE_KERNEL_THREAD_ID_SELF.
 * @param	cpuAffinityMask	Specify the CPU affinity mask after the change.
 *				The CPU affinity mask is expressed by the logical OR of the following macros.
 *				- SCE_KERNEL_CPU_MASK_USER_0
 *				- SCE_KERNEL_CPU_MASK_USER_1
 *				- SCE_KERNEL_CPU_MASK_USER_2
 *				The following macros are also available to specify all available CPUs.
 *				- SCE_KERNEL_CPU_MASK_USER_ALL
 * @retval	Positive value	CPU affinity mask before change
 * @retval	Negative value	Error code
 */
SceInt32 sceKernelChangeThreadCpuAffinityMaskForDriver(
	SceUID		threadId,
	SceInt32	cpuAffinityMask
);

sceKernelSetThreadAccessLevelForDriver

Version NID
1.69-3.60 0x02EEDF17

Temp name was sceKernelSetPermissionForDriver.

// return value is previous value
int sceKernelSetThreadAccessLevelForDriver(int value);

sceKernelGetProcessIdForDriver

Version NID
1.69-3.60 0x9DCB4B7A

Returns the process ID.

SceUID sceKernelGetProcessIdForDriver(void);

sceKernelSetProcessIdToTLSForDriver

Version NID
1.69-3.60 0x0486F239

Sets given pid into TLS.

// return value is previous value
SceUID sceKernelSetProcessIdToTLSForDriver(SceUID pid);

sceKernelGetProcessIdFromTLSForDriver

Version NID
1.69-3.60 0xFA54D49A

Gets pid from TLS.

// return value is previous value
SceUID sceKernelGetProcessIdFromTLSForDriver();

sceKernelRegisterTimerForDriver

Version NID
3.60 0xC58DF384

// seen: unk = 2 so maybe UDCD bus

int sceKernelRegisterTimerForDriver(char *name, void *function, int unk);

sceKernelCreateRWLockForDriver

Version NID
0.990-3.60 0x04150799

sceKernelCreateTimerForDriver

Version NID
3.60 0x90656C98
int sceKernelCreateTimerForDriver(const char *name, uint32_t attr);

sceKernelDelayThreadUnkCBForDriver

Version NID
3.60 0x2B60B793

sceKernelDelayThreadUnkForDriver

Version NID
3.60 0xE9A99C50

sceKernelGetTHBPForDriver

Version NID
0.990-3.60 0x453B764A
int sceKernelGetTHBPForDriver(SceUID pid, SceUInt32 a2, int a3, int a4);

sceKernelSetTHBPForDriver

Version NID
0.990-3.60 0x385831A1
int sceKernelSetTHBPForDriver(SceUID pid, SceUInt32 a2, int a3, int a4);

SceThreadmgrForKernel

SceThreadmgrForKernel_33E85E9E

Version NID
0.931-3.60 0x33E85E9E
int SceThreadmgrForKernel_33E85E9E(void *unk_34_buf);

sceKernelPMonThreadSetEventForKernel

Version NID
0.990-3.60 0x6ECCDCBD

sceKernelPMonSetControlRegisterForKernel

Version NID
0.990 0x1AAFA818
3.60 moved to ForDriver

sceKernelPMonSetUserEnableRegisterForKernel

Version NID
0.990 0x5053B005
3.60 moved to ForDriver

sceKernelPMonThreadSetEnableCounterForKernel

Version NID
0.990-3.60 0x72E5DA4E

sceKernelPMonThreadSetCounterForKernel

Version NID
0.990-3.60 0xD2BE5EFB

sceKernelPMonThreadClearEnableCounterForKernel

Version NID
0.990-3.60 0x43D13895

sceKernelGetThreadIdListForKernel

Version NID
0.990 0xEA7B8AEF

This function is used to query and obtain the number of thread within a process.

/**
 * @brief       Retreive a list of all threads belonging to a process.
 * @param[in]   pid         The process to query.
 * @param[out]  ids         The list of thread ids. Can be NULL if output is not required.
 * @param[in]   n           The max number of thread ids to copy out.
 * @param[out]  copy_count  The number of thread ids copied.
 * @return      The number of threads within the process, else < 0 on error.
 */
int sceKernelGetThreadIdListForKernel(SceUID pid, SceUID *ids, int n, int *copy_count);

sceKernelCreateTimerForKernel

Version NID
0.990 0x90656C98
3.60 not present, but exists in ForDriver
int sceKernelCreateTimerForKernel(const char *name, uint32_t attr);

sceKernelLockMutex_089ForKernel

Version NID
1.69-3.60 0x16AC80C5
int sceKernelLockMutex_089ForKernel(SceUID mutex_id, int unk1, int unk2);

sceKernelUnlockMutex_089ForKernel

Version NID
0.990-3.60 0x1E82E5D0
int sceKernelUnlockMutex_089ForKernel(SceUID mutex_id, int unk1);

sceKernelLockMutexCB_089ForKernel

Version NID
1.69 0xD06F2886
3.60 not present, but exists in ForDriver

sceKernelTryLockMutex_089ForKernel

Version NID
1.69 0x270993A6
3.60 not present, but exists in ForDriver

sceKernelCreateMutexForKernel

Version NID
1.69-3.60 0xFBAA026E
SceUID sceKernelCreateMutexForKernel(const char *pName, SceUInt attr, int initCount, const SceKernelMutexOptParam *pOptParam);

sceKernelDeleteMutexForKernel

Version NID
1.69-3.60 0x0A912340
int sceKernelDeleteMutexForKernel(SceUID mutexid);

sceKernelGetMutexInfo_089ForKernel

Version NID
1.69 0x69B78A12
3.60 not present, but exists in ForDriver
int sceKernelGetMutexInfo_089ForKernel(SceUID mutexid, SceKernelMutexInfo *info);

sceKernelCancelMutex_089ForKernel

Version NID
1.69 0x7204B846
3.60 not present, but exists in ForDriver

sceKernelSetThreadAccessLevelForKernel

Version NID
0.990-3.60 0x02EEDF17

Temp name was sceKernelSetPermissionForKernel.

// return value is previous value
int sceKernelSetThreadAccessLevelForKernel(int value);

sceKernelCreateSemaForKernel

Version NID
3.60 0x30E93C31
/**
 * Creates a new semaphore
 *
 * @par Example:
 * @code
 * int semaid;
 * semaid = sceKernelCreateSemaForKernel("MySema", 0, 1, 1, 0);
 * @endcode
 *
 * @param name - Specifies the name of the sema
 * @param attr - Sema attribute flags (normally set to 0)
 * @param initVal - Sema initial value
 * @param maxVal - Sema maximum value
 * @param option - Sema options (normally set to 0)
 * @return A semaphore id
 */
SceUID sceKernelCreateSemaForKernel(const char *name, SceUInt attr, int initVal, int maxVal, SceKernelSemaOptParam *option);

sceKernelSignalSemaForKernel

Version NID
3.60 0xD270498B

sceKernelWaitSemaForKernel

Version NID
3.60 0x3C8B55A9
/**
 * Lock a semaphore
 *
 * @par Example:
 * @code
 * sceKernelWaitSemaForKernel(sema_id, 1, 0);
 * @endcode
 *
 * @param sema_id - The sema id returned from ::sceKernelCreateSemaForKernel
 * @param signal - The value to wait for (i.e. if 1 then wait till reaches a signal state of 1)
 * @param timeout - Timeout in microseconds (assumed).
 *
 * @return < 0 on error.
 */
int sceKernelWaitSemaForKernel(SceUID sema_id, int signal, SceUInt *timeout);

sceKernelDeleteSemaForKernel

Version NID
0.990-3.60 0x16A35E58

sceKernelStartThread_089ForKernel

Version NID
1.69 0x21F5419B
3.60 not present, but exists in ForDriver
/**
 * @brief Thread activation
 *
 * Starts the thread specified by threadId and puts it in READY state.
 *
 * The argument block specified by argSize and argBlock is copied onto the thread stack, argSize is
 * passed directly to the first argument of the thread entry function, and the second argument of
 * the entry function is the argument copied onto the stack. The block address is passed.
 *
 * This system call does not queue activation requests. In other words, if the target thread is not
 * in the DORMANT state, an SCE_KERNEL_ERROR_NOT_DORMANT error is returned to the calling thread.
 *
 * @param	threadId	Specify the identifier of the thread to be started.
 * @param	argSize		Specify the size (byte) of the argument to be passed to the thread.
 * @param	pArgBlock	Specify the address of the argument to be passed to the thread.
 * @retval	SCE_OK		Success
 * @retval	Negative value	Error code
 */
SceInt32	sceKernelStartThread_089ForKernel(
	SceUID		threadId,
	SceSize		argSize,
	const void	*pArgBlock
);

sceKernelWaitThreadEnd_089ForKernel

Version NID
1.69 0xF3489EF4
3.60 not present

sceKernelDelayThreadForKernel

Version NID
1.69 0x4B675D05
3.60 not present, but exists in ForDriver

sceKernelDelayThreadUnkCBForKernel

Version NID
0.990 0x2B60B793
3.60 moved to ForDriver

sceKernelDelayThreadUnkForKernel

Version NID
0.990 0xE9A99C50
3.60 moved to ForDriver

sceKernelStopThreadForKernel

Version NID
0.990-3.60 0x150AEF74

sceKernelSuspendThreadForKernel

Version NID
0.990-3.60 0xAEEE955F

sceKernelWaitThreadEndCB_089ForKernel

Version NID
1.69 0x0373C5E3
3.60 not present

sceKernelExitThreadForKernel

Version NID
1.69 0x0C8A38E1
3.60 not present, but exists in ForDriver
/**
 * @brief End of own thread
 *
 * Terminates the own thread normally and shifts to the DORMANT state.
 * sceKernelExitThread() is a system call that does not return to the context of the issuer.
 *
 * Resources (memory, semaphores, etc.) acquired by the terminating thread are not automatically released.
 * However, for mutexes only, mutexes that have been locked by the terminating thread are automatically unlocked.
 * The mutex is unlocked and not deleted.
 *
 * When the terminated thread is restarted with sceKernelStartThread(), the information included in the thread
 * management area, such as thread priority, is reset.
 * It will not inherit the one at the end.
 *
 * When a thread exits, exitStatus becomes the exit status of that thread.
 *
 * If the thread is terminated by a return from the entry function without using
 * sceKernelExitThread(), the return value of the entry function becomes the termination status.
 *
 * The end status of a thread can be obtained by sceKernelGetThreadExitStatus() and sceKernelGetThreadInfo(),
 * and when another thread waits for the end of the thread by sceKernelWaitThreadEnd(), it can be obtained by the return value.
 *
 * The thread exit status is saved while the thread exits and is in the DORMANT state,
 * but the value is lost if the thread is restarted or deleted with sceKernelStartThread().
 *
 * @param	exitStatus	Specify the value to be set for the termination status of the local thread.
 * @retval	Negative value	Error code
 */
SceInt32	sceKernelExitThreadForKernel(
	SceInt32	exitStatus
);

sceKernelExitDeleteThreadForKernel

Version NID
1.69 0x1D17DECF
3.60 not present, but exists in ForDriver
/**
 * @brief End and delete own thread
 *
 * Terminates the own thread normally and deletes it.
 * sceKernelExitDeleteThread() is a system call that does not return to the context of the issuer.
 *
 * Resources (memory, semaphores, etc.) acquired by the terminating thread are not automatically released.
 * However, for mutexes only, mutexes that have been locked by the terminating thread are automatically unlocked.
 * The mutex is unlocked and not deleted.
 *
 * When a thread exits, exitStatus becomes the exit status of that thread (sceKernelExitDeleteThread()
 * directly deletes the thread without going through the DORMANT state.
 * (It cannot be obtained by sceKernelGetThreadInfo(). The end status can be obtained by the return
 * value only when waiting for the end of the thread by sceKernelWaitThreadEnd().)
 *
 * @param	exitStatus	Specify the value to be set for the termination status of the local thread.
 * @retval	Negative value	Error code
 */
SceInt32	sceKernelExitDeleteThreadForKernel(
	SceInt32	exitStatus
);

sceKernelDelayThreadCBForKernel

Version NID
1.69 0x9C0180E1
3.60 not present, but exists in ForDriver

sceKernelGetThreadCurrentPriorityForKernel

Version NID
1.69 0x01414F0B
3.60 not present, but exists in ForDriver

sceKernelChangeCurrentThreadAttrForKernel

Version NID
1.69 0x751C9B7A
3.60 not present, but exists in ForDriver

sceKernelCpuScanThreadForProcessmgrForKernel

Version NID
0.990-3.60 0x3B4B8293

sceKernelGetProcessIdForKernel

Version NID
0.931-1.69 0x9DCB4B7A
3.60 not present, but exists in ForDriver

Returns the process ID.

SceUID sceKernelGetProcessIdForKernel(void);

sceKernelChangeActiveCpuMaskForKernel

Version NID
1.69 0x001173F8
3.60 not present, but exists in ForDriver

sceKernelCheckWaitableStatusForKernel

Version NID
1.69 0xD9BD74EB
3.60 not present, but exists in ForDriver

sceKernelCheckCallbackForKernel

Version NID
1.69 0xE53E41F6
3.60 not present, but exists in ForDriver

_sceKernelExtendKernelStackWideForKernel

Version NID
0.990-3.60 0xE54FD746

Temp name was sceKernelRunWithStackForKernel.

This takes a function and runs it exclusively on the current core on its own stack.

// stack_size should be 0x2000
int _sceKernelExtendKernelStackWideForKernel(int stack_size, void *func, void *args);

sceKernelExtendKernelStackWideForKernel

Version NID
0.990-1.69 0xA2C801A5
3.60 moved to ForDriver

Temp name was sceKernelRunWithStack2ForKernel.

// stack_size should be 0x2000
int sceKernelExtendKernelStackWideForKernel(int stack_size, void *func, void *args);

sceKernelExtendKernelStackWide2ForKernel

Version NID
0.990 0x236AF33A
3.60 unk
// stack_size should be 0x2000
int sceKernelExtendKernelStackWide2ForKernel(int stack_size, void *func, void *args);

sceKernelGetFaultingProcessForKernel

Version NID
0.990-3.60 0xD8B9AC8D
3.65-3.67 0x6C1F092F

sceKernelDeleteEventFlagForKernel

Version NID
0.990 0x71ECB352
3.60 not present but exists in ForDriver

SceThreadmgrForKernel_E0833C77

Version NID
0.990-3.57 not present, added on 3.60
3.60 0xE0833C77

sceKernelSetThreadMgrTestModeForKernel

Version NID
1.69-3.60 0x333B26AD
int sceKernelSetThreadMgrTestModeForKernel(void);

sceKernelClearThreadMgrTestModeForKernel

Version NID
1.69-3.60 0xE00333A6
int sceKernelClearThreadMgrTestModeForKernel(void);

SceThreadmgr

_sceKernelCloseTimer

Version NID
1.69 0x22605E63
3.60 not present

_sceKernelCloseMutex

Version NID
1.69 0x21716C81
3.60 not present

_sceKernelPollSema

Version NID
1.69 0x20AF286A
3.60 not present

_sceKernelCancelCallback

Version NID
1.69 0x19A0C1B6
3.60 not present

_sceKernelOpenMsgPipe

Version NID
1.69 0x16EC5B7C
3.60 not present

_sceKernelDeleteEventFlag

Version NID
1.69 0x16C93704
3.60 not present

_sceKernelDeleteThread

Version NID
1.69 0x151E0020
3.60 not present

Simply calls sceKernelDeleteThread();

/**
 * @brief Delete thread
 *
 * Deletes the thread specified by threadId.
 *
 * Accordingly, the stack area and thread management area are released. The target thread must be in the DORMANT state.
 *
 * Since the own thread cannot be in the DORMANT state, it cannot be set as the target thread
 * (this results in an SCE_KERNEL_ERROR_NOT_DORMANT error).
 * Use sceKernelExitDeleteThread() to delete your own thread.
 *
 * @param	threadId	Specify the identifier of the thread to be deleted.
 * @retval	SCE_OK		Success
 * @retval	Negative value	Error code
 */
SceInt32	_sceKernelDeleteThread(
	SceUID	threadId
);

_sceKernelUnlockMutex

Version NID
1.69 0x12948A63
3.60 not present

sceKernelGetActiveCpuMask

Version NID
1.69 0x0C3CBB8B
3.60 not present

_sceKernelSignalCondAll

Version NID
1.69 0x0F11545D
3.60 not present

sceKernelUnregisterThreadEventHandler

Version NID
3.60 0x2C8ED6F0

sceKernelChangeActiveCpuMask

Version NID
1.69-3.60 0x001173F8

sceKernelGetThreadCurrentPriority

Version NID
1.69-3.60 0x01414F0B

sceKernelWaitThreadEndCB_089

Version NID
1.69-3.60 0x0373C5E3

sceKernelGetCallbackCount

Version NID
1.69-3.60 0x038644D5

_sceKernelTryReceiveMsgPipeVector

Version NID
1.69-3.60 0x03CFCF00

sceKernelCloseMutex

Version NID
1.69-3.60 0x03E23AF6

_sceKernelGetSemaInfo

Version NID
1.69-3.60 0x0402C633

_sceKernelWaitCond

Version NID
1.69-3.60 0x040795C7

_sceKernelWaitMultipleEventsCB

Version NID
1.69-3.60 0x0558B7C1

_sceKernelGetCondInfo

Version NID
1.69-3.60 0x05C51CE1

_sceKernelSignalLwCondAll

Version NID
1.69-3.60 0x07D2584A

sceKernelExitThread

Version NID
1.69-3.60 0x0C8A38E1
/**
 * @brief End of own thread
 *
 * Terminates the own thread normally and shifts to the DORMANT state.
 * sceKernelExitThread() is a system call that does not return to the context of the issuer.
 *
 * Resources (memory, semaphores, etc.) acquired by the terminating thread are not automatically released.
 * However, for mutexes only, mutexes that have been locked by the terminating thread are automatically unlocked.
 * The mutex is unlocked and not deleted.
 *
 * When the terminated thread is restarted with sceKernelStartThread(), the information included in the thread
 * management area, such as thread priority, is reset.
 * It will not inherit the one at the end.
 *
 * When a thread exits, exitStatus becomes the exit status of that thread.
 *
 * If the thread is terminated by a return from the entry function without using
 * sceKernelExitThread(), the return value of the entry function becomes the termination status.
 *
 * The end status of a thread can be obtained by sceKernelGetThreadExitStatus() and sceKernelGetThreadInfo(),
 * and when another thread waits for the end of the thread by sceKernelWaitThreadEnd(), it can be obtained by the return value.
 *
 * The thread exit status is saved while the thread exits and is in the DORMANT state,
 * but the value is lost if the thread is restarted or deleted with sceKernelStartThread().
 *
 * @param	exitStatus	Specify the value to be set for the termination status of the local thread.
 * @retval	Negative value	Error code
 */
SceInt32	sceKernelExitThread(
	SceInt32	exitStatus
);

_sceKernelCreateSema

Version NID
1.69-3.60 0x0D76458E

sceKernelOpenMsgPipe

Version NID
1.69-3.60 0x0E1CB9F6

_sceKernelGetEventFlagInfo

Version NID
1.69-3.60 0x106C216F

_sceKernelSetEventWithNotifyCallback

Version NID
1.69-3.60 0x118F646E

sceKernelSignalCondTo

Version NID
1.69-3.60 0x1269F4EC

sceKernelCloseMsgPipe

Version NID
1.69-3.60 0x1305A065

_sceKernelCancelTimer

Version NID
1.69-3.60 0x13117B21

sceKernelChangeThreadCpuAffinityMask

Version NID
1.69-3.60 0x15129174
/**
 * @brief Thread CPU affinity mask setting
 *
 * Change the CPU affinity mask of the thread specified by threadId to cpuAffinityMask.
 * A thread can run only on the CPU specified by the CPU affinity mask.
 *
 * If the CPU affinity mask of a running thread is changed and cannot be executed on the current CPU, the thread is dispatched immediately.
 * As a result of scheduling, if a higher priority thread is running on the newly executable CPU, it is made to wait in the READY state.
 *
 * However, if the dispatch is disabled, the CPU affinity mask is changed immediately,
 * but the rescheduling process is delayed until dispatch is permitted.
 *
 * @param	threadId	Specify the identifier of the thread whose CPU affinity mask is to be changed.
 *				You can specify your own thread with SCE_KERNEL_THREAD_ID_SELF.
 * @param	cpuAffinityMask	Specify the CPU affinity mask after the change.
 *				The CPU affinity mask is expressed by the logical OR of the following macros.
 *				- SCE_KERNEL_CPU_MASK_USER_0
 *				- SCE_KERNEL_CPU_MASK_USER_1
 *				- SCE_KERNEL_CPU_MASK_USER_2
 *				The following macros are also available to specify all available CPUs.
 *				- SCE_KERNEL_CPU_MASK_USER_ALL
 * @retval	Positive value	CPU affinity mask before change
 * @retval	Negative value	Error code
 */
SceInt32 sceKernelChangeThreadCpuAffinityMask(
	SceUID		threadId,
	SceInt32	cpuAffinityMask
);

sceKernelCloseCond

Version NID
1.69-3.60 0x15C690E0

sceKernelLockMutex_089

Version NID
1.69-3.60 0x16AC80C5
int sceKernelLockMutex_089(SceUID mutex_id, int unk1, int unk2);

sceKernelUnregisterCallbackFromEvent

Version NID
1.69-3.60 0x18462B11

_sceKernelWaitLwCond

Version NID
1.69-3.60 0x18C65756

sceKernelUnlockMutex

Version NID
1.69-3.60 0x1A372EC8

_sceKernelCancelMutex

Version NID
1.69-3.60 0x1B74CB89

sceKernelDeleteThread

Version NID
1.69-3.60 0x1BBDE3D9
/**
 * @brief Delete thread
 *
 * Deletes the thread specified by threadId.
 *
 * Accordingly, the stack area and thread management area are released. The target thread must be in the DORMANT state.
 *
 * Since the own thread cannot be in the DORMANT state, it cannot be set as the target thread
 * (this results in an SCE_KERNEL_ERROR_NOT_DORMANT error).
 * Use sceKernelExitDeleteThread() to delete your own thread.
 *
 * @param	threadId	Specify the identifier of the thread to be deleted.
 * @retval	SCE_OK		Success
 * @retval	Negative value	Error code
 */
SceInt32	sceKernelDeleteThread(
	SceUID	threadId
);

_sceKernelCancelSema

Version NID
1.69-3.60 0x1CAF805D

sceKernelExitDeleteThread

Version NID
1.69-3.60 0x1D17DECF
/**
 * @brief End and delete own thread
 *
 * Terminates the own thread normally and deletes it.
 * sceKernelExitDeleteThread() is a system call that does not return to the context of the issuer.
 *
 * Resources (memory, semaphores, etc.) acquired by the terminating thread are not automatically released.
 * However, for mutexes only, mutexes that have been locked by the terminating thread are automatically unlocked.
 * The mutex is unlocked and not deleted.
 *
 * When a thread exits, exitStatus becomes the exit status of that thread (sceKernelExitDeleteThread()
 * directly deletes the thread without going through the DORMANT state.
 * (It cannot be obtained by sceKernelGetThreadInfo(). The end status can be obtained by the return
 * value only when waiting for the end of the thread by sceKernelWaitThreadEnd().)
 *
 * @param	exitStatus	Specify the value to be set for the termination status of the local thread.
 * @retval	Negative value	Error code
 */
SceInt32	sceKernelExitDeleteThread(
	SceInt32	exitStatus
);

sceKernelUnlockMutex_089

Version NID
1.69-3.60 0x1E82E5D0
int sceKernelUnlockMutex_089(SceUID mutex_id, int unk1);

_sceKernelWaitMultipleEvents

Version NID
1.69-3.60 0x200CC503

sceKernelTryLockWriteRWLock

Version NID
1.69-3.60 0x206CBB66

sceKernelDeleteSimpleEvent

Version NID
1.69-3.60 0x208CFE28

_sceKernelGetThreadCpuAffinityMask

Version NID
1.69-3.60 0x212E6C35

_sceKernelGetTimerEventRemainingTime

Version NID
1.69-3.60 0x215FD24D

_sceKernelPollEvent

Version NID
1.69-3.60 0x21C7913E

sceKernelStartThread_089

Version NID
1.69-3.60 0x21F5419B
/**
 * @brief Thread activation
 *
 * Starts the thread specified by threadId and puts it in READY state.
 *
 * The argument block specified by argSize and argBlock is copied onto the thread stack, argSize is
 * passed directly to the first argument of the thread entry function, and the second argument of
 * the entry function is the argument copied onto the stack. The block address is passed.
 *
 * This system call does not queue activation requests. In other words, if the target thread is not
 * in the DORMANT state, an SCE_KERNEL_ERROR_NOT_DORMANT error is returned to the calling thread.
 *
 * @param	threadId	Specify the identifier of the thread to be started.
 * @param	argSize		Specify the size (byte) of the argument to be passed to the thread.
 * @param	pArgBlock	Specify the address of the argument to be passed to the thread.
 * @retval	SCE_OK		Success
 * @retval	Negative value	Error code
 */
SceInt32	sceKernelStartThread_089(
	SceUID		threadId,
	SceSize		argSize,
	const void	*pArgBlock
);

_sceKernelExitCallback

Version NID
1.69 0x2682E6ED

sceKernelTryLockMutex_089

Version NID
1.69-3.60 0x270993A6

sceKernelSetTimerTimeWide

Version NID
1.69 0x273B4A4D

_sceKernelOpenCond

Version NID
1.69 0x27DD11EA

_sceKernelGetThreadmgrUIDClass

Version NID
1.69 0x27EE191B

sceKernelOpenMutex_089

Version NID
1.69 0x2928D2EC

_sceKernelCancelEvent

Version NID
1.69 0x29483405

_sceKernelCreateMsgPipeWithLR

Version NID
1.69 0x2AAC8BFD

_sceKernelUnlockLwMutex

Version NID
1.69 0x2ABC41DF

_sceKernelGetMsgPipeCreatorId

Version NID
1.69 0x2B751F95

sceKernelCancelCallback

Version NID
1.69 0x30741EF2

sceKernelSetEvent

Version NID
1.69 0x324218CD

_sceKernelGetTimerBaseWide

Version NID
1.69 0x370E147B

_sceKernelGetThreadContextForVM

Version NID
1.69 0x377094D5

_sceKernelCreateEventFlag

Version NID
1.69 0x38AA5E8E
/**
 * @brief Event flag generation
 *
 * Generate an event flag and set the initial value of the event flag. Returns the identifier of the generated event flag as a return value.
 *
 * @param	pName		Specifies the name of the eventflag.
 *                      The name of the eventflag does not need to be unique because it is used only for the purpose of operator
 *                      identification when debugging without interprocess communication.
 *                      However, if the SCE_KERNEL_ATTR_OPENABLE attribute is specified for attr,
 *                      a unique name must be specified in the system.
 *                      The maximum name length is 31 bytes.
 * @param	attr		Specifies the event flag attribute.
 *                      Specify the queue order from one of the following.
 *                      - SCE_KERNEL_EVF_ATTR_TH_FIFO: Waiting thread queuing is FIFO
 *                      - SCE_KERNEL_EVF_ATTR_TH_PRIO: Waiting thread queuing is based on the priority of threads.
 *                      Specify whether to wait for multiple threads from either of the following.
 *                      - SCE_KERNEL_EVF_ATTR_SINGLE: Multiple threads cannot wait simultaneously
 *                      - SCE_KERNEL_EVF_ATTR_MULTI: To generate an event flag that can be referenced by
 *                      sceKernelOpenEventFlag() that allows multiple threads to wait simultaneously, specify the following:
 *                      - SCE_KERNEL_ATTR_OPENABLE
 * @param	initPattern	Specifies the initial value of the eventflag.
 * @param	pOptParam	Argument for future expansion. Please specify NULL.
 * @retval	(>=0)		Event flag identifier (UID)
 * @retval	(<0)		Error code
 */
SceUID _sceKernelCreateEventFlag(const char *pName, SceUInt32 attr, SceUInt32 initPattern, const SceKernelEventFlagOptParam *pOptParam);

_sceKernelSetTimerTimeWide

Version NID
1.69 0x39364623

_sceKernelWaitThreadEndCB_0910

Version NID
1.69 0x394BCCF2

_sceKernelSignalCondTo

Version NID
1.69 0x3C00071F

_sceKernelReceiveMsgPipeVector

Version NID
1.69 0x3DD9E4AB

_sceKernelPulseEventWithNotifyCallback

Version NID
1.69 0x3E49D3F1

sceKernelUnlockReadRWLock

Version NID
1.69 0x3EF91145

sceKernelGetTimerTimeWide

Version NID
1.69 0x3EFD3165

_sceKernelCreateCallback

Version NID
1.69 0x3F42E175

_sceKernelWaitEventFlagCB

Version NID
1.69 0x401E0C68

_sceKernelSetEventFlag

Version NID
1.69 0x438917E4

_sceKernelWaitCondCB

Version NID
1.69 0x452B0AB3

_sceKernelWaitSema

Version NID
1.69 0x45389B6B

sceKernelGetSystemTimeLow

Version NID
1.69-3.60 0x47F6DE49

sceKernelStartTimer

Version NID
1.69 0x48091E0C

sceKernelDelayThread

Version NID
1.69-3.60 0x4B675D05

_sceKernelClearEvent

Version NID
1.69 0x4B7F47DC

__sceKernelCreateLwMutex

Version NID
1.69-3.60 0x4BB3154A
typedef struct sceKernelCreateLwMutex_opt //size is 0x10
{
  int initCount;
  const SceKernelLwMutexOptParam* pOptParam;
  uint32_t unk_8;
  uint32_t unk_C;
} sceKernelCreateLwMutex_opt;

int __sceKernelCreateLwMutex(SceKernelLwMutexWork *pWork, const char *pName, unsigned int attr, sceKernelCreateLwMutex_opt* opt);

sceKernelClearEventFlag

Version NID
1.69 0x4CB87CA7

_sceKernelReceiveMsgPipeVectorCB

Version NID
1.69 0x4DBF648E

_sceKernelNotifyCallback

Version NID
1.69 0x4DF8B624

_sceKernelWaitEvent

Version NID
1.69 0x4E0EA70D

sceKernelOpenSimpleEvent

Version NID
1.69 0x4E1E4DF8

sceKernelGetThreadStackFreeSize

Version NID
1.69 0x4F8A3DA0

_sceKernelWaitSignal

Version NID
1.69 0x50407BF4

_sceKernelTryLockWriteRWLock

Version NID
1.69 0x52DD3322

sceKernelOpenMutex

Version NID
1.69 0x52E17182

sceKernelDeleteEventFlag

Version NID
1.69 0x5840162C

_sceKernelUnregisterCallbackFromEventAll

Version NID
1.69 0x5B5650C7

_sceKernelUnlockWriteRWLock

Version NID
1.69 0x5B746A69

_sceKernelGetCallbackCount

Version NID
1.69 0x5D06FF09

_sceKernelLockReadRWLockCB

Version NID
1.69 0x5D86D763

sceKernelGetTimerBaseWide

Version NID
1.69 0x5DBC1960

_sceKernelSendMsgPipeVector

Version NID
1.69 0x5E65E454

_sceKernelWaitExceptionCB

Version NID
1.69 0x5E7876F2

sceKernelResumeThreadForVM

Version NID
1.69 0x5E93840E

_sceKernelCloseCond

Version NID
1.69 0x650CE348

_sceKernelPMonCpuGetCounter

Version NID
1.69 0x667A4649

_sceKernelGetActiveCpuMask

Version NID
1.69 0x67FDA21B

_sceKernelDeleteCallback

Version NID
1.69 0x68D0FA79

sceKernelGetMutexInfo_089

Version NID
1.69-3.60 0x69B78A12
int sceKernelGetMutexInfo_089(SceUID mutexid, SceKernelMutexInfo *info);

_sceKernelPMonThreadGetCounter

Version NID
1.69 0x6B9711AC

_sceKernelGetLwCondInfo

Version NID
1.69 0x6C79F2F2

sceKernelSignalCond

Version NID
1.69 0x6ED2E2DC
3.60 0x6ED2E2DC

_sceKernelSignalLwCondTo

Version NID
1.69 0x6F1A4A2E

_sceKernelGetTimerTime

Version NID
1.69 0x6F2C41BA

_sceKernelWaitException

Version NID
1.69 0x6F7C4DE6

_sceKernelGetEventPattern

Version NID
1.69 0x70358258

sceKernelGetMsgPipeCreatorId

Version NID
1.69 0x70E2A6D2

_sceKernelSuspendThreadForVM

Version NID
1.69 0x7192B01C

sceKernelCancelMutex_089

Version NID
1.69-3.60 0x7204B846

_sceKernelWaitLwCondCB

Version NID
1.69 0x72DBB96B

sceKernelTryLockMutex

Version NID
1.69 0x72FC1F54

sceKernelChangeCurrentThreadAttr

Version NID
1.69-3.60 0x751C9B7A

_sceKernelDeleteLwCond

Version NID
1.69 0x75FCF058

sceKernelOpenCond

Version NID
1.69 0x76BDA02F

sceKernelRegisterCallbackToEvent

Version NID
1.69 0x76FB37E9

_sceKernelSignalCond

Version NID
1.69 0x79889DAC

_sceKernelCreateTimer

Version NID
1.69 0x79BA0A6D

_sceKernelGetMsgPipeInfo

Version NID
1.69 0x7AE31060

sceKernelClearEvent

Version NID
1.69 0x7B2A4B28

_sceKernelUnlockReadRWLock

Version NID
1.69 0x7D16FB3B

_sceKernelWaitEventCB

Version NID
1.69 0x7D483C33

_sceKernelLockReadRWLock

Version NID
1.69 0x7EB9E8B5

_sceKernelLockMutex

Version NID
1.69 0x7FA945AD

_sceKernelGetThreadExitStatus_0940

Version NID
1.69 0x800BB137

_sceKernelLockWriteRWLock

Version NID
1.69 0x80191FAA

_sceKernelGetSystemInfo

Version NID
1.69 0x80544E0C

_sceKernelDeleteSema

Version NID
1.69 0x855F49D5

_sceKernelOpenTimer

Version NID
1.69 0x8564E008

_sceKernelGetTimerBase

Version NID
1.69 0x865DA482

sceKernelPollSema

Version NID
1.69 0x866EF048

_sceKernelGetCallbackInfo

Version NID
1.69 0x86761234

sceKernelStopTimer

Version NID
1.69 0x869E9F20

sceKernelDeleteCond

Version NID
1.69 0x879E6EBD

sceKernelUnregisterCallbackFromEventAll

Version NID
1.69 0x888A7361

_sceKernelGetRWLockInfo

Version NID
1.69 0x8CE3AFC7

sceKernelPulseEvent

Version NID
1.69 0x8D27BAD6

_sceKernelCancelEventWithSetPattern

Version NID
1.69 0x8E68E870

_sceKernelSignalSema

Version NID
1.69 0x8E9A0400

_sceKernelDeleteLwMutex

Version NID
1.69 0x91262C5F

_sceKernelDeleteTimer

Version NID
1.69 0x921A043D

_sceKernelCreateMutex

Version NID
1.69 0x92667AE5
SceUID	_sceKernelCreateMutex(const char *pName, SceUInt32 attr, SceInt32 initCount, const SceKernelMutexOptParam *pOptParam);

_sceKernelCreateLwCond

Version NID
1.69 0x940B9EBE

sceKernelCloseEventFlag

Version NID
1.69 0x9A68F547

_sceKernelSetEvent

Version NID
1.69 0x9A92C33F

_sceKernelDeleteRWLock

Version NID
1.69 0x9AA387DF

_sceKernelGetTimerTimeWide

Version NID
1.69 0x9AC39954

_sceKernelRegisterCallbackToEvent

Version NID
1.69 0x9B1922F2

sceKernelDelayThreadCB

Version NID
1.69-3.60 0x9C0180E1

_sceKernelCreateSimpleEvent

Version NID
1.69 0x9C187FAD

_sceKernelLockLwMutex

Version NID
1.69 0x9C572180

_sceKernelChangeThreadCpuAffinityMask

Version NID
1.69 0x9C921F8D

Simply calls sceKernelChangeThreadCpuAffinityMask().

/**
 * @brief Thread CPU affinity mask setting
 *
 * Change the CPU affinity mask of the thread specified by threadId to cpuAffinityMask.
 * A thread can run only on the CPU specified by the CPU affinity mask.
 *
 * If the CPU affinity mask of a running thread is changed and cannot be executed on the current CPU, the thread is dispatched immediately.
 * As a result of scheduling, if a higher priority thread is running on the newly executable CPU, it is made to wait in the READY state.
 *
 * However, if the dispatch is disabled, the CPU affinity mask is changed immediately,
 * but the rescheduling process is delayed until dispatch is permitted.
 *
 * @param	threadId	Specify the identifier of the thread whose CPU affinity mask is to be changed.
 *				You can specify your own thread with SCE_KERNEL_THREAD_ID_SELF.
 * @param	cpuAffinityMask	Specify the CPU affinity mask after the change.
 *				The CPU affinity mask is expressed by the logical OR of the following macros.
 *				- SCE_KERNEL_CPU_MASK_USER_0
 *				- SCE_KERNEL_CPU_MASK_USER_1
 *				- SCE_KERNEL_CPU_MASK_USER_2
 *				The following macros are also available to specify all available CPUs.
 *				- SCE_KERNEL_CPU_MASK_USER_ALL
 * @retval	Positive value	CPU affinity mask before change
 * @retval	Negative value	Error code
 */
SceInt32 _sceKernelChangeThreadCpuAffinityMask(
	SceUID		threadId,
	SceInt32	cpuAffinityMask
);

_sceKernelOpenMutex

Version NID
1.69 0x9D291788

sceKernelGetProcessId

Version NID
1.69-3.60 0x9DCB4B7A

sceKernelCloseSema

Version NID
1.69 0xA2D81F9E

sceKernelCloseMutex_089

Version NID
1.69 0xA35427EE

sceKernelNotifyCallback

Version NID
1.69 0xA4683592

_sceKernelCloseMsgPipe

Version NID
1.69 0xAA888831

sceKernelDeleteTimer

Version NID
1.69 0xAB1E42C4

_sceKernelGetTimerInfo

Version NID
1.69 0xAC7FE4F3

sceKernelCloseTimer

Version NID
1.69 0xACE60E4A

_sceKernelCreateRWLock

Version NID
1.69 0xB1877F5E

sceKernelCreateCallback

Version NID
1.69 0xB19CF7E9

_sceKernelGetThreadInfo

Version NID
1.69-3.60 0xB373D8A1
typedef struct get_thread_info_opt
{
   uint32_t size; // size of SceKernelThreadInfo
   uint32_t unk;
}get_thread_info_opt;

int _sceKernelGetThreadInfo(SceUID thid, SceKernelThreadInfo *info, get_thread_info_opt* opt)

_sceKernelTrySendMsgPipeVector

Version NID
1.69 0xB3D600AB

sceKernelUnlockWriteRWLock

Version NID
1.69 0xB4151397

_sceKernelGetThreadStackFreeSize

Version NID
1.69 0xB5EC061A

_sceKernelDeleteMsgPipe

Version NID
1.69 0xB6D50FCC

sceKernelOpenTimer

Version NID
1.69 0xB6E286E7

_sceKernelGetSystemTime

Version NID
1.69 0xB70EBAE9

_sceKernelChangeThreadVfpException

Version NID
1.69 0xB8F165B4

_sceKernelOpenSema

Version NID
1.69 0xB96FED7D

_sceKernelGetThreadTLSAddr

Version NID
1.69 0xBACA6891

sceKernelOpenEventFlag

Version NID
1.69 0xBC19F8A1

_sceKernelTryLockMutex

Version NID
1.69 0xBCFB867F

sceKernelChangeThreadPriority

Version NID
1.69 0xBD0139F2

sceKernelCreateThreadForUser

Version NID
1.69-3.60 0xC0FAF6A3
/**
 * @brief Thread generation that operates in the address space of its own process
 *
 * A thread that operates in the address space of its own process is created.
 *
 * Allocate a thread management area for the thread to be created, perform initialization, and secure a stack area.
 * The thread information to be created is specified as an argument, and the thread identifier (UID) is returned as the return value.
 *
 * The generated thread is in the DORMANT state.
 *
 * @param	pName		Specifies the name of the thread.
 *				The name of the thread does not have to be unique because it is
 *				used by the operator to identify it when debugging. The maximum name length is 31 bytes.
 * @param	entry		Specify the entry address of the thread. The thread entry point function
 * 				can receive memory block data with two arguments.
 *				The argument is given by sceKernelStartThread() described later.
 *				The thread is terminated by returning from this function, and the return value of the function is the thread termination status.
 * @param	initPriority	Specifies the initial priority of the thread. The smaller the number, the higher the priority.
 *				The range from SCE_KERNEL_HIGHEST_PRIORITY_USER (= 64) to SCE_KERNEL_LOWEST_PRIORITY_USER (= 191) can be used.
 *				By specifying SCE_KERNEL_DEFAULT_PRIORITY_USER, you can specify the default priority of the process to which the thread belongs.
 *				For the default priority, it is also possible to specify with SCE_KERNEL_DEFAULT_PRIORITY_USER ± offset.
 * @param	stackSize	Specify the required stack size of the thread in bytes. The argument block given by
 *				sceKernelStartThread () is copied onto the stack, so specify the stack size with this margin in mind.
 *				An error will occur if a stack size less than 4 KiB is specified.
 * @param	attr		You can specify multiple thread attributes by logical OR.
 * @param	cpuAffinityMask	Specifies the initial CPU affinity mask for the thread.
 *				A thread can run only on the thread 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
 *				The following macros are also available to represent all available CPUs.
 *				- SCE_KERNEL_CPU_MASK_USER_ALL
 * @param	pOptParam	Argument for future expansion. Please specify NULL. Max size is 0x14.
 * @retval	Positive value	Thread identifier (UID)
 * @retval	Negative value	Error code
 */
SceUID	sceKernelCreateThreadForUser(
	const char	*pName,
	SceKernelThreadEntry		entry,
	SceInt32	initPriority,
	SceSize		stackSize,
	SceUInt32	attr,
	SceInt32	cpuAffinityMask,
	const SceKernelThreadOptParam	*pOptParam
);

_sceKernelSendSignal

Version NID
1.69 0xC21FC992

_sceKernelCloseRWLock

Version NID
1.69 0xC239DBCC

sceKernelSignalCondAll

Version NID
1.69 0xC2E7AC22

_sceKernelStartThread

Version NID
1.69 0xC30B1745
/**
 * @brief Thread activation
 *
 * Starts the thread specified by threadId and puts it in READY state.
 *
 * The argument block specified by argSize and argBlock is copied onto the thread stack, argSize is
 * passed directly to the first argument of the thread entry function, and the second argument of
 * the entry function is the argument copied onto the stack. The block address is passed.
 *
 * This system call does not queue activation requests. In other words, if the target thread is not
 * in the DORMANT state, an SCE_KERNEL_ERROR_NOT_DORMANT error is returned to the calling thread.
 *
 * @param	threadId	Specify the identifier of the thread to be started.
 * @param	argSize		Specify the size (byte) of the argument to be passed to the thread.
 * @param	pArgBlock	Specify the address of the argument to be passed to the thread.
 * @retval	SCE_OK		Success
 * @retval	Negative value	Error code
 */
SceInt32	_sceKernelStartThread(
	SceUID		threadId,
	SceSize		argSize,
	const void	*pArgBlock
);

_sceKernelSignalLwCond

Version NID
1.69 0xC37F6983

_sceKernelStartTimer

Version NID
1.69 0xC3ED6E4A

_sceKernelCloseSimpleEvent

Version NID
1.69 0xC6FFE335

_sceKernelGetThreadRunStatus

Version NID
1.69 0xC7FB5497

sceKernelGetThreadmgrUIDClass

Version NID
1.69 0xC9678F7F

_sceKernelStopTimer

Version NID
1.69 0xC96F4269

sceKernelDeleteMutex

Version NID
1.69 0xCB78710D

sceKernelOpenSema

Version NID
1.69 0xCBE235C7

_sceKernelCreateCond

Version NID
1.69 0xCC14FA59

sceKernelChangeThreadVfpException

Version NID
1.69 0xCC18FBAE

sceKernelOpenRWLock

Version NID
1.69 0xCE510196

_sceKernelCancelMsgPipe

Version NID
1.69 0xCE769C83

_sceKernelWaitSignalCB

Version NID
1.69 0xCEA3FC52

_sceKernelCancelRWLock

Version NID
1.69 0xD004EA15

sceKernelLockMutexCB_089

Version NID
1.69-3.60 0xD06F2886

_sceKernelGetThreadExitStatus

Version NID
1.69 0xD3210C08

_sceKernelWaitThreadEnd_0910

Version NID
1.69 0xD38231C9

sceKernelDeleteCallback

Version NID
1.69 0xD469676B

_sceKernelSetThreadContextForVM

Version NID
1.69 0xD4785C41

sceKernelSendSignal

Version NID
1.69 0xD4C367B2

_sceKernelDeleteCond

Version NID
1.69 0xD99F51D3

sceKernelCheckWaitableStatus

Version NID
1.69-3.60 0xD9BD74EB

_sceKernelGetLwCondInfoById

Version NID
1.69 0xD9E78D30

_sceKernelPollEventFlag

Version NID
1.69 0xDAB1B1C8
/**
 * @brief Event flag polling
 *
 * Polls the event flag specified by evfId.
 *
 * sceKernelPollEventFlag() is a system call that removes the function to enter standby state from sceKernelWaitEventFlag().
 * Unlike sceKernelWaitEventFlag(), an error (SCE_KERNEL_ERROR_EVF_COND) is returned immediately if the wait release condition is not satisfied.
 * In this case, SCE_KERNEL_EVF_WAITMODE_CLEAR_ALL / SCE_KERNEL_EVF_WAITMODE_CLEAR_PAT specification is ignored.
 *
 * @param	evfId		Specify the event flag identifier to be polled.
 * @param	bitPattern	Specify the comparison value with the eventflag.
 * @param	waitMode	Specify the wait mode. Specify one of the following:
 *                      - SCE_KERNEL_EVF_WAITMODE_AND: Waiting for AND
 *                      - SCE_KERNEL_EVF_WAITMODE_OR : Wait for OR
 *                      In addition, you can optionally add one of the following specifications as a logical sum.
 *                      - SCE_KERNEL_EVF_WAITMODE_CLEAR_ALL: Clear all bits after waiting
 *                      - SCE_KERNEL_EVF_WAITMODE_CLEAR_PAT: After waiting, clear the bit specified in bitPattern
 * @param	pResultPat	Specify a pointer to the SceUInt32 type variable that receives the eventflag value when waiting is established.
 * @retval	SCE_OK		Success
 * @retval	(<0)		Error code
 */
SceInt32 _sceKernelPollEventFlag(SceUID evfId, SceUInt32 bitPattern, SceUInt32 waitMode, SceUInt32 *pResultPat);

sceKernelDeleteSema

Version NID
1.69 0xDB32948A

_sceKernelLockMutexCB

Version NID
1.69 0xDB9F5333

_sceKernelLockWriteRWLockCB

Version NID
1.69 0xDBD09B09

_sceKernelOpenRWLock

Version NID
1.69 0xDFCEE5AB

_sceKernelDeleteMutex

Version NID
1.69 0xE0A6D759

_sceKernelSetTimerEvent

Version NID
1.69 0xE2C0BFEF

_sceKernelOpenSimpleEvent

Version NID
1.69 0xE326EA7A

sceKernelCheckCallback

Version NID
1.69-3.60 0xE53E41F6

_sceKernelChangeThreadPriority

Version NID
1.69 0xE61C2B06

sceKernelSignalSema

Version NID
1.69 0xE6B761D1

sceKernelDeleteRWLock

Version NID
1.69 0xE73649CA

sceKernelDeleteMsgPipe

Version NID
1.69 0xE78BCCF7

_sceKernelCloseSema

Version NID
1.69 0xE8C03447

_sceKernelGetMutexInfo

Version NID
1.69-3.60 0xE8CC3DF0
int _sceKernelGetMutexInfo(SceUID mutexid, SceKernelMutexInfo *pInfo, SceKernelMutexOptParam* pOpt);

_sceKernelWaitThreadEnd

Version NID
1.69 0xEA5C52F5

_sceKernelTryLockReadRWLock

Version NID
1.69 0xEB9054B2

sceKernelSetEventFlag

Version NID
1.69 0xEC94DFF7

sceKernelTryLockReadRWLock

Version NID
1.69 0xEFDDA456

_sceKernelClearEventFlag

Version NID
1.69 0xF0526CE2

sceKernelGetThreadCpuAffinityMask

Version NID
1.69 0xF1AE5654

sceKernelWaitThreadEnd_089

Version NID
1.69-3.60 0xF3489EF4

sceKernelGetSystemTimeWide

Version NID
1.69-3.60 0xF4EE4FA9

_sceKernelPulseEvent

Version NID
1.69 0xF6A0FE84

_sceKernelCloseEventFlag

Version NID
1.69 0xF6CFB4F1

_sceKernelSendMsgPipeVectorCB

Version NID
1.69 0xF6D515DC

_sceKernelDeleteSimpleEvent

Version NID
1.69 0xF7413EC7

_sceKernelCancelEventFlag

Version NID
1.69 0xF76F3056

_sceKernelWaitSemaCB

Version NID
1.69 0xF8E06784

_sceKernelWaitThreadEndCB

Version NID
1.69 0xFA3D4491

_sceKernelOpenEventFlag

Version NID
1.69 0xFA64FB37

_sceKernelUnregisterCallbackFromEvent

Version NID
1.69 0xFB66565E

_sceKernelWaitEventFlag

Version NID
1.69 0xFCE2F728
/**
 * @brief Event flag wait
 *
 * This system call waits for the event flag specified by evfId to be set according to the wait release condition specified by waitMode.
 * If the event flag specified by evfId already satisfies the wait release condition specified by waitMode,
 * the issuing thread continues execution without transitioning to the waiting state (WAITING).
 *
 * When SCE_KERNEL_EVF_WAITMODE_AND is specified for waitMode, it waits until all the bits specified by bitPattern become 1.
 * If SCE_KERNEL_EVF_WAITMODE_OR is specified for waitMode, wait until one of the bits specified in bitPattern becomes 1.
 * If SCE_KERNEL_EVF_WAITMODE_CLEAR_ALL is additionally specified for waitMode, all the eventflag bits
 * are cleared to 0 when the wait release condition is satisfied and this thread is released.
 * If SCE_KERNEL_EVF_WAITMODE_CLEAR_PAT is additionally specified for waitMode, the bit specified
 * by bitPattern is cleared to 0 when the wait release condition is satisfied and this thread is released.
 *
 * The event flag value is returned to pResultPat in the following cases. NULL can be specified if no value is required.
 * - If the wait release condition is satisfied (SCE_OK is returned),
 *   the event flag value before clearing by specifying SCE_KERNEL_EVF_WAITMODE_CLEAR_ALL,
 *   SCE_KERNEL_EVF_WAITMODE_CLEAR_PAT is returned immediately after the condition is satisfied.
 * - After exiting the wait state, the event flag value just before exiting from the wait state is returned when
 *   exiting except when the wait release condition is satisfied (when SCE_KERNEL_ERROR_WAIT_CANCEL,
 *   SCE_KERNEL_ERROR_WAIT_DELETE, SCE_KERNEL_ERROR_WAIT_TIMEOUT errors are returned).
 *   When canceling with sceKernelCancelEventFlag(), the eventflag value set at the time of cancellation is returned.
 *
 * When pTimeout is specified, the timeout operation specified in microseconds is set.
 * If pTimeout is NULL, timeout operation is not performed.
 * Note that if pTimeout is specified, the value pointed to by pTimeout is updated when the system call ends.
 * If the condition is met within the time, it is updated with the remaining time. If not established,
 * the value pointed to by pTimeout is updated with 0. In this case, error SCE_KERNEL_ERROR_WAIT_TIMEOUT is returned.
 *
 * Another thread cannot execute sceKernelWaitEventFlag() and sceKernelPollEventFlag() for an event flag with
 * the SCE_KERNEL_EVF_ATTR_SINGLE attribute that already has a waiting thread.
 * In this case, an error is returned immediately to the thread that executed sceKernelWaitEventFlag() or sceKernelPollEventFlag() later.
 *
 * If multiple threads are waiting for an event flag with the SCE_KERNEL_EVF_ATTR_MULTI attribute, a thread queue is created.
 * In this case, a single sceKernelSetEventFlag() may release the waiting status of multiple threads.
 *
 * In the case of the event flag of the SCE_KERNEL_EVF_ATTR_TH_FIFO attribute, the thread queue is
 * arranged in the order in which it waits first.
 * In the event flag of the SCE_KERNEL_EVF_ATTR_TH_PRIO attribute, the thread with the highest
 * priority among the waiting threads starts first and is arranged in the order of thread priority.
 *
 * If there is a thread with SCE_KERNEL_EVF_WAITMODE_CLEAR_ALL specified or SCE_KERNEL_EVF_WAITMODE_CLEAR_PAT specified in the
 * queue and the wait release condition for that thread is satisfied, the event flag is cleared at the same time as the wait release.
 * Threads that are lined up behind the thread that has specified SCE_KERNEL_EVF_WAITMODE_CLEAR_ALL or SCE_KERNEL_EVF_WAITMODE_CLEAR_PAT
 * will see the event flag after being cleared, so the wait may not be released.
 *
 * @param	evfId		Specifies the identifier of the event flag to wait for.
 * @param	bitPattern	Specify the comparison value with the eventflag.
 * @param	waitMode	Specifies the wait mode. Specify one of the following:
 *                      - SCE_KERNEL_EVF_WAITMODE_AND: Waiting for AND
 *                      - SCE_KERNEL_EVF_WAITMODE_OR : Wait for OR
 *                      In addition, you can optionally add either of the following specifications as a logical sum.
 *                      - SCE_KERNEL_EVF_WAITMODE_CLEAR_ALL: After waiting, clear all bits
 *                      - SCE_KERNEL_EVF_WAITMODE_CLEAR_PAT: After waiting, clear the bit specified in bitPattern
 * @param	pResultPat	Specifies a pointer to the SceUInt32 type variable that receives the eventflag value when waiting is established.
 *                      If NULL is specified, the event flag value is not received.
 * @param	pTimeout	Specify a pointer to the SceUInt32 type variable that stores the upper limit (microseconds) of the waiting time.
 *                      If NULL is specified, wait indefinitely. When the wait condition is satisfied, the remaining time is returned.
 * @retval	SCE_OK		Success
 * @retval	(<0)		Error code
 */
SceInt32 _sceKernelWaitEventFlag(SceUID evfId, SceUInt32 bitPattern, SceUInt32 waitMode, SceUInt32 *pResultPat, SceUInt32 *pTimeout);

sceKernelCloseRWLock

Version NID
1.69 0xFD5BD5C1

_sceKernelGetLwMutexInfoById

Version NID
1.69 0xFEC9E946

sceKernelCloseSimpleEvent

Version NID
1.69 0xFEF4CA53

_sceKernelSetTimerTime

Version NID
1.69 0xFF738CD9

_sceKernelRegisterThreadEventHandler

Version NID
3.60 0xCE6B49D8
struct sceKernelRegisterThreadEventHandlerOpt
{
  void *handler;
  int num1;
  int reserved0;
  int reserved1;
};

int _sceKernelRegisterThreadEventHandler(char *name, SceUID uid, uint32_t num0, sceKernelRegisterThreadEventHandlerOpt *opt);

SceThreadmgrCoredumpTime

sceKernelExitThread

Version NID
3.60 0x0C8A38E1
/**
 * @brief End of own thread
 *
 * Terminates the own thread normally and shifts to the DORMANT state.
 * sceKernelExitThread() is a system call that does not return to the context of the issuer.
 *
 * Resources (memory, semaphores, etc.) acquired by the terminating thread are not automatically released.
 * However, for mutexes only, mutexes that have been locked by the terminating thread are automatically unlocked.
 * The mutex is unlocked and not deleted.
 *
 * When the terminated thread is restarted with sceKernelStartThread(), the information included in the thread
 * management area, such as thread priority, is reset.
 * It will not inherit the one at the end.
 *
 * When a thread exits, exitStatus becomes the exit status of that thread.
 *
 * If the thread is terminated by a return from the entry function without using
 * sceKernelExitThread(), the return value of the entry function becomes the termination status.
 *
 * The end status of a thread can be obtained by sceKernelGetThreadExitStatus() and sceKernelGetThreadInfo(),
 * and when another thread waits for the end of the thread by sceKernelWaitThreadEnd(), it can be obtained by the return value.
 *
 * The thread exit status is saved while the thread exits and is in the DORMANT state,
 * but the value is lost if the thread is restarted or deleted with sceKernelStartThread().
 *
 * @param	exitStatus	Specify the value to be set for the termination status of the local thread.
 * @retval	Negative value	Error code
 */
SceInt32	sceKernelExitThread(
	SceInt32	exitStatus
);