Changeset 00aece0 in mainline for uspace/srv/fs/fat/fat.h


Ignore:
Timestamp:
2012-02-18T16:47:38Z (13 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
4449c6c
Parents:
bd5f3b7 (diff), f943dd3 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge mainline changes.

File:
1 edited

Legend:

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

    rbd5f3b7 r00aece0  
    11/*
    22 * Copyright (c) 2008 Jakub Jermar
     3 * Copyright (c) 2011 Oleg Romanenko
    34 * All rights reserved.
    45 *
     
    4647#endif
    4748
    48 #define min(a, b)               ((a) < (b) ? (a) : (b))
     49#define min(a, b)       ((a) < (b) ? (a) : (b))
    4950
    5051/*
     
    5556#define RSCNT(bs)       uint16_t_le2host((bs)->rscnt)
    5657#define FATCNT(bs)      (bs)->fatcnt
    57 #define SF(bs)          uint16_t_le2host((bs)->sec_per_fat)
     58
     59#define SF(bs)          (uint16_t_le2host((bs)->sec_per_fat) ? \
     60    uint16_t_le2host((bs)->sec_per_fat) : \
     61    uint32_t_le2host(bs->fat32.sectors_per_fat))
     62
    5863#define RDE(bs)         uint16_t_le2host((bs)->root_ent_max)
    59 #define TS(bs)          (uint16_t_le2host((bs)->totsec16) != 0 ? \
    60                         uint16_t_le2host((bs)->totsec16) : \
    61                         uint32_t_le2host(bs->totsec32))
    62 
    63 #define BS_BLOCK                0
    64 #define BS_SIZE                 512
     64
     65#define TS(bs)          (uint16_t_le2host((bs)->totsec16) ? \
     66    uint16_t_le2host((bs)->totsec16) : \
     67    uint32_t_le2host(bs->totsec32))
     68
     69#define BS_BLOCK        0
     70#define BS_SIZE         512
    6571
    6672typedef struct fat_bs {
     
    135141} __attribute__ ((packed)) fat_bs_t;
    136142
     143#define FAT32_FSINFO_SIG1       "RRaA"
     144#define FAT32_FSINFO_SIG2       "rrAa"
     145#define FAT32_FSINFO_SIG3       "\x00\x00\x55\xaa"
     146
     147typedef struct {
     148        uint8_t sig1[4];
     149        uint8_t res1[480];
     150        uint8_t sig2[4];
     151        uint32_t free_clusters;
     152        uint32_t last_allocated_cluster;
     153        uint8_t res2[12];
     154        uint8_t sig3[4];
     155} __attribute__ ((packed)) fat32_fsinfo_t;
     156
    137157typedef enum {
    138158        FAT_INVALID,
     
    224244} fat_node_t;
    225245
     246typedef struct {
     247        bool lfn_enabled;
     248} fat_instance_t;
     249
    226250extern vfs_out_ops_t fat_ops;
    227251extern libfs_ops_t fat_libfs_ops;
Note: See TracChangeset for help on using the changeset viewer.