summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorReiko Asakura2021-03-26 14:29:44 -0400
committerReiko Asakura2021-03-26 14:29:44 -0400
commit8412457fa8cc570d5d14c022088b82d32ede93cd (patch)
tree3ce7168aac64033da91ff54c51bf492456c4d7ab
parentChanges to SceIniFileProcessor (diff)
downloadvds-libraries-8412457fa8cc570d5d14c022088b82d32ede93cd.tar.gz
Add inline forwarder for sysmodule with arg
Official names for these functions have a underscore prefix, which is a convention for forwarded syscalls. Since the forwarders are not found in any system software module, they must be inline. Also note that the fourth argument has unused fields, characteristic of forwarded syscalls.
-rw-r--r--include/user/libsysmodule.h34
1 files changed, 28 insertions, 6 deletions
diff --git a/include/user/libsysmodule.h b/include/user/libsysmodule.h
index ad2fda0..0e746d8 100644
--- a/include/user/libsysmodule.h
+++ b/include/user/libsysmodule.h
@@ -102,18 +102,31 @@ int sceSysmoduleUnloadModuleInternal(SceUInt32 id);
*/
int sceSysmoduleIsLoadedInternal(SceUInt32 id);
+int _sceSysmoduleLoadModuleInternalWithArg(SceUInt32 id, SceSize args, const void *argp, void *extra);
+
/**
* Load an internal module with custom arguments.
*
* @param[in] id - Module ID to check.
* @param[in] args - Size of passed arguments.
* @param[in] argp - Pointer to arguments to pass.
- * @param[in] unk - Unknown value.
+ * @param[in] flags - Set to 0.
+ * @param[out] pRes - Result of load.
*
* @return 0 on success, <0 otherwise.
*/
-#define sceSysmoduleLoadModuleInternalWithArg _sceSysmoduleLoadModuleInternalWithArg
-int _sceSysmoduleLoadModuleInternalWithArg(SceUInt32 id, SceSize args, void *argp, void *unk);
+static int sceSysmoduleLoadModuleInternalWithArg(
+ SceUInt32 id, SceSize args, const void *argp, SceUInt32 flags, int *pRes)
+{
+ struct {
+ SceUInt32 flags;
+ int *pRes;
+ int unused[2];
+ } extra = {flags, pRes, 0, 0};
+ return _sceSysmoduleLoadModuleInternalWithArg(id, args, argp, &extra);
+}
+
+int _sceSysmoduleUnloadModuleInternalWithArg(SceUInt32 id, SceSize args, const void *argp, void *extra);
/**
* Unload an internal module with custom arguments.
@@ -121,12 +134,21 @@ int _sceSysmoduleLoadModuleInternalWithArg(SceUInt32 id, SceSize args, void *arg
* @param[in] id - Module ID to check.
* @param[in] args - Size of passed arguments.
* @param[in] argp - Pointer to arguments to pass.
- * @param[in] unk - Unknown value.
+ * @param[in] flags - Set to 0.
+ * @param[out] pRes - Result of unload.
*
* @return 0 on success, <0 otherwise.
*/
-#define sceSysmoduleUnloadModuleInternalWithArg _sceSysmoduleUnloadModuleInternalWithArg
-int _sceSysmoduleUnloadModuleInternalWithArg(SceUInt32 id, SceSize args, void *argp, void *unk);
+static int sceSysmoduleUnloadModuleInternalWithArg(
+ SceUInt32 id, SceSize args, const void *argp, SceUInt32 flags, int *pRes)
+{
+ struct {
+ SceUInt32 flags;
+ int *pRes;
+ int unused[2];
+ } extra = {flags, pRes, 0, 0};
+ return _sceSysmoduleUnloadModuleInternalWithArg(id, args, argp, &extra);
+}
#ifdef __cplusplus
}