Changeset f91bbe64 in rtems
- Timestamp:
- 03/22/04 17:10:43 (20 years ago)
- Branches:
- 4.10, 4.11, 4.8, 4.9, 5, master
- Children:
- 83c5fc1
- Parents:
- 82c123d
- Location:
- cpukit
- Files:
-
- 19 edited
Legend:
- Unmodified
- Added
- Removed
-
cpukit/ChangeLog
r82c123d rf91bbe64 1 2004-03-22 Ralf Corsepius <ralf_corsepius@rtems.org> 2 3 * libfs/src/dosfs/fat.c, libfs/src/dosfs/fat.h, 4 libfs/src/dosfs/fat_fat_operations.c, 5 libfs/src/dosfs/fat_fat_operations.h, libfs/src/dosfs/fat_file.c, 6 libfs/src/dosfs/fat_file.h, libfs/src/dosfs/msdos.h, 7 libfs/src/dosfs/msdos_create.c, libfs/src/dosfs/msdos_dir.c, 8 libfs/src/dosfs/msdos_file.c, libfs/src/dosfs/msdos_initsupp.c, 9 libfs/src/dosfs/msdos_misc.c, libfs/src/imfs/deviceio.c, 10 libfs/src/imfs/imfs.h, libfs/src/imfs/imfs_directory.c, 11 libfs/src/imfs/imfs_fchmod.c, libfs/src/imfs/linearfile.c, 12 libfs/src/imfs/memfile.c: Convert to using c99 fixed-size types. 13 1 14 2004-03-05 Joel Sherrill <joel@OARcorp.com> 2 15 -
cpukit/libfs/src/dosfs/fat.c
r82c123d rf91bbe64 47 47 _fat_block_read( 48 48 rtems_filesystem_mount_table_entry_t *mt_entry, 49 u nsigned32start,50 u nsigned32offset,51 u nsigned32count,49 uint32_t start, 50 uint32_t offset, 51 uint32_t count, 52 52 void *buff 53 53 ) … … 56 56 register fat_fs_info_t *fs_info = mt_entry->fs_info; 57 57 ssize_t cmpltd = 0; 58 u nsigned32blk = start;59 u nsigned32ofs = offset;58 uint32_t blk = start; 59 uint32_t ofs = offset; 60 60 bdbuf_buffer *block = NULL; 61 u nsigned32c = 0;61 uint32_t c = 0; 62 62 63 63 while (count > 0) … … 98 98 _fat_block_write( 99 99 rtems_filesystem_mount_table_entry_t *mt_entry, 100 u nsigned32start,101 u nsigned32offset,102 u nsigned32count,100 uint32_t start, 101 uint32_t offset, 102 uint32_t count, 103 103 const void *buff) 104 104 { … … 106 106 fat_fs_info_t *fs_info = mt_entry->fs_info; 107 107 ssize_t cmpltd = 0; 108 u nsigned32blk = start;109 u nsigned32ofs = offset;108 uint32_t blk = start; 109 uint32_t ofs = offset; 110 110 bdbuf_buffer *block = NULL; 111 u nsigned32c = 0;111 uint32_t c = 0; 112 112 113 113 while(count > 0) … … 152 152 fat_cluster_read( 153 153 rtems_filesystem_mount_table_entry_t *mt_entry, 154 u nsigned32cln,154 uint32_t cln, 155 155 void *buff 156 156 ) 157 157 { 158 158 fat_fs_info_t *fs_info = mt_entry->fs_info; 159 u nsigned32fsec = 0;159 uint32_t fsec = 0; 160 160 161 161 fsec = fat_cluster_num_to_sector_num(mt_entry, cln); … … 180 180 fat_cluster_write( 181 181 rtems_filesystem_mount_table_entry_t *mt_entry, 182 u nsigned32cln,182 uint32_t cln, 183 183 const void *buff 184 184 ) 185 185 { 186 186 fat_fs_info_t *fs_info = mt_entry->fs_info; 187 u nsigned32fsec = 0;187 uint32_t fsec = 0; 188 188 189 189 fsec = fat_cluster_num_to_sector_num(mt_entry, cln); … … 209 209 fat_fs_info_t *fs_info = mt_entry->fs_info; 210 210 register fat_vol_t *vol = &fs_info->vol; 211 u nsigned32data_secs = 0;211 uint32_t data_secs = 0; 212 212 char boot_rec[FAT_MAX_BPB_SIZE]; 213 213 char fs_info_sector[FAT_USEFUL_INFO_SIZE]; … … 527 527 fat_init_clusters_chain( 528 528 rtems_filesystem_mount_table_entry_t *mt_entry, 529 u nsigned32start_cln529 uint32_t start_cln 530 530 ) 531 531 { … … 533 533 ssize_t ret = 0; 534 534 register fat_fs_info_t *fs_info = mt_entry->fs_info; 535 u nsigned32cur_cln = start_cln;535 uint32_t cur_cln = start_cln; 536 536 char *buf; 537 537 … … 586 586 * 587 587 */ 588 u nsigned32588 uint32_t 589 589 fat_get_unique_ino(rtems_filesystem_mount_table_entry_t *mt_entry) 590 590 { 591 591 register fat_fs_info_t *fs_info = mt_entry->fs_info; 592 u nsigned32j = 0;592 uint32_t j = 0; 593 593 rtems_boolean resrc_unsuff = FALSE; 594 594 … … 635 635 fat_free_unique_ino( 636 636 rtems_filesystem_mount_table_entry_t *mt_entry, 637 u nsigned32ino637 uint32_t ino 638 638 ) 639 639 { … … 656 656 fat_ino_is_unique( 657 657 rtems_filesystem_mount_table_entry_t *mt_entry, 658 u nsigned32ino658 uint32_t ino 659 659 ) 660 660 { … … 678 678 fat_fat32_update_fsinfo_sector( 679 679 rtems_filesystem_mount_table_entry_t *mt_entry, 680 u nsigned32free_count,681 u nsigned32next_free680 uint32_t free_count, 681 uint32_t next_free 682 682 ) 683 683 { 684 684 ssize_t ret1 = 0, ret2 = 0; 685 685 register fat_fs_info_t *fs_info = mt_entry->fs_info; 686 u nsigned32le_free_count = 0;687 u nsigned32le_next_free = 0;686 uint32_t le_free_count = 0; 687 uint32_t le_next_free = 0; 688 688 689 689 le_free_count = CT_LE_L(free_count); -
cpukit/libfs/src/dosfs/fat.h
r82c123d rf91bbe64 52 52 53 53 #if (CPU_BIG_ENDIAN == TRUE) 54 # define CF_LE_W(v) CPU_swap_u16((u nsigned16)v)55 # define CF_LE_L(v) CPU_swap_u32((u nsigned32)v)56 # define CT_LE_W(v) CPU_swap_u16((u nsigned16)v)57 # define CT_LE_L(v) CPU_swap_u32((u nsigned32)v)54 # define CF_LE_W(v) CPU_swap_u16((uint16_t )v) 55 # define CF_LE_L(v) CPU_swap_u32((uint32_t )v) 56 # define CT_LE_W(v) CPU_swap_u16((uint16_t )v) 57 # define CT_LE_L(v) CPU_swap_u32((uint32_t )v) 58 58 #else 59 59 # define CF_LE_W(v) (v) … … 82 82 #define FAT_FAT32 0x04 83 83 84 #define FAT_UNDEFINED_VALUE (u nsigned32)0xFFFFFFFF84 #define FAT_UNDEFINED_VALUE (uint32_t )0xFFFFFFFF 85 85 86 86 #define FAT_FAT12_EOC 0x0FF8 87 87 #define FAT_FAT16_EOC 0xFFF8 88 #define FAT_FAT32_EOC (u nsigned32)0x0FFFFFF888 #define FAT_FAT32_EOC (uint32_t )0x0FFFFFF8 89 89 90 90 #define FAT_FAT12_FREE 0x0000 … … 92 92 #define FAT_FAT32_FREE 0x00000000 93 93 94 #define FAT_GENFAT_EOC (u nsigned32)0xFFFFFFFF95 #define FAT_GENFAT_FREE (u nsigned32)0x0000000094 #define FAT_GENFAT_EOC (uint32_t )0xFFFFFFFF 95 #define FAT_GENFAT_FREE (uint32_t )0x00000000 96 96 97 97 #define FAT_FAT12_SHIFT 0x04 … … 99 99 #define FAT_FAT12_MASK 0x00000FFF 100 100 #define FAT_FAT16_MASK 0x0000FFFF 101 #define FAT_FAT32_MASK (u nsigned32)0x0FFFFFFF101 #define FAT_FAT32_MASK (uint32_t )0x0FFFFFFF 102 102 103 103 #define FAT_MAX_BPB_SIZE 90 … … 106 106 #define FAT_USEFUL_INFO_SIZE 12 107 107 108 #define FAT_VAL8(x, ofs) (u nsigned8)(*((unsigned8*)(x) + (ofs)))108 #define FAT_VAL8(x, ofs) (uint8_t )(*((uint8_t *)(x) + (ofs))) 109 109 110 110 #define FAT_VAL16(x, ofs) \ 111 (u nsigned16)( (*((unsigned8*)(x) + (ofs))) | \112 ((*((u nsigned8*)(x) + (ofs) + 1)) << 8) )111 (uint16_t )( (*((uint8_t *)(x) + (ofs))) | \ 112 ((*((uint8_t *)(x) + (ofs) + 1)) << 8) ) 113 113 114 114 #define FAT_VAL32(x, ofs) \ 115 (u nsigned32)( (unsigned32)(*((unsigned8*)(x) + (ofs))) | \116 ((u nsigned32)(*((unsigned8*)(x) + (ofs) + 1)) << 8) | \117 ((u nsigned32)(*((unsigned8*)(x) + (ofs) + 2)) << 16) | \118 ((u nsigned32)(*((unsigned8*)(x) + (ofs) + 3)) << 24) )115 (uint32_t )( (uint32_t )(*((uint8_t *)(x) + (ofs))) | \ 116 ((uint32_t )(*((uint8_t *)(x) + (ofs) + 1)) << 8) | \ 117 ((uint32_t )(*((uint8_t *)(x) + (ofs) + 2)) << 16) | \ 118 ((uint32_t )(*((uint8_t *)(x) + (ofs) + 3)) << 24) ) 119 119 120 120 /* macros to access boot sector fields */ … … 171 171 typedef struct fat_vol_s 172 172 { 173 u nsigned16bps; /* bytes per sector */174 u nsigned8sec_log2; /* log2 of bps */175 u nsigned8sec_mul; /* log2 of 512bts sectors number per sector */176 u nsigned8spc; /* sectors per cluster */177 u nsigned8spc_log2; /* log2 of spc */178 u nsigned16bpc; /* bytes per cluster */179 u nsigned8bpc_log2; /* log2 of bytes per cluster */180 u nsigned8fats; /* number of FATs */181 u nsigned8type; /* FAT type */182 u nsigned32mask;183 u nsigned32eoc_val;184 u nsigned16fat_loc; /* FAT start */185 u nsigned32fat_length; /* sectors per FAT */186 u nsigned32rdir_loc; /* root directory start */187 u nsigned16rdir_entrs; /* files per root directory */188 u nsigned32rdir_secs; /* sectors per root directory */189 u nsigned32rdir_size; /* root directory size in bytes */190 u nsigned32tot_secs; /* total count of sectors */191 u nsigned32data_fsec; /* first data sector */192 u nsigned32data_cls; /* count of data clusters */193 u nsigned32rdir_cl; /* first cluster of the root directory */194 u nsigned16info_sec; /* FSInfo Sector Structure location */195 u nsigned32free_cls; /* last known free clusters count */196 u nsigned32next_cl; /* next free cluster number */197 u nsigned8mirror; /* mirroring enabla/disable */198 u nsigned32afat_loc; /* active FAT location */199 u nsigned8afat; /* the number of active FAT */173 uint16_t bps; /* bytes per sector */ 174 uint8_t sec_log2; /* log2 of bps */ 175 uint8_t sec_mul; /* log2 of 512bts sectors number per sector */ 176 uint8_t spc; /* sectors per cluster */ 177 uint8_t spc_log2; /* log2 of spc */ 178 uint16_t bpc; /* bytes per cluster */ 179 uint8_t bpc_log2; /* log2 of bytes per cluster */ 180 uint8_t fats; /* number of FATs */ 181 uint8_t type; /* FAT type */ 182 uint32_t mask; 183 uint32_t eoc_val; 184 uint16_t fat_loc; /* FAT start */ 185 uint32_t fat_length; /* sectors per FAT */ 186 uint32_t rdir_loc; /* root directory start */ 187 uint16_t rdir_entrs; /* files per root directory */ 188 uint32_t rdir_secs; /* sectors per root directory */ 189 uint32_t rdir_size; /* root directory size in bytes */ 190 uint32_t tot_secs; /* total count of sectors */ 191 uint32_t data_fsec; /* first data sector */ 192 uint32_t data_cls; /* count of data clusters */ 193 uint32_t rdir_cl; /* first cluster of the root directory */ 194 uint16_t info_sec; /* FSInfo Sector Structure location */ 195 uint32_t free_cls; /* last known free clusters count */ 196 uint32_t next_cl; /* next free cluster number */ 197 uint8_t mirror; /* mirroring enabla/disable */ 198 uint32_t afat_loc; /* active FAT location */ 199 uint8_t afat; /* the number of active FAT */ 200 200 dev_t dev; /* device ID */ 201 201 disk_device *dd; /* disk device (see libblock) */ … … 206 206 typedef struct fat_cache_s 207 207 { 208 u nsigned32blk_num;208 uint32_t blk_num; 209 209 rtems_boolean modified; 210 u nsigned8state;210 uint8_t state; 211 211 bdbuf_buffer *buf; 212 212 } fat_cache_t; … … 222 222 Chain_Control *rhash; /* "rhash" of fat-file descriptors */ 223 223 char *uino; /* array of unique ino numbers */ 224 u nsigned32index;225 u nsigned32uino_pool_size; /* size */226 u nsigned32uino_base;224 uint32_t index; 225 uint32_t uino_pool_size; /* size */ 226 uint32_t uino_base; 227 227 fat_cache_t c; /* cache */ 228 u nsigned8*sec_buf; /* just placeholder for anything */228 uint8_t *sec_buf; /* just placeholder for anything */ 229 229 } fat_fs_info_t; 230 230 … … 236 236 typedef struct fat_auxiliary_s 237 237 { 238 u nsigned32cln;239 u nsigned32ofs;238 uint32_t cln; 239 uint32_t ofs; 240 240 } fat_auxiliary_t; 241 241 … … 259 259 #define FAT_OP_TYPE_GET 0x2 260 260 261 static inline u nsigned32261 static inline uint32_t 262 262 fat_cluster_num_to_sector_num( 263 263 rtems_filesystem_mount_table_entry_t *mt_entry, 264 u nsigned32cln264 uint32_t cln 265 265 ) 266 266 { … … 274 274 } 275 275 276 static inline u nsigned32276 static inline uint32_t 277 277 fat_cluster_num_to_sector512_num( 278 278 rtems_filesystem_mount_table_entry_t *mt_entry, 279 u nsigned32cln279 uint32_t cln 280 280 ) 281 281 { … … 290 290 291 291 static inline int 292 fat_buf_access(fat_fs_info_t *fs_info, u nsigned32blk, int op_type,292 fat_buf_access(fat_fs_info_t *fs_info, uint32_t blk, int op_type, 293 293 bdbuf_buffer **buf) 294 294 { 295 295 rtems_status_code sc = RTEMS_SUCCESSFUL; 296 u nsigned8i;296 uint8_t i; 297 297 rtems_boolean sec_of_fat; 298 298 … … 373 373 { 374 374 rtems_status_code sc = RTEMS_SUCCESSFUL; 375 u nsigned8i;375 uint8_t i; 376 376 rtems_boolean sec_of_fat; 377 377 … … 431 431 ssize_t 432 432 _fat_block_read(rtems_filesystem_mount_table_entry_t *mt_entry, 433 u nsigned32start,434 u nsigned32offset,435 u nsigned32count,433 uint32_t start, 434 uint32_t offset, 435 uint32_t count, 436 436 void *buff); 437 437 438 438 ssize_t 439 439 _fat_block_write(rtems_filesystem_mount_table_entry_t *mt_entry, 440 u nsigned32start,441 u nsigned32offset,442 u nsigned32count,440 uint32_t start, 441 uint32_t offset, 442 uint32_t count, 443 443 const void *buff); 444 444 445 445 ssize_t 446 446 fat_cluster_read(rtems_filesystem_mount_table_entry_t *mt_entry, 447 u nsigned32cln,447 uint32_t cln, 448 448 void *buff); 449 449 450 450 ssize_t 451 451 fat_cluster_write(rtems_filesystem_mount_table_entry_t *mt_entry, 452 u nsigned32cln,452 uint32_t cln, 453 453 const void *buff); 454 454 … … 458 458 int 459 459 fat_init_clusters_chain(rtems_filesystem_mount_table_entry_t *mt_entry, 460 u nsigned32start_cln);461 462 u nsigned32460 uint32_t start_cln); 461 462 uint32_t 463 463 fat_cluster_num_to_sector_num(rtems_filesystem_mount_table_entry_t *mt_entry, 464 u nsigned32cln);464 uint32_t cln); 465 465 466 466 int … … 468 468 469 469 470 u nsigned32470 uint32_t 471 471 fat_get_unique_ino(rtems_filesystem_mount_table_entry_t *mt_entry); 472 472 473 473 rtems_boolean 474 474 fat_ino_is_unique(rtems_filesystem_mount_table_entry_t *mt_entry, 475 u nsigned32ino);475 uint32_t ino); 476 476 477 477 void 478 478 fat_free_unique_ino(rtems_filesystem_mount_table_entry_t *mt_entry, 479 u nsigned32ino);479 uint32_t ino); 480 480 481 481 int 482 482 fat_fat32_update_fsinfo_sector( 483 483 rtems_filesystem_mount_table_entry_t *mt_entry, 484 u nsigned32free_count,485 u nsigned32next_free484 uint32_t free_count, 485 uint32_t next_free 486 486 ); 487 487 -
cpukit/libfs/src/dosfs/fat_fat_operations.c
r82c123d rf91bbe64 45 45 fat_scan_fat_for_free_clusters( 46 46 rtems_filesystem_mount_table_entry_t *mt_entry, 47 u nsigned32*chain,48 u nsigned32count,49 u nsigned32*cls_added,50 u nsigned32*last_cl47 uint32_t *chain, 48 uint32_t count, 49 uint32_t *cls_added, 50 uint32_t *last_cl 51 51 ) 52 52 { 53 53 int rc = RC_OK; 54 54 fat_fs_info_t *fs_info = mt_entry->fs_info; 55 u nsigned32cl4find = 2;56 u nsigned32next_cln = 0;57 u nsigned32save_cln = 0;58 u nsigned32data_cls_val = fs_info->vol.data_cls + 2;59 u nsigned32i = 2;55 uint32_t cl4find = 2; 56 uint32_t next_cln = 0; 57 uint32_t save_cln = 0; 58 uint32_t data_cls_val = fs_info->vol.data_cls + 2; 59 uint32_t i = 2; 60 60 61 61 *cls_added = 0; … … 167 167 fat_free_fat_clusters_chain( 168 168 rtems_filesystem_mount_table_entry_t *mt_entry, 169 u nsigned32chain169 uint32_t chain 170 170 ) 171 171 { 172 172 int rc = RC_OK, rc1 = RC_OK; 173 173 fat_fs_info_t *fs_info = mt_entry->fs_info; 174 u nsigned32cur_cln = chain;175 u nsigned32next_cln = 0;176 u nsigned32freed_cls_cnt = 0;174 uint32_t cur_cln = chain; 175 uint32_t next_cln = 0; 176 uint32_t freed_cls_cnt = 0; 177 177 178 178 while ((cur_cln & fs_info->vol.mask) < fs_info->vol.eoc_val) … … 224 224 fat_get_fat_cluster( 225 225 rtems_filesystem_mount_table_entry_t *mt_entry, 226 u nsigned32cln,227 u nsigned32*ret_val226 uint32_t cln, 227 uint32_t *ret_val 228 228 ) 229 229 { … … 231 231 register fat_fs_info_t *fs_info = mt_entry->fs_info; 232 232 bdbuf_buffer *block0 = NULL; 233 u nsigned32sec = 0;234 u nsigned32ofs = 0;233 uint32_t sec = 0; 234 uint32_t ofs = 0; 235 235 236 236 /* sanity check */ … … 253 253 * align problems for some architectures 254 254 */ 255 *ret_val = (*((u nsigned8*)(block0->buffer + ofs)));255 *ret_val = (*((uint8_t *)(block0->buffer + ofs))); 256 256 if ( ofs == (fs_info->vol.bps - 1) ) 257 257 { … … 261 261 return rc; 262 262 263 *ret_val |= (*((u nsigned8*)(block0->buffer)))<<8;263 *ret_val |= (*((uint8_t *)(block0->buffer)))<<8; 264 264 } 265 265 else 266 266 { 267 *ret_val |= (*((u nsigned8*)(block0->buffer + ofs + 1)))<<8;267 *ret_val |= (*((uint8_t *)(block0->buffer + ofs + 1)))<<8; 268 268 } 269 269 … … 275 275 276 276 case FAT_FAT16: 277 *ret_val = *((u nsigned16*)(block0->buffer + ofs));277 *ret_val = *((uint16_t *)(block0->buffer + ofs)); 278 278 *ret_val = CF_LE_W(*ret_val); 279 279 break; 280 280 281 281 case FAT_FAT32: 282 *ret_val = *((u nsigned32*)(block0->buffer + ofs));282 *ret_val = *((uint32_t *)(block0->buffer + ofs)); 283 283 *ret_val = CF_LE_L(*ret_val); 284 284 break; … … 308 308 fat_set_fat_cluster( 309 309 rtems_filesystem_mount_table_entry_t *mt_entry, 310 u nsigned32cln,311 u nsigned32in_val310 uint32_t cln, 311 uint32_t in_val 312 312 ) 313 313 { 314 314 int rc = RC_OK; 315 315 fat_fs_info_t *fs_info = mt_entry->fs_info; 316 u nsigned32sec = 0;317 u nsigned32ofs = 0;318 u nsigned16fat16_clv = 0;319 u nsigned32fat32_clv = 0;316 uint32_t sec = 0; 317 uint32_t ofs = 0; 318 uint16_t fat16_clv = 0; 319 uint32_t fat32_clv = 0; 320 320 bdbuf_buffer *block0 = NULL; 321 321 … … 337 337 if ( FAT_CLUSTER_IS_ODD(cln) ) 338 338 { 339 fat16_clv = ((u nsigned16)in_val) << FAT_FAT12_SHIFT;340 *((u nsigned8*)(block0->buffer + ofs)) =341 (*((u nsigned8*)(block0->buffer + ofs))) & 0x0F;342 343 *((u nsigned8*)(block0->buffer + ofs)) =344 (*((u nsigned8*)(block0->buffer + ofs))) |345 (u nsigned8)(fat16_clv & 0x00FF);339 fat16_clv = ((uint16_t )in_val) << FAT_FAT12_SHIFT; 340 *((uint8_t *)(block0->buffer + ofs)) = 341 (*((uint8_t *)(block0->buffer + ofs))) & 0x0F; 342 343 *((uint8_t *)(block0->buffer + ofs)) = 344 (*((uint8_t *)(block0->buffer + ofs))) | 345 (uint8_t )(fat16_clv & 0x00FF); 346 346 347 347 fat_buf_mark_modified(fs_info); … … 354 354 return rc; 355 355 356 *((u nsigned8*)(block0->buffer)) &= 0x00;356 *((uint8_t *)(block0->buffer)) &= 0x00; 357 357 358 *((u nsigned8*)(block0->buffer)) =359 (*((u nsigned8*)(block0->buffer))) |360 (u nsigned8)((fat16_clv & 0xFF00)>>8);358 *((uint8_t *)(block0->buffer)) = 359 (*((uint8_t *)(block0->buffer))) | 360 (uint8_t )((fat16_clv & 0xFF00)>>8); 361 361 362 362 fat_buf_mark_modified(fs_info); … … 364 364 else 365 365 { 366 *((u nsigned8*)(block0->buffer + ofs + 1)) &= 0x00;366 *((uint8_t *)(block0->buffer + ofs + 1)) &= 0x00; 367 367 368 *((u nsigned8*)(block0->buffer + ofs + 1)) =369 (*((u nsigned8*)(block0->buffer + ofs + 1))) |370 (u nsigned8)((fat16_clv & 0xFF00)>>8);368 *((uint8_t *)(block0->buffer + ofs + 1)) = 369 (*((uint8_t *)(block0->buffer + ofs + 1))) | 370 (uint8_t )((fat16_clv & 0xFF00)>>8); 371 371 } 372 372 } 373 373 else 374 374 { 375 fat16_clv = ((u nsigned16)in_val) & FAT_FAT12_MASK;376 *((u nsigned8*)(block0->buffer + ofs)) &= 0x00;377 378 *((u nsigned8*)(block0->buffer + ofs)) =379 (*((u nsigned8*)(block0->buffer + ofs))) |380 (u nsigned8)(fat16_clv & 0x00FF);375 fat16_clv = ((uint16_t )in_val) & FAT_FAT12_MASK; 376 *((uint8_t *)(block0->buffer + ofs)) &= 0x00; 377 378 *((uint8_t *)(block0->buffer + ofs)) = 379 (*((uint8_t *)(block0->buffer + ofs))) | 380 (uint8_t )(fat16_clv & 0x00FF); 381 381 382 382 fat_buf_mark_modified(fs_info); … … 389 389 return rc; 390 390 391 *((u nsigned8*)(block0->buffer)) =392 (*((u nsigned8*)(block0->buffer))) & 0xF0;391 *((uint8_t *)(block0->buffer)) = 392 (*((uint8_t *)(block0->buffer))) & 0xF0; 393 393 394 *((u nsigned8*)(block0->buffer)) =395 (*((u nsigned8*)(block0->buffer))) |396 (u nsigned8)((fat16_clv & 0xFF00)>>8);394 *((uint8_t *)(block0->buffer)) = 395 (*((uint8_t *)(block0->buffer))) | 396 (uint8_t )((fat16_clv & 0xFF00)>>8); 397 397 398 398 fat_buf_mark_modified(fs_info); … … 400 400 else 401 401 { 402 *((u nsigned8*)(block0->buffer + ofs + 1)) =403 (*((u nsigned8*)(block0->buffer + ofs + 1))) & 0xF0;404 405 *((u nsigned8*)(block0->buffer + ofs+1)) =406 (*((u nsigned8*)(block0->buffer + ofs+1))) |407 (u nsigned8)((fat16_clv & 0xFF00)>>8);402 *((uint8_t *)(block0->buffer + ofs + 1)) = 403 (*((uint8_t *)(block0->buffer + ofs + 1))) & 0xF0; 404 405 *((uint8_t *)(block0->buffer + ofs+1)) = 406 (*((uint8_t *)(block0->buffer + ofs+1))) | 407 (uint8_t )((fat16_clv & 0xFF00)>>8); 408 408 } 409 409 } … … 411 411 412 412 case FAT_FAT16: 413 *((u nsigned16*)(block0->buffer + ofs)) =414 (u nsigned16)(CT_LE_W(in_val));413 *((uint16_t *)(block0->buffer + ofs)) = 414 (uint16_t )(CT_LE_W(in_val)); 415 415 fat_buf_mark_modified(fs_info); 416 416 break; … … 419 419 fat32_clv = CT_LE_L((in_val & FAT_FAT32_MASK)); 420 420 421 *((u nsigned32*)(block0->buffer + ofs)) =422 (*((u nsigned32*)(block0->buffer + ofs))) & (CT_LE_L(0xF0000000));423 424 *((u nsigned32*)(block0->buffer + ofs)) =425 fat32_clv | (*((u nsigned32*)(block0->buffer + ofs)));421 *((uint32_t *)(block0->buffer + ofs)) = 422 (*((uint32_t *)(block0->buffer + ofs))) & (CT_LE_L(0xF0000000)); 423 424 *((uint32_t *)(block0->buffer + ofs)) = 425 fat32_clv | (*((uint32_t *)(block0->buffer + ofs))); 426 426 427 427 fat_buf_mark_modified(fs_info); -
cpukit/libfs/src/dosfs/fat_fat_operations.h
r82c123d rf91bbe64 29 29 int 30 30 fat_get_fat_cluster(rtems_filesystem_mount_table_entry_t *mt_entry, 31 u nsigned32cln,32 u nsigned32*ret_val);31 uint32_t cln, 32 uint32_t *ret_val); 33 33 34 34 int 35 35 fat_set_fat_cluster(rtems_filesystem_mount_table_entry_t *mt_entry, 36 u nsigned32cln,37 u nsigned32in_val);36 uint32_t cln, 37 uint32_t in_val); 38 38 39 39 int 40 40 fat_scan_fat_for_free_clusters( 41 41 rtems_filesystem_mount_table_entry_t *mt_entry, 42 u nsigned32*chain,43 u nsigned32count,44 u nsigned32*cls_added,45 u nsigned32*last_cl42 uint32_t *chain, 43 uint32_t count, 44 uint32_t *cls_added, 45 uint32_t *last_cl 46 46 ); 47 47 … … 49 49 fat_free_fat_clusters_chain( 50 50 rtems_filesystem_mount_table_entry_t *mt_entry, 51 u nsigned32chain51 uint32_t chain 52 52 ); 53 53 -
cpukit/libfs/src/dosfs/fat_file.c
r82c123d rf91bbe64 32 32 33 33 static inline void 34 _hash_insert(Chain_Control *hash, u nsigned32 key1, unsigned32key2,34 _hash_insert(Chain_Control *hash, uint32_t key1, uint32_t key2, 35 35 fat_file_fd_t *el); 36 36 37 37 static inline void 38 _hash_delete(Chain_Control *hash, u nsigned32 key1, unsigned32key2,38 _hash_delete(Chain_Control *hash, uint32_t key1, uint32_t key2, 39 39 fat_file_fd_t *el); 40 40 … … 43 43 rtems_filesystem_mount_table_entry_t *mt_entry, 44 44 Chain_Control *hash, 45 u nsigned32key1,46 u nsigned32key2,45 uint32_t key1, 46 uint32_t key2, 47 47 fat_file_fd_t **ret 48 48 ); … … 52 52 rtems_filesystem_mount_table_entry_t *mt_entry, 53 53 fat_file_fd_t *fat_fd, 54 u nsigned32file_cln,55 u nsigned32*disk_cln54 uint32_t file_cln, 55 uint32_t *disk_cln 56 56 ); 57 57 … … 85 85 fat_file_open( 86 86 rtems_filesystem_mount_table_entry_t *mt_entry, 87 u nsigned32cln,88 u nsigned32ofs,87 uint32_t cln, 88 uint32_t ofs, 89 89 fat_file_fd_t **fat_fd 90 90 ) … … 93 93 fat_fs_info_t *fs_info = mt_entry->fs_info; 94 94 fat_file_fd_t *lfat_fd = NULL; 95 u nsigned32key = 0;95 uint32_t key = 0; 96 96 97 97 /* construct key */ … … 190 190 int rc = RC_OK; 191 191 fat_fs_info_t *fs_info = mt_entry->fs_info; 192 u nsigned32key = 0;192 uint32_t key = 0; 193 193 194 194 /* … … 257 257 rtems_filesystem_mount_table_entry_t *mt_entry, 258 258 fat_file_fd_t *fat_fd, 259 u nsigned32start,260 u nsigned32count,259 uint32_t start, 260 uint32_t count, 261 261 char *buf 262 262 ) … … 265 265 ssize_t ret = 0; 266 266 fat_fs_info_t *fs_info = mt_entry->fs_info; 267 u nsigned32cmpltd = 0;268 u nsigned32cur_cln = 0;269 u nsigned32cl_start = 0;270 u nsigned32save_cln = 0;271 u nsigned32ofs = 0;272 u nsigned32save_ofs;273 u nsigned32sec = 0;274 u nsigned32byte = 0;275 u nsigned32c = 0;267 uint32_t cmpltd = 0; 268 uint32_t cur_cln = 0; 269 uint32_t cl_start = 0; 270 uint32_t save_cln = 0; 271 uint32_t ofs = 0; 272 uint32_t save_ofs; 273 uint32_t sec = 0; 274 uint32_t byte = 0; 275 uint32_t c = 0; 276 276 277 277 /* it couldn't be removed - otherwise cache update will be broken */ … … 362 362 rtems_filesystem_mount_table_entry_t *mt_entry, 363 363 fat_file_fd_t *fat_fd, 364 u nsigned32start,365 u nsigned32count,364 uint32_t start, 365 uint32_t count, 366 366 const char *buf 367 367 ) … … 370 370 ssize_t ret = 0; 371 371 fat_fs_info_t *fs_info = mt_entry->fs_info; 372 u nsigned32cmpltd = 0;373 u nsigned32cur_cln = 0;374 u nsigned32save_cln = 0; /* FIXME: This might be incorrect, cf. below */375 u nsigned32cl_start = 0;376 u nsigned32ofs = 0;377 u nsigned32save_ofs;378 u nsigned32sec = 0;379 u nsigned32byte = 0;380 u nsigned32c = 0;372 uint32_t cmpltd = 0; 373 uint32_t cur_cln = 0; 374 uint32_t save_cln = 0; /* FIXME: This might be incorrect, cf. below */ 375 uint32_t cl_start = 0; 376 uint32_t ofs = 0; 377 uint32_t save_ofs; 378 uint32_t sec = 0; 379 uint32_t byte = 0; 380 uint32_t c = 0; 381 381 382 382 if ( count == 0 ) … … 473 473 rtems_filesystem_mount_table_entry_t *mt_entry, 474 474 fat_file_fd_t *fat_fd, 475 u nsigned32new_length,476 u nsigned32*a_length475 uint32_t new_length, 476 uint32_t *a_length 477 477 ) 478 478 { 479 479 int rc = RC_OK; 480 480 fat_fs_info_t *fs_info = mt_entry->fs_info; 481 u nsigned32chain = 0;482 u nsigned32bytes2add = 0;483 u nsigned32cls2add = 0;484 u nsigned32old_last_cl;485 u nsigned32last_cl = 0;486 u nsigned32bytes_remain = 0;487 u nsigned32cls_added;481 uint32_t chain = 0; 482 uint32_t bytes2add = 0; 483 uint32_t cls2add = 0; 484 uint32_t old_last_cl; 485 uint32_t last_cl = 0; 486 uint32_t bytes_remain = 0; 487 uint32_t cls_added; 488 488 489 489 *a_length = new_length; … … 601 601 rtems_filesystem_mount_table_entry_t *mt_entry, 602 602 fat_file_fd_t *fat_fd, 603 u nsigned32new_length603 uint32_t new_length 604 604 ) 605 605 { 606 606 int rc = RC_OK; 607 607 fat_fs_info_t *fs_info = mt_entry->fs_info; 608 u nsigned32cur_cln = 0;609 u nsigned32cl_start = 0;610 u nsigned32new_last_cln = FAT_UNDEFINED_VALUE;608 uint32_t cur_cln = 0; 609 uint32_t cl_start = 0; 610 uint32_t new_last_cln = FAT_UNDEFINED_VALUE; 611 611 612 612 … … 672 672 int rc = RC_OK; 673 673 fat_fs_info_t *fs_info = mt_entry->fs_info; 674 u nsigned32cur_cln = 0;675 u nsigned32cl_start = 0;676 u nsigned32pos = 0;677 u nsigned32*ret;674 uint32_t cur_cln = 0; 675 uint32_t cl_start = 0; 676 uint32_t pos = 0; 677 uint32_t *ret; 678 678 va_list ap; 679 679 … … 683 683 { 684 684 case F_CLU_NUM: 685 pos = va_arg(ap, u nsigned32);686 ret = va_arg(ap, u nsigned32*);685 pos = va_arg(ap, uint32_t ); 686 ret = va_arg(ap, uint32_t *); 687 687 688 688 /* sanity check */ … … 733 733 { 734 734 fat_fs_info_t *fs_info = mt_entry->fs_info; 735 u nsigned32key = 0;735 uint32_t key = 0; 736 736 737 737 key = fat_construct_key(mt_entry, fat_fd->info_cln, fat_fd->info_ofs); … … 763 763 rtems_status_code sc = RTEMS_SUCCESSFUL; 764 764 fat_fs_info_t *fs_info = mt_entry->fs_info; 765 u nsigned32cur_cln = fat_fd->cln;765 uint32_t cur_cln = fat_fd->cln; 766 766 bdbuf_buffer *block = NULL; 767 u nsigned32sec = 0;768 u nsigned32i = 0;767 uint32_t sec = 0; 768 uint32_t i = 0; 769 769 770 770 if (fat_fd->fat_file_size == 0) … … 827 827 int rc = RC_OK; 828 828 fat_fs_info_t *fs_info = mt_entry->fs_info; 829 u nsigned32cur_cln = fat_fd->cln;830 u nsigned32save_cln = 0;829 uint32_t cur_cln = fat_fd->cln; 830 uint32_t save_cln = 0; 831 831 832 832 /* Have we requested root dir size for FAT12/16? */ … … 868 868 */ 869 869 static inline void 870 _hash_insert(Chain_Control *hash, u nsigned32 key1, unsigned32key2,870 _hash_insert(Chain_Control *hash, uint32_t key1, uint32_t key2, 871 871 fat_file_fd_t *el) 872 872 { … … 888 888 */ 889 889 static inline void 890 _hash_delete(Chain_Control *hash, u nsigned32 key1, unsigned32key2,890 _hash_delete(Chain_Control *hash, uint32_t key1, uint32_t key2, 891 891 fat_file_fd_t *el) 892 892 { … … 912 912 rtems_filesystem_mount_table_entry_t *mt_entry, 913 913 Chain_Control *hash, 914 u nsigned32key1,915 u nsigned32key2,914 uint32_t key1, 915 uint32_t key2, 916 916 fat_file_fd_t **ret 917 917 ) 918 918 { 919 u nsigned32mod = (key1) % FAT_HASH_MODULE;919 uint32_t mod = (key1) % FAT_HASH_MODULE; 920 920 Chain_Node *the_node = ((Chain_Control *)((hash) + mod))->first; 921 921 … … 923 923 { 924 924 fat_file_fd_t *ffd = (fat_file_fd_t *)the_node; 925 u nsigned32ck =925 uint32_t ck = 926 926 fat_construct_key(mt_entry, ffd->info_cln, ffd->info_ofs); 927 927 … … 943 943 rtems_filesystem_mount_table_entry_t *mt_entry, 944 944 fat_file_fd_t *fat_fd, 945 u nsigned32file_cln,946 u nsigned32*disk_cln945 uint32_t file_cln, 946 uint32_t *disk_cln 947 947 ) 948 948 { … … 955 955 else 956 956 { 957 u nsigned32cur_cln;958 u nsigned32count;959 u nsigned32i;957 uint32_t cur_cln; 958 uint32_t count; 959 uint32_t i; 960 960 961 961 if (file_cln > fat_fd->map.file_cln) -
cpukit/libfs/src/dosfs/fat_file.h
r82c123d rf91bbe64 47 47 typedef struct fat_file_map_s 48 48 { 49 u nsigned32file_cln;50 u nsigned32disk_cln;51 u nsigned32last_cln;49 uint32_t file_cln; 50 uint32_t disk_cln; 51 uint32_t last_cln; 52 52 } fat_file_map_t; 53 53 /* … … 63 63 * field 64 64 */ 65 u nsigned32links_num; /*65 uint32_t links_num; /* 66 66 * the number of fat_file_open call on 67 67 * this fat-file 68 68 */ 69 u nsigned32ino; /* inode, file serial number :)))) */69 uint32_t ino; /* inode, file serial number :)))) */ 70 70 fat_file_type_t fat_file_type; 71 u nsigned32size_limit;72 u nsigned32fat_file_size; /* length */73 u nsigned32info_cln;74 u nsigned32cln;75 u nsigned16info_ofs;71 uint32_t size_limit; 72 uint32_t fat_file_size; /* length */ 73 uint32_t info_cln; 74 uint32_t cln; 75 uint16_t info_ofs; 76 76 unsigned char first_char; 77 u nsigned8flags;77 uint8_t flags; 78 78 fat_file_map_t map; 79 79 time_t mtime; … … 120 120 * constructed key 121 121 */ 122 static inline u nsigned32122 static inline uint32_t 123 123 fat_construct_key( 124 124 rtems_filesystem_mount_table_entry_t *mt_entry, 125 u nsigned32cl,126 u nsigned32ofs)125 uint32_t cl, 126 uint32_t ofs) 127 127 { 128 128 return ( ((fat_cluster_num_to_sector512_num(mt_entry, cl) + … … 134 134 int 135 135 fat_file_open(rtems_filesystem_mount_table_entry_t *mt_entry, 136 u nsigned32cln,137 u nsigned32ofs,136 uint32_t cln, 137 uint32_t ofs, 138 138 fat_file_fd_t **fat_fd); 139 139 … … 148 148 fat_file_read(rtems_filesystem_mount_table_entry_t *mt_entry, 149 149 fat_file_fd_t *fat_fd, 150 u nsigned32start,151 u nsigned32count,150 uint32_t start, 151 uint32_t count, 152 152 char *buf); 153 153 … … 155 155 fat_file_write(rtems_filesystem_mount_table_entry_t *mt_entry, 156 156 fat_file_fd_t *fat_fd, 157 u nsigned32start,158 u nsigned32count,157 uint32_t start, 158 uint32_t count, 159 159 const char *buf); 160 160 … … 162 162 fat_file_extend(rtems_filesystem_mount_table_entry_t *mt_entry, 163 163 fat_file_fd_t *fat_fd, 164 u nsigned32new_length,165 u nsigned32*a_length);164 uint32_t new_length, 165 uint32_t *a_length); 166 166 167 167 int 168 168 fat_file_truncate(rtems_filesystem_mount_table_entry_t *mt_entry, 169 169 fat_file_fd_t *fat_fd, 170 u nsigned32new_length);170 uint32_t new_length); 171 171 172 172 int -
cpukit/libfs/src/dosfs/msdos.h
r82c123d rf91bbe64 59 59 * the volume 60 60 */ 61 u nsigned8*cl_buf; /*61 uint8_t *cl_buf; /* 62 62 * just placeholder 63 63 * for anything … … 88 88 #define MSDOS_DIRECTORY_ENTRY_STRUCT_SIZE 32 /* 32 bytes */ 89 89 90 #define MSDOS_DIR_NAME(x) (u nsigned8*)((x) + 0)91 #define MSDOS_DIR_ATTR(x) (u nsigned8*)((x) + 11)92 #define MSDOS_DIR_NT_RES(x) (u nsigned8*)((x) + 12)93 #define MSDOS_DIR_CRT_TIME_TENTH(x) (u nsigned8*)((x) + 13)94 #define MSDOS_DIR_CRT_TIME(x) (u nsigned16*)((x) + 14)95 #define MSDOS_DIR_CRT_DATE(x) (u nsigned16*)((x) + 16)96 #define MSDOS_DIR_LAST_ACCESS_DATE(x) (u nsigned16*)((x) + 18)97 #define MSDOS_DIR_FIRST_CLUSTER_HI(x) (u nsigned16*)((x) + 20)98 #define MSDOS_DIR_WRITE_TIME(x) (u nsigned16*)((x) + 22)99 #define MSDOS_DIR_WRITE_DATE(x) (u nsigned16*)((x) + 24)100 #define MSDOS_DIR_FIRST_CLUSTER_LOW(x) (u nsigned16*)((x) + 26)101 #define MSDOS_DIR_FILE_SIZE(x) (u nsigned32*)((x) + 28)90 #define MSDOS_DIR_NAME(x) (uint8_t *)((x) + 0) 91 #define MSDOS_DIR_ATTR(x) (uint8_t *)((x) + 11) 92 #define MSDOS_DIR_NT_RES(x) (uint8_t *)((x) + 12) 93 #define MSDOS_DIR_CRT_TIME_TENTH(x) (uint8_t *)((x) + 13) 94 #define MSDOS_DIR_CRT_TIME(x) (uint16_t *)((x) + 14) 95 #define MSDOS_DIR_CRT_DATE(x) (uint16_t *)((x) + 16) 96 #define MSDOS_DIR_LAST_ACCESS_DATE(x) (uint16_t *)((x) + 18) 97 #define MSDOS_DIR_FIRST_CLUSTER_HI(x) (uint16_t *)((x) + 20) 98 #define MSDOS_DIR_WRITE_TIME(x) (uint16_t *)((x) + 22) 99 #define MSDOS_DIR_WRITE_DATE(x) (uint16_t *)((x) + 24) 100 #define MSDOS_DIR_FIRST_CLUSTER_LOW(x) (uint16_t *)((x) + 26) 101 #define MSDOS_DIR_FILE_SIZE(x) (uint32_t *)((x) + 28) 102 102 103 103 #define MSDOS_EXTRACT_CLUSTER_NUM(p) \ 104 (u nsigned32)( (CF_LE_W(*MSDOS_DIR_FIRST_CLUSTER_LOW(p))) | \105 ((u nsigned32)(CF_LE_W((*MSDOS_DIR_FIRST_CLUSTER_HI(p))))<<16) )104 (uint32_t )( (CF_LE_W(*MSDOS_DIR_FIRST_CLUSTER_LOW(p))) | \ 105 ((uint32_t )(CF_LE_W((*MSDOS_DIR_FIRST_CLUSTER_HI(p))))<<16) ) 106 106 107 107 /* … … 248 248 rtems_libio_t *iop, /* IN */ 249 249 const char *pathname, /* IN */ 250 u nsigned32flag, /* IN */251 u nsigned32mode /* IN */250 uint32_t flag, /* IN */ 251 uint32_t mode /* IN */ 252 252 ); 253 253 … … 259 259 rtems_libio_t *iop, /* IN */ 260 260 void *buffer, /* IN */ 261 u nsigned32count /* IN */261 uint32_t count /* IN */ 262 262 ); 263 263 … … 266 266 rtems_libio_t *iop, /* IN */ 267 267 const void *buffer, /* IN */ 268 u nsigned32count /* IN */268 uint32_t count /* IN */ 269 269 ); 270 270 … … 295 295 msdos_file_ioctl( 296 296 rtems_libio_t *iop, /* IN */ 297 u nsigned32command, /* IN */297 uint32_t command, /* IN */ 298 298 void *buffer /* IN */ 299 299 ); … … 311 311 rtems_libio_t *iop, /* IN */ 312 312 const char *pathname, /* IN */ 313 u nsigned32flag, /* IN */314 u nsigned32mode /* IN */313 uint32_t flag, /* IN */ 314 uint32_t mode /* IN */ 315 315 ); 316 316 … … 322 322 rtems_libio_t *iop, /* IN */ 323 323 void *buffer, /* IN */ 324 u nsigned32count /* IN */324 uint32_t count /* IN */ 325 325 ); 326 326 … … 389 389 int 390 390 msdos_set_first_char4file_name(rtems_filesystem_mount_table_entry_t *mt_entry, 391 u nsigned32cl,392 u nsigned32ofs,391 uint32_t cl, 392 uint32_t ofs, 393 393 unsigned char first_char); 394 394 … … 417 417 rtems_filesystem_mount_table_entry_t *mt_entry, 418 418 fat_file_fd_t *fat_fd, 419 u nsigned32cl4find,419 uint32_t cl4find, 420 420 fat_auxiliary_t *paux, 421 421 char *dir_entry … … 425 425 msdos_get_dotdot_dir_info_cluster_num_and_offset( 426 426 rtems_filesystem_mount_table_entry_t *mt_entry, 427 u nsigned32cln,427 uint32_t cln, 428 428 fat_auxiliary_t *paux, 429 429 char *dir_entry -
cpukit/libfs/src/dosfs/msdos_create.c
r82c123d rf91bbe64 63 63 fat_file_fd_t *fat_fd = NULL; 64 64 time_t time_ret = 0; 65 u nsigned16time_val = 0;66 u nsigned16date = 0;65 uint16_t time_val = 0; 66 uint16_t date = 0; 67 67 fat_auxiliary_t aux; 68 68 unsigned char new_node [MSDOS_DIRECTORY_ENTRY_STRUCT_SIZE]; 69 69 unsigned char dot_dotdot[MSDOS_DIRECTORY_ENTRY_STRUCT_SIZE * 2]; 70 70 unsigned char link_node [MSDOS_DIRECTORY_ENTRY_STRUCT_SIZE]; 71 u nsigned32sec = 0;72 u nsigned32byte = 0;71 uint32_t sec = 0; 72 uint32_t byte = 0; 73 73 74 74 memset(new_node, 0, MSDOS_DIRECTORY_ENTRY_STRUCT_SIZE); … … 203 203 { 204 204 *MSDOS_DIR_FIRST_CLUSTER_LOW(DOTDOT_NODE_P(dot_dotdot)) = 205 CT_LE_W((u nsigned16)((parent_fat_fd->cln) & 0x0000FFFF));205 CT_LE_W((uint16_t )((parent_fat_fd->cln) & 0x0000FFFF)); 206 206 *MSDOS_DIR_FIRST_CLUSTER_HI(DOTDOT_NODE_P(dot_dotdot)) = 207 CT_LE_W((u nsigned16)(((parent_fat_fd->cln) & 0xFFFF0000)>>16));207 CT_LE_W((uint16_t )(((parent_fat_fd->cln) & 0xFFFF0000)>>16)); 208 208 } 209 209 … … 227 227 /* set up cluster num for dot entry */ 228 228 *MSDOS_DIR_FIRST_CLUSTER_LOW(DOT_NODE_P(dot_dotdot)) = 229 CT_LE_W((u nsigned16)((fat_fd->cln) & 0x0000FFFF));229 CT_LE_W((uint16_t )((fat_fd->cln) & 0x0000FFFF)); 230 230 *MSDOS_DIR_FIRST_CLUSTER_HI(DOT_NODE_P(dot_dotdot)) = 231 CT_LE_W((u nsigned16)(((fat_fd->cln) & 0xFFFF0000) >> 16));231 CT_LE_W((uint16_t )(((fat_fd->cln) & 0xFFFF0000) >> 16)); 232 232 233 233 /* rewrite dot entry */ -
cpukit/libfs/src/dosfs/msdos_dir.c
r82c123d rf91bbe64 46 46 */ 47 47 int 48 msdos_dir_open(rtems_libio_t *iop, const char *pathname, u nsigned32flag,49 u nsigned32mode)48 msdos_dir_open(rtems_libio_t *iop, const char *pathname, uint32_t flag, 49 uint32_t mode) 50 50 { 51 51 int rc = RC_OK; … … 197 197 */ 198 198 ssize_t 199 msdos_dir_read(rtems_libio_t *iop, void *buffer, u nsigned32count)199 msdos_dir_read(rtems_libio_t *iop, void *buffer, uint32_t count) 200 200 { 201 201 int rc = RC_OK; … … 205 205 fat_file_fd_t *tmp_fat_fd = NULL; 206 206 struct dirent tmp_dirent; 207 u nsigned32start = 0;207 uint32_t start = 0; 208 208 ssize_t ret = 0; 209 u nsigned32cmpltd = 0;210 u nsigned32j = 0, i = 0;211 u nsigned32bts2rd = 0;212 u nsigned32cur_cln = 0;209 uint32_t cmpltd = 0; 210 uint32_t j = 0, i = 0; 211 uint32_t bts2rd = 0; 212 uint32_t cur_cln = 0; 213 213 214 214 /* -
cpukit/libfs/src/dosfs/msdos_file.c
r82c123d rf91bbe64 43 43 */ 44 44 int 45 msdos_file_open(rtems_libio_t *iop, const char *pathname, u nsigned32flag,46 u nsigned32mode)45 msdos_file_open(rtems_libio_t *iop, const char *pathname, uint32_t flag, 46 uint32_t mode) 47 47 { 48 48 int rc = RC_OK; … … 145 145 */ 146 146 ssize_t 147 msdos_file_read(rtems_libio_t *iop, void *buffer, u nsigned32count)147 msdos_file_read(rtems_libio_t *iop, void *buffer, uint32_t count) 148 148 { 149 149 ssize_t ret = 0; … … 178 178 */ 179 179 ssize_t 180 msdos_file_write(rtems_libio_t *iop,const void *buffer, u nsigned32count)180 msdos_file_write(rtems_libio_t *iop,const void *buffer, uint32_t count) 181 181 { 182 182 ssize_t ret = 0; … … 231 231 msdos_fs_info_t *fs_info = iop->pathinfo.mt_entry->fs_info; 232 232 fat_file_fd_t *fat_fd = iop->file_info; 233 u nsigned32real_size = 0;233 uint32_t real_size = 0; 234 234 235 235 sc = rtems_semaphore_obtain(fs_info->vol_sema, RTEMS_WAIT, … … 438 438 */ 439 439 int 440 msdos_file_ioctl(rtems_libio_t *iop,u nsigned32command, void *buffer)440 msdos_file_ioctl(rtems_libio_t *iop,uint32_t command, void *buffer) 441 441 { 442 442 int rc = RC_OK; -
cpukit/libfs/src/dosfs/msdos_initsupp.c
r82c123d rf91bbe64 58 58 msdos_fs_info_t *fs_info = NULL; 59 59 fat_file_fd_t *fat_fd = NULL; 60 u nsigned32cl_buf_size;60 uint32_t cl_buf_size; 61 61 62 62 fs_info = (msdos_fs_info_t *)calloc(1, sizeof(msdos_fs_info_t)); -
cpukit/libfs/src/dosfs/msdos_misc.c
r82c123d rf91bbe64 265 265 msdos_fs_info_t *fs_info = parent_loc->mt_entry->fs_info; 266 266 fat_file_fd_t *fat_fd = parent_loc->node_access; 267 u nsigned32dotdot_cln = 0;267 uint32_t dotdot_cln = 0; 268 268 269 269 /* find name in fat-file which correspondes to the directory */ … … 378 378 msdos_get_dotdot_dir_info_cluster_num_and_offset( 379 379 rtems_filesystem_mount_table_entry_t *mt_entry, 380 u nsigned32cln,380 uint32_t cln, 381 381 fat_auxiliary_t *paux, 382 382 char *dir_entry … … 389 389 unsigned char dotdot_node[MSDOS_DIRECTORY_ENTRY_STRUCT_SIZE]; 390 390 unsigned char cur_node[MSDOS_DIRECTORY_ENTRY_STRUCT_SIZE]; 391 u nsigned32cl4find = 0;391 uint32_t cl4find = 0; 392 392 393 393 memset(dot_node, 0, MSDOS_DIRECTORY_ENTRY_STRUCT_SIZE); … … 516 516 unsigned short time_val; 517 517 unsigned short date; 518 u nsigned32sec = 0;519 u nsigned32byte = 0;518 uint32_t sec = 0; 519 uint32_t byte = 0; 520 520 521 521 msdos_date_unix2dos(fat_fd->mtime, &time_val, &date); … … 563 563 ssize_t ret1 = 0, ret2 = 0; 564 564 msdos_fs_info_t *fs_info = mt_entry->fs_info; 565 u nsigned32new_cln = fat_fd->cln;566 u nsigned16le_cl_low = 0;567 u nsigned16le_cl_hi = 0;568 u nsigned32sec = 0;569 u nsigned32byte = 0;565 uint32_t new_cln = fat_fd->cln; 566 uint16_t le_cl_low = 0; 567 uint16_t le_cl_hi = 0; 568 uint32_t sec = 0; 569 uint32_t byte = 0; 570 570 571 571 /* … … 578 578 byte = fat_fd->info_ofs & (fs_info->fat.vol.bps - 1); 579 579 580 le_cl_low = CT_LE_W((u nsigned16)(new_cln & 0x0000FFFF));580 le_cl_low = CT_LE_W((uint16_t )(new_cln & 0x0000FFFF)); 581 581 ret1 = _fat_block_write(mt_entry, sec, 582 582 byte + MSDOS_FIRST_CLUSTER_LOW_OFFSET, 2, 583 583 (char *)(&le_cl_low)); 584 le_cl_hi = CT_LE_W((u nsigned16)((new_cln & 0xFFFF0000) >> 16));584 le_cl_hi = CT_LE_W((uint16_t )((new_cln & 0xFFFF0000) >> 16)); 585 585 ret2 = _fat_block_write(mt_entry, sec, 586 586 byte + MSDOS_FIRST_CLUSTER_HI_OFFSET, 2, … … 612 612 ssize_t ret = 0; 613 613 msdos_fs_info_t *fs_info = mt_entry->fs_info; 614 u nsigned32le_new_length = 0;615 u nsigned32sec = 0;616 u nsigned32byte = 0;614 uint32_t le_new_length = 0; 615 uint32_t sec = 0; 616 uint32_t byte = 0; 617 617 618 618 sec = fat_cluster_num_to_sector_num(mt_entry, fat_fd->info_cln); … … 651 651 msdos_set_first_char4file_name( 652 652 rtems_filesystem_mount_table_entry_t *mt_entry, 653 u nsigned32cl,654 u nsigned32ofs,653 uint32_t cl, 654 uint32_t ofs, 655 655 unsigned char fchar 656 656 ) … … 658 658 ssize_t ret = 0; 659 659 msdos_fs_info_t *fs_info = mt_entry->fs_info; 660 u nsigned32sec = 0;661 u nsigned32byte = 0;660 uint32_t sec = 0; 661 uint32_t byte = 0; 662 662 663 663 sec = fat_cluster_num_to_sector_num(mt_entry, cl); … … 695 695 ssize_t ret = 0; 696 696 msdos_fs_info_t *fs_info = mt_entry->fs_info; 697 u nsigned32j = 0, i = 0;697 uint32_t j = 0, i = 0; 698 698 699 699 /* dir is not empty */ … … 776 776 ssize_t ret = 0; 777 777 msdos_fs_info_t *fs_info = mt_entry->fs_info; 778 u nsigned32i = 0, j = 0;779 u nsigned32bts2rd = 0;778 uint32_t i = 0, j = 0; 779 uint32_t bts2rd = 0; 780 780 781 781 if (FAT_FD_OF_ROOT_DIR(fat_fd) && … … 885 885 rtems_filesystem_mount_table_entry_t *mt_entry, 886 886 fat_file_fd_t *fat_fd, 887 u nsigned32cl4find,887 uint32_t cl4find, 888 888 fat_auxiliary_t *paux, 889 889 char *dir_entry … … 893 893 ssize_t ret = 0; 894 894 msdos_fs_info_t *fs_info = mt_entry->fs_info; 895 u nsigned32bts2rd = 0;896 u nsigned32i = 0, j = 0;895 uint32_t bts2rd = 0; 896 uint32_t i = 0, j = 0; 897 897 898 898 if (FAT_FD_OF_ROOT_DIR(fat_fd) && -
cpukit/libfs/src/imfs/deviceio.c
r82c123d rf91bbe64 49 49 int rc; 50 50 51 if ((rc = rtems_assoc_remote_by_local(errno_assoc, (u nsigned32) code)))51 if ((rc = rtems_assoc_remote_by_local(errno_assoc, (uint32_t ) code))) 52 52 { 53 53 errno = rc; … … 66 66 rtems_libio_t *iop, 67 67 const char *pathname, 68 u nsigned32flag,69 u nsigned32mode68 uint32_t flag, 69 uint32_t mode 70 70 ) 71 71 { … … 131 131 rtems_libio_t *iop, 132 132 void *buffer, 133 u nsigned32count133 uint32_t count 134 134 ) 135 135 { … … 168 168 rtems_libio_t *iop, 169 169 const void *buffer, 170 u nsigned32count170 uint32_t count 171 171 ) 172 172 { … … 204 204 int device_ioctl( 205 205 rtems_libio_t *iop, 206 u nsigned32command,206 uint32_t command, 207 207 void *buffer 208 208 ) -
cpukit/libfs/src/imfs/imfs.h
r82c123d rf91bbe64 388 388 rtems_libio_t *iop, /* IN */ 389 389 const char *pathname, /* IN */ 390 u nsigned32flag, /* IN */391 u nsigned32mode /* IN */390 uint32_t flag, /* IN */ 391 uint32_t mode /* IN */ 392 392 ); 393 393 … … 399 399 rtems_libio_t *iop, /* IN */ 400 400 void *buffer, /* IN */ 401 u nsigned32count /* IN */401 uint32_t count /* IN */ 402 402 ); 403 403 … … 420 420 rtems_libio_t *iop, /* IN */ 421 421 void *buffer, /* IN */ 422 u nsigned32count /* IN */422 uint32_t count /* IN */ 423 423 ); 424 424 … … 432 432 rtems_libio_t *iop, /* IN */ 433 433 const char *pathname, /* IN */ 434 u nsigned32flag, /* IN */435 u nsigned32mode /* IN */434 uint32_t flag, /* IN */ 435 uint32_t mode /* IN */ 436 436 ); 437 437 … … 443 443 rtems_libio_t *iop, /* IN */ 444 444 void *buffer, /* IN */ 445 u nsigned32count /* IN */445 uint32_t count /* IN */ 446 446 ); 447 447 … … 449 449 rtems_libio_t *iop, /* IN */ 450 450 const void *buffer, /* IN */ 451 u nsigned32count /* IN */451 uint32_t count /* IN */ 452 452 ); 453 453 454 454 int memfile_ioctl( 455 455 rtems_libio_t *iop, /* IN */ 456 u nsigned32command, /* IN */456 uint32_t command, /* IN */ 457 457 void *buffer /* IN */ 458 458 ); … … 471 471 rtems_libio_t *iop, /* IN */ 472 472 const char *pathname, /* IN */ 473 u nsigned32flag, /* IN */474 u nsigned32mode /* IN */473 uint32_t flag, /* IN */ 474 uint32_t mode /* IN */ 475 475 ); 476 476 … … 482 482 rtems_libio_t *iop, /* IN */ 483 483 void *buffer, /* IN */ 484 u nsigned32count /* IN */484 uint32_t count /* IN */ 485 485 ); 486 486 … … 488 488 rtems_libio_t *iop, /* IN */ 489 489 const void *buffer, /* IN */ 490 u nsigned32count /* IN */490 uint32_t count /* IN */ 491 491 ); 492 492 493 493 int device_ioctl( 494 494 rtems_libio_t *iop, /* IN */ 495 u nsigned32command, /* IN */495 uint32_t command, /* IN */ 496 496 void *buffer /* IN */ 497 497 ); -
cpukit/libfs/src/imfs/imfs_directory.c
r82c123d rf91bbe64 42 42 rtems_libio_t *iop, 43 43 const char *pathname, 44 u nsigned32flag,45 u nsigned32mode44 uint32_t flag, 45 uint32_t mode 46 46 ) 47 47 { … … 76 76 rtems_libio_t *iop, 77 77 void *buffer, 78 u nsigned32count78 uint32_t count 79 79 ) 80 80 { -
cpukit/libfs/src/imfs/imfs_fchmod.c
r82c123d rf91bbe64 64 64 (mode & (S_IWUSR | S_IWGRP | S_IWOTH)) ) 65 65 { 66 u nsigned32count = jnode->info.linearfile.size;66 uint32_t count = jnode->info.linearfile.size; 67 67 const unsigned char *buffer = jnode->info.linearfile.direct; 68 68 -
cpukit/libfs/src/imfs/linearfile.c
r82c123d rf91bbe64 41 41 rtems_libio_t *iop, 42 42 void *buffer, 43 u nsigned32count43 uint32_t count 44 44 ) 45 45 { -
cpukit/libfs/src/imfs/memfile.c
r82c123d rf91bbe64 92 92 rtems_libio_t *iop, 93 93 const char *pathname, 94 u nsigned32flag,95 u nsigned32mode94 uint32_t flag, 95 uint32_t mode 96 96 ) 97 97 { … … 138 138 rtems_libio_t *iop, 139 139 void *buffer, 140 u nsigned32count140 uint32_t count 141 141 ) 142 142 { … … 157 157 rtems_libio_t *iop, 158 158 const void *buffer, 159 u nsigned32count159 uint32_t count 160 160 ) 161 161 { … … 181 181 int memfile_ioctl( 182 182 rtems_libio_t *iop, 183 u nsigned32command,183 uint32_t command, 184 184 void *buffer 185 185 )
Note: See TracChangeset
for help on using the changeset viewer.