]> git.kernelconcepts.de Git - karo-tx-uboot.git/blobdiff - include/fat.h
Merge branch 'u-boot-samsung/master' into 'u-boot-arm/master'
[karo-tx-uboot.git] / include / fat.h
index 2c951e7d79c626bdff3749eabd2cce5283089050..81d9790420d8057d0a8e3d1f5e22a6474c89cccd 100644 (file)
 #define START(dent)    (FAT2CPU16((dent)->start) \
                        + (mydata->fatsize != 32 ? 0 : \
                          (FAT2CPU16((dent)->starthi) << 16)))
+#define IS_LAST_CLUST(x, fatsize) ((x) >= ((fatsize) != 32 ? \
+                                       ((fatsize) != 16 ? 0xff8 : 0xfff8) : \
+                                       0xffffff8))
 #define CHECK_CLUST(x, fatsize) ((x) <= 1 || \
-                               (x) >= ((fatsize) != 32 ? 0xfff0 : 0xffffff0))
+                               (x) >= ((fatsize) != 32 ? \
+                                       ((fatsize) != 16 ? 0xff0 : 0xfff0) : \
+                                       0xffffff0))
 
 typedef struct boot_sector {
        __u8    ignored[3];     /* Bootstrap code */
@@ -188,6 +193,7 @@ file_read_func              file_fat_read;
 int file_cd(const char *path);
 int file_fat_detectfs(void);
 int file_fat_ls(const char *dir);
+int fat_exists(const char *filename);
 long file_fat_read_at(const char *filename, unsigned long pos, void *buffer,
                      unsigned long maxsize);
 long file_fat_read(const char *filename, void *buffer, unsigned long maxsize);