]>
Commit | Line | Data |
---|---|---|
71f95118 WD |
1 | /* |
2 | * R/O (V)FAT 12/16/32 filesystem implementation by Marcus Sundberg | |
3 | * | |
4 | * 2002-07-28 - [email protected] - ported to ppcboot v1.1.6 | |
5 | * 2003-03-10 - [email protected] - ported to u-boot | |
6 | * | |
7 | * See file CREDITS for list of people who contributed to this | |
8 | * project. | |
9 | * | |
10 | * This program is free software; you can redistribute it and/or | |
11 | * modify it under the terms of the GNU General Public License as | |
12 | * published by the Free Software Foundation; either version 2 of | |
13 | * the License, or (at your option) any later version. | |
14 | * | |
15 | * This program is distributed in the hope that it will be useful, | |
16 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
17 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
18 | * GNU General Public License for more details. | |
19 | * | |
20 | * You should have received a copy of the GNU General Public License | |
21 | * along with this program; if not, write to the Free Software | |
22 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, | |
23 | * MA 02111-1307 USA | |
24 | * | |
25 | */ | |
26 | ||
27 | #ifndef _FAT_H_ | |
28 | #define _FAT_H_ | |
29 | ||
5cf91d6b WD |
30 | #include <asm/byteorder.h> |
31 | ||
71f95118 WD |
32 | #define CONFIG_SUPPORT_VFAT |
33 | ||
34 | #define SECTOR_SIZE FS_BLOCK_SIZE | |
35 | ||
36 | #define FS_BLOCK_SIZE 512 | |
37 | ||
38 | #if FS_BLOCK_SIZE != SECTOR_SIZE | |
39 | #error FS_BLOCK_SIZE != SECTOR_SIZE - This code needs to be fixed! | |
40 | #endif | |
41 | ||
42 | #define MAX_CLUSTSIZE 65536 | |
43 | #define DIRENTSPERBLOCK (FS_BLOCK_SIZE/sizeof(dir_entry)) | |
44 | #define DIRENTSPERCLUST ((mydata->clust_size*SECTOR_SIZE)/sizeof(dir_entry)) | |
45 | ||
46 | #define FATBUFBLOCKS 6 | |
47 | #define FATBUFSIZE (FS_BLOCK_SIZE*FATBUFBLOCKS) | |
cd37d9e6 | 48 | #define FAT12BUFSIZE ((FATBUFSIZE*2)/3) |
71f95118 WD |
49 | #define FAT16BUFSIZE (FATBUFSIZE/2) |
50 | #define FAT32BUFSIZE (FATBUFSIZE/4) | |
51 | ||
52 | ||
53 | /* Filesystem identifiers */ | |
54 | #define FAT12_SIGN "FAT12 " | |
55 | #define FAT16_SIGN "FAT16 " | |
56 | #define FAT32_SIGN "FAT32 " | |
57 | #define SIGNLEN 8 | |
58 | ||
59 | /* File attributes */ | |
60 | #define ATTR_RO 1 | |
61 | #define ATTR_HIDDEN 2 | |
62 | #define ATTR_SYS 4 | |
63 | #define ATTR_VOLUME 8 | |
64 | #define ATTR_DIR 16 | |
65 | #define ATTR_ARCH 32 | |
66 | ||
67 | #define ATTR_VFAT (ATTR_RO | ATTR_HIDDEN | ATTR_SYS | ATTR_VOLUME) | |
68 | ||
69 | #define DELETED_FLAG ((char)0xe5) /* Marks deleted files when in name[0] */ | |
70 |