Changeset 707 for soft/giet_vm/giet_fat32
- Timestamp:
- Aug 24, 2015, 5:08:30 PM (9 years ago)
- Location:
- soft/giet_vm/giet_fat32
- Files:
-
- 2 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" ); -
soft/giet_vm/giet_fat32/fat32.h
r674 r707 12 12 #include "giet_config.h" 13 13 #include "kernel_locks.h" 14 #include "mapping_info.h" 14 15 15 16 /*************** Partition Boot Sector Format **********************************/ … … 225 226 226 227 extern int _fat_read( unsigned int fd_id, // file descriptor 227 void* buffer, // destination buffer 228 unsigned int count ); // number of bytes 228 paddr_t buffer, // destination buffer 229 unsigned int count, // number of bytes 230 unsigned int phys ); // use physical_memcpy 229 231 230 232 extern int _fat_write( unsigned int fd_id, // file descriptor
Note: See TracChangeset
for help on using the changeset viewer.