Changeset 707 for soft/giet_vm/giet_fat32/fat32.c
- Timestamp:
- Aug 24, 2015, 5:08:30 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
soft/giet_vm/giet_fat32/fat32.c
r674 r707 3174 3174 // GIET_FAT32_IO_ERROR 3175 3175 ///////////////////////////////////////////////////////////////////////////////// 3176 int _fat_read( unsigned int fd_id, // file descriptor index 3177 void* buffer, // destination buffer 3178 unsigned int count ) // number of bytes to read 3176 int _fat_read( unsigned int fd_id, // file descriptor index 3177 paddr_t buffer, // destination buffer 3178 unsigned int count, // number of bytes to read 3179 unsigned int phys ) // use physical_memcpy 3179 3180 { 3180 3181 // checking FAT initialized … … 3266 3267 unsigned char* source; 3267 3268 unsigned int nbytes; 3268 unsigned char* dest = (unsigned char*)buffer + done; 3269 3269 3270 if ( (cluster_id == first_cluster_id) && (cluster_id == last_cluster_id) ) 3270 3271 { … … 3289 3290 3290 3291 // move data 3291 memcpy( dest , source , nbytes ); 3292 if ( !phys ) 3293 { 3294 void* dest = (void*)(unsigned int)buffer + done; 3295 3296 memcpy( dest, source, nbytes ); 3297 } 3298 else 3299 { 3300 unsigned int flags; 3301 paddr_t pdest = buffer + done; 3302 paddr_t psource = _v2p_translate( (unsigned int)source, &flags ); 3303 3304 _physical_memcpy( pdest, psource, nbytes ); 3305 } 3306 3292 3307 done = done + nbytes; 3293 3308 } … … 4266 4281 while ( 1 ) 4267 4282 { 4268 if ( _fat_read( fd_id, &buf, sizeof(buf)) != sizeof(buf) )4283 if ( _fat_read( fd_id, (unsigned int)&buf, sizeof(buf), 0 ) != sizeof(buf) ) 4269 4284 { 4270 4285 _printf("\n[FAT ERROR] _fat_readdir(): can't read entry\n" );
Note: See TracChangeset
for help on using the changeset viewer.