@@ -83,51 +83,28 @@ static int exists(const char *path) {
83
83
return 1 ;
84
84
}
85
85
86
- static int io_mount (int id , const char * path , int permission , int a4 , int a5 , int a6 ) {
87
- uint32_t buf [6 ];
88
-
89
- buf [0 ] = a4 ;
90
- buf [1 ] = a5 ;
91
- buf [2 ] = a6 ;
92
- buf [3 ] = 0 ;
93
- buf [4 ] = 0 ;
94
- buf [5 ] = 0 ;
95
-
96
- return ksceIoMount (id , path , permission , buf );
97
- }
98
-
99
86
static void io_remount (int id ) {
100
87
ksceIoUmount (id , 0 , 0 , 0 );
101
88
ksceIoUmount (id , 1 , 0 , 0 );
102
- io_mount (id , NULL , 0 , 0 , 0 , 0 );
89
+ ksceIoMount (id , NULL , 0 , 0 , 0 , 0 );
103
90
}
104
91
105
92
int shellKernelIsUx0Redirected () {
106
- uint32_t state ;
107
- ENTER_SYSCALL (state );
108
-
109
93
SceIoMountPoint * mount = sceIoFindMountPoint (MOUNT_POINT_ID );
110
94
if (!mount ) {
111
- EXIT_SYSCALL (state );
112
95
return -1 ;
113
96
}
114
97
115
98
if (mount -> dev == & uma_ux0_dev && mount -> dev2 == & uma_ux0_dev ) {
116
- EXIT_SYSCALL (state );
117
99
return 1 ;
118
100
}
119
101
120
- EXIT_SYSCALL (state );
121
102
return 0 ;
122
103
}
123
104
124
105
int shellKernelRedirectUx0 () {
125
- uint32_t state ;
126
- ENTER_SYSCALL (state );
127
-
128
106
SceIoMountPoint * mount = sceIoFindMountPoint (MOUNT_POINT_ID );
129
107
if (!mount ) {
130
- EXIT_SYSCALL (state );
131
108
return -1 ;
132
109
}
133
110
@@ -139,17 +116,12 @@ int shellKernelRedirectUx0() {
139
116
mount -> dev = & uma_ux0_dev ;
140
117
mount -> dev2 = & uma_ux0_dev ;
141
118
142
- EXIT_SYSCALL (state );
143
119
return 0 ;
144
120
}
145
121
146
122
int shellKernelUnredirectUx0 () {
147
- uint32_t state ;
148
- ENTER_SYSCALL (state );
149
-
150
123
SceIoMountPoint * mount = sceIoFindMountPoint (MOUNT_POINT_ID );
151
124
if (!mount ) {
152
- EXIT_SYSCALL (state );
153
125
return -1 ;
154
126
}
155
127
@@ -161,7 +133,6 @@ int shellKernelUnredirectUx0() {
161
133
ori_dev2 = NULL ;
162
134
}
163
135
164
- EXIT_SYSCALL (state );
165
136
return 0 ;
166
137
}
167
138
@@ -211,7 +182,6 @@ int module_start(SceSize args, void *argp) {
211
182
212
183
// start memory card redirection if we don't disable it
213
184
if (exists ("sdstor0:uma-lp-act-entire" ) && !exists ("ur0:DISABLE_USB_MC.txt" ) && !shellKernelIsUx0Redirected ()) {
214
- ksceIoUmount (0xF00 , 0 , 0 , 0 );
215
185
shellKernelRedirectUx0 ();
216
186
io_remount (MOUNT_POINT_ID );
217
187
}
0 commit comments