Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

A bit more info about _vshIoMount/vshIoUmount #837

Merged
merged 3 commits into from
Aug 16, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
55 changes: 42 additions & 13 deletions include/psp2/vshbridge.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,28 @@
extern "C" {
#endif

typedef enum SceVshMountId {
SCE_VSH_MOUNT_SD0 = 0x00100,
SCE_VSH_MOUNT_OS0 = 0x00200,
SCE_VSH_MOUNT_VS0 = 0x00300,
SCE_VSH_MOUNT_VD0 = 0x00400,
SCE_VSH_MOUNT_TM0 = 0x00500,
SCE_VSH_MOUNT_UR0 = 0x00600,
SCE_VSH_MOUNT_UD0 = 0x00700,
SCE_VSH_MOUNT_UX0 = 0x00800,
SCE_VSH_MOUNT_GRO0 = 0x00900,
SCE_VSH_MOUNT_GRW0 = 0x00A00,
SCE_VSH_MOUNT_SA0 = 0x00B00,
SCE_VSH_MOUNT_PD0 = 0x00C00,
SCE_VSH_MOUNT_IMC0 = 0x00D00,
SCE_VSH_MOUNT_XMC0 = 0x00E00,
SCE_VSH_MOUNT_UMA0 = 0x00F00,
SCE_VSH_MOUNT_LMA0 = 0x10000,
SCE_VSH_MOUNT_LMB0 = 0x20000,
SCE_VSH_MOUNT_MFA0 = 0x50000,
SCE_VSH_MOUNT_MFB0 = 0x60000,
} SceVshMountId;

/**
* Gets real system firmware information.
*
Expand Down Expand Up @@ -43,25 +65,32 @@ int _vshSblAimgrGetConsoleId(char CID[32]);
SceUID _vshKernelSearchModuleByName(const char *module_name, const void *buffer);

/**
* @param[in] id - mount id
* @param[in] path - mount path
* @param[in] permission - 1/RO 2/RW
* @param[in] buf - work buffer
* @brief Mount a partition.
*
* @param[in] id - Mount ID (one of ::SceVshMountId).
* @param[in] path - Mount path (optional, can be NULL).
* @param[in] permission - `1` for read-only, `2` for read-write.
* @param[in] buf - Work buffer. Allocate `0x100` and (important!) fill with `0`.
*
* @return 0 >= on success, < 0 on error.
* @return `>= 0` on success, `< 0` on error.
*/
int _vshIoMount(int id, const char *path, int permission, void *buf);

int _vshIoMount(SceVshMountId id, const char *path, int permission, void *buf);

/**
* @param[in] id - mount id
* @param[in] force - Set to 1 to force umount
* @param[in] unk2 - Unknown, set 0
* @param[in] unk3 - Unknown, set 0
* @brief Unmount a partition.
*
* @warning Unmounting system partitions can cause system instability, even if
* you remount them back. For example, FIOS overlays used by the Shell
* won't get recreated and would effectively render the Shell unusable
*
* @param[in] id - Mount ID (one of ::SceVshMountId).
* @param[in] force - `1` to force unmount, `0` otherwise.
* @param[in] unk2 - Unknown, set to `0`.
* @param[in] unk3 - Unknown, set to `0`.
*
* @return 0 >= on success, < 0 on error.
* @return `>= 0` on success, `< 0` on error.
*/
int vshIoUmount(int id, int force, int unk2, int unk3);
int vshIoUmount(SceVshMountId id, int force, int unk2, int unk3);

int vshIdStorageIsDirty(void);
int vshIdStorageIsFormatted(void);
Expand Down
Loading