12 * Maximum number of open files. This is *currently* constrained by the
13 * fact that PXE needs to be able to fit all its packet buffers into a
14 * 64K segment; this should be fixed by moving the packet buffers to high
17 #define MAX_OPEN_LG2 5
18 #define MAX_OPEN (1 << MAX_OPEN_LG2)
20 #define FILENAME_MAX_LG2 8
21 #define FILENAME_MAX (1 << FILENAME_MAX_LG2)
24 const struct fs_ops *fs_ops;
25 struct device *fs_dev;
28 struct open_file_t; /* Filesystem private structure */
29 struct dirent; /* Directory entry structure */
32 struct open_file_t *open_file; /* Filesystem private data */
42 /* in fact, we use fs_ops structure to find the right fs */
44 enum fs_flags fs_flags;
46 int (*fs_init)(struct fs_info *);
47 void (*searchdir)(char *, struct file *);
48 uint32_t (*getfssec)(struct file *, char *, int, bool *);
49 void (*close_file)(struct file *);
50 void (*mangle_name)(char *, const char *);
51 char * (*unmangle_name)(char *, const char *);
55 void (*opendir)(com32sys_t *);
56 struct dirent * (*readdir)(struct file *);
59 enum dev_type {CHS, EDD};
62 * Generic functions that filesystem drivers may choose to use
64 void generic_mangle_name(char *, const char *);
65 #define generic_unmangle_name stpcpy
68 * Struct device contains:
69 * the pointer points to the disk structure,
78 uint16_t cache_block_size;
79 uint16_t cache_entries;
84 * Our definition of "not whitespace"
86 static inline bool not_whitespace(char c)
88 return (unsigned char)c > ' ';
94 void mangle_name(com32sys_t *);
95 void searchdir(com32sys_t *);
96 void _close_file(struct file *);
97 inline uint16_t file_to_handle(struct file *);
98 inline struct file *handle_to_file(uint16_t);