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


Ignore:
Timestamp:
2011-04-30T08:02:46Z (13 years ago)
Author:
Oleg Romanenko <romanenko.oleg@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
875edff6
Parents:
ce8f4f4
Message:
  1. Add new macros for determining FAT32 (FAT_IS_FAT32) and change existing macros: FAT_CLST_LAST1,

FAT_CLST_LAST8, FAT_CLST_BAD to support FAT32

  1. Allow to mount FAT32 filesystem
  2. Known issue: FAT32 fs does not pass sanity checks because of support 32-bit fat_cluster_t is required.
File:
1 edited

Legend:

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

    rce8f4f4 rcb052b4  
    5050#define FAT16_CLST_LAST1  0xfff8
    5151#define FAT16_CLST_LAST8  0xffff
     52#define FAT32_CLST_BAD    0x0ffffff7
     53#define FAT32_CLST_LAST1  0x0ffffff8
     54#define FAT32_CLST_LAST8  0x0fffffff
    5255
    5356#define FAT12_CLST_MAX    4085
     
    7275#define FAT_IS_FAT16(bs) \
    7376    ((CC(bs) >= FAT12_CLST_MAX) && (CC(bs) < FAT16_CLST_MAX))
     77#define FAT_IS_FAT32(bs)        (CC(bs) >= FAT16_CLST_MAX)
    7478
    7579#define FAT_CLST_LAST1(bs) \
    76     (FAT_IS_FAT12(bs) ? FAT12_CLST_LAST1 : FAT16_CLST_LAST1)
     80    (FAT_IS_FAT12(bs) ? FAT12_CLST_LAST1 : (FAT_IS_FAT32(bs) ? FAT32_CLST_LAST1 : FAT16_CLST_LAST1))
    7781#define FAT_CLST_LAST8(bs) \
    78     (FAT_IS_FAT12(bs) ? FAT12_CLST_LAST8 : FAT16_CLST_LAST8)
     82    (FAT_IS_FAT12(bs) ? FAT12_CLST_LAST8 : (FAT_IS_FAT32(bs) ? FAT32_CLST_LAST8 : FAT16_CLST_LAST8))
    7983#define FAT_CLST_BAD(bs) \
    80     (FAT_IS_FAT12(bs) ? FAT12_CLST_BAD : FAT16_CLST_BAD)
     84    (FAT_IS_FAT12(bs) ? FAT12_CLST_BAD : (FAT_IS_FAT32(bs) ? FAT32_CLST_BAD : FAT16_CLST_BAD))
    8185
    8286/* forward declarations */
Note: See TracChangeset for help on using the changeset viewer.