@@ -50,18 +50,6 @@ int SVC_CALL_VFS_OUT(int r0, int r1, int r2, int r3, int *v1) {
5050 return errno ;
5151}
5252
53-
54- typedef enum vfs_command {
55- VFS_OPEN = 1 ,
56- VFS_VALID = 2 ,
57- VFS_REPR = 3 ,
58- VFS_CLOSE = 4 ,
59- VFS_READ = 5 ,
60- VFS_WRITE = 6 ,
61- VFS_SEEK = 7 ,
62- VFS_FLUSH = 8 ,
63- } vfs_command ;
64-
6553typedef struct _mp_obj_vfs_openpie_file_t {
6654 mp_obj_base_t base ;
6755 int fd ;
@@ -90,7 +78,7 @@ mp_obj_t mp_vfs_openpie_file_open(const mp_obj_type_t *type, mp_obj_t address_in
9078 o -> base .type = type ;
9179 o -> fd = -1 ;
9280
93- int errno = SVC_CALL_VFS_OUT (VFS_OPEN , (int ) address , (int ) path , (int ) mode , & (o -> fd ));
81+ int errno = SVC_CALL_VFS_OUT (SYS_VFS_OPEN , (int ) address , (int ) path , (int ) mode , & (o -> fd ));
9482 if (errno != 0 ) {
9583 mp_raise_OSError (errno );
9684 }
@@ -131,7 +119,7 @@ STATIC mp_uint_t vfs_openpie_file_read(mp_obj_t o_in, void *buf, mp_uint_t size,
131119 check_fd_is_open (o );
132120
133121 int count = 0 ;
134- int errno = SVC_CALL_VFS_OUT (VFS_READ , o -> fd , (int ) size , (int ) buf , & count );
122+ int errno = SVC_CALL_VFS_OUT (SYS_VFS_READ , o -> fd , (int ) size , (int ) buf , & count );
135123 if (errno != 0 ) {
136124 * errcode = errno ;
137125 return MP_STREAM_ERROR ;
@@ -149,7 +137,7 @@ STATIC mp_uint_t vfs_openpie_file_write(mp_obj_t o_in, const void *buf, mp_uint_
149137 }
150138#endif
151139 int written = 0 ;
152- int errno = SVC_CALL_VFS_OUT (VFS_WRITE , o -> fd , (int ) buf , (int ) size , & written );
140+ int errno = SVC_CALL_VFS_OUT (SYS_VFS_WRITE , o -> fd , (int ) buf , (int ) size , & written );
153141 if (errno != 0 ) {
154142 * errcode = errno ;
155143 return MP_STREAM_ERROR ;
@@ -163,7 +151,7 @@ STATIC mp_uint_t vfs_openpie_file_ioctl(mp_obj_t o_in, mp_uint_t request, uintpt
163151 int errno ;
164152 switch (request ) {
165153 case MP_STREAM_FLUSH :
166- errno = SVC_CALL_VFS (VFS_FLUSH , o -> fd , 0 , 0 );
154+ errno = SVC_CALL_VFS (SYS_VFS_FLUSH , o -> fd , 0 , 0 );
167155 if (errno != 0 ) {
168156 * errcode = errno ;
169157 return MP_STREAM_ERROR ;
@@ -172,7 +160,7 @@ STATIC mp_uint_t vfs_openpie_file_ioctl(mp_obj_t o_in, mp_uint_t request, uintpt
172160 case MP_STREAM_SEEK : {
173161 struct mp_stream_seek_t * s = (struct mp_stream_seek_t * ) arg ;
174162 int offset = 0 ;
175- errno = SVC_CALL_VFS_OUT (VFS_SEEK , o -> fd , s -> offset , s -> whence , & offset );
163+ errno = SVC_CALL_VFS_OUT (SYS_VFS_SEEK , o -> fd , s -> offset , s -> whence , & offset );
176164 if (errno != 0 ) {
177165 * errcode = errno ;
178166 return MP_STREAM_ERROR ;
@@ -181,7 +169,7 @@ STATIC mp_uint_t vfs_openpie_file_ioctl(mp_obj_t o_in, mp_uint_t request, uintpt
181169 return 0 ;
182170 }
183171 case MP_STREAM_CLOSE :
184- errno = SVC_CALL_VFS (VFS_CLOSE , o -> fd , 0 , 0 );
172+ errno = SVC_CALL_VFS (SYS_VFS_CLOSE , o -> fd , 0 , 0 );
185173 if (errno != 0 ) {
186174 * errcode = errno ;
187175 return MP_STREAM_ERROR ;
0 commit comments