Changeset 358 for soft/giet_vm/giet_fat32
- Timestamp:
- Jul 19, 2014, 5:04:57 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
soft/giet_vm/giet_fat32/fat32.c
r354 r358 790 790 791 791 #if GIET_DEBUG_FAT 792 _printf("\n[FAT DEBUG] enter _scan_directory() searching dir/file %s", file_name );792 _printf("\n[FAT DEBUG] enter _scan_directory() for dir/file %s\n", file_name ); 793 793 #endif 794 794 … … 822 822 823 823 fat.cache_lba = lba; 824 825 #if ( GIET_DEBUG_FAT > 1 ) 826 display_fat_cache(); 827 #endif 824 828 825 829 // in this loop we scan all names in directory identified by cluster: … … 1071 1075 fat.last_cluster_allocated = read_entry( FS_FREE_CLUSTER_HINT, fat.fat_cache, 1); 1072 1076 1073 #if GIET_DEBUG_FAT 1074 _printf("\n[FAT DEBUG] Processor[%d,%d,%d] exit _fat_init() / " 1075 "free clusters = %x / last allocated cluster = %x\n", 1076 x, y, lpid, fat.number_free_cluster, fat.last_cluster_allocated ); 1077 1078 #if GIET_DEBUG_FAT 1079 _printf("\n[FAT DEBUG] Processor[%d,%d,%d] initialises FAT descriptor\n", x, y, lpid ); 1080 _fat_print(); 1081 _printf("\n[FAT DEBUG] Processor[%d,%d,%d] exit _fat_init()\n", x, y, lpid ); 1077 1082 #endif 1078 1083 … … 1083 1088 void _fat_print() 1084 1089 { 1085 _printf("\n########################## FAT32 ###########################"); 1086 _printf("\nFAT initialised %x", fat.initialised ); 1087 _printf("\nSector Size (bytes) %x", fat.sector_size ); 1088 _printf("\nSectors per cluster %x", fat.sectors_per_cluster ); 1089 _printf("\nFAT region first lba %x", fat.fat_lba ); 1090 _printf("\nData region first lba %x", fat.data_lba ); 1091 _printf("\nNumber of sectors for one FAT %x", fat.fat_sectors ); 1092 _printf("\n############################################################\n"); 1090 _printf("\n########################## FAT32 ################################"); 1091 _printf("\nFAT initialised %x", fat.initialised ); 1092 _printf("\nSector Size (bytes) %x", fat.sector_size ); 1093 _printf("\nSectors per cluster %x", fat.sectors_per_cluster ); 1094 _printf("\nFAT region first lba %x", fat.fat_lba ); 1095 _printf("\nData region first lba %x", fat.data_lba ); 1096 _printf("\nNumber of sectors for one FAT %x", fat.fat_sectors ); 1097 _printf("\nNumber of free clusters %x", fat.number_free_cluster ); 1098 _printf("\nLast last allocated cluster %x", fat.last_cluster_allocated ); 1099 _printf("\n#################################################################\n"); 1093 1100 } 1094 1101 … … 1150 1157 { 1151 1158 _printf("[FAT ERROR] in _fat_open() : Cannot initialize FAT descriptor\n"); 1152 1153 // release FAT lock1154 1159 _release_lock( &fat.fat_lock ); 1155 1156 1160 return -1; 1157 1161 } 1158 1159 #if GIET_DEBUG_FAT1160 _printf("\n[FAT DEBUG] Processor[%d,%d,%d] initialises FAT descriptor\n",1161 x, y, lpid );1162 _fat_print();1163 #endif1164 1165 1162 } 1166 1163 … … 1283 1280 unsigned int sectors_to_skip; // number of sectors to skip in first iteration 1284 1281 1285 // compute file size as a number of sectors1286 file_size = fat.fd[fd_id].file_size;1287 if ( file_size & 0x1FF ) file_sectors = (file_size >> 9) + 1;1288 else file_sectors = (file_size >> 9);1289 1290 1282 // arguments checking 1291 1283 if ( fd_id >= GIET_OPEN_FILES_MAX ) … … 1304 1296 return -1; 1305 1297 } 1298 1299 // compute file size as a number of sectors 1300 file_size = fat.fd[fd_id].file_size; 1301 if ( file_size & 0x1FF ) file_sectors = (file_size >> 9) + 1; 1302 else file_sectors = (file_size >> 9); 1303 1306 1304 if ( offset >= file_sectors ) 1307 1305 { … … 1359 1357 else iter_sectors = spc - sectors_to_skip; 1360 1358 1361 // loop on the clusters 1359 // loop on the clusters: one IOC access per cluster 1362 1360 while ( todo_sectors > 0 ) 1363 1361 { 1364 1362 1365 1363 #if GIET_DEBUG_FAT 1366 _printf("\n[FAT DEBUG] Processor[%d,%d,%d] makes an IOC read :"1367 " buf = %x / lba = %x / sectors = %d\n",1368 x, y, lpid, (unsigned int)dst, lba, iter_sectors );1364 _printf("\n[FAT DEBUG] Processor[%d,%d,%d] makes an IOC read " 1365 " for cluster %x : buf = %x / lba = %x / sectors = %d\n", 1366 x, y, lpid, cluster, (unsigned int)dst, lba, iter_sectors ); 1369 1367 #endif 1370 1368
Note: See TracChangeset
for help on using the changeset viewer.