summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavee2019-02-12 21:42:23 +0000
committerSunguk Lee2019-02-13 19:09:44 +0900
commit54f2da6db4773208d0ff7fc72ae7f0125643f265 (patch)
tree777bba7425cebded24487883880f628465a07a47
parentMerge pull request #388 from scribam/scegxm-enums (diff)
downloadvds-libraries-54f2da6db4773208d0ff7fc72ae7f0125643f265.tar.gz
Add for kernel MsgPipes
-rw-r--r--include/kernel/kernel/threadmgr.h101
-rw-r--r--nids/360/SceKernelThreadMgr.yml6
2 files changed, 107 insertions, 0 deletions
diff --git a/include/kernel/kernel/threadmgr.h b/include/kernel/kernel/threadmgr.h
index 5c9c677..61f96b3 100644
--- a/include/kernel/kernel/threadmgr.h
+++ b/include/kernel/kernel/threadmgr.h
@@ -932,6 +932,107 @@ int sceKernelGetThreadCpuRegisters(SceUID thid, ThreadCpuRegisters *registers);
*/
int sceKernelChangeThreadSuspendStatus(SceUID thid, int status);
+/* 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);
+
+typedef struct
+{
+ const void *message;
+ unsigned int size;
+} MsgPipeSendData;
+
+/**
+ * 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 sceKernelSendMsgPipeVector(SceUID uid, const MsgPipeSendData *v, unsigned int n, 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 sceKernelTrySendMsgPipeVector(SceUID uid, const MsgPipeSendData *v, unsigned int size, int unk1, void *unk2);
+
+typedef struct
+{
+ void *message;
+ unsigned int size;
+} MsgPipeRecvData;
+
+/**
+ * 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 sceKernelReceiveMsgPipeVector(SceUID uid, const MsgPipeRecvData *v, unsigned int n, 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 sceKernelTryReceiveMsgPipeVector(SceUID uid, const MsgPipeRecvData *v, 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);
+
#ifdef __cplusplus
}
#endif
diff --git a/nids/360/SceKernelThreadMgr.yml b/nids/360/SceKernelThreadMgr.yml
index 08b67ff..d04ed40 100644
--- a/nids/360/SceKernelThreadMgr.yml
+++ b/nids/360/SceKernelThreadMgr.yml
@@ -208,6 +208,7 @@ modules:
nid: 0xE2C40624
functions:
sceKernelCancelCallback: 0xC040EC1C
+ sceKernelCancelMsgPipe: 0x9D6A2311
sceKernelCancelMutex: 0x7204B846
sceKernelChangeCurrentThreadAttr: 0x751C9B7A
sceKernelChangeThreadCpuAffinityMask: 0x6D0733A8
@@ -220,6 +221,7 @@ modules:
sceKernelCreateCallback: 0x1C41614C
sceKernelCreateCond: 0xDB6CD34A
sceKernelCreateEventFlag: 0x4336BAA4
+ sceKernelCreateMsgPipe: 0xBF631145
sceKernelCreateMutex: 0xFBAA026E
sceKernelCreateSema: 0x30E93C31
sceKernelCreateSimpleEvent: 0x357A8177
@@ -230,6 +232,7 @@ modules:
sceKernelDeleteCond: 0xAEE0D27C
sceKernelDeleteEventFlag: 0x71ECB352
sceKernelDeleteFastMutex: 0x11FE84A1
+ sceKernelDeleteMsgPipe: 0xB3453F88
sceKernelDeleteMutex: 0x0A912340
sceKernelDeleteSema: 0x16A35E58
sceKernelDeleteThread: 0xAC834F3F
@@ -267,6 +270,7 @@ modules:
sceKernelRegisterCallbackToEvent: 0x832A7E0C
sceKernelRegisterTimer: 0xC58DF384
sceKernelRunWithStack: 0xE54FD746
+ sceKernelSendMsgPipeVector: 0x67DD3BAD
sceKernelSetEvent: 0x9EA3A45C
sceKernelSetEventFlag: 0xD4780C3E
sceKernelSetPermission: 0x02EEDF17
@@ -282,6 +286,8 @@ modules:
sceKernelTryLockMutex: 0x270993A6
sceKernelTryLockReadRWLock: 0xFC2B5A50
sceKernelTryLockWriteRWLock: 0xA96F2E5A
+ sceKernelTryReceiveMsgPipeVector: 0xCE09221A
+ sceKernelTrySendMsgPipeVector: 0x4CF1BE58
sceKernelUnlockFastMutex: 0xDB395782
sceKernelUnlockMutex: 0x1E82E5D0
sceKernelUnlockReadRWLock: 0xDE1B9EEE