Changeset f91bbe64 in rtems


Ignore:
Timestamp:
03/22/04 17:10:43 (20 years ago)
Author:
Ralf Corsepius <ralf.corsepius@…>
Branches:
4.10, 4.11, 4.8, 4.9, 5, master
Children:
83c5fc1
Parents:
82c123d
Message:

2004-03-22 Ralf Corsepius <ralf_corsepius@…>

  • libfs/src/dosfs/fat.c, libfs/src/dosfs/fat.h, libfs/src/dosfs/fat_fat_operations.c, libfs/src/dosfs/fat_fat_operations.h, libfs/src/dosfs/fat_file.c, libfs/src/dosfs/fat_file.h, libfs/src/dosfs/msdos.h, libfs/src/dosfs/msdos_create.c, libfs/src/dosfs/msdos_dir.c, libfs/src/dosfs/msdos_file.c, libfs/src/dosfs/msdos_initsupp.c, libfs/src/dosfs/msdos_misc.c, libfs/src/imfs/deviceio.c, libfs/src/imfs/imfs.h, libfs/src/imfs/imfs_directory.c, libfs/src/imfs/imfs_fchmod.c, libfs/src/imfs/linearfile.c, libfs/src/imfs/memfile.c: Convert to using c99 fixed-size types.
Location:
cpukit
Files:
19 edited

Legend:

Unmodified
Added
Removed
  • cpukit/ChangeLog

    r82c123d rf91bbe64  
     12004-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
    1142004-03-05      Joel Sherrill <joel@OARcorp.com>
    215
  • cpukit/libfs/src/dosfs/fat.c

    r82c123d rf91bbe64  
    4747_fat_block_read(
    4848    rtems_filesystem_mount_table_entry_t *mt_entry,
    49     unsigned32                            start,
    50     unsigned32                            offset,
    51     unsigned32                            count,
     49    uint32_t                              start,
     50    uint32_t                              offset,
     51    uint32_t                              count,
    5252    void                                 *buff
    5353    )
     
    5656    register fat_fs_info_t *fs_info = mt_entry->fs_info;
    5757    ssize_t                 cmpltd = 0;
    58     unsigned32              blk = start;
    59     unsigned32              ofs = offset;
     58    uint32_t                blk = start;
     59    uint32_t                ofs = offset;
    6060    bdbuf_buffer           *block = NULL;
    61     unsigned32              c = 0;
     61    uint32_t                c = 0;
    6262 
    6363    while (count > 0)
     
    9898_fat_block_write(
    9999    rtems_filesystem_mount_table_entry_t *mt_entry,
    100     unsigned32                            start,
    101     unsigned32                            offset,
    102     unsigned32                            count,
     100    uint32_t                              start,
     101    uint32_t                              offset,
     102    uint32_t                              count,
    103103    const void                           *buff)
    104104{
     
    106106    fat_fs_info_t *fs_info = mt_entry->fs_info;
    107107    ssize_t        cmpltd = 0;
    108     unsigned32     blk  = start;
    109     unsigned32     ofs = offset;
     108    uint32_t       blk  = start;
     109    uint32_t       ofs = offset;
    110110    bdbuf_buffer  *block = NULL;
    111     unsigned32     c = 0;
     111    uint32_t       c = 0;
    112112 
    113113    while(count > 0)
     
    152152fat_cluster_read(
    153153    rtems_filesystem_mount_table_entry_t *mt_entry,
    154     unsigned32                            cln,
     154    uint32_t                              cln,
    155155    void                                 *buff
    156156    )
    157157{
    158158    fat_fs_info_t *fs_info = mt_entry->fs_info;
    159     unsigned32     fsec = 0;
     159    uint32_t       fsec = 0;
    160160 
    161161    fsec = fat_cluster_num_to_sector_num(mt_entry, cln);
     
    180180fat_cluster_write(
    181181    rtems_filesystem_mount_table_entry_t *mt_entry,
    182     unsigned32                            cln,
     182    uint32_t                              cln,
    183183    const void                           *buff
    184184    )
    185185{
    186186    fat_fs_info_t *fs_info = mt_entry->fs_info;
    187     unsigned32     fsec = 0;
     187    uint32_t       fsec = 0;
    188188 
    189189    fsec = fat_cluster_num_to_sector_num(mt_entry, cln);
     
    209209    fat_fs_info_t      *fs_info = mt_entry->fs_info;     
    210210    register fat_vol_t *vol = &fs_info->vol;
    211     unsigned32          data_secs = 0;
     211    uint32_t            data_secs = 0;
    212212    char                boot_rec[FAT_MAX_BPB_SIZE];
    213213    char                fs_info_sector[FAT_USEFUL_INFO_SIZE];
     
    527527fat_init_clusters_chain(
    528528    rtems_filesystem_mount_table_entry_t *mt_entry,
    529     unsigned32                            start_cln
     529    uint32_t                              start_cln
    530530    )
    531531{
     
    533533    ssize_t                 ret = 0;
    534534    register fat_fs_info_t *fs_info = mt_entry->fs_info;
    535     unsigned32              cur_cln = start_cln;
     535    uint32_t                cur_cln = start_cln;
    536536    char                   *buf;
    537537 
     
    586586 *     
    587587 */
    588 unsigned32
     588uint32_t 
    589589fat_get_unique_ino(rtems_filesystem_mount_table_entry_t *mt_entry)
    590590{
    591591    register fat_fs_info_t *fs_info = mt_entry->fs_info;
    592     unsigned32              j = 0;
     592    uint32_t                j = 0;
    593593    rtems_boolean           resrc_unsuff = FALSE;
    594594
     
    635635fat_free_unique_ino(
    636636    rtems_filesystem_mount_table_entry_t *mt_entry,
    637     unsigned32                            ino
     637    uint32_t                              ino
    638638    )
    639639{
     
    656656fat_ino_is_unique(
    657657    rtems_filesystem_mount_table_entry_t *mt_entry,
    658     unsigned32                            ino
     658    uint32_t                              ino
    659659    )
    660660{
     
    678678fat_fat32_update_fsinfo_sector(
    679679    rtems_filesystem_mount_table_entry_t *mt_entry,
    680     unsigned32                            free_count,
    681     unsigned32                            next_free
     680    uint32_t                              free_count,
     681    uint32_t                              next_free
    682682    )
    683683{
    684684    ssize_t                 ret1 = 0, ret2 = 0;
    685685    register fat_fs_info_t *fs_info = mt_entry->fs_info;
    686     unsigned32              le_free_count = 0;
    687     unsigned32              le_next_free = 0;
     686    uint32_t                le_free_count = 0;
     687    uint32_t                le_next_free = 0;
    688688
    689689    le_free_count = CT_LE_L(free_count);
  • cpukit/libfs/src/dosfs/fat.h

    r82c123d rf91bbe64  
    5252
    5353#if (CPU_BIG_ENDIAN == TRUE)
    54 #    define CF_LE_W(v) CPU_swap_u16((unsigned16)v)
    55 #    define CF_LE_L(v) CPU_swap_u32((unsigned32)v)
    56 #    define CT_LE_W(v) CPU_swap_u16((unsigned16)v)
    57 #    define CT_LE_L(v) CPU_swap_u32((unsigned32)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)
    5858#else 
    5959#    define CF_LE_W(v) (v)
     
    8282#define FAT_FAT32              0x04
    8383 
    84 #define FAT_UNDEFINED_VALUE     (unsigned32)0xFFFFFFFF
     84#define FAT_UNDEFINED_VALUE     (uint32_t  )0xFFFFFFFF
    8585
    8686#define FAT_FAT12_EOC          0x0FF8
    8787#define FAT_FAT16_EOC          0xFFF8
    88 #define FAT_FAT32_EOC          (unsigned32)0x0FFFFFF8
     88#define FAT_FAT32_EOC          (uint32_t  )0x0FFFFFF8
    8989
    9090#define FAT_FAT12_FREE         0x0000
     
    9292#define FAT_FAT32_FREE         0x00000000
    9393
    94 #define FAT_GENFAT_EOC         (unsigned32)0xFFFFFFFF
    95 #define FAT_GENFAT_FREE        (unsigned32)0x00000000
     94#define FAT_GENFAT_EOC         (uint32_t  )0xFFFFFFFF
     95#define FAT_GENFAT_FREE        (uint32_t  )0x00000000
    9696
    9797#define FAT_FAT12_SHIFT        0x04
     
    9999#define FAT_FAT12_MASK         0x00000FFF
    100100#define FAT_FAT16_MASK         0x0000FFFF
    101 #define FAT_FAT32_MASK         (unsigned32)0x0FFFFFFF
     101#define FAT_FAT32_MASK         (uint32_t  )0x0FFFFFFF
    102102
    103103#define FAT_MAX_BPB_SIZE       90
     
    106106#define FAT_USEFUL_INFO_SIZE   12
    107107
    108 #define FAT_VAL8(x, ofs)       (unsigned8)(*((unsigned8 *)(x) + (ofs)))
     108#define FAT_VAL8(x, ofs)       (uint8_t  )(*((uint8_t  *)(x) + (ofs)))
    109109 
    110110#define FAT_VAL16(x, ofs)                                   \
    111     (unsigned16)( (*((unsigned8 *)(x) + (ofs))) |           \
    112                   ((*((unsigned8 *)(x) + (ofs) + 1)) << 8) )
     111    (uint16_t  )( (*((uint8_t  *)(x) + (ofs))) |           \
     112                  ((*((uint8_t  *)(x) + (ofs) + 1)) << 8) )
    113113
    114114#define FAT_VAL32(x, ofs)                                                 \
    115     (unsigned32)( (unsigned32)(*((unsigned8 *)(x) + (ofs))) |             \
    116                   ((unsigned32)(*((unsigned8 *)(x) + (ofs) + 1)) << 8)  | \
    117                   ((unsigned32)(*((unsigned8 *)(x) + (ofs) + 2)) << 16) | \
    118                   ((unsigned32)(*((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) )
    119119                   
    120120/* macros to access boot sector fields */
     
    171171typedef struct fat_vol_s
    172172{
    173     unsigned16   bps;            /* bytes per sector */
    174     unsigned8    sec_log2;       /* log2 of bps */
    175     unsigned8    sec_mul;        /* log2 of 512bts sectors number per sector */
    176     unsigned8    spc;            /* sectors per cluster */
    177     unsigned8    spc_log2;       /* log2 of spc */
    178     unsigned16   bpc;            /* bytes per cluster */
    179     unsigned8    bpc_log2;       /* log2 of bytes per cluster */
    180     unsigned8    fats;           /* number of FATs */
    181     unsigned8    type;           /* FAT type */
    182     unsigned32   mask;
    183     unsigned32   eoc_val;
    184     unsigned16   fat_loc;        /* FAT start */
    185     unsigned32   fat_length;     /* sectors per FAT */
    186     unsigned32   rdir_loc;       /* root directory start */
    187     unsigned16   rdir_entrs;     /* files per root directory */
    188     unsigned32   rdir_secs;      /* sectors per root directory */
    189     unsigned32   rdir_size;      /* root directory size in bytes */
    190     unsigned32   tot_secs;       /* total count of sectors */
    191     unsigned32   data_fsec;      /* first data sector */
    192     unsigned32   data_cls;       /* count of data clusters */
    193     unsigned32   rdir_cl;        /* first cluster of the root directory */
    194     unsigned16   info_sec;       /* FSInfo Sector Structure location */
    195     unsigned32   free_cls;       /* last known free clusters count */
    196     unsigned32   next_cl;        /* next free cluster number */
    197     unsigned8    mirror;         /* mirroring enabla/disable */
    198     unsigned32   afat_loc;       /* active FAT location */
    199     unsigned8    afat;           /* 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 */
    200200    dev_t        dev;            /* device ID */
    201201    disk_device *dd;             /* disk device (see libblock) */
     
    206206typedef struct fat_cache_s
    207207{
    208     unsigned32     blk_num;
     208    uint32_t       blk_num;
    209209    rtems_boolean  modified;
    210     unsigned8      state;
     210    uint8_t        state;
    211211    bdbuf_buffer   *buf;
    212212} fat_cache_t;
     
    222222    Chain_Control *rhash;         /* "rhash" of fat-file descriptors */
    223223    char          *uino;          /* array of unique ino numbers */
    224     unsigned32     index;
    225     unsigned32     uino_pool_size; /* size */
    226     unsigned32     uino_base;
     224    uint32_t       index;
     225    uint32_t       uino_pool_size; /* size */
     226    uint32_t       uino_base;
    227227    fat_cache_t    c;             /* cache */
    228     unsigned8     *sec_buf; /* just placeholder for anything */
     228    uint8_t       *sec_buf; /* just placeholder for anything */
    229229} fat_fs_info_t;
    230230
     
    236236typedef struct fat_auxiliary_s
    237237{
    238     unsigned32 cln;
    239     unsigned32 ofs;
     238    uint32_t  cln;
     239    uint32_t  ofs;
    240240} fat_auxiliary_t;
    241241
     
    259259#define FAT_OP_TYPE_GET   0x2
    260260
    261 static inline unsigned32
     261static inline uint32_t 
    262262fat_cluster_num_to_sector_num(
    263263    rtems_filesystem_mount_table_entry_t *mt_entry,
    264     unsigned32                            cln
     264    uint32_t                              cln
    265265    )
    266266{
     
    274274}
    275275
    276 static inline unsigned32
     276static inline uint32_t 
    277277fat_cluster_num_to_sector512_num(
    278278    rtems_filesystem_mount_table_entry_t *mt_entry,
    279     unsigned32                            cln
     279    uint32_t                              cln
    280280    )
    281281{
     
    290290
    291291static inline int
    292 fat_buf_access(fat_fs_info_t *fs_info, unsigned32 blk, int op_type,
     292fat_buf_access(fat_fs_info_t *fs_info, uint32_t  blk, int op_type,
    293293               bdbuf_buffer **buf)
    294294{
    295295    rtems_status_code sc = RTEMS_SUCCESSFUL;
    296     unsigned8         i;
     296    uint8_t           i;
    297297    rtems_boolean     sec_of_fat;
    298298   
     
    373373{
    374374    rtems_status_code sc = RTEMS_SUCCESSFUL;
    375     unsigned8         i;
     375    uint8_t           i;
    376376    rtems_boolean     sec_of_fat;
    377377       
     
    431431ssize_t
    432432_fat_block_read(rtems_filesystem_mount_table_entry_t *mt_entry,
    433                 unsigned32                            start,
    434                 unsigned32                            offset,
    435                 unsigned32                            count,
     433                uint32_t                              start,
     434                uint32_t                              offset,
     435                uint32_t                              count,
    436436                void                                 *buff);
    437437
    438438ssize_t
    439439_fat_block_write(rtems_filesystem_mount_table_entry_t *mt_entry,
    440                  unsigned32                            start,
    441                  unsigned32                            offset,
    442                  unsigned32                            count,
     440                 uint32_t                              start,
     441                 uint32_t                              offset,
     442                 uint32_t                              count,
    443443                 const void                           *buff);
    444444
    445445ssize_t
    446446fat_cluster_read(rtems_filesystem_mount_table_entry_t *mt_entry,
    447                   unsigned32                           cln,
     447                  uint32_t                             cln,
    448448                  void                                *buff);
    449449
    450450ssize_t
    451451fat_cluster_write(rtems_filesystem_mount_table_entry_t *mt_entry,
    452                    unsigned32                           cln,
     452                   uint32_t                             cln,
    453453                   const void                          *buff);
    454454
     
    458458int
    459459fat_init_clusters_chain(rtems_filesystem_mount_table_entry_t *mt_entry,
    460                         unsigned32                            start_cln);
    461 
    462 unsigned32
     460                        uint32_t                              start_cln);
     461
     462uint32_t 
    463463fat_cluster_num_to_sector_num(rtems_filesystem_mount_table_entry_t *mt_entry,
    464                               unsigned32                            cln);
     464                              uint32_t                              cln);
    465465
    466466int
     
    468468
    469469
    470 unsigned32
     470uint32_t 
    471471fat_get_unique_ino(rtems_filesystem_mount_table_entry_t *mt_entry);
    472472                                                           
    473473rtems_boolean
    474474fat_ino_is_unique(rtems_filesystem_mount_table_entry_t *mt_entry,
    475                   unsigned32                            ino);
     475                  uint32_t                              ino);
    476476
    477477void
    478478fat_free_unique_ino(rtems_filesystem_mount_table_entry_t *mt_entry,
    479                     unsigned32                            ino);
     479                    uint32_t                              ino);
    480480
    481481int
    482482fat_fat32_update_fsinfo_sector(
    483483  rtems_filesystem_mount_table_entry_t *mt_entry,
    484   unsigned32                            free_count,
    485   unsigned32                            next_free
     484  uint32_t                              free_count,
     485  uint32_t                              next_free
    486486  );
    487487                       
  • cpukit/libfs/src/dosfs/fat_fat_operations.c

    r82c123d rf91bbe64  
    4545fat_scan_fat_for_free_clusters(
    4646    rtems_filesystem_mount_table_entry_t *mt_entry,
    47     unsigned32                           *chain,
    48     unsigned32                            count,
    49     unsigned32                           *cls_added,
    50     unsigned32                           *last_cl
     47    uint32_t                             *chain,
     48    uint32_t                              count,
     49    uint32_t                             *cls_added,
     50    uint32_t                             *last_cl
    5151    )
    5252{
    5353    int            rc = RC_OK;
    5454    fat_fs_info_t *fs_info = mt_entry->fs_info;
    55     unsigned32     cl4find = 2;
    56     unsigned32     next_cln = 0;
    57     unsigned32     save_cln = 0;
    58     unsigned32     data_cls_val = fs_info->vol.data_cls + 2;
    59     unsigned32     i = 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;
    6060 
    6161    *cls_added = 0;   
     
    167167fat_free_fat_clusters_chain(
    168168    rtems_filesystem_mount_table_entry_t *mt_entry,
    169     unsigned32                            chain
     169    uint32_t                              chain
    170170    )
    171171{
    172172    int            rc = RC_OK, rc1 = RC_OK;
    173173    fat_fs_info_t *fs_info = mt_entry->fs_info;
    174     unsigned32     cur_cln = chain;
    175     unsigned32     next_cln = 0;
    176     unsigned32     freed_cls_cnt = 0;
     174    uint32_t       cur_cln = chain;
     175    uint32_t       next_cln = 0;
     176    uint32_t       freed_cls_cnt = 0;
    177177   
    178178    while ((cur_cln & fs_info->vol.mask) < fs_info->vol.eoc_val)
     
    224224fat_get_fat_cluster(
    225225    rtems_filesystem_mount_table_entry_t *mt_entry,
    226     unsigned32                            cln,
    227     unsigned32                           *ret_val
     226    uint32_t                              cln,
     227    uint32_t                             *ret_val
    228228    )
    229229{
     
    231231    register fat_fs_info_t *fs_info = mt_entry->fs_info;
    232232    bdbuf_buffer           *block0 = NULL;
    233     unsigned32              sec = 0;
    234     unsigned32              ofs = 0;
     233    uint32_t                sec = 0;
     234    uint32_t                ofs = 0;
    235235
    236236    /* sanity check */
     
    253253             * align problems for some architectures
    254254             */
    255             *ret_val = (*((unsigned8 *)(block0->buffer + ofs)));
     255            *ret_val = (*((uint8_t  *)(block0->buffer + ofs)));
    256256            if ( ofs == (fs_info->vol.bps - 1) )
    257257            {
     
    261261                    return rc;
    262262
    263                 *ret_val |= (*((unsigned8 *)(block0->buffer)))<<8;
     263                *ret_val |= (*((uint8_t  *)(block0->buffer)))<<8;
    264264            }
    265265            else
    266266            { 
    267                 *ret_val |= (*((unsigned8 *)(block0->buffer + ofs + 1)))<<8;
     267                *ret_val |= (*((uint8_t  *)(block0->buffer + ofs + 1)))<<8;
    268268            }
    269269
     
    275275
    276276        case FAT_FAT16:
    277             *ret_val = *((unsigned16 *)(block0->buffer + ofs));
     277            *ret_val = *((uint16_t  *)(block0->buffer + ofs));
    278278            *ret_val = CF_LE_W(*ret_val);
    279279            break;
    280280
    281281        case FAT_FAT32:
    282             *ret_val = *((unsigned32 *)(block0->buffer + ofs));
     282            *ret_val = *((uint32_t  *)(block0->buffer + ofs));
    283283            *ret_val = CF_LE_L(*ret_val);
    284284            break;
     
    308308fat_set_fat_cluster(
    309309    rtems_filesystem_mount_table_entry_t *mt_entry,
    310     unsigned32                            cln,
    311     unsigned32                            in_val
     310    uint32_t                              cln,
     311    uint32_t                              in_val
    312312    )
    313313{
    314314    int                rc = RC_OK;
    315315    fat_fs_info_t     *fs_info = mt_entry->fs_info;
    316     unsigned32         sec = 0;
    317     unsigned32         ofs = 0;
    318     unsigned16         fat16_clv = 0;
    319     unsigned32         fat32_clv = 0;
     316    uint32_t           sec = 0;
     317    uint32_t           ofs = 0;
     318    uint16_t           fat16_clv = 0;
     319    uint32_t           fat32_clv = 0;
    320320    bdbuf_buffer      *block0 = NULL; 
    321321
     
    337337            if ( FAT_CLUSTER_IS_ODD(cln) )
    338338            {
    339                 fat16_clv = ((unsigned16)in_val) << FAT_FAT12_SHIFT;
    340                 *((unsigned8 *)(block0->buffer + ofs)) =
    341                         (*((unsigned8 *)(block0->buffer + ofs))) & 0x0F;
    342 
    343                 *((unsigned8 *)(block0->buffer + ofs)) =
    344                         (*((unsigned8 *)(block0->buffer + ofs))) |
    345                         (unsigned8)(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);
    346346
    347347                fat_buf_mark_modified(fs_info);
     
    354354                        return rc;
    355355
    356                      *((unsigned8 *)(block0->buffer)) &= 0x00;
     356                     *((uint8_t  *)(block0->buffer)) &= 0x00;
    357357 
    358                      *((unsigned8 *)(block0->buffer)) =
    359                             (*((unsigned8 *)(block0->buffer))) |
    360                             (unsigned8)((fat16_clv & 0xFF00)>>8);
     358                     *((uint8_t  *)(block0->buffer)) =
     359                            (*((uint8_t  *)(block0->buffer))) |
     360                            (uint8_t  )((fat16_clv & 0xFF00)>>8);
    361361                     
    362362                     fat_buf_mark_modified(fs_info);
     
    364364                else
    365365                {
    366                     *((unsigned8 *)(block0->buffer + ofs + 1)) &= 0x00;
     366                    *((uint8_t  *)(block0->buffer + ofs + 1)) &= 0x00;
    367367             
    368                     *((unsigned8 *)(block0->buffer + ofs + 1)) =
    369                             (*((unsigned8 *)(block0->buffer + ofs + 1))) |
    370                             (unsigned8)((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);
    371371                } 
    372372            }
    373373            else
    374374            {
    375                 fat16_clv = ((unsigned16)in_val) & FAT_FAT12_MASK;
    376                 *((unsigned8 *)(block0->buffer + ofs)) &= 0x00;
    377 
    378                 *((unsigned8 *)(block0->buffer + ofs)) =
    379                         (*((unsigned8 *)(block0->buffer + ofs))) |
    380                         (unsigned8)(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);
    381381                       
    382382                fat_buf_mark_modified(fs_info);         
     
    389389                        return rc;
    390390
    391                     *((unsigned8 *)(block0->buffer)) =
    392                             (*((unsigned8 *)(block0->buffer))) & 0xF0;
     391                    *((uint8_t  *)(block0->buffer)) =
     392                            (*((uint8_t  *)(block0->buffer))) & 0xF0;
    393393 
    394                     *((unsigned8 *)(block0->buffer)) =
    395                             (*((unsigned8 *)(block0->buffer))) |
    396                             (unsigned8)((fat16_clv & 0xFF00)>>8);
     394                    *((uint8_t  *)(block0->buffer)) =
     395                            (*((uint8_t  *)(block0->buffer))) |
     396                            (uint8_t  )((fat16_clv & 0xFF00)>>8);
    397397                           
    398398                    fat_buf_mark_modified(fs_info);       
     
    400400                else
    401401                {
    402                     *((unsigned8 *)(block0->buffer + ofs + 1)) =   
    403                       (*((unsigned8 *)(block0->buffer + ofs + 1))) & 0xF0;
    404 
    405                     *((unsigned8 *)(block0->buffer + ofs+1)) =
    406                            (*((unsigned8 *)(block0->buffer + ofs+1))) |
    407                            (unsigned8)((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);
    408408                } 
    409409            }
     
    411411
    412412        case FAT_FAT16:
    413             *((unsigned16 *)(block0->buffer + ofs)) =
    414                     (unsigned16)(CT_LE_W(in_val));
     413            *((uint16_t  *)(block0->buffer + ofs)) =
     414                    (uint16_t  )(CT_LE_W(in_val));
    415415            fat_buf_mark_modified(fs_info);       
    416416            break;
     
    419419            fat32_clv = CT_LE_L((in_val & FAT_FAT32_MASK));
    420420
    421             *((unsigned32 *)(block0->buffer + ofs)) =
    422             (*((unsigned32 *)(block0->buffer + ofs))) & (CT_LE_L(0xF0000000));
    423 
    424             *((unsigned32 *)(block0->buffer + ofs)) =
    425                    fat32_clv | (*((unsigned32 *)(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)));
    426426           
    427427            fat_buf_mark_modified(fs_info);
  • cpukit/libfs/src/dosfs/fat_fat_operations.h

    r82c123d rf91bbe64  
    2929int
    3030fat_get_fat_cluster(rtems_filesystem_mount_table_entry_t *mt_entry,
    31                     unsigned32                            cln,
    32                     unsigned32                           *ret_val);
     31                    uint32_t                              cln,
     32                    uint32_t                             *ret_val);
    3333
    3434int
    3535fat_set_fat_cluster(rtems_filesystem_mount_table_entry_t *mt_entry,
    36                     unsigned32                            cln,
    37                     unsigned32                            in_val);
     36                    uint32_t                              cln,
     37                    uint32_t                              in_val);
    3838
    3939int
    4040fat_scan_fat_for_free_clusters(
    4141    rtems_filesystem_mount_table_entry_t *mt_entry,
    42     unsigned32                           *chain,
    43     unsigned32                            count,
    44     unsigned32                           *cls_added,
    45     unsigned32                           *last_cl
     42    uint32_t                             *chain,
     43    uint32_t                              count,
     44    uint32_t                             *cls_added,
     45    uint32_t                             *last_cl
    4646);
    4747
     
    4949fat_free_fat_clusters_chain(
    5050    rtems_filesystem_mount_table_entry_t *mt_entry,
    51     unsigned32                            chain
     51    uint32_t                              chain
    5252);
    5353
  • cpukit/libfs/src/dosfs/fat_file.c

    r82c123d rf91bbe64  
    3232
    3333static inline void
    34 _hash_insert(Chain_Control *hash, unsigned32 key1, unsigned32 key2,
     34_hash_insert(Chain_Control *hash, uint32_t   key1, uint32_t  key2,
    3535             fat_file_fd_t *el);
    3636
    3737static inline void
    38 _hash_delete(Chain_Control *hash, unsigned32 key1, unsigned32 key2,
     38_hash_delete(Chain_Control *hash, uint32_t   key1, uint32_t  key2,
    3939             fat_file_fd_t *el);
    4040
     
    4343    rtems_filesystem_mount_table_entry_t  *mt_entry,
    4444    Chain_Control                         *hash,
    45     unsigned32                             key1,
    46     unsigned32                             key2,
     45    uint32_t                               key1,
     46    uint32_t                               key2,
    4747    fat_file_fd_t                          **ret
    4848);
     
    5252    rtems_filesystem_mount_table_entry_t  *mt_entry,
    5353    fat_file_fd_t                         *fat_fd,
    54     unsigned32                             file_cln,
    55     unsigned32                            *disk_cln
     54    uint32_t                               file_cln,
     55    uint32_t                              *disk_cln
    5656);
    5757
     
    8585fat_file_open(
    8686    rtems_filesystem_mount_table_entry_t  *mt_entry,
    87     unsigned32                             cln,
    88     unsigned32                             ofs, 
     87    uint32_t                               cln,
     88    uint32_t                               ofs, 
    8989    fat_file_fd_t                        **fat_fd
    9090    )
     
    9393    fat_fs_info_t *fs_info = mt_entry->fs_info;
    9494    fat_file_fd_t *lfat_fd = NULL;
    95     unsigned32     key = 0;
     95    uint32_t       key = 0;
    9696 
    9797    /* construct key */
     
    190190    int            rc = RC_OK;
    191191    fat_fs_info_t *fs_info = mt_entry->fs_info;
    192     unsigned32     key = 0;
     192    uint32_t       key = 0;
    193193
    194194    /*
     
    257257    rtems_filesystem_mount_table_entry_t *mt_entry,
    258258    fat_file_fd_t                        *fat_fd,
    259     unsigned32                            start,
    260     unsigned32                            count,
     259    uint32_t                              start,
     260    uint32_t                              count,
    261261    char                                 *buf
    262262    )
     
    265265    ssize_t        ret = 0;
    266266    fat_fs_info_t *fs_info = mt_entry->fs_info;
    267     unsigned32     cmpltd = 0;
    268     unsigned32     cur_cln = 0;
    269     unsigned32     cl_start = 0;
    270     unsigned32     save_cln = 0;
    271     unsigned32     ofs = 0;
    272     unsigned32     save_ofs;
    273     unsigned32     sec = 0;
    274     unsigned32     byte = 0;
    275     unsigned32     c = 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;
    276276
    277277    /* it couldn't be removed - otherwise cache update will be broken */
     
    362362    rtems_filesystem_mount_table_entry_t *mt_entry,
    363363    fat_file_fd_t                        *fat_fd,
    364     unsigned32                            start,
    365     unsigned32                            count,
     364    uint32_t                              start,
     365    uint32_t                              count,
    366366    const char                            *buf
    367367    )
     
    370370    ssize_t        ret = 0;
    371371    fat_fs_info_t *fs_info = mt_entry->fs_info;
    372     unsigned32     cmpltd = 0;
    373     unsigned32     cur_cln = 0;
    374     unsigned32     save_cln = 0; /* FIXME: This might be incorrect, cf. below */
    375     unsigned32     cl_start = 0;
    376     unsigned32     ofs = 0; 
    377     unsigned32     save_ofs;
    378     unsigned32     sec = 0;
    379     unsigned32     byte = 0;
    380     unsigned32     c = 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;
    381381 
    382382    if ( count == 0 )
     
    473473    rtems_filesystem_mount_table_entry_t *mt_entry,
    474474    fat_file_fd_t                        *fat_fd,
    475     unsigned32                            new_length,
    476     unsigned32                           *a_length
     475    uint32_t                              new_length,
     476    uint32_t                             *a_length
    477477    )
    478478{
    479479    int            rc = RC_OK;
    480480    fat_fs_info_t *fs_info = mt_entry->fs_info;
    481     unsigned32     chain = 0;
    482     unsigned32     bytes2add = 0;
    483     unsigned32     cls2add = 0;
    484     unsigned32     old_last_cl;
    485     unsigned32     last_cl = 0;
    486     unsigned32     bytes_remain = 0;
    487     unsigned32     cls_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;
    488488 
    489489    *a_length = new_length;
     
    601601    rtems_filesystem_mount_table_entry_t *mt_entry,
    602602    fat_file_fd_t                        *fat_fd,     
    603     unsigned32                            new_length
     603    uint32_t                              new_length
    604604    )
    605605{
    606606    int            rc = RC_OK;
    607607    fat_fs_info_t *fs_info = mt_entry->fs_info;
    608     unsigned32     cur_cln = 0;
    609     unsigned32     cl_start = 0;
    610     unsigned32     new_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;
    611611 
    612612   
     
    672672    int            rc = RC_OK;
    673673    fat_fs_info_t *fs_info = mt_entry->fs_info;
    674     unsigned32     cur_cln = 0;
    675     unsigned32     cl_start = 0;
    676     unsigned32     pos = 0;
    677     unsigned32    *ret;
     674    uint32_t       cur_cln = 0;
     675    uint32_t       cl_start = 0;
     676    uint32_t       pos = 0;
     677    uint32_t      *ret;
    678678    va_list        ap;
    679679 
     
    683683    {
    684684        case F_CLU_NUM:
    685             pos = va_arg(ap, unsigned32);
    686             ret = va_arg(ap, unsigned32 *);
     685            pos = va_arg(ap, uint32_t  );
     686            ret = va_arg(ap, uint32_t  *);
    687687
    688688            /* sanity check */
     
    733733{
    734734    fat_fs_info_t *fs_info = mt_entry->fs_info;
    735     unsigned32     key = 0;
     735    uint32_t       key = 0;
    736736 
    737737    key = fat_construct_key(mt_entry, fat_fd->info_cln, fat_fd->info_ofs);
     
    763763    rtems_status_code  sc = RTEMS_SUCCESSFUL;
    764764    fat_fs_info_t     *fs_info = mt_entry->fs_info;
    765     unsigned32         cur_cln = fat_fd->cln;
     765    uint32_t           cur_cln = fat_fd->cln;
    766766    bdbuf_buffer      *block = NULL;
    767     unsigned32         sec = 0;
    768     unsigned32         i = 0;
     767    uint32_t           sec = 0;
     768    uint32_t           i = 0;
    769769 
    770770    if (fat_fd->fat_file_size == 0)
     
    827827    int            rc = RC_OK;
    828828    fat_fs_info_t *fs_info = mt_entry->fs_info;
    829     unsigned32     cur_cln = fat_fd->cln;
    830     unsigned32     save_cln = 0;
     829    uint32_t       cur_cln = fat_fd->cln;
     830    uint32_t       save_cln = 0;
    831831 
    832832    /* Have we requested root dir size for FAT12/16? */
     
    868868 */
    869869static inline void
    870 _hash_insert(Chain_Control *hash, unsigned32 key1, unsigned32 key2,
     870_hash_insert(Chain_Control *hash, uint32_t   key1, uint32_t  key2,
    871871             fat_file_fd_t *el)
    872872{
     
    888888 */
    889889static inline void
    890 _hash_delete(Chain_Control *hash, unsigned32 key1, unsigned32 key2,
     890_hash_delete(Chain_Control *hash, uint32_t   key1, uint32_t  key2,
    891891             fat_file_fd_t *el)
    892892{
     
    912912    rtems_filesystem_mount_table_entry_t  *mt_entry,
    913913    Chain_Control                         *hash,
    914     unsigned32                             key1,
    915     unsigned32                             key2,
     914    uint32_t                               key1,
     915    uint32_t                               key2,
    916916    fat_file_fd_t                          **ret
    917917    )
    918918{                         
    919     unsigned32 mod = (key1) % FAT_HASH_MODULE;
     919    uint32_t  mod = (key1) % FAT_HASH_MODULE;
    920920    Chain_Node *the_node = ((Chain_Control *)((hash) + mod))->first;
    921921
     
    923923    {
    924924        fat_file_fd_t *ffd = (fat_file_fd_t *)the_node;
    925         unsigned32 ck =
     925        uint32_t  ck =
    926926                fat_construct_key(mt_entry, ffd->info_cln, ffd->info_ofs);
    927927
     
    943943    rtems_filesystem_mount_table_entry_t  *mt_entry,
    944944    fat_file_fd_t                         *fat_fd,
    945     unsigned32                             file_cln,
    946     unsigned32                            *disk_cln
     945    uint32_t                               file_cln,
     946    uint32_t                              *disk_cln
    947947    )
    948948{
     
    955955    else
    956956    {
    957         unsigned32 cur_cln;
    958         unsigned32 count;
    959         unsigned32 i;
     957        uint32_t  cur_cln;
     958        uint32_t  count;
     959        uint32_t  i;
    960960       
    961961        if (file_cln > fat_fd->map.file_cln)
  • cpukit/libfs/src/dosfs/fat_file.h

    r82c123d rf91bbe64  
    4747typedef struct fat_file_map_s
    4848{
    49     unsigned32 file_cln;
    50     unsigned32 disk_cln;
    51     unsigned32 last_cln;
     49    uint32_t  file_cln;
     50    uint32_t  disk_cln;
     51    uint32_t  last_cln;
    5252} fat_file_map_t;
    5353/*
     
    6363                                    * field
    6464                                    */
    65     unsigned32      links_num;     /*
     65    uint32_t        links_num;     /*
    6666                                    * the number of fat_file_open call on
    6767                                    * this fat-file
    6868                                    */
    69     unsigned32      ino;           /* inode, file serial number :)))) */                               
     69    uint32_t        ino;           /* inode, file serial number :)))) */                               
    7070    fat_file_type_t fat_file_type;
    71     unsigned32      size_limit;
    72     unsigned32      fat_file_size; /* length  */
    73     unsigned32      info_cln;
    74     unsigned32      cln;
    75     unsigned16      info_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;     
    7676    unsigned char   first_char;
    77     unsigned8       flags;
     77    uint8_t         flags;
    7878    fat_file_map_t  map;
    7979    time_t          mtime;
     
    120120 *     constructed key
    121121 */
    122 static inline unsigned32
     122static inline uint32_t 
    123123fat_construct_key(
    124124    rtems_filesystem_mount_table_entry_t *mt_entry,
    125     unsigned32                            cl,
    126     unsigned32                            ofs)
     125    uint32_t                              cl,
     126    uint32_t                              ofs)
    127127{
    128128    return ( ((fat_cluster_num_to_sector512_num(mt_entry, cl) +
     
    134134int
    135135fat_file_open(rtems_filesystem_mount_table_entry_t  *mt_entry,
    136               unsigned32                             cln,
    137               unsigned32                             ofs,
     136              uint32_t                               cln,
     137              uint32_t                               ofs,
    138138              fat_file_fd_t                        **fat_fd);
    139139
     
    148148fat_file_read(rtems_filesystem_mount_table_entry_t *mt_entry,
    149149              fat_file_fd_t                        *fat_fd,
    150               unsigned32                            start,
    151               unsigned32                            count,
     150              uint32_t                              start,
     151              uint32_t                              count,
    152152              char                                 *buf);
    153153
     
    155155fat_file_write(rtems_filesystem_mount_table_entry_t *mt_entry,
    156156               fat_file_fd_t                        *fat_fd,
    157                unsigned32                            start,
    158                unsigned32                            count,
     157               uint32_t                              start,
     158               uint32_t                              count,
    159159               const char                            *buf);
    160160
     
    162162fat_file_extend(rtems_filesystem_mount_table_entry_t *mt_entry,
    163163                fat_file_fd_t                        *fat_fd,
    164                 unsigned32                            new_length,
    165                 unsigned32                           *a_length);
     164                uint32_t                              new_length,
     165                uint32_t                             *a_length);
    166166
    167167int
    168168fat_file_truncate(rtems_filesystem_mount_table_entry_t *mt_entry,
    169169                  fat_file_fd_t                        *fat_fd,
    170                   unsigned32                            new_length);
     170                  uint32_t                              new_length);
    171171                 
    172172int
  • cpukit/libfs/src/dosfs/msdos.h

    r82c123d rf91bbe64  
    5959                                                           * the volume
    6060                                                           */
    61     unsigned8                        *cl_buf;              /*
     61    uint8_t                          *cl_buf;              /*
    6262                                                            * just placeholder
    6363                                                            * for anything
     
    8888#define MSDOS_DIRECTORY_ENTRY_STRUCT_SIZE    32 /* 32 bytes */
    8989
    90 #define MSDOS_DIR_NAME(x)                 (unsigned8 *)((x) + 0)
    91 #define MSDOS_DIR_ATTR(x)                 (unsigned8 *)((x) + 11)
    92 #define MSDOS_DIR_NT_RES(x)               (unsigned8 *)((x) + 12)
    93 #define MSDOS_DIR_CRT_TIME_TENTH(x)       (unsigned8 *)((x) + 13)
    94 #define MSDOS_DIR_CRT_TIME(x)             (unsigned16 *)((x) + 14)
    95 #define MSDOS_DIR_CRT_DATE(x)             (unsigned16 *)((x) + 16)
    96 #define MSDOS_DIR_LAST_ACCESS_DATE(x)     (unsigned16 *)((x) + 18)
    97 #define MSDOS_DIR_FIRST_CLUSTER_HI(x)     (unsigned16 *)((x) + 20)
    98 #define MSDOS_DIR_WRITE_TIME(x)           (unsigned16 *)((x) + 22)
    99 #define MSDOS_DIR_WRITE_DATE(x)           (unsigned16 *)((x) + 24)
    100 #define MSDOS_DIR_FIRST_CLUSTER_LOW(x)    (unsigned16 *)((x) + 26)
    101 #define MSDOS_DIR_FILE_SIZE(x)            (unsigned32 *)((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)
    102102
    103103#define MSDOS_EXTRACT_CLUSTER_NUM(p)                                         \
    104             (unsigned32)( (CF_LE_W(*MSDOS_DIR_FIRST_CLUSTER_LOW(p))) |       \
    105                           ((unsigned32)(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) )
    106106
    107107/*
     
    248248  rtems_libio_t *iop,             /* IN  */
    249249  const char    *pathname,        /* IN  */
    250   unsigned32     flag,            /* IN  */
    251   unsigned32     mode             /* IN  */
     250  uint32_t       flag,            /* IN  */
     251  uint32_t       mode             /* IN  */
    252252);
    253253
     
    259259  rtems_libio_t *iop,              /* IN  */
    260260  void          *buffer,           /* IN  */
    261   unsigned32     count             /* IN  */
     261  uint32_t       count             /* IN  */
    262262);
    263263
     
    266266  rtems_libio_t *iop,             /* IN  */
    267267  const void    *buffer,          /* IN  */
    268   unsigned32     count            /* IN  */
     268  uint32_t       count            /* IN  */
    269269);
    270270
     
    295295msdos_file_ioctl(
    296296  rtems_libio_t *iop,             /* IN  */
    297   unsigned32     command,         /* IN  */
     297  uint32_t       command,         /* IN  */
    298298  void          *buffer           /* IN  */
    299299);
     
    311311  rtems_libio_t *iop,             /* IN  */
    312312  const char    *pathname,        /* IN  */
    313   unsigned32     flag,            /* IN  */
    314   unsigned32     mode             /* IN  */
     313  uint32_t       flag,            /* IN  */
     314  uint32_t       mode             /* IN  */
    315315);
    316316
     
    322322  rtems_libio_t *iop,              /* IN  */
    323323  void          *buffer,           /* IN  */
    324   unsigned32     count             /* IN  */
     324  uint32_t       count             /* IN  */
    325325);
    326326
     
    389389int
    390390msdos_set_first_char4file_name(rtems_filesystem_mount_table_entry_t *mt_entry,
    391                                unsigned32  cl,
    392                                unsigned32  ofs,
     391                               uint32_t    cl,
     392                               uint32_t    ofs,
    393393                               unsigned char first_char);
    394394
     
    417417    rtems_filesystem_mount_table_entry_t *mt_entry,
    418418    fat_file_fd_t                        *fat_fd,
    419     unsigned32                            cl4find,
     419    uint32_t                              cl4find,
    420420    fat_auxiliary_t                      *paux,
    421421    char                                 *dir_entry
     
    425425msdos_get_dotdot_dir_info_cluster_num_and_offset(
    426426    rtems_filesystem_mount_table_entry_t *mt_entry,
    427     unsigned32                            cln,
     427    uint32_t                              cln,
    428428    fat_auxiliary_t                      *paux,
    429429    char                                 *dir_entry
  • cpukit/libfs/src/dosfs/msdos_create.c

    r82c123d rf91bbe64  
    6363    fat_file_fd_t   *fat_fd = NULL;
    6464    time_t           time_ret = 0;
    65     unsigned16       time_val = 0;
    66     unsigned16       date = 0;
     65    uint16_t         time_val = 0;
     66    uint16_t         date = 0;
    6767    fat_auxiliary_t  aux;
    6868    unsigned char    new_node  [MSDOS_DIRECTORY_ENTRY_STRUCT_SIZE];
    6969    unsigned char    dot_dotdot[MSDOS_DIRECTORY_ENTRY_STRUCT_SIZE * 2];
    7070    unsigned char    link_node [MSDOS_DIRECTORY_ENTRY_STRUCT_SIZE];
    71     unsigned32       sec = 0;
    72     unsigned32       byte = 0;
     71    uint32_t         sec = 0;
     72    uint32_t         byte = 0;
    7373   
    7474    memset(new_node, 0, MSDOS_DIRECTORY_ENTRY_STRUCT_SIZE);
     
    203203        {
    204204            *MSDOS_DIR_FIRST_CLUSTER_LOW(DOTDOT_NODE_P(dot_dotdot)) =
    205                 CT_LE_W((unsigned16)((parent_fat_fd->cln) & 0x0000FFFF));
     205                CT_LE_W((uint16_t  )((parent_fat_fd->cln) & 0x0000FFFF));
    206206            *MSDOS_DIR_FIRST_CLUSTER_HI(DOTDOT_NODE_P(dot_dotdot)) =
    207                 CT_LE_W((unsigned16)(((parent_fat_fd->cln) & 0xFFFF0000)>>16));
     207                CT_LE_W((uint16_t  )(((parent_fat_fd->cln) & 0xFFFF0000)>>16));
    208208        }       
    209209   
     
    227227        /* set up cluster num for dot entry */
    228228        *MSDOS_DIR_FIRST_CLUSTER_LOW(DOT_NODE_P(dot_dotdot)) =
    229                 CT_LE_W((unsigned16)((fat_fd->cln) & 0x0000FFFF));
     229                CT_LE_W((uint16_t  )((fat_fd->cln) & 0x0000FFFF));
    230230        *MSDOS_DIR_FIRST_CLUSTER_HI(DOT_NODE_P(dot_dotdot)) =
    231                 CT_LE_W((unsigned16)(((fat_fd->cln) & 0xFFFF0000) >> 16));
     231                CT_LE_W((uint16_t  )(((fat_fd->cln) & 0xFFFF0000) >> 16));
    232232
    233233        /* rewrite dot entry */
  • cpukit/libfs/src/dosfs/msdos_dir.c

    r82c123d rf91bbe64  
    4646 */
    4747int
    48 msdos_dir_open(rtems_libio_t *iop, const char *pathname, unsigned32 flag,
    49                unsigned32 mode)
     48msdos_dir_open(rtems_libio_t *iop, const char *pathname, uint32_t  flag,
     49               uint32_t  mode)
    5050{
    5151    int                rc = RC_OK; 
     
    197197 */
    198198ssize_t
    199 msdos_dir_read(rtems_libio_t *iop, void *buffer, unsigned32 count)
     199msdos_dir_read(rtems_libio_t *iop, void *buffer, uint32_t  count)
    200200{
    201201    int                rc = RC_OK;
     
    205205    fat_file_fd_t     *tmp_fat_fd = NULL;
    206206    struct dirent      tmp_dirent;
    207     unsigned32         start = 0;
     207    uint32_t           start = 0;
    208208    ssize_t            ret = 0;
    209     unsigned32         cmpltd = 0;
    210     unsigned32         j = 0, i = 0;
    211     unsigned32         bts2rd = 0;
    212     unsigned32         cur_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;
    213213 
    214214    /*
  • cpukit/libfs/src/dosfs/msdos_file.c

    r82c123d rf91bbe64  
    4343 */
    4444int
    45 msdos_file_open(rtems_libio_t *iop, const char *pathname, unsigned32 flag,
    46                 unsigned32 mode)
     45msdos_file_open(rtems_libio_t *iop, const char *pathname, uint32_t  flag,
     46                uint32_t  mode)
    4747{
    4848    int                rc = RC_OK;
     
    145145 */
    146146ssize_t
    147 msdos_file_read(rtems_libio_t *iop, void *buffer, unsigned32 count)
     147msdos_file_read(rtems_libio_t *iop, void *buffer, uint32_t  count)
    148148{
    149149    ssize_t            ret = 0;
     
    178178 */
    179179ssize_t
    180 msdos_file_write(rtems_libio_t *iop,const void *buffer, unsigned32 count)
     180msdos_file_write(rtems_libio_t *iop,const void *buffer, uint32_t  count)
    181181{
    182182    ssize_t            ret = 0;
     
    231231    msdos_fs_info_t   *fs_info = iop->pathinfo.mt_entry->fs_info;
    232232    fat_file_fd_t     *fat_fd = iop->file_info;
    233     unsigned32         real_size = 0;
     233    uint32_t           real_size = 0;
    234234
    235235    sc = rtems_semaphore_obtain(fs_info->vol_sema, RTEMS_WAIT,
     
    438438 */
    439439int
    440 msdos_file_ioctl(rtems_libio_t *iop,unsigned32 command, void *buffer)
     440msdos_file_ioctl(rtems_libio_t *iop,uint32_t  command, void *buffer)
    441441{
    442442    int rc = RC_OK;
  • cpukit/libfs/src/dosfs/msdos_initsupp.c

    r82c123d rf91bbe64  
    5858    msdos_fs_info_t   *fs_info = NULL;
    5959    fat_file_fd_t     *fat_fd = NULL;
    60     unsigned32         cl_buf_size;
     60    uint32_t           cl_buf_size;
    6161
    6262    fs_info = (msdos_fs_info_t *)calloc(1, sizeof(msdos_fs_info_t));
  • cpukit/libfs/src/dosfs/msdos_misc.c

    r82c123d rf91bbe64  
    265265    msdos_fs_info_t *fs_info = parent_loc->mt_entry->fs_info;
    266266    fat_file_fd_t   *fat_fd = parent_loc->node_access;
    267     unsigned32       dotdot_cln = 0;
     267    uint32_t         dotdot_cln = 0;
    268268
    269269    /* find name in fat-file which correspondes to the directory */
     
    378378msdos_get_dotdot_dir_info_cluster_num_and_offset(
    379379    rtems_filesystem_mount_table_entry_t *mt_entry,
    380     unsigned32                            cln,
     380    uint32_t                              cln,
    381381    fat_auxiliary_t                      *paux,
    382382    char                                 *dir_entry
     
    389389    unsigned char    dotdot_node[MSDOS_DIRECTORY_ENTRY_STRUCT_SIZE];
    390390    unsigned char    cur_node[MSDOS_DIRECTORY_ENTRY_STRUCT_SIZE];
    391     unsigned32       cl4find = 0;
     391    uint32_t         cl4find = 0;
    392392 
    393393    memset(dot_node, 0, MSDOS_DIRECTORY_ENTRY_STRUCT_SIZE); 
     
    516516    unsigned short   time_val;
    517517    unsigned short   date;
    518     unsigned32       sec = 0;
    519     unsigned32       byte = 0;
     518    uint32_t         sec = 0;
     519    uint32_t         byte = 0;
    520520 
    521521    msdos_date_unix2dos(fat_fd->mtime, &time_val, &date);
     
    563563    ssize_t          ret1 = 0, ret2 = 0;
    564564    msdos_fs_info_t *fs_info = mt_entry->fs_info;
    565     unsigned32       new_cln = fat_fd->cln;
    566     unsigned16       le_cl_low = 0;
    567     unsigned16       le_cl_hi = 0; 
    568     unsigned32       sec = 0;
    569     unsigned32       byte = 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;
    570570
    571571    /*
     
    578578    byte = fat_fd->info_ofs & (fs_info->fat.vol.bps - 1);
    579579 
    580     le_cl_low = CT_LE_W((unsigned16)(new_cln & 0x0000FFFF));
     580    le_cl_low = CT_LE_W((uint16_t  )(new_cln & 0x0000FFFF));
    581581    ret1 = _fat_block_write(mt_entry, sec,
    582582                            byte + MSDOS_FIRST_CLUSTER_LOW_OFFSET, 2,
    583583                            (char *)(&le_cl_low));
    584     le_cl_hi = CT_LE_W((unsigned16)((new_cln & 0xFFFF0000) >> 16));
     584    le_cl_hi = CT_LE_W((uint16_t  )((new_cln & 0xFFFF0000) >> 16));
    585585    ret2 = _fat_block_write(mt_entry, sec,
    586586                            byte + MSDOS_FIRST_CLUSTER_HI_OFFSET, 2,
     
    612612    ssize_t          ret = 0;
    613613    msdos_fs_info_t *fs_info = mt_entry->fs_info;
    614     unsigned32       le_new_length = 0;
    615     unsigned32       sec = 0;
    616     unsigned32       byte = 0;
     614    uint32_t         le_new_length = 0;
     615    uint32_t         sec = 0;
     616    uint32_t         byte = 0;
    617617
    618618    sec = fat_cluster_num_to_sector_num(mt_entry, fat_fd->info_cln);
     
    651651msdos_set_first_char4file_name(
    652652    rtems_filesystem_mount_table_entry_t *mt_entry,
    653     unsigned32                            cl,
    654     unsigned32                            ofs,
     653    uint32_t                              cl,
     654    uint32_t                              ofs,
    655655    unsigned char                         fchar
    656656    )
     
    658658    ssize_t          ret = 0;
    659659    msdos_fs_info_t *fs_info = mt_entry->fs_info;
    660     unsigned32       sec = 0;
    661     unsigned32       byte = 0;
     660    uint32_t         sec = 0;
     661    uint32_t         byte = 0;
    662662
    663663    sec = fat_cluster_num_to_sector_num(mt_entry, cl);
     
    695695    ssize_t          ret = 0;
    696696    msdos_fs_info_t *fs_info = mt_entry->fs_info;
    697     unsigned32       j = 0, i = 0;
     697    uint32_t         j = 0, i = 0;
    698698 
    699699    /* dir is not empty */
     
    776776    ssize_t          ret = 0;
    777777    msdos_fs_info_t *fs_info = mt_entry->fs_info;
    778     unsigned32       i = 0, j = 0;
    779     unsigned32       bts2rd = 0;
     778    uint32_t         i = 0, j = 0;
     779    uint32_t         bts2rd = 0;
    780780
    781781    if (FAT_FD_OF_ROOT_DIR(fat_fd) &&
     
    885885    rtems_filesystem_mount_table_entry_t *mt_entry,
    886886    fat_file_fd_t                        *fat_fd,
    887     unsigned32                            cl4find,
     887    uint32_t                              cl4find,
    888888    fat_auxiliary_t                      *paux,
    889889    char                                 *dir_entry
     
    893893    ssize_t          ret = 0;
    894894    msdos_fs_info_t *fs_info = mt_entry->fs_info;
    895     unsigned32       bts2rd = 0; 
    896     unsigned32       i = 0, j = 0;
     895    uint32_t         bts2rd = 0; 
     896    uint32_t         i = 0, j = 0;
    897897
    898898    if (FAT_FD_OF_ROOT_DIR(fat_fd) &&
  • cpukit/libfs/src/imfs/deviceio.c

    r82c123d rf91bbe64  
    4949    int rc;
    5050   
    51     if ((rc = rtems_assoc_remote_by_local(errno_assoc, (unsigned32) code)))
     51    if ((rc = rtems_assoc_remote_by_local(errno_assoc, (uint32_t  ) code)))
    5252    {
    5353        errno = rc;
     
    6666  rtems_libio_t *iop,
    6767  const char    *pathname,
    68   unsigned32     flag,
    69   unsigned32     mode
     68  uint32_t       flag,
     69  uint32_t       mode
    7070)
    7171{
     
    131131  rtems_libio_t *iop,
    132132  void          *buffer,
    133   unsigned32     count
     133  uint32_t       count
    134134)
    135135{
     
    168168  rtems_libio_t *iop,
    169169  const void    *buffer,
    170   unsigned32     count
     170  uint32_t       count
    171171)
    172172{
     
    204204int device_ioctl(
    205205  rtems_libio_t *iop,
    206   unsigned32     command,
     206  uint32_t       command,
    207207  void          *buffer
    208208)
  • cpukit/libfs/src/imfs/imfs.h

    r82c123d rf91bbe64  
    388388  rtems_libio_t *iop,             /* IN  */
    389389  const char    *pathname,        /* IN  */
    390   unsigned32     flag,            /* IN  */
    391   unsigned32     mode             /* IN  */
     390  uint32_t       flag,            /* IN  */
     391  uint32_t       mode             /* IN  */
    392392);
    393393
     
    399399  rtems_libio_t *iop,              /* IN  */
    400400  void          *buffer,           /* IN  */
    401   unsigned32     count             /* IN  */
     401  uint32_t       count             /* IN  */
    402402);
    403403
     
    420420  rtems_libio_t *iop,             /* IN  */
    421421  void          *buffer,          /* IN  */
    422   unsigned32     count            /* IN  */
     422  uint32_t       count            /* IN  */
    423423);
    424424
     
    432432  rtems_libio_t *iop,             /* IN  */
    433433  const char    *pathname,        /* IN  */
    434   unsigned32     flag,            /* IN  */
    435   unsigned32     mode             /* IN  */
     434  uint32_t       flag,            /* IN  */
     435  uint32_t       mode             /* IN  */
    436436);
    437437
     
    443443  rtems_libio_t *iop,             /* IN  */
    444444  void          *buffer,          /* IN  */
    445   unsigned32     count            /* IN  */
     445  uint32_t       count            /* IN  */
    446446);
    447447
     
    449449  rtems_libio_t *iop,             /* IN  */
    450450  const void    *buffer,          /* IN  */
    451   unsigned32     count            /* IN  */
     451  uint32_t       count            /* IN  */
    452452);
    453453
    454454int memfile_ioctl(
    455455  rtems_libio_t *iop,             /* IN  */
    456   unsigned32     command,         /* IN  */
     456  uint32_t       command,         /* IN  */
    457457  void          *buffer           /* IN  */
    458458);
     
    471471  rtems_libio_t *iop,            /* IN  */
    472472  const char    *pathname,       /* IN  */
    473   unsigned32     flag,           /* IN  */
    474   unsigned32     mode            /* IN  */
     473  uint32_t       flag,           /* IN  */
     474  uint32_t       mode            /* IN  */
    475475);
    476476
     
    482482  rtems_libio_t *iop,            /* IN  */
    483483  void          *buffer,         /* IN  */
    484   unsigned32     count           /* IN  */
     484  uint32_t       count           /* IN  */
    485485);
    486486
     
    488488  rtems_libio_t *iop,               /* IN  */
    489489  const void    *buffer,            /* IN  */
    490   unsigned32     count              /* IN  */
     490  uint32_t       count              /* IN  */
    491491);
    492492
    493493int device_ioctl(
    494494  rtems_libio_t *iop,               /* IN  */
    495   unsigned32     command,           /* IN  */
     495  uint32_t       command,           /* IN  */
    496496  void          *buffer             /* IN  */
    497497);
  • cpukit/libfs/src/imfs/imfs_directory.c

    r82c123d rf91bbe64  
    4242  rtems_libio_t  *iop,
    4343  const char *pathname,
    44   unsigned32 flag,
    45   unsigned32 mode
     44  uint32_t  flag,
     45  uint32_t  mode
    4646)
    4747{
     
    7676  rtems_libio_t  *iop,
    7777  void *buffer,
    78   unsigned32 count
     78  uint32_t  count
    7979)
    8080{
  • cpukit/libfs/src/imfs/imfs_fchmod.c

    r82c123d rf91bbe64  
    6464       (mode & (S_IWUSR | S_IWGRP | S_IWOTH)) )
    6565  {
    66     unsigned32 count = jnode->info.linearfile.size;
     66    uint32_t  count = jnode->info.linearfile.size;
    6767    const unsigned char *buffer = jnode->info.linearfile.direct;
    6868
  • cpukit/libfs/src/imfs/linearfile.c

    r82c123d rf91bbe64  
    4141  rtems_libio_t *iop,
    4242  void          *buffer,
    43   unsigned32     count
     43  uint32_t       count
    4444)
    4545{
  • cpukit/libfs/src/imfs/memfile.c

    r82c123d rf91bbe64  
    9292  rtems_libio_t *iop,
    9393  const char    *pathname,
    94   unsigned32     flag,
    95   unsigned32     mode
     94  uint32_t       flag,
     95  uint32_t       mode
    9696)
    9797{
     
    138138  rtems_libio_t *iop,
    139139  void          *buffer,
    140   unsigned32     count
     140  uint32_t       count
    141141)
    142142{
     
    157157  rtems_libio_t *iop,
    158158  const void    *buffer,
    159   unsigned32     count
     159  uint32_t       count
    160160)
    161161{
     
    181181int memfile_ioctl(
    182182  rtems_libio_t *iop,
    183   unsigned32     command,
     183  uint32_t       command,
    184184  void          *buffer
    185185)
Note: See TracChangeset for help on using the changeset viewer.