Changeset 875edff6 in mainline for uspace/srv/fs/fat/fat_fat.h


Ignore:
Timestamp:
2011-04-30T11:22:28Z (13 years ago)
Author:
Oleg Romanenko <romanenko.oleg@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
aa2ea13
Parents:
cb052b4
Message:

It is possible to mount FAT32 file system.
Changes:

  1. 32bit fat_cluster_t
  2. Change macros SF(bs) to add support FAT32 sectors per fat value
  3. New macros (FAT_CLST_SIZE) for determining size of FAT cluster (2 or 4 bytes)
  4. New macros (FAT_MASK) for determining necessary mask for cluster value depending on FAT type
  5. fat_get_cluster support FAT32 and correctly return cluster value
  6. Change fat_sanity_check() to add support FAT32. Wrapping explicit use of br→(value) with macros.

TODO: need to wrap all explicit use of br→() with appropriated macros.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/srv/fs/fat/fat_fat.h

    rcb052b4 r875edff6  
    5454#define FAT32_CLST_LAST8  0x0fffffff
    5555
     56#define FAT12_MASK                0x0fff
     57#define FAT16_MASK                0xffff
     58#define FAT32_MASK                0x0fffffff
     59
    5660#define FAT12_CLST_MAX    4085
    5761#define FAT16_CLST_MAX    65525
     62
     63/* Size in bytes for cluster value of FAT */
     64#define FAT12_CLST_SIZE   2
     65#define FAT16_CLST_SIZE   2
     66#define FAT32_CLST_SIZE   4
    5867
    5968/* internally used to mark root directory's parent */
     
    8493    (FAT_IS_FAT12(bs) ? FAT12_CLST_BAD : (FAT_IS_FAT32(bs) ? FAT32_CLST_BAD : FAT16_CLST_BAD))
    8594
     95#define FAT_CLST_SIZE(bs)       (FAT_IS_FAT32(bs) ? FAT32_CLST_SIZE : FAT16_CLST_SIZE)
     96
     97#define FAT_MASK(bs) \
     98    (FAT_IS_FAT12(bs) ? FAT12_MASK : (FAT_IS_FAT32(bs) ? FAT32_MASK : FAT16_MASK))
     99
    86100/* forward declarations */
    87101struct block;
     
    89103struct fat_bs;
    90104
    91 typedef uint16_t fat_cluster_t;
     105typedef uint32_t fat_cluster_t;
    92106
    93107#define fat_clusters_get(numc, bs, dh, fc) \
Note: See TracChangeset for help on using the changeset viewer.