summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavee2016-11-03 05:38:47 +0100
committerYifan Lu2016-11-02 21:38:47 -0700
commit92f1eacaee2948052d3f16ebf5c855f7c39573a1 (patch)
treee75efabd14e8bb397eb2e6ba8201ee21f3807c3c
parentAdded sceAppMgrUmount (#66) (diff)
downloadvds-libraries-92f1eacaee2948052d3f16ebf5c855f7c39573a1.tar.gz
kernel development headers (#67)
* Added some kernel headers * Modified kernel headers * Added suprx loading args to headers * Added kernel modulemgr load/stop nids * Added struct for versioninfo * Added sceKernelMemcpyKernelToUser * Added SceSblACMgr * Added syscall entry/exit stubs * Added strncpy u2k/k2u functions * Wrong offset for version * More kernel adds * Added sceKernelQueueLoadModuleForPid * Added sceKernelGetSystemSwVersion to user headers * Added sceKernelStrncpyUserForPid * Added a couple more kernel apis
Diffstat (limited to '')
-rw-r--r--include/kernel/kernel/cpu.h141
-rw-r--r--include/kernel/kernel/modulemgr.h96
-rw-r--r--include/kernel/kernel/processmgr.h16
-rw-r--r--include/kernel/kernel/sysmem.h133
-rw-r--r--include/kernel/kernel/threadmgr.h1068
-rw-r--r--include/kernel/sblacmgr.h19
-rw-r--r--include/user/kernel/modulemgr.h27
-rw-r--r--nids/360/SceIofilemgr.yml42
-rw-r--r--nids/360/SceKernelModulemgr.yml29
-rw-r--r--nids/360/SceKernelThreadMgr.yml112
-rw-r--r--nids/360/SceLibKernel.yml (renamed from nids/360/SceKernel.yml)161
-rw-r--r--nids/360/SceProcessmgr.yml27
-rw-r--r--nids/360/SceSblACMgr.yml11
-rw-r--r--nids/360/SceSblSsMgr.yml8
-rw-r--r--nids/360/SceStdio.yml8
-rw-r--r--nids/360/SceSysmem.yml105
16 files changed, 1843 insertions, 160 deletions
diff --git a/include/kernel/kernel/cpu.h b/include/kernel/kernel/cpu.h
new file mode 100644
index 0000000..5c84c46
--- /dev/null
+++ b/include/kernel/kernel/cpu.h
@@ -0,0 +1,141 @@
+#ifndef _PSP2_KERNEL_CPU_H_
+#define _PSP2_KERNEL_CPU_H_
+
+#include <psp2kern/types.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/**
+ * @brief Call this when entering a syscall
+ *
+ * @param state The state
+ */
+#define ENTER_SYSCALL(state) do { \
+ asm volatile ("mrc p15, 0, %0, c13, c0, 3" : "=r" (state)); \
+ asm volatile ("mcr p15, 0, %0, c13, c0, 3" :: "r" (state << 16) : "memory"); \
+} while(0)
+
+/**
+ * @brief Call this when existing a syscall
+ *
+ * @param state The state
+ */
+#define EXIT_SYSCALL(state) do { \
+ asm volatile ("mcr p15, 0, %0, c13, c0, 3" :: "r" (state) : "memory"); \
+} while (0)
+
+/**
+ * @brief Save process context
+ *
+ * @param context The context
+ */
+static inline void sceKernelCpuSaveContext(int context[3]) {
+ asm ("mrc p15, 0, %0, c2, c0, 1" : "=r" (context[0]));
+ asm ("mrc p15, 0, %0, c3, c0, 0" : "=r" (context[1]));
+ asm ("mrc p15, 0, %0, c13, c0, 1" : "=r" (context[2]));
+}
+
+/**
+ * @brief Restore process context
+ *
+ * @param context The context, can be from `sceKernelGetPidContext`
+ */
+static inline void sceKernelCpuRestoreContext(int context[3]) {
+ int cpsr;
+ int tmp;
+
+ asm volatile ("mrs %0, cpsr" : "=r" (cpsr));
+ if (!(cpsr & 0x80)) {
+ asm volatile ("cpsid i" ::: "memory");
+ }
+ asm volatile ("mrc p15, 0, %0, c13, c0, 1" : "=r" (tmp));
+ tmp = (tmp & 0xFFFFFF00) | context[2];
+ asm volatile ("mcr p15, 0, %0, c13, c0, 1" :: "r" (0));
+ asm volatile ("isb" ::: "memory");
+ asm volatile ("mcr p15, 0, %0, c2, c0, 1" :: "r" (context[0] | 0x4A));
+ asm volatile ("isb" ::: "memory");
+ asm volatile ("mcr p15, 0, %0, c13, c0, 1" :: "r" (tmp));
+ asm volatile ("mcr p15, 0, %0, c3, c0, 0" :: "r" (context[1] & 0x55555555));
+ if (!(cpsr & 0x80)) {
+ asm volatile ("cpsie i" ::: "memory");
+ }
+}
+
+/**
+ * @brief Disabled interrupts
+ *
+ * @return Interrupt masks before disabling
+ */
+int sceKernelCpuDisableInterrupts(void);
+
+/**
+ * @brief Enable interrupts
+ *
+ * @param[in] flags Interrupt masks
+ *
+ * @return Zero on success
+ */
+int sceKernelCpuEnableInterrupts(int flags);
+
+/**
+ * @brief Flush L1 dcache and L2
+ *
+ * Note: symbols currently does not work on 3.x, need to find new ones.
+ *
+ * @param ptr The pointer
+ * @param[in] len The length
+ *
+ * @return Zero on success
+ */
+int sceKernelCpuDcacheAndL2Flush(void *ptr, size_t len);
+
+/**
+ * @brief Flush L2 dcache without L2
+ *
+ * @param ptr The pointer
+ * @param[in] len The length
+ *
+ * @return Zero on success
+ */
+int sceKernelCpuDcacheFlush(void *ptr, size_t len);
+
+/**
+ * @brief Flush L1 icache and L2
+ *
+ * @param ptr The pointer
+ * @param[in] len The length
+ *
+ * @return Zero on success
+ */
+int sceKernelCpuIcacheAndL2Flush(void *ptr, size_t len);
+
+/**
+ * @brief Flush L1 dcache and L2 for DMA operations
+ *
+ * @param ptr The pointer
+ * @param[in] len The length
+ *
+ * @return Zero on success
+ */
+int sceKernelCpuDcacheAndL2AndDMAFlush(void *ptr, size_t len);
+
+/**
+ * @brief MMU permission bypassing memcpy
+ *
+ * This works by writing to the DACR before and after the memcpy.
+ *
+ * @param dst The destination
+ * @param[in] src The source
+ * @param[in] len The length
+ *
+ * @return Zero on success.
+ */
+int sceKernelCpuUnrestrictedMemcpy(void *dst, const void *src, size_t len);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* _PSP2_KERNEL_CPU_H_ */
diff --git a/include/kernel/kernel/modulemgr.h b/include/kernel/kernel/modulemgr.h
new file mode 100644
index 0000000..67f5ab5
--- /dev/null
+++ b/include/kernel/kernel/modulemgr.h
@@ -0,0 +1,96 @@
+#ifndef _PSP2_KERNEL_MODULEMGR_H_
+#define _PSP2_KERNEL_MODULEMGR_H_
+
+#include <psp2/types.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/**
+ * @brief Return values for plugins `module_start` and `module_stop`
+ */
+/** @{ */
+#define SCE_KERNEL_START_SUCCESS (0)
+#define SCE_KERNEL_START_RESIDENT SCE_KERNEL_START_SUCCESS
+#define SCE_KERNEL_START_NO_RESIDENT (1)
+#define SCE_KERNEL_START_FAILED (2)
+
+#define SCE_KERNEL_STOP_SUCCESS (0)
+#define SCE_KERNEL_STOP_FAIL (1)
+#define SCE_KERNEL_STOP_CANCEL SCE_KERNEL_STOP_FAIL
+/** @} */
+
+typedef struct
+{
+ SceUInt size; //< this structure size (0x18)
+ SceUInt perms; //< probably rwx in low bits
+ void *vaddr; //< address in memory
+ SceUInt memsz; //< size in memory
+ SceUInt flags; //< meanig unknown
+ SceUInt res; //< unused?
+} SceKernelSegmentInfo;
+
+typedef struct
+{
+ SceUInt size; //< 0x1B8 for Vita 1.x
+ SceUInt handle; //< kernel module handle?
+ SceUInt flags; //< some bits. could be priority or whatnot
+ char module_name[28];
+ SceUInt unk28;
+ void *module_start;
+ SceUInt unk30;
+ void *module_stop;
+ void *exidxTop;
+ void *exidxBtm;
+ SceUInt unk40;
+ SceUInt unk44;
+ void *tlsInit;
+ SceSize tlsInitSize;
+ SceSize tlsAreaSize;
+ char path[256];
+ SceKernelSegmentInfo segments[4];
+ SceUInt type; //< 6 = user-mode PRX?
+} SceKernelModuleInfo;
+
+typedef struct {
+ SceSize size;
+} SceKernelLMOption;
+
+typedef struct {
+ SceSize size;
+} SceKernelULMOption;
+
+typedef struct
+{
+ SceSize size;
+ char versionString[16];
+ SceUInt unk_14;
+ SceUInt unk_18;
+ SceUInt unk_1C;
+ SceUInt version;
+ SceUInt unk_24;
+} SceKernelFwInfo;
+
+int sceKernelGetModuleList(SceUID pid, int flags1, int flags2, SceUID *modids, size_t *num);
+int sceKernelGetModuleInfo(SceUID pid, SceUID modid, SceKernelModuleInfo *info);
+int sceKernelGetModuleInternal(SceUID modid, void **module);
+
+int sceKernelGetSystemSwVersion(SceKernelFwInfo *data);
+
+SceUID sceKernelLoadModule(const char *path, int flags, SceKernelLMOption *option);
+int sceKernelStartModule(SceUID modid, SceSize args, void *argp, int flags, SceKernelLMOption *option, int *status);
+
+SceUID sceKernelLoadStartSharedModuleForPid(SceUID pid, const char *path, SceSize args, void *argp, int flags, SceKernelLMOption *option, int *status);
+SceUID sceKernelLoadStartModuleForPid(SceUID pid, const char *path, SceSize args, void *argp, int flags, SceKernelLMOption *option, int *status);
+SceUID sceKernelLoadModuleForPid(SceUID pid, const char *path, int flags, SceKernelLMOption *option);
+
+int sceKernelUnloadModule(SceUID modid, int flags);
+
+int sceKernelStopUnloadModule(SceUID modid, SceSize args, void *argp, int flags, SceKernelULMOption *option, int *status);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* _PSP2_KERNEL_MODULEMGR_H_ */
diff --git a/include/kernel/kernel/processmgr.h b/include/kernel/kernel/processmgr.h
new file mode 100644
index 0000000..963d42c
--- /dev/null
+++ b/include/kernel/kernel/processmgr.h
@@ -0,0 +1,16 @@
+#ifndef _PSP2_KERNEL_PROCESSMGR_H_
+#define _PSP2_KERNEL_PROCESSMGR_H_
+
+#include <psp2/types.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void *sceKernelGetProcessKernelBuf(SceUID pid);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* _PSP2_KERNEL_PROCESSMGR_H_ */
diff --git a/include/kernel/kernel/sysmem.h b/include/kernel/kernel/sysmem.h
new file mode 100644
index 0000000..09acf27
--- /dev/null
+++ b/include/kernel/kernel/sysmem.h
@@ -0,0 +1,133 @@
+#ifndef _PSP2_KERNEL_SYSMEM_H_
+#define _PSP2_KERNEL_SYSMEM_H_
+
+#include <psp2kern/types.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+typedef int SceKernelMemBlockType;
+
+enum {
+ SCE_KERNEL_MEMBLOCK_TYPE_USER_RW = 0x0c20d060,
+ SCE_KERNEL_MEMBLOCK_TYPE_USER_RW_UNCACHE = 0x0c208060,
+ SCE_KERNEL_MEMBLOCK_TYPE_USER_MAIN_PHYCONT_RW = 0x0c80d060,
+ SCE_KERNEL_MEMBLOCK_TYPE_USER_MAIN_PHYCONT_NC_RW = 0x0d808060,
+ SCE_KERNEL_MEMBLOCK_TYPE_USER_CDRAM_RW = 0x09408060,
+ SCE_KERNEL_MEMBLOCK_TYPE_KERNEL_RX = 0x1020D005,
+ SCE_KERNEL_MEMBLOCK_TYPE_SHARED_RX = 0x390D050,
+ SCE_KERNEL_MEMBLOCK_TYPE_USER_RX = 0xC20D050,
+ SCE_KERNEL_MEMBLOCK_TYPE_RW_UNK0 = 0x6020D006
+};
+
+// specific to 3.60
+typedef struct SceKernelAllocMemBlockKernelOpt {
+ SceSize size;
+ SceUInt32 field_4;
+ SceUInt32 attr;
+ SceUInt32 field_C;
+ SceUInt32 paddr;
+ SceSize alignment;
+ SceUInt32 field_18;
+ SceUInt32 field_1C;
+ SceUInt32 mirror_blkid;
+ SceUID pid;
+ SceUInt32 field_28;
+ SceUInt32 field_2C;
+ SceUInt32 field_30;
+ SceUInt32 field_34;
+ SceUInt32 field_38;
+ SceUInt32 field_3C;
+ SceUInt32 field_40;
+ SceUInt32 field_44;
+ SceUInt32 field_48;
+ SceUInt32 field_4C;
+ SceUInt32 field_50;
+ SceUInt32 field_54;
+} SceKernelAllocMemBlockKernelOpt;
+
+enum {
+ SCE_KERNEL_MODEL_VITA = 0x10000,
+ SCE_KERNEL_MODEL_VITATV = 0x20000
+};
+
+#define SCE_KERNEL_ALLOC_MEMBLOCK_ATTR_HAS_ALIGNMENT 0x00000004U
+
+/***
+ * Allocates a new memoy block
+ *
+ * @param[in] name - Name for the memory block
+ * @param[in] type - Type of the memory to allocate
+ * @param[in] size - Size of the memory to allocate
+ * @param[in] optp - Memory block options?
+ *
+ * @return SceUID of the memory block on success, < 0 on error.
+*/
+SceUID sceKernelAllocMemBlock(const char *name, SceKernelMemBlockType type, int size, SceKernelAllocMemBlockKernelOpt *optp);
+
+/***
+ * Frees new memoy block
+ *
+ * @param[in] uid - SceUID of the memory block to free
+ *
+ * @return 0 on success, < 0 on error.
+*/
+int sceKernelFreeMemBlock(SceUID uid);
+
+/***
+ * Gets the base address of a memoy block
+ *
+ * @param[in] uid - SceUID of the memory block to free
+ * @param[out] basep - Base address of the memory block identified by SceUID
+ *
+ * @return 0 on success, < 0 on error.
+*/
+int sceKernelGetMemBlockBase(SceUID uid, void **basep);
+
+SceUID sceKernelMemPoolCreate(const char *name, SceSize size, void *opt);
+int sceKernelMemPoolDestroy(SceUID pool);
+void *sceKernelMemPoolAlloc(SceUID pool, SceSize size);
+void sceKernelMemPoolFree(SceUID pool, void *ptr);
+
+int sceKernelMemcpyUserToKernelForPid(SceUID pid, void *dst, uintptr_t src, size_t len);
+int sceKernelMemcpyUserToKernel(void *dst, uintptr_t src, size_t len);
+int sceKernelMemcpyKernelToUser(uintptr_t dst, const void *src, size_t len);
+int sceKernelRxMemcpyKernelToUserForPid(SceUID pid, uintptr_t dst, const void *src, size_t len);
+
+int sceKernelStrncpyUserToKernel(void *dst, uintptr_t src, size_t len);
+int sceKernelStrncpyKernelToUser(uintptr_t dst, const void *src, size_t len);
+int sceKernelStrncpyUserForPid(SceUID pid, void *dst, uintptr_t src, size_t len);
+
+typedef struct {
+ char data[0x2C];
+} SceClass;
+
+typedef struct {
+ uint32_t sce_reserved[2];
+} SceObjectBase;
+
+SceUID sceKernelKernelUidForUserUid(SceUID pid, SceUID user_uid);
+SceUID sceKernelCreateUserUid(SceUID pid, SceUID kern_uid);
+SceUID sceKernelCreateUidObj(SceClass *cls, const char *name, void *opt, SceObjectBase **obj);
+int sceKernelGetObjForUid(SceUID uid, SceClass *cls, SceObjectBase **obj);
+SceClass *sceKernelGetUidClass(void);
+typedef int (*SceClassCallback)(void *item);
+int sceKernelCreateClass(SceClass *cls, const char *name, void *uidclass, size_t itemsize, SceClassCallback create, SceClassCallback destroy);
+int sceKernelDeleteUserUid(SceUID pid, SceUID user_uid);
+int sceKernelDeleteUid(SceUID uid);
+
+int sceKernelSwitchVmaForPid(SceUID pid);
+
+void *sceKernelGetSysrootBuffer(void);
+int sceKernelGetPidContext(SceUID pid, int **ctx);
+
+int sceKernelGetProcessTitleId(SceUID pid, char *titleid, size_t len);
+
+int sceKernelMapBlockUserVisible(SceUID uid);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/include/kernel/kernel/threadmgr.h b/include/kernel/kernel/threadmgr.h
new file mode 100644
index 0000000..9fe1faf
--- /dev/null
+++ b/include/kernel/kernel/threadmgr.h
@@ -0,0 +1,1068 @@
+#ifndef _PSP2_KERNEL_THREADMGR_H_
+#define _PSP2_KERNEL_THREADMGR_H_
+
+#include <psp2kern/types.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#define SCE_KERNEL_MUTEX_ATTR_RECURSIVE 2
+
+/** 64-bit system clock type. */
+typedef SceUInt64 SceKernelSysClock;
+
+/* Threads. */
+
+typedef int (*SceKernelThreadEntry)(SceSize args, void *argp);
+
+/** Additional options used when creating threads. */
+typedef struct SceKernelThreadOptParam {
+ /** Size of the ::SceKernelThreadOptParam structure. */
+ SceSize size;
+ /** Attributes */
+ SceUInt32 attr;
+} SceKernelThreadOptParam;
+
+/** Structure to hold the status information for a thread
+ * @see sceKernelGetThreadInfo
+ */
+typedef struct SceKernelThreadInfo {
+ /** Size of the structure */
+ SceSize size;
+ /** The UID of the process where the thread belongs */
+ SceUID processId; //Needs confirmation
+ /** Nul terminated name of the thread */
+ char name[32];
+ /** Thread attributes */
+ SceUInt attr;
+ /** Thread status */
+ int status;
+ /** Thread entry point */
+ SceKernelThreadEntry entry;
+ /** Thread stack pointer */
+ void *stack;
+ /** Thread stack size */
+ int stackSize;
+ /** Initial priority */
+ int initPriority;
+ /** Current priority */
+ int currentPriority;
+ /** Initial CPU affinity mask */
+ int initCpuAffinityMask;
+ /** Current CPU affinity mask */
+ int currentCpuAffinityMask;
+ /** Current CPU ID */
+ int currentCpuId;
+ /** Last executed CPU ID */
+ int lastExecutedCpuId;
+ /** Wait type */
+ int waitType;
+ /** Wait id */
+ SceUID waitId;
+ /** Exit status of the thread */
+ int exitStatus;
+ /** Number of clock cycles run */
+ SceKernelSysClock runClocks;
+ /** Interrupt preemption count */
+ SceUInt intrPreemptCount;
+ /** Thread preemption count */
+ SceUInt threadPreemptCount;
+ /** Thread release count */
+ SceUInt threadReleaseCount;
+ /** Function notify callback UID */
+ SceUID fNotifyCallback;
+ /** Reserved */
+ int reserved;
+} SceKernelThreadInfo;
+
+/** Statistics about a running thread.
+ * @see sceKernelGetThreadRunStatus.
+ */
+typedef struct SceKernelThreadRunStatus {
+ SceSize size;
+ struct {
+ SceUID processId;
+ SceUID threadId;
+ int priority;
+ } cpuInfo[4];
+} SceKernelThreadRunStatus;
+
+/* Sure there must be more than this, but haven't seen them */
+typedef enum SceThreadStatus
+{
+ SCE_THREAD_RUNNING = 1,
+ SCE_THREAD_READY = 2,
+ SCE_THREAD_WAITING = 4,
+ SCE_THREAD_SUSPEND = 8,
+ SCE_THREAD_STOPPED = 16,
+ SCE_THREAD_KILLED = 32, /* Thread manager has killed the thread (stack overflow) */
+} SceThreadStatus;
+
+/**
+ * Create a thread
+ *
+ * @par Example:
+ * @code
+ * SceUID thid;
+ * thid = sceKernelCreateThread("my_thread", threadFunc, 0x10000100, 0x10000, 0, 0, NULL);
+ * @endcode
+ *
+ * @param name - An arbitrary thread name.
+ * @param entry - The thread function to run when started.
+ * @param initPriority - The initial priority of the thread. Less if higher priority.
+ * @param stackSize - The size of the initial stack.
+ * @param attr - The thread attributes, zero or more of ::SceThreadAttributes.
+ * @param cpuAffinityMask - The CPU affinity mask
+ * @param option - Additional options specified by ::SceKernelThreadOptParam.
+
+ * @return UID of the created thread, or an error code.
+ */
+SceUID sceKernelCreateThread(const char *name, SceKernelThreadEntry entry, int initPriority,
+ int stackSize, SceUInt attr, int cpuAffinityMask,
+ const SceKernelThreadOptParam *option);
+
+/**
+ * Delate a thread
+ *
+ * @param thid - UID of the thread to be deleted.
+ *
+ * @return < 0 on error.
+ */
+int sceKernelDeleteThread(SceUID thid);
+
+/**
+ * Start a created thread
+ *
+ * @param thid - Thread id from sceKernelCreateThread
+ * @param arglen - Length of the data pointed to by argp, in bytes
+ * @param argp - Pointer to the arguments.
+ */
+int sceKernelStartThread(SceUID thid, SceSize arglen, void *argp);
+
+/**
+ * Exit a thread
+ *
+ * @param status - Exit status.
+ */
+int sceKernelExitThread(int status);
+
+/**
+ * Exit a thread and delete itself.
+ *
+ * @param status - Exit status
+ */
+int sceKernelExitDeleteThread(int status);
+
+/**
+ * Wait until a thread has ended.
+ *
+ * @param thid - Id of the thread to wait for.
+ * @param stat - Exit status.
+ * @param timeout - Timeout in microseconds (assumed).
+ *
+ * @return < 0 on error.
+ */
+int sceKernelWaitThreadEnd(SceUID thid, int *stat, SceUInt *timeout);
+
+/**
+ * Wait until a thread has ended and handle callbacks if necessary.
+ *
+ * @param thid - Id of the thread to wait for.
+ * @param stat - Exit status.
+ * @param timeout - Timeout in microseconds (assumed).
+ *
+ * @return < 0 on error.
+ */
+int sceKernelWaitThreadEndCB(SceUID thid, int *stat, SceUInt *timeout);
+
+/**
+ * Delay the current thread by a specified number of microseconds
+ *
+ * @param delay - Delay in microseconds.
+ *
+ * @par Example:
+ * @code
+ * sceKernelDelayThread(1000000); // Delay for a second
+ * @endcode
+ */
+int sceKernelDelayThread(SceUInt delay);
+
+/**
+ * Delay the current thread by a specified number of microseconds and handle any callbacks.
+ *
+ * @param delay - Delay in microseconds.
+ *
+ * @par Example:
+ * @code
+ * sceKernelDelayThread(1000000); // Delay for a second
+ * @endcode
+ */
+int sceKernelDelayThreadCB(SceUInt delay);
+
+/**
+ * Modify the attributes of the current thread.
+ *
+ * @param unknown - Set to 0.
+ * @param attr - The thread attributes to modify. One of ::SceThreadAttributes.
+ *
+ * @return < 0 on error.
+ */
+int sceKernelChangeCurrentThreadAttr(int unknown, SceUInt attr);
+
+/**
+ * Change the threads current priority.
+ *
+ * @param thid - The ID of the thread (from sceKernelCreateThread or sceKernelGetThreadId)
+ * @param priority - The new priority (the lower the number the higher the priority)
+ *
+ * @par Example:
+ * @code
+ * int thid = sceKernelGetThreadId();
+ * // Change priority of current thread to 16
+ * sceKernelChangeThreadPriority(thid, 16);
+ * @endcode
+ *
+ * @return 0 if successful, otherwise the error code.
+ */
+int sceKernelChangeThreadPriority(SceUID thid, int priority);
+
+/**
+ * Release a thread in the wait state.
+ *
+ * @param thid - The UID of the thread.
+ *
+ * @return 0 on success, < 0 on error
+ */
+int sceKernelReleaseWaitThread(SceUID thid);
+
+/**
+ * Get the current thread Id
+ *
+ * @return The thread id of the calling thread.
+ */
+int sceKernelGetThreadId(void);
+
+/**
+ * Get the current priority of the thread you are in.
+ *
+ * @return The current thread priority
+ */
+int sceKernelGetThreadCurrentPriority(void);
+
+/**
+ * Get the exit status of a thread.
+ *
+ * @param thid - The UID of the thread to check.
+ *
+ * @return The exit status
+ */
+int sceKernelGetThreadExitStatus(SceUID thid);
+
+/**
+ * Check the thread stack?
+ *
+ * @return Unknown.
+ */
+int sceKernelCheckThreadStack(void);
+
+/**
+ * Get the free stack size for a thread.
+ *
+ * @param thid - The thread ID. Seem to take current thread
+ * if set to 0.
+ *
+ * @return The free size.
+ */
+int sceKernelGetThreadStackFreeSize(SceUID thid);
+
+/**
+ * Get the status information for the specified thread.
+ *
+ * @param thid - Id of the thread to get status
+ * @param info - Pointer to the info structure to receive the data.
+ * Note: The structures size field should be set to
+ * sizeof(SceKernelThreadInfo) before calling this function.
+ *
+ * @par Example:
+ * @code
+ * SceKernelThreadInfo status;
+ * status.size = sizeof(SceKernelThreadInfo);
+ * if(sceKernelGetThreadInfo(thid, &status) == 0)
+ * { Do something... }
+ * @endcode
+ * @return 0 if successful, otherwise the error code.
+ */
+int sceKernelGetThreadInfo(SceUID thid, SceKernelThreadInfo *info);
+
+/**
+ * Retrive the runtime status of a thread.
+ *
+ * @param thid - UID of the thread to retrive status.
+ * @param status - Pointer to a ::SceKernelThreadRunStatus struct to receive the runtime status.
+ *
+ * @return 0 if successful, otherwise the error code.
+ */
+int sceKernelGetThreadRunStatus(SceUID thid, SceKernelThreadRunStatus *status);
+
+
+/* Semaphores. */
+
+/** Additional options used when creating semaphores. */
+typedef struct SceKernelSemaOptParam {
+ /** Size of the ::SceKernelSemaOptParam structure. */
+ SceSize size;
+} SceKernelSemaOptParam;
+
+/** Current state of a semaphore.
+ * @see sceKernelGetSemaInfo.
+ */
+typedef struct SceKernelSemaInfo {
+ /** Size of the ::SceKernelSemaInfo structure. */
+ SceSize size;
+ /** The UID of the semaphore */
+ SceUID semaId;
+ /** NUL-terminated name of the semaphore. */
+ char name[32];
+ /** Attributes. */
+ SceUInt attr;
+ /** The initial count the semaphore was created with. */
+ int initCount;
+ /** The current count. */
+ int currentCount;
+ /** The maximum count. */
+ int maxCount;
+ /** The number of threads waiting on the semaphore. */
+ int numWaitThreads;
+} SceKernelSemaInfo;
+
+/**
+ * Creates a new semaphore
+ *
+ * @par Example:
+ * @code
+ * int semaid;
+ * semaid = sceKernelCreateSema("MyMutex", 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 sceKernelCreateSema(const char *name, SceUInt attr, int initVal, int maxVal, SceKernelSemaOptParam *option);
+
+/**
+ * Destroy a semaphore
+ *
+ * @param semaid - The semaid returned from a previous create call.
+ * @return Returns the value 0 if its succesful otherwise -1
+ */
+int sceKernelDeleteSema(SceUID semaid);
+
+/**
+ * Send a signal to a semaphore
+ *
+ * @par Example:
+ * @code
+ * // Signal the sema
+ * sceKernelSignalSema(semaid, 1);
+ * @endcode
+ *
+ * @param semaid - The sema id returned from sceKernelCreateSema
+ * @param signal - The amount to signal the sema (i.e. if 2 then increment the sema by 2)
+ *
+ * @return < 0 On error.
+ */
+int sceKernelSignalSema(SceUID semaid, int signal);
+
+/**
+ * Lock a semaphore
+ *
+ * @par Example:
+ * @code
+ * sceKernelWaitSema(semaid, 1, 0);
+ * @endcode
+ *
+ * @param semaid - The sema id returned from sceKernelCreateSema
+ * @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 sceKernelWaitSema(SceUID semaid, int signal, SceUInt *timeout);
+
+/**
+ * Lock a semaphore and handle callbacks if necessary.
+ *
+ * @par Example:
+ * @code
+ * sceKernelWaitSemaCB(semaid, 1, 0);
+ * @endcode
+ *
+ * @param semaid - The sema id returned from sceKernelCreateSema
+ * @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 sceKernelWaitSemaCB(SceUID semaid, int signal, SceUInt *timeout);
+
+/**
+ * Poll a sempahore.
+ *
+ * @param semaid - UID of the semaphore to poll.
+ * @param signal - The value to test for.
+ *
+ * @return < 0 on error.
+ */
+int sceKernelPollSema(SceUID semaid, int signal);
+
+/**
+ * Cancels a semaphore
+ *
+ * @param semaid - The sema id returned from sceKernelCreateSema
+ * @param setCount - The new lock count of the semaphore
+ * @param numWaitThreads - Number of threads waiting for the semaphore
+ * @return < 0 On error.
+ */
+int sceKernelCancelSema(SceUID semaid, int setCount, int *numWaitThreads);
+
+/**
+ * Retrieve information about a semaphore.
+ *
+ * @param semaid - UID of the semaphore to retrieve info for.
+ * @param info - Pointer to a ::SceKernelSemaInfo struct to receive the info.
+ *
+ * @return < 0 on error.
+ */
+int sceKernelGetSemaInfo(SceUID semaid, SceKernelSemaInfo *info);
+
+
+/* Mutexes. */
+
+/** Additional options used when creating mutexes. */
+typedef struct SceKernelMutexOptParam {
+ /** Size of the ::SceKernelMutexOptParam structure. */
+ SceSize size;
+ int ceilingPriority;
+} SceKernelMutexOptParam;
+
+/** Current state of a mutex.
+ * @see sceKernelGetMutexInfo.
+ */
+typedef struct SceKernelMutexInfo {
+ /** Size of the ::SceKernelMutexInfo structure. */
+ SceSize size;
+ /** The UID of the mutex. */
+ SceUID mutexId;
+ /** NUL-terminated name of the mutex. */
+ char name[32];
+ /** Attributes. */
+ SceUInt attr;
+ /** The initial count the mutex was created with. */
+ int initCount;
+ /** The current count. */
+ int currentCount;
+ /** The UID of the current owner of the mutex. */
+ SceUID currentOwnerId;
+ /** The number of threads waiting on the mutex. */
+ int numWaitThreads;
+} SceKernelMutexInfo;
+
+/**
+ * Creates a new mutex
+ *
+ * @par Example:
+ * @code
+ * int mutexid;
+ * mutexid = sceKernelCreateMutex("MyMutex", 0, 1, 1, 0);
+ * @endcode
+ *
+ * @param name - Specifies the name of the mutex
+ * @param attr - Mutex attribute flags (normally set to 0)
+ * @param initCount - Mutex initial value
+ * @param option - Mutex options (normally set to 0)
+ * @return A mutex id
+ */
+SceUID sceKernelCreateMutex(const char *name, SceUInt attr, int initCount, SceKernelMutexOptParam *option);
+
+/**
+ * Destroy a mutex
+ *
+ * @param mutexid - The mutex id returned from sceKernelCreateMutex
+ * @return Returns the value 0 if its succesful otherwise -1
+ */
+int sceKernelDeleteMutex(SceUID mutexid);
+
+/**
+ * Open a mutex
+ *
+ * @param name - The name of the mutex to open
+ * @return Returns the value 0 if its succesful otherwise -1
+ */
+int sceKernelOpenMutex(const char *name);
+
+/**
+ * Close a mutex
+ *
+ * @param mutexid - The mutex id returned from sceKernelCreateMutex
+ * @return Returns the value 0 if its succesful otherwise -1
+ */
+int sceKernelCloseMutex(SceUID mutexid);
+
+/**
+ * Lock a mutex
+ *
+ * @param mutexid - The mutex id returned from sceKernelCreateMutex
+ * @param lockCount - The value to increment to the lock count of the mutex
+ * @param timeout - Timeout in microseconds (assumed)
+ * @return < 0 On error.
+ */
+int sceKernelLockMutex(SceUID mutexid, int lockCount, unsigned int *timeout);
+
+/**
+ * Lock a mutex and handle callbacks if necessary.
+ *
+ * @param mutexid - The mutex id returned from sceKernelCreateMutex
+ * @param lockCount - The value to increment to the lock count of the mutex
+ * @param timeout - Timeout in microseconds (assumed)
+ * @return < 0 On error.
+ */
+int sceKernelLockMutexCB(SceUID mutexid, int lockCount, unsigned int *timeout);
+
+/**
+ * Try to lock a mutex (non-blocking)
+ *
+ * @param mutexid - The mutex id returned from sceKernelCreateMutex
+ * @param lockCount - The value to increment to the lock count of the mutex
+ * @return < 0 On error.
+ */
+int sceKernelTryLockMutex(SceUID mutexid, int lockCount);
+
+/**
+ * Try to unlock a mutex (non-blocking)
+ *
+ * @param mutexid - The mutex id returned from sceKernelCreateMutex
+ * @param unlockCount - The value to decrement to the lock count of the mutex
+ * @return < 0 On error.
+ */
+int sceKernelUnlockMutex(SceUID mutexid, int unlockCount);
+
+/**
+ * Cancels a mutex
+ *
+ * @param mutexid - The mutex id returned from sceKernelCreateMutex
+ * @param newCount - The new lock count of the mutex
+ * @param numWaitThreads - Number of threads waiting for the mutex
+ * @return < 0 On error.
+ */
+int sceKernelCancelMutex(SceUID mutexid, int newCount, int *numWaitThreads);
+
+/**
+ * Retrieve information about a mutex.
+ *
+ * @param mutexid - UID of the mutex to retrieve info for.
+ * @param info - Pointer to a ::SceKernelMutexInfo struct to receive the info.
+ *
+ * @return < 0 on error.
+ */
+int sceKernelGetMutexInfo(SceUID mutexid, SceKernelMutexInfo info);
+
+
+/* Event flags. */
+
+/** Structure to hold the event flag information */
+typedef struct SceKernelEventFlagInfo {
+ SceSize size;
+ SceUID evfId; // Needs confirmation
+ char name[32];
+ SceUInt attr;
+ SceUInt initPattern;
+ SceUInt currentPattern;
+ int numWaitThreads;
+} SceKernelEventFlagInfo;
+
+typedef struct SceKernelEventFlagOptParam {
+ SceSize size;
+} SceKernelEventFlagOptParam;
+
+typedef struct SceKernelEventFlagOptParam SceKernelEventFlagOptParam;
+
+/** Event flag creation attributes */
+typedef enum SceEventFlagAttributes {
+ /** Allow the event flag to be waited upon by multiple threads */
+ SCE_EVENT_WAITMULTIPLE = 0x200
+} SceEventFlagAttributes;
+
+/** Event flag wait types */
+typedef enum SceEventFlagWaitTypes {
+ /** Wait for all bits in the pattern to be set */
+ SCE_EVENT_WAITAND = 0,
+ /** Wait for one or more bits in the pattern to be set */
+ SCE_EVENT_WAITOR = 1,
+ /** Clear all the bits when it matches */
+ SCE_EVENT_WAITCLEAR = 2,
+ /** Clear the wait pattern when it matches */
+ SCE_EVENT_WAITCLEAR_PAT = 4
+} SceEventFlagWaitTypes;
+
+/**
+ * Create an event flag.
+ *
+ * @param name - The name of the event flag.
+ * @param attr - Attributes from ::SceEventFlagAttributes
+ * @param bits - Initial bit pattern.
+ * @param opt - Options, set to NULL
+ * @return < 0 on error. >= 0 event flag id.
+ *
+ * @par Example:
+ * @code
+ * int evid;
+ * evid = sceKernelCreateEventFlag("wait_event", 0, 0, 0);
+ * @endcode
+ */
+SceUID sceKernelCreateEventFlag(const char *name, int attr, int bits, SceKernelEventFlagOptParam *opt);
+
+/**
+ * Set an event flag bit pattern.
+ *
+ * @param evid - The event id returned by sceKernelCreateEventFlag.
+ * @param bits - The bit pattern to set.
+ *
+ * @return < 0 On error
+ */
+int sceKernelSetEventFlag(SceUID evid, unsigned int bits);
+
+/**
+ * Clear a event flag bit pattern
+ *
+ * @param evid - The event id returned by ::sceKernelCreateEventFlag
+ * @param bits - The bits to clean
+ *
+ * @return < 0 on Error
+ */
+int sceKernelClearEventFlag(SceUID evid, unsigned int bits);
+
+/**
+ * Poll an event flag for a given bit pattern.
+ *
+ * @param evid - The event id returned by sceKernelCreateEventFlag.
+ * @param bits - The bit pattern to poll for.
+ * @param wait - Wait type, one or more of ::SceEventFlagWaitTypes or'ed together
+ * @param outBits - The bit pattern that was matched.
+ * @return < 0 On error
+ */
+int sceKernelPollEventFlag(int evid, unsigned int bits, unsigned int wait, unsigned int *outBits);
+
+/**
+ * Wait for an event flag for a given bit pattern.
+ *
+ * @param evid - The event id returned by sceKernelCreateEventFlag.
+ * @param bits - The bit pattern to poll for.
+ * @param wait - Wait type, one or more of ::SceEventFlagWaitTypes or'ed together
+ * @param outBits - The bit pattern that was matched.
+ * @param timeout - Timeout in microseconds
+ * @return < 0 On error
+ */
+int sceKernelWaitEventFlag(int evid, unsigned int bits, unsigned int wait, unsigned int *outBits, SceUInt *timeout);
+
+/**
+ * Wait for an event flag for a given bit pattern with callback.
+ *
+ * @param evid - The event id returned by sceKernelCreateEventFlag.
+ * @param bits - The bit pattern to poll for.
+ * @param wait - Wait type, one or more of ::SceEventFlagWaitTypes or'ed together
+ * @param outBits - The bit pattern that was matched.
+ * @param timeout - Timeout in microseconds
+ * @return < 0 On error
+ */
+int sceKernelWaitEventFlagCB(int evid, unsigned int bits, unsigned int wait, unsigned int *outBits, SceUInt *timeout);
+
+/**
+ * Delete an event flag
+ *
+ * @param evid - The event id returned by sceKernelCreateEventFlag.
+ *
+ * @return < 0 On error
+ */
+int sceKernelDeleteEventFlag(int evid);
+
+/**
+ * Get the status of an event flag.
+ *
+ * @param event - The UID of the event.
+ * @param status - A pointer to a ::SceKernelEventFlagInfo structure.
+ *
+ * @return < 0 on error.
+ */
+int sceKernelGetEventFlagInfo(SceUID event, SceKernelEventFlagInfo *info);
+
+
+/* Callbacks. */
+
+/** Callback function prototype */
+typedef int (*SceKernelCallbackFunction)(int notifyId, int notifyCount, int notifyArg, void *common);
+
+/** Structure to hold the status information for a callback */
+typedef struct SceKernelCallbackInfo {
+ /** Size of the structure (i.e. sizeof(SceKernelCallbackInfo)) */
+ SceSize size;
+ /** The UID of the callback. */
+ SceUID callbackId; // Needs confirmation
+ /** The name given to the callback */
+ char name[32];
+ /** The thread id associated with the callback */
+ SceUID threadId;
+ /** Pointer to the callback function */
+ SceKernelCallbackFunction callback;
+ /** User supplied argument for the callback */
+ void *common;
+ /** Unknown */
+ int notifyCount;
+ /** Unknown */
+ int notifyArg;
+} SceKernelCallbackInfo;
+
+/**
+ * Create callback
+ *
+ * @par Example:
+ * @code
+ * int cbid;
+ * cbid = sceKernelCreateCallback("Exit Callback", exit_cb, NULL);
+ * @endcode
+ *
+ * @param name - A textual name for the callback
+ * @param func - A pointer to a function that will be called as the callback
+ * @param arg - Argument for the callback ?
+ *
+ * @return >= 0 A callback id which can be used in subsequent functions, < 0 an error.
+ */
+int sceKernelCreateCallback(const char *name, unsigned int attr, SceKernelCallbackFunction func, void *arg);
+
+/**
+ * Gets the status of a specified callback.
+ *
+ * @param cb - The UID of the callback to retrieve info for.
+ * @param status - Pointer to a status structure. The size parameter should be
+ * initialised before calling.
+ *
+ * @return < 0 on error.
+ */
+int sceKernelGetCallbackInfo(SceUID cb, SceKernelCallbackInfo *infop);
+
+/**
+ * Delete a callback
+ *
+ * @param cb - The UID of the specified callback
+ *
+ * @return 0 on success, < 0 on error
+ */
+int sceKernelDeleteCallback(SceUID cb);
+
+/**
+ * Notify a callback
+ *
+ * @param cb - The UID of the specified callback
+ * @param arg2 - Passed as arg2 into the callback function
+ *
+ * @return 0 on success, < 0 on error
+ */
+int sceKernelNotifyCallback(SceUID cb, int arg2);
+
+/**
+ * Cancel a callback ?
+ *
+ * @param cb - The UID of the specified callback
+ *
+ * @return 0 on succes, < 0 on error
+ */
+int sceKernelCancelCallback(SceUID cb);
+
+/**
+ * Get the callback count
+ *
+ * @param cb - The UID of the specified callback
+ *
+ * @return The callback count, < 0 on error
+ */
+int sceKernelGetCallbackCount(SceUID cb);
+
+/**
+ * Check callback ?
+ *
+ * @return Something or another
+ */
+int sceKernelCheckCallback(void);
+
+
+/* Message pipes */
+
+/**
+ * Create a message pipe
+ *
+ * @param name - Name of the pipe
+ * @param type - The type of memory attribute to use internally (set to 0x40)
+ * @param attr - Set to 12
+ * @param bufSize - The size of the internal buffer in multiples of 0x1000 (4KB)
+ * @param opt - Message pipe options (set to NULL)
+ *
+ * @return The UID of the created pipe, < 0 on error
+ */
+SceUID sceKernelCreateMsgPipe(const char *name, int type, int attr, unsigned int bufSize, void *opt);
+
+/**
+ * Delete a message pipe
+ *
+ * @param uid - The UID of the pipe
+ *
+ * @return 0 on success, < 0 on error
+ */
+int sceKernelDeleteMsgPipe(SceUID uid);
+
+/**
+ * Send a message to a pipe
+ *
+ * @param uid - The UID of the pipe
+ * @param message - Pointer to the message
+ * @param size - Size of the message
+ * @param unk1 - Unknown - async vs sync? use 0 for sync
+ * @param unk2 - Unknown - use NULL
+ * @param timeout - Timeout for send in us. use NULL to wait indefinitely
+ *
+ * @return 0 on success, < 0 on error
+ */
+int sceKernelSendMsgPipe(SceUID uid, void *message, unsigned int size, int unk1, void *unk2, unsigned int *timeout);
+
+/**
+ * Send a message to a pipe (with callback)
+ *
+ * @param uid - The UID of the pipe
+ * @param message - Pointer to the message
+ * @param size - Size of the message
+ * @param unk1 - Unknown - async vs sync? use 0 for sync
+ * @param unk2 - Unknown - use NULL
+ * @param timeout - Timeout for send in us. use NULL to wait indefinitely
+ *
+ * @return 0 on success, < 0 on error
+ */
+int sceKernelSendMsgPipeCB(SceUID uid, void *message, unsigned int size, int unk1, void *unk2, unsigned int *timeout);
+
+/**
+ * Try to send a message to a pipe
+ *
+ * @param uid - The UID of the pipe
+ * @param message - Pointer to the message
+ * @param size - Size of the message
+ * @param unk1 - Unknown - use 0
+ * @param unk2 - Unknown - use NULL
+ *
+ * @return 0 on success, < 0 on error
+ */
+int sceKernelTrySendMsgPipe(SceUID uid, void *message, unsigned int size, int unk1, void *unk2);
+
+/**
+ * Receive a message from a pipe
+ *
+ * @param uid - The UID of the pipe
+ * @param message - Pointer to the message
+ * @param size - Size of the message
+ * @param unk1 - Unknown - async vs sync? use 0 for sync
+ * @param unk2 - Unknown - use NULL
+ * @param timeout - Timeout for receive in us. use NULL to wait indefinitely
+ *
+ * @return 0 on success, < 0 on error
+ */
+int sceKernelReceiveMsgPipe(SceUID uid, void *message, unsigned int size, int unk1, void *unk2, unsigned int *timeout);
+
+/**
+ * Receive a message from a pipe (with callback)
+ *
+ * @param uid - The UID of the pipe
+ * @param message - Pointer to the message
+ * @param size - Size of the message
+ * @param unk1 - Unknown - async vs sync? use 0 for sync
+ * @param unk2 - Unknown - use NULL
+ * @param timeout - Timeout for receive in us. use NULL to wait indefinitely
+ *
+ * @return 0 on success, < 0 on error
+ */
+int sceKernelReceiveMsgPipeCB(SceUID uid, void *message, unsigned int size, int unk1, void *unk2, unsigned int *timeout);
+
+/**
+ * Receive a message from a pipe
+ *
+ * @param uid - The UID of the pipe
+ * @param message - Pointer to the message
+ * @param size - Size of the message
+ * @param unk1 - Unknown - use 0
+ * @param unk2 - Unknown - use NULL
+ *
+ * @return 0 on success, < 0 on error
+ */
+int sceKernelTryReceiveMsgPipe(SceUID uid, void *message, unsigned int size, int unk1, void *unk2);
+
+/**
+ * Cancel a message pipe
+ *
+ * @param uid - UID of the pipe to cancel
+ * @param psend - Receive number of sending threads, NULL is valid
+ * @param precv - Receive number of receiving threads, NULL is valid
+ *
+ * @return 0 on success, < 0 on error
+ */
+int sceKernelCancelMsgPipe(SceUID uid, int *psend, int *precv);
+
+/** Message Pipe status info */
+typedef struct SceKernelMppInfo {
+ SceSize size;
+ SceUID mppId; // Needs confirmation
+ char name[32];
+ SceUInt attr;
+ int bufSize;
+ int freeSize;
+ int numSendWaitThreads;
+ int numReceiveWaitThreads;
+} SceKernelMppInfo;
+
+/**
+ * Get the status of a Message Pipe
+ *
+ * @param uid - The uid of the Message Pipe
+ * @param info - Pointer to a ::SceKernelMppInfo structure
+ *
+ * @return 0 on success, < 0 on error
+ */
+int sceKernelGetMsgPipeInfo(SceUID uid, SceKernelMppInfo *info);
+
+
+/* Misc. */
+
+typedef struct SceKernelSystemInfo {
+ SceSize size;
+ SceUInt32 activeCpuMask;
+
+ struct {
+ SceKernelSysClock idleClock;
+ SceUInt32 comesOutOfIdleCount;
+ SceUInt32 threadSwitchCount;
+ } cpuInfo[4];
+} SceKernelSystemInfo;
+
+/**
+ * Get the system information
+ *
+ * @param info - Pointer to a ::SceKernelSystemInfo structure
+ *
+ * @return 0 on success, < 0 on error
+ */
+int sceKernelGetSystemInfo(SceKernelSystemInfo *info);
+
+/* Misc. */
+
+/** Threadmgr types */
+typedef enum SceKernelIdListType {
+ SCE_KERNEL_TMID_Thread = 1,
+ SCE_KERNEL_TMID_Semaphore = 2,
+ SCE_KERNEL_TMID_EventFlag = 3,
+ SCE_KERNEL_TMID_Mbox = 4,
+ SCE_KERNEL_TMID_Vpl = 5,
+ SCE_KERNEL_TMID_Fpl = 6,
+ SCE_KERNEL_TMID_Mpipe = 7,
+ SCE_KERNEL_TMID_Callback = 8,
+ SCE_KERNEL_TMID_ThreadEventHandler = 9,
+ SCE_KERNEL_TMID_Alarm = 10,
+ SCE_KERNEL_TMID_VTimer = 11,
+ SCE_KERNEL_TMID_SleepThread = 64,
+ SCE_KERNEL_TMID_DelayThread = 65,
+ SCE_KERNEL_TMID_SuspendThread = 66,
+ SCE_KERNEL_TMID_DormantThread = 67,
+} SceKernelIdListType;
+
+/**
+ * Get the type of a threadman uid
+ *
+ * @param uid - The uid to get the type from
+ *
+ * @return The type, < 0 on error
+ */
+SceKernelIdListType sceKernelGetThreadmgrUIDClass(SceUID uid);
+
+
+
+typedef struct SceKernelLwMutexWork {
+ SceInt64 data[4];
+} SceKernelLwMutexWork;
+
+typedef struct SceKernelLwMutexOptParam {
+ SceSize size;
+} SceKernelLwMutexOptParam;
+
+int sceKernelCreateLwMutex(SceKernelLwMutexWork *pWork,const char *pName, unsigned int attr, int initCount, const SceKernelLwMutexOptParam *pOptParam);
+int sceKernelDeleteLwMutex(SceKernelLwMutexWork *pWork);
+int sceKernelLockLwMutex(SceKernelLwMutexWork *pWork, int lockCount, unsigned int *pTimeout);
+int sceKernelUnlockLwMutex(SceKernelLwMutexWork *pWork, int unlockCount);
+
+typedef struct SceKernelLwCondWork {
+ SceInt64 data[4];
+} SceKernelLwCondWork;
+
+typedef struct SceKernelLwCondOptParam {
+ SceSize size;
+} SceKernelLwCondOptParam;
+
+int sceKernelCreateLwCond(SceKernelLwCondWork *pWork, const char *pName, unsigned int attr, SceKernelLwMutexWork *pLwMutex, const SceKernelLwCondOptParam *pOptParam);
+int sceKernelDeleteLwCond(SceKernelLwCondWork *pWork);
+int sceKernelSignalLwCond(SceKernelLwCondWork *pWork);
+int sceKernelWaitLwCond(SceKernelLwCondWork *pWork, unsigned int *pTimeout);
+
+
+
+/**
+ * Get the system time (wide version)
+ *
+ * @return The system time
+ */
+SceInt64 sceKernelGetSystemTimeWide(void);
+
+/**
+ * @brief sceKernelGetThreadTLSAddr gets an address to a 4 bytes area of TLS memory for the specified thread
+ * @param thid - The UID of the thread to access TLS
+ * @param key - the TLS keyslot index
+ * @return pointer to TLS memory
+ */
+void *sceKernelGetThreadTLSAddr(SceUID thid, int key);
+
+/**
+ * @brief sceKernelGetTLSAddr get pointer to TLS key area for current thread
+ * @param key - the TLS keyslot index
+ * @return pointer to TLS key value
+ */
+void *sceKernelGetTLSAddr(int key);
+
+/**
+ * @brief Gets the current process PID
+ *
+ * @return Current PID
+ */
+SceUID sceKernelGetProcessId(void);
+
+/**
+ * @brief Runs a function with larger stack size
+ *
+ * @param[in] stack_size The stack size
+ * @param[in] to_call To call
+ * @param args The arguments
+ *
+ * @return Zero on success
+ */
+int sceKernelRunWithStack(int stack_size, int (*to_call)(void *), void *args);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* _PSP2_KERNEL_THREADMGR_H_ */
diff --git a/include/kernel/sblacmgr.h b/include/kernel/sblacmgr.h
new file mode 100644
index 0000000..3f4143d
--- /dev/null
+++ b/include/kernel/sblacmgr.h
@@ -0,0 +1,19 @@
+#ifndef _PSP2_KERNEL_SBLACMGR_H_
+#define _PSP2_KERNEL_SBLACMGR_H_
+
+#include <psp2kern/types.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+int sceSblACMgrIsShell(SceUID pid);
+int sceSblACMgrIsGameProgram(SceUID pid);
+int sceSblACMgrIsNonGameProgram(SceUID pid);
+int sceSblACMgrIsDevelopmentMode(void);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* _PSP2_KERNEL_SBLACMGR_H_ */
diff --git a/include/user/kernel/modulemgr.h b/include/user/kernel/modulemgr.h
index ab41eba..abdf387 100644
--- a/include/user/kernel/modulemgr.h
+++ b/include/user/kernel/modulemgr.h
@@ -7,6 +7,20 @@
extern "C" {
#endif
+/**
+ * @brief Return values for plugins `module_start` and `module_stop`
+ */
+/** @{ */
+#define SCE_KERNEL_START_SUCCESS (0)
+#define SCE_KERNEL_START_RESIDENT SCE_KERNEL_START_SUCCESS
+#define SCE_KERNEL_START_NO_RESIDENT (1)
+#define SCE_KERNEL_START_FAILED (2)
+
+#define SCE_KERNEL_STOP_SUCCESS (0)
+#define SCE_KERNEL_STOP_FAIL (1)
+#define SCE_KERNEL_STOP_CANCEL SCE_KERNEL_STOP_FAIL
+/** @} */
+
typedef struct
{
SceUInt size; //< this structure size (0x18)
@@ -56,6 +70,19 @@ int sceKernelUnloadModule(SceUID modid, int flags, SceKernelULMOption *option);
SceUID sceKernelLoadStartModule(char *path, SceSize args, void *argp, int flags, SceKernelLMOption *option, int *status);
int sceKernelStopUnloadModule(SceUID modid, SceSize args, void *argp, int flags, SceKernelULMOption *option, int *status);
+typedef struct
+{
+ SceSize size;
+ char versionString[16];
+ SceUInt unk_14;
+ SceUInt unk_18;
+ SceUInt unk_1C;
+ SceUInt version;
+ SceUInt unk_24;
+} SceKernelFwInfo;
+
+int sceKernelGetSystemSwVersion(SceKernelFwInfo *data);
+
#ifdef __cplusplus
}
#endif
diff --git a/nids/360/SceIofilemgr.yml b/nids/360/SceIofilemgr.yml
new file mode 100644
index 0000000..db4d4ef
--- /dev/null
+++ b/nids/360/SceIofilemgr.yml
@@ -0,0 +1,42 @@
+modules:
+ SceIofilemgr:
+ nid: 0x3E244C17
+ libraries:
+ SceIofilemgr:
+ nid: 0xF2FF276E
+ functions:
+ sceIoCancel: 0xCEF48835
+ sceIoClose: 0xC70B8886
+ sceIoCloseAsync: 0x8EA3616A
+ sceIoComplete: 0xD1C49D2F
+ sceIoDclose: 0x422A221A
+ sceIoFlockForSystem: 0x3E98E422
+ sceIoGetPriority: 0xF2A472A1
+ sceIoGetProcessDefaultPriority: 0x0DC4F1BB
+ sceIoGetThreadDefaultPriority: 0xA176CD03
+ sceIoLseek32: 0x49252B9B
+ sceIoRead: 0xFDB32293
+ sceIoReadAsync: 0x773EBD45
+ sceIoSetPriority: 0x14B2D56C
+ sceIoSetPriorityForSystem: 0x27373135
+ sceIoSetProcessDefaultPriority: 0x7F2ABBAF
+ sceIoSetThreadDefaultPriority: 0x49312108
+ sceIoSetThreadDefaultPriorityForSystem: 0xB9C9C9CF
+ sceIoSyncByFd: 0x16512F59
+ sceIoSyncByFdAsync: 0x7E1367CB
+ sceIoWrite: 0x34EFD876
+ sceIoWriteAsync: 0xE0D63D2A
+ SceIofilemgrForDriver:
+ nid: 0x40FD29C7
+ functions:
+ sceIoChstat: 0x7D42B8DC
+ sceIoClose: 0xF99DD8A3
+ sceIoDopen: 0x463B25CC
+ sceIoDread: 0x20CF5FC7
+ sceIoGetstat: 0x75C96D25
+ sceIoLseek: 0x62090481
+ sceIoMkdir: 0x7F710B25
+ sceIoOpen: 0x75192972
+ sceIoRead: 0xE17EFC03
+ sceIoRename: 0xDC0C4997
+ sceIoWrite: 0x21EE91F0
diff --git a/nids/360/SceKernelModulemgr.yml b/nids/360/SceKernelModulemgr.yml
new file mode 100644
index 0000000..d889f7b
--- /dev/null
+++ b/nids/360/SceKernelModulemgr.yml
@@ -0,0 +1,29 @@
+modules:
+ SceKernelModulemgr:
+ nid: 0x726C6635
+ libraries:
+ SceModulemgr:
+ nid: 0xEAED1616
+ functions:
+ sceKernelGetModuleIdByAddr: 0xF5798C7C
+ sceKernelGetModuleInfo: 0x36585DAF
+ sceKernelGetModuleList: 0x2EF2581F
+ sceKernelGetSystemSwVersion: 0x5182E212
+ SceModulemgrForDriver:
+ nid: 0xD4A60A52
+ functions:
+ sceKernelGetSystemSwVersion: 0x5182E212
+ sceKernelLoadModule: 0x86D8D634
+ sceKernelLoadStartModule: 0x189BFBBB
+ sceKernelLoadStartModuleForPid: 0x9D953C22
+ sceKernelLoadStartSharedModuleForPid: 0xE2ADEF8D
+ sceKernelStartModule: 0x0675B682
+ sceKernelStopUnloadModule: 0x100DAEB9
+ sceKernelUnloadModule: 0x728E72A6
+ SceModulemgrForKernel:
+ nid: 0xC445FA63
+ functions:
+ sceKernelGetModuleInfo: 0xD269F915
+ sceKernelGetModuleInternal: 0xFE303863
+ sceKernelGetModuleList: 0x97CF7B4E
+ sceKernelLoadModuleForPid: 0xFA21D8CB
diff --git a/nids/360/SceKernelThreadMgr.yml b/nids/360/SceKernelThreadMgr.yml
new file mode 100644
index 0000000..ec66d76
--- /dev/null
+++ b/nids/360/SceKernelThreadMgr.yml
@@ -0,0 +1,112 @@
+modules:
+ SceKernelThreadMgr:
+ nid: 0xA09CFA5C
+ libraries:
+ SceCpu:
+ nid: 0x45265161
+ SceDebugLed:
+ nid: 0xAE004C0A
+ functions:
+ sceKernelGetGPI: 0x14F582CF
+ sceKernelSetGPO: 0x78E702D3
+ SceDipsw:
+ nid: 0xB36D5922
+ functions:
+ sceKernelCheckDipsw: 0x1C783FB2
+ sceKernelClearDipsw: 0x800EDCC1
+ sceKernelSetDipsw: 0x817053D4
+ SceThreadmgr:
+ nid: 0x859A24B1
+ functions:
+ sceKernelCancelCallback: 0x30741EF2
+ sceKernelChangeActiveCpuMask: 0x001173F8
+ sceKernelChangeThreadCpuAffinityMask: 0x15129174
+ sceKernelChangeThreadPriority: 0xBD0139F2
+ sceKernelChangeThreadVfpException: 0xCC18FBAE
+ sceKernelCheckCallback: 0xE53E41F6
+ sceKernelCheckWaitableStatus: 0xD9BD74EB
+ sceKernelClearEvent: 0x7B2A4B28
+ sceKernelClearEventFlag: 0x4CB87CA7
+ sceKernelCloseCond: 0x15C690E0
+ sceKernelCloseEventFlag: 0x9A68F547
+ sceKernelCloseMsgPipe: 0x1305A065
+ sceKernelCloseMutex: 0x03E23AF6
+ sceKernelCloseRWLock: 0xFD5BD5C1
+ sceKernelCloseSema: 0xA2D81F9E
+ sceKernelCloseSimpleEvent: 0xFEF4CA53
+ sceKernelCloseTimer: 0xACE60E4A
+ sceKernelCreateCallback: 0xB19CF7E9
+ sceKernelCreateThreadForUser: 0xC0FAF6A3
+ sceKernelDelayThread: 0x4B675D05
+ sceKernelDelayThreadCB: 0x9C0180E1
+ sceKernelDeleteCallback: 0xD469676B
+ sceKernelDeleteCond: 0x879E6EBD
+ sceKernelDeleteEventFlag: 0x5840162C
+ sceKernelDeleteMsgPipe: 0xE78BCCF7
+ sceKernelDeleteMutex: 0xCB78710D
+ sceKernelDeleteRWLock: 0xE73649CA
+ sceKernelDeleteSema: 0xDB32948A
+ sceKernelDeleteSimpleEvent: 0x208CFE28
+ sceKernelDeleteThread: 0x1BBDE3D9
+ sceKernelDeleteTimer: 0xAB1E42C4
+ sceKernelExitDeleteThread: 0x1D17DECF
+ sceKernelGetCallbackCount: 0x038644D5
+ sceKernelGetMsgPipeCreatorId: 0x70E2A6D2
+ sceKernelGetProcessId: 0x9DCB4B7A
+ sceKernelGetSystemTimeWide: 0xF4EE4FA9
+ sceKernelGetThreadStackFreeSize: 0x4F8A3DA0
+ sceKernelGetThreadTLSAddr: 0xBACA6891
+ sceKernelGetThreadmgrUIDClass: 0xC9678F7F
+ sceKernelGetTimerBaseWide: 0x5DBC1960
+ sceKernelGetTimerTimeWide: 0x3EFD3165
+ sceKernelNotifyCallback: 0xA4683592
+ sceKernelOpenCond: 0x76BDA02F
+ sceKernelOpenEventFlag: 0xBC19F8A1
+ sceKernelOpenMsgPipe: 0x0E1CB9F6
+ sceKernelOpenMutex: 0x52E17182
+ sceKernelOpenRWLock: 0xCE510196
+ sceKernelOpenSema: 0xCBE235C7
+ sceKernelOpenSimpleEvent: 0x4E1E4DF8
+ sceKernelOpenTimer: 0xB6E286E7
+ sceKernelPollSema: 0x866EF048
+ sceKernelPulseEvent: 0x8D27BAD6
+ sceKernelRegisterCallbackToEvent: 0x76FB37E9
+ sceKernelSendSignal: 0xD4C367B2
+ sceKernelSetEvent: 0x324218CD
+ sceKernelSetEventFlag: 0xEC94DFF7
+ sceKernelSetTimerTimeWide: 0x273B4A4D
+ sceKernelSignalCond: 0x6ED2E2DC
+ sceKernelSignalCondAll: 0xC2E7AC22
+ sceKernelSignalCondTo: 0x1269F4EC
+ sceKernelSignalSema: 0xE6B761D1
+ sceKernelStartTimer: 0x48091E0C
+ sceKernelStopTimer: 0x869E9F20
+ sceKernelTryLockMutex: 0x72FC1F54
+ sceKernelTryLockReadRWLock: 0xEFDDA456
+ sceKernelTryLockWriteRWLock: 0x206CBB66
+ sceKernelUnlockMutex: 0x1A372EC8
+ sceKernelUnlockReadRWLock: 0x3EF91145
+ sceKernelUnlockWriteRWLock: 0xB4151397
+ sceKernelUnregisterCallbackFromEvent: 0x18462B11
+ sceKernelUnregisterCallbackFromEventAll: 0x888A7361
+ SceThreadmgrCoredumpTime:
+ nid: 0x5E8D0E22
+ functions:
+ sceKernelExitThread: 0x0C8A38E1
+ SceThreadmgrForDriver:
+ nid: 0xE2C40624
+ functions:
+ sceKernelCreateThread: 0xC6674E7D
+ sceKernelDeleteThread: 0xAC834F3F
+ sceKernelGetProcessId: 0x9DCB4B7A
+ sceKernelGetSystemTimeWide: 0xF4EE4FA9
+ sceKernelStartThread: 0x21F5419B
+ sceKernelWaitThreadEnd: 0x3E20216F
+ SceThreadmgrForKernel:
+ nid: 0xA8CA0EFD
+ functions:
+ sceKernelCreateMutex: 0xFBAA026E
+ sceKernelDeleteMutex: 0x0A912340
+ sceKernelLockMutex: 0x16AC80C5
+ sceKernelRunWithStack: 0xE54FD746
+ sceKernelUnlockMutex: 0x1E82E5D0
diff --git a/nids/360/SceKernel.yml b/nids/360/SceLibKernel.yml
index 5fa0bca..8cee1ee 100644
--- a/nids/360/SceKernel.yml
+++ b/nids/360/SceLibKernel.yml
@@ -1,44 +1,7 @@
modules:
- SceKernel:
+ SceLibKernel:
nid: 0x00000048
libraries:
- SceCpu:
- nid: 0x45265161
- SceDebugLed:
- nid: 0xAE004C0A
- functions:
- sceKernelGetGPI: 0x14F582CF
- sceKernelSetGPO: 0x78E702D3
- SceDipsw:
- nid: 0xB36D5922
- functions:
- sceKernelCheckDipsw: 0x1C783FB2
- sceKernelClearDipsw: 0x800EDCC1
- sceKernelSetDipsw: 0x817053D4
- SceIofilemgr:
- nid: 0xF2FF276E
- functions:
- sceIoCancel: 0xCEF48835
- sceIoClose: 0xC70B8886
- sceIoCloseAsync: 0x8EA3616A
- sceIoComplete: 0xD1C49D2F
- sceIoDclose: 0x422A221A
- sceIoFlockForSystem: 0x3E98E422
- sceIoGetPriority: 0xF2A472A1
- sceIoGetProcessDefaultPriority: 0x0DC4F1BB
- sceIoGetThreadDefaultPriority: 0xA176CD03
- sceIoLseek32: 0x49252B9B
- sceIoRead: 0xFDB32293
- sceIoReadAsync: 0x773EBD45
- sceIoSetPriority: 0x14B2D56C
- sceIoSetPriorityForSystem: 0x27373135
- sceIoSetProcessDefaultPriority: 0x7F2ABBAF
- sceIoSetThreadDefaultPriority: 0x49312108
- sceIoSetThreadDefaultPriorityForSystem: 0xB9C9C9CF
- sceIoSyncByFd: 0x16512F59
- sceIoSyncByFdAsync: 0x7E1367CB
- sceIoWrite: 0x34EFD876
- sceIoWriteAsync: 0xE0D63D2A
SceLibKernel:
nid: 0xCAE9ACE6
functions:
@@ -313,125 +276,3 @@ modules:
nid: 0xF9AC7CF8
functions:
sceKernelGetRandomNumber: 0xB2700165
- SceModulemgr:
- nid: 0xEAED1616
- functions:
- sceKernelGetModuleIdByAddr: 0xF5798C7C
- sceKernelGetModuleInfo: 0x36585DAF
- sceKernelGetModuleList: 0x2EF2581F
- sceKernelGetSystemSwVersion: 0x5182E212
- SceProcessmgr:
- nid: 0x2DD91812
- functions:
- sceKernelGetStderr: 0xFA5E3ADA
- sceKernelGetStdin: 0xC1727F59
- sceKernelGetStdout: 0xE5AA625C
- sceKernelIsCDialogAvailable: 0x143BC4D6
- sceKernelIsGameBudget: 0xCE0F02F0
- sceKernelLibcClock: 0x9E45DA09
- sceKernelLibcGettimeofday: 0x4B879059
- sceKernelLibcGmtime_r: 0xBCA437CD
- sceKernelLibcLocaltime_r: 0x94F041ED
- sceKernelLibcMktime: 0x890BDC39
- sceKernelLibcTime: 0x0039BE45
- sceKernelPowerLock: 0x7AA73378
- sceKernelPowerTick: 0x2252890C
- sceKernelPowerUnlock: 0x466C0CBD
- sceKernelRegisterProcessTerminationCallback: 0x5EC77870
- sceKernelUnregisterProcessTerminationCallback: 0x973A4527
- SceSysmem:
- nid: 0x37FE725A
- functions:
- sceKernelAllocMemBlock: 0xB9D5EBDE
- sceKernelAllocMemBlockForVM: 0xE2D7E137
- sceKernelCloseMemBlock: 0xB680E3A0
- sceKernelCloseVMDomain: 0xD6CA56CA
- sceKernelFindMemBlockByAddr: 0xA33B99D1
- sceKernelFreeMemBlock: 0xA91E15EE
- sceKernelGetFreeMemorySize: 0x87CC580B
- sceKernelGetMemBlockBase: 0xB8EF5818
- sceKernelGetMemBlockInfoByAddr: 0x4010AD65
- sceKernelGetMemBlockInfoByRange: 0x006F3DB4
- sceKernelGetModel: 0xD0D4F729
- sceKernelGetModelForCDialog: 0xA2CB322F
- sceKernelOpenMemBlock: 0x8EB8DFBB
- sceKernelOpenVMDomain: 0x9CA3EB2B
- sceKernelSyncVMDomain: 0x19D2A81A
- SceThreadmgr:
- nid: 0x859A24B1
- functions:
- sceKernelCancelCallback: 0x30741EF2
- sceKernelChangeActiveCpuMask: 0x001173F8
- sceKernelChangeThreadCpuAffinityMask: 0x15129174
- sceKernelChangeThreadPriority: 0xBD0139F2
- sceKernelChangeThreadVfpException: 0xCC18FBAE
- sceKernelCheckCallback: 0xE53E41F6
- sceKernelCheckWaitableStatus: 0xD9BD74EB
- sceKernelClearEvent: 0x7B2A4B28
- sceKernelClearEventFlag: 0x4CB87CA7
- sceKernelCloseCond: 0x15C690E0
- sceKernelCloseEventFlag: 0x9A68F547
- sceKernelCloseMsgPipe: 0x1305A065
- sceKernelCloseMutex: 0x03E23AF6
- sceKernelCloseRWLock: 0xFD5BD5C1
- sceKernelCloseSema: 0xA2D81F9E
- sceKernelCloseSimpleEvent: 0xFEF4CA53
- sceKernelCloseTimer: 0xACE60E4A
- sceKernelCreateCallback: 0xB19CF7E9
- sceKernelCreateThreadForUser: 0xC0FAF6A3
- sceKernelDelayThread: 0x4B675D05
- sceKernelDelayThreadCB: 0x9C0180E1
- sceKernelDeleteCallback: 0xD469676B
- sceKernelDeleteCond: 0x879E6EBD
- sceKernelDeleteEventFlag: 0x5840162C
- sceKernelDeleteMsgPipe: 0xE78BCCF7
- sceKernelDeleteMutex: 0xCB78710D
- sceKernelDeleteRWLock: 0xE73649CA
- sceKernelDeleteSema: 0xDB32948A
- sceKernelDeleteSimpleEvent: 0x208CFE28
- sceKernelDeleteThread: 0x1BBDE3D9
- sceKernelDeleteTimer: 0xAB1E42C4
- sceKernelExitDeleteThread: 0x1D17DECF
- sceKernelGetCallbackCount: 0x038644D5
- sceKernelGetMsgPipeCreatorId: 0x70E2A6D2
- sceKernelGetProcessId: 0x9DCB4B7A
- sceKernelGetSystemTimeWide: 0xF4EE4FA9
- sceKernelGetThreadStackFreeSize: 0x4F8A3DA0
- sceKernelGetThreadTLSAddr: 0xBACA6891
- sceKernelGetThreadmgrUIDClass: 0xC9678F7F
- sceKernelGetTimerBaseWide: 0x5DBC1960
- sceKernelGetTimerTimeWide: 0x3EFD3165
- sceKernelNotifyCallback: 0xA4683592
- sceKernelOpenCond: 0x76BDA02F
- sceKernelOpenEventFlag: 0xBC19F8A1
- sceKernelOpenMsgPipe: 0x0E1CB9F6
- sceKernelOpenMutex: 0x52E17182
- sceKernelOpenRWLock: 0xCE510196
- sceKernelOpenSema: 0xCBE235C7
- sceKernelOpenSimpleEvent: 0x4E1E4DF8
- sceKernelOpenTimer: 0xB6E286E7
- sceKernelPollSema: 0x866EF048
- sceKernelPulseEvent: 0x8D27BAD6
- sceKernelRegisterCallbackToEvent: 0x76FB37E9
- sceKernelSendSignal: 0xD4C367B2
- sceKernelSetEvent: 0x324218CD
- sceKernelSetEventFlag: 0xEC94DFF7
- sceKernelSetTimerTimeWide: 0x273B4A4D
- sceKernelSignalCond: 0x6ED2E2DC
- sceKernelSignalCondAll: 0xC2E7AC22
- sceKernelSignalCondTo: 0x1269F4EC
- sceKernelSignalSema: 0xE6B761D1
- sceKernelStartTimer: 0x48091E0C
- sceKernelStopTimer: 0x869E9F20
- sceKernelTryLockMutex: 0x72FC1F54
- sceKernelTryLockReadRWLock: 0xEFDDA456
- sceKernelTryLockWriteRWLock: 0x206CBB66
- sceKernelUnlockMutex: 0x1A372EC8
- sceKernelUnlockReadRWLock: 0x3EF91145
- sceKernelUnlockWriteRWLock: 0xB4151397
- sceKernelUnregisterCallbackFromEvent: 0x18462B11
- sceKernelUnregisterCallbackFromEventAll: 0x888A7361
- SceThreadmgrCoredumpTime:
- nid: 0x5E8D0E22
- functions:
- sceKernelExitThread: 0x0C8A38E1
diff --git a/nids/360/SceProcessmgr.yml b/nids/360/SceProcessmgr.yml
new file mode 100644
index 0000000..7235635
--- /dev/null
+++ b/nids/360/SceProcessmgr.yml
@@ -0,0 +1,27 @@
+modules:
+ SceProcessmgr:
+ nid: 0xF019E1DA
+ libraries:
+ SceProcessmgr:
+ nid: 0x2DD91812
+ functions:
+ sceKernelGetStderr: 0xFA5E3ADA
+ sceKernelGetStdin: 0xC1727F59
+ sceKernelGetStdout: 0xE5AA625C
+ sceKernelIsCDialogAvailable: 0x143BC4D6
+ sceKernelIsGameBudget: 0xCE0F02F0
+ sceKernelLibcClock: 0x9E45DA09
+ sceKernelLibcGettimeofday: 0x4B879059
+ sceKernelLibcGmtime_r: 0xBCA437CD
+ sceKernelLibcLocaltime_r: 0x94F041ED
+ sceKernelLibcMktime: 0x890BDC39
+ sceKernelLibcTime: 0x0039BE45
+ sceKernelPowerLock: 0x7AA73378
+ sceKernelPowerTick: 0x2252890C
+ sceKernelPowerUnlock: 0x466C0CBD
+ sceKernelRegisterProcessTerminationCallback: 0x5EC77870
+ sceKernelUnregisterProcessTerminationCallback: 0x973A4527
+ SceProcessmgrForKernel:
+ nid: 0x7A69DE86
+ functions:
+ sceKernelGetProcessKernelBuf: 0xB9E68092
diff --git a/nids/360/SceSblACMgr.yml b/nids/360/SceSblACMgr.yml
new file mode 100644
index 0000000..c744b03
--- /dev/null
+++ b/nids/360/SceSblACMgr.yml
@@ -0,0 +1,11 @@
+modules:
+ SceSblACMgr:
+ nid: 0xB6E5AEBE
+ libraries:
+ SceSblACMgrForDriver:
+ nid: 0x9AD8E213
+ functions:
+ sceSblACMgrIsDevelopmentMode: 0xE87D1777
+ sceSblACMgrIsGameProgram: 0x1298C647
+ sceSblACMgrIsNonGameProgram: 0x6C5AB07F
+ sceSblACMgrIsShell: 0x8612B243
diff --git a/nids/360/SceSblSsMgr.yml b/nids/360/SceSblSsMgr.yml
new file mode 100644
index 0000000..4ef2d51
--- /dev/null
+++ b/nids/360/SceSblSsMgr.yml
@@ -0,0 +1,8 @@
+modules:
+ SceSblSsMgr:
+ nid: 0xFDDD93FA
+ libraries:
+ SceSblSsMgrForDriver:
+ nid: 0x61E9428D
+ functions:
+ sceKernelGetRandomNumber: 0x4F9BFBE5
diff --git a/nids/360/SceStdio.yml b/nids/360/SceStdio.yml
new file mode 100644
index 0000000..d82ed9d
--- /dev/null
+++ b/nids/360/SceStdio.yml
@@ -0,0 +1,8 @@
+modules:
+ SceStdio:
+ nid: 0x771A73C0
+ libraries:
+ SceDebugForDriver:
+ nid: 0x88758561
+ functions:
+ printf: 0x391B74B7
diff --git a/nids/360/SceSysmem.yml b/nids/360/SceSysmem.yml
new file mode 100644
index 0000000..e69a4f0
--- /dev/null
+++ b/nids/360/SceSysmem.yml
@@ -0,0 +1,105 @@
+modules:
+ SceSysmem:
+ nid: 0xB93950C6
+ libraries:
+ SceCpuForDriver:
+ nid: 0x40ECDB0E
+ functions:
+ sceKernelCpuDcacheAndL2AndDMAFlush: 0x364E68A4
+ sceKernelCpuDcacheAndL2Flush: 0x9CB9F0CE
+ sceKernelCpuDisableInterrupts: 0x821FC0EE
+ sceKernelCpuEnableInterrupts: 0xF5BAD43B
+ SceCpuForKernel:
+ nid: 0x54BF2BAB
+ functions:
+ sceKernelCpuDcacheFlush: 0x6BA2E51C
+ sceKernelCpuIcacheAndL2Flush: 0x19F17BD0
+ sceKernelCpuRestoreContext: 0x0A4F0FB9
+ sceKernelCpuSaveContext: 0x211B89DA
+ sceKernelCpuUnrestrictedMemcpy: 0x8C683DEC
+ SceSysclibForDriver:
+ nid: 0x7EE45391
+ functions:
+ __aeabi_uidiv: 0xA9FF1205
+ __aeabi_uidivmod: 0xA46CB7DE
+ memcmp: 0xF939E83D
+ memcpy: 0x40C88316
+ memset: 0x0AB9BF5C
+ rshift: 0x1D89F6C0
+ sceKernelStackCheckFail: 0xB997493D
+ snprintf: 0xAE7A8981
+ strchr: 0x38463759
+ strcmp: 0x0B33BC43
+ strlen: 0xCFC6A9AC
+ strncat: 0xA1D1C32C
+ strncmp: 0x12CEE649
+ strnlen: 0xCD4BD884
+ strrchr: 0x7F0E0835
+ strstr: 0x1304A69D
+ strtol: 0xAB77C5AA
+ SceSysmem:
+ nid: 0x37FE725A
+ functions:
+ sceKernelAllocMemBlock: 0xB9D5EBDE
+ sceKernelAllocMemBlockForVM: 0xE2D7E137
+ sceKernelCloseMemBlock: 0xB680E3A0
+ sceKernelCloseVMDomain: 0xD6CA56CA
+ sceKernelFindMemBlockByAddr: 0xA33B99D1
+ sceKernelFreeMemBlock: 0xA91E15EE
+ sceKernelGetFreeMemorySize: 0x87CC580B
+ sceKernelGetMemBlockBase: 0xB8EF5818
+ sceKernelGetMemBlockInfoByAddr: 0x4010AD65
+ sceKernelGetMemBlockInfoByRange: 0x006F3DB4
+ sceKernelGetModel: 0xD0D4F729
+ sceKernelGetModelForCDialog: 0xA2CB322F
+ sceKernelOpenMemBlock: 0x8EB8DFBB
+ sceKernelOpenVMDomain: 0x9CA3EB2B
+ sceKernelSyncVMDomain: 0x19D2A81A
+ SceSysmemForDriver:
+ nid: 0x6F25E18A
+ functions:
+ sceKernelAllocMemBlock: 0xC94850C9
+ sceKernelCreateClass: 0x61317102
+ sceKernelCreateUserUid: 0xBF209859
+ sceKernelDeleteUid: 0x047D32F2
+ sceKernelDeleteUserUid: 0x84A4AF5E
+ sceKernelFindMemBlockByAddr: 0x8A1742F6
+ sceKernelFirstDifferentIntUserForPid: 0x8334454F
+ sceKernelFreeMemBlock: 0x009E1C61
+ sceKernelGetMemBlockBase: 0xA841EDDA
+ sceKernelGetObjForUid: 0x00ED6C14
+ sceKernelGetPaddr: 0x8D160E65
+ sceKernelGetPaddrList: 0xE68BEEBD
+ sceKernelGetPidContext: 0x2ECF7944
+ sceKernelGetUidClass: 0x85336A1C
+ sceKernelKernelUidForUserUid: 0x45D22597
+ sceKernelMapBlockUserVisible: 0x58D21746
+ sceKernelMapUserBlock: 0x7D4F8B5F
+ sceKernelMemPoolAlloc: 0x7B4CB60A
+ sceKernelMemPoolCreate: 0x9328E0E8
+ sceKernelMemPoolDestroy: 0xD6437637
+ sceKernelMemPoolFree: 0x3EBCE343
+ sceKernelMemcpyKernelToUser: 0x6D88EF8A
+ sceKernelMemcpyKernelToUserForPid: 0x6B825479
+ sceKernelMemcpyKernelToUserForPidUnchecked: 0xFED82F2D
+ sceKernelMemcpyUserToKernel: 0xBC996A7A
+ sceKernelMemcpyUserToKernelForPid: 0x605275F8
+ sceKernelMemcpyUserToUserForPid: 0x8E086C33
+ sceKernelRemapBlock: 0xDFE2C8CB
+ sceKernelRoMemcpyKernelToUserForPid: 0x571D2739
+ sceKernelStrlenUser: 0xB429D419
+ sceKernelStrncpyKernelToUser: 0x80BD6FEB
+ sceKernelStrncpyUserForPid: 0x75AAF178
+ sceKernelStrncpyUserToKernel: 0xDB3EC244
+ sceKernelStrnlenUserForPid: 0x9929EB07
+ sceKernelSwitchVmaForPid: 0x6F2ACDAE
+ SceSysmemForKernel:
+ nid: 0x63A519E5
+ functions:
+ sceKernelCreateUidObj: 0xDF0288D7
+ sceKernelRxMemcpyKernelToUserForPid: 0x30931572
+ SceSysrootForKernel:
+ nid: 0x3691DA45
+ functions:
+ sceKernelGetProcessTitleId: 0xEC3124A3
+ sceKernelGetSysrootBuffer: 0x3E455842