36 #ifndef _RTEMS_CONFDEFS_LIBIO_H 37 #define _RTEMS_CONFDEFS_LIBIO_H 39 #ifndef __CONFIGURATION_TEMPLATE_h 40 #error "Do not include this file directly, use <rtems/confdefs.h> instead" 46 #include <rtems/sysinit.h> 48 #ifdef CONFIGURE_FILESYSTEM_ALL 49 #define CONFIGURE_FILESYSTEM_DOSFS 50 #define CONFIGURE_FILESYSTEM_FTPFS 51 #define CONFIGURE_FILESYSTEM_IMFS 52 #define CONFIGURE_FILESYSTEM_JFFS2 53 #define CONFIGURE_FILESYSTEM_NFS 54 #define CONFIGURE_FILESYSTEM_RFS 55 #define CONFIGURE_FILESYSTEM_TFTPFS 58 #ifdef CONFIGURE_USE_MINIIMFS_AS_BASE_FILESYSTEM 59 #ifdef CONFIGURE_USE_DEVFS_AS_BASE_FILESYSTEM 60 #error "CONFIGURE_USE_MINIIMFS_AS_BASE_FILESYSTEM cannot be used together with CONFIGURE_USE_DEVFS_AS_BASE_FILESYSTEM" 63 #define CONFIGURE_IMFS_DISABLE_CHMOD 64 #define CONFIGURE_IMFS_DISABLE_CHOWN 65 #define CONFIGURE_IMFS_DISABLE_LINK 66 #define CONFIGURE_IMFS_DISABLE_READLINK 67 #define CONFIGURE_IMFS_DISABLE_RENAME 68 #define CONFIGURE_IMFS_DISABLE_SYMLINK 69 #define CONFIGURE_IMFS_DISABLE_UNMOUNT 70 #define CONFIGURE_IMFS_DISABLE_UTIME 73 #ifdef CONFIGURE_USE_DEVFS_AS_BASE_FILESYSTEM 74 #define CONFIGURE_IMFS_DISABLE_CHMOD 75 #define CONFIGURE_IMFS_DISABLE_CHOWN 76 #define CONFIGURE_IMFS_DISABLE_LINK 77 #define CONFIGURE_IMFS_DISABLE_MKNOD_FILE 78 #define CONFIGURE_IMFS_DISABLE_MOUNT 79 #define CONFIGURE_IMFS_DISABLE_READDIR 80 #define CONFIGURE_IMFS_DISABLE_READLINK 81 #define CONFIGURE_IMFS_DISABLE_RENAME 82 #define CONFIGURE_IMFS_DISABLE_RMNOD 83 #define CONFIGURE_IMFS_DISABLE_SYMLINK 84 #define CONFIGURE_IMFS_DISABLE_UNMOUNT 85 #define CONFIGURE_IMFS_DISABLE_UTIME 88 #ifndef CONFIGURE_MAXIMUM_FILE_DESCRIPTORS 89 #define CONFIGURE_MAXIMUM_FILE_DESCRIPTORS 3 92 #if !defined(CONFIGURE_APPLICATION_DISABLE_FILESYSTEM) || \ 93 CONFIGURE_MAXIMUM_FILE_DESCRIPTORS > 0 97 #ifdef CONFIGURE_APPLICATION_DISABLE_FILESYSTEM 98 #ifdef CONFIGURE_USE_DEVFS_AS_BASE_FILESYSTEM 99 #error "CONFIGURE_APPLICATION_DISABLE_FILESYSTEM cannot be used together with CONFIGURE_USE_DEVFS_AS_BASE_FILESYSTEM" 102 #ifdef CONFIGURE_USE_MINIIMFS_AS_BASE_FILESYSTEM 103 #error "CONFIGURE_APPLICATION_DISABLE_FILESYSTEM cannot be used together with CONFIGURE_USE_MINIIMFS_AS_BASE_FILESYSTEM" 106 #ifdef CONFIGURE_FILESYSTEM_DOSFS 107 #error "CONFIGURE_APPLICATION_DISABLE_FILESYSTEM cannot be used together with CONFIGURE_FILESYSTEM_DOSFS" 110 #ifdef CONFIGURE_FILESYSTEM_FTPFS 111 #error "CONFIGURE_APPLICATION_DISABLE_FILESYSTEM cannot be used together with CONFIGURE_FILESYSTEM_FTPFS" 114 #ifdef CONFIGURE_FILESYSTEM_IMFS 115 #error "CONFIGURE_APPLICATION_DISABLE_FILESYSTEM cannot be used together with CONFIGURE_FILESYSTEM_IMFS" 118 #ifdef CONFIGURE_FILESYSTEM_JFFS2 119 #error "CONFIGURE_APPLICATION_DISABLE_FILESYSTEM cannot be used together with CONFIGURE_FILESYSTEM_JFFS2" 122 #ifdef CONFIGURE_FILESYSTEM_NFS 123 #error "CONFIGURE_APPLICATION_DISABLE_FILESYSTEM cannot be used together with CONFIGURE_FILESYSTEM_NFS" 126 #ifdef CONFIGURE_FILESYSTEM_RFS 127 #error "CONFIGURE_APPLICATION_DISABLE_FILESYSTEM cannot be used together with CONFIGURE_FILESYSTEM_RFS" 130 #ifdef CONFIGURE_FILESYSTEM_TFTPFS 131 #error "CONFIGURE_APPLICATION_DISABLE_FILESYSTEM cannot be used together with CONFIGURE_FILESYSTEM_TFTPFS" 134 #include <rtems/imfs.h> 137 #ifdef CONFIGURE_FILESYSTEM_DOSFS 138 #include <rtems/dosfs.h> 141 #ifdef CONFIGURE_FILESYSTEM_FTPFS 142 #include <rtems/ftpfs.h> 145 #ifdef CONFIGURE_FILESYSTEM_JFFS2 146 #include <rtems/jffs2.h> 149 #ifdef CONFIGURE_FILESYSTEM_NFS 150 #include <librtemsNfs.h> 153 #ifdef CONFIGURE_FILESYSTEM_RFS 154 #include <rtems/rtems-rfs.h> 157 #ifdef CONFIGURE_FILESYSTEM_TFTPFS 158 #include <rtems/tftp.h> 165 #ifndef CONFIGURE_APPLICATION_DISABLE_FILESYSTEM 167 #ifndef CONFIGURE_IMFS_MEMFILE_BYTES_PER_BLOCK 168 #define CONFIGURE_IMFS_MEMFILE_BYTES_PER_BLOCK \ 169 IMFS_MEMFILE_DEFAULT_BYTES_PER_BLOCK 172 #if CONFIGURE_IMFS_MEMFILE_BYTES_PER_BLOCK != 16 && \ 173 CONFIGURE_IMFS_MEMFILE_BYTES_PER_BLOCK != 32 && \ 174 CONFIGURE_IMFS_MEMFILE_BYTES_PER_BLOCK != 64 && \ 175 CONFIGURE_IMFS_MEMFILE_BYTES_PER_BLOCK != 128 && \ 176 CONFIGURE_IMFS_MEMFILE_BYTES_PER_BLOCK != 256 && \ 177 CONFIGURE_IMFS_MEMFILE_BYTES_PER_BLOCK != 512 178 #error "CONFIGURE_IMFS_MEMFILE_BYTES_PER_BLOCK must be a power of two between 16 and 512" 183 static IMFS_fs_info_t IMFS_root_fs_info;
188 #ifdef CONFIGURE_USE_DEVFS_AS_BASE_FILESYSTEM 189 IMFS_eval_path_devfs,
193 #ifdef CONFIGURE_IMFS_DISABLE_LINK 199 #ifdef CONFIGURE_IMFS_DISABLE_MKNOD 204 #ifdef CONFIGURE_IMFS_DISABLE_RMNOD 209 #ifdef CONFIGURE_IMFS_DISABLE_CHMOD 214 #ifdef CONFIGURE_IMFS_DISABLE_CHOWN 221 #ifdef CONFIGURE_IMFS_DISABLE_MOUNT 226 #ifdef CONFIGURE_IMFS_DISABLE_UNMOUNT 232 #ifdef CONFIGURE_IMFS_DISABLE_UTIME 237 #ifdef CONFIGURE_IMFS_DISABLE_SYMLINK 242 #ifdef CONFIGURE_IMFS_DISABLE_READLINK 247 #ifdef CONFIGURE_IMFS_DISABLE_RENAME 255 static const IMFS_mknod_controls IMFS_root_mknod_controls = {
256 #ifdef CONFIGURE_IMFS_DISABLE_READDIR 257 &IMFS_mknod_control_dir_minimal,
259 &IMFS_mknod_control_dir_default,
261 #ifdef CONFIGURE_IMFS_DISABLE_MKNOD_DEVICE 262 &IMFS_mknod_control_enosys,
264 &IMFS_mknod_control_device,
266 #ifdef CONFIGURE_IMFS_DISABLE_MKNOD_FILE 267 &IMFS_mknod_control_enosys,
269 &IMFS_mknod_control_memfile,
271 #ifdef CONFIGURE_IMFS_ENABLE_MKFIFO 272 &IMFS_mknod_control_fifo
274 &IMFS_mknod_control_enosys
278 static const IMFS_mount_data IMFS_root_mount_data = {
281 &IMFS_root_mknod_controls
285 {
"/", IMFS_initialize_support },
286 #ifdef CONFIGURE_FILESYSTEM_DOSFS 287 { RTEMS_FILESYSTEM_TYPE_DOSFS, rtems_dosfs_initialize },
289 #ifdef CONFIGURE_FILESYSTEM_FTPFS 290 { RTEMS_FILESYSTEM_TYPE_FTPFS, rtems_ftpfs_initialize },
292 #ifdef CONFIGURE_FILESYSTEM_IMFS 293 { RTEMS_FILESYSTEM_TYPE_IMFS, IMFS_initialize },
295 #ifdef CONFIGURE_FILESYSTEM_JFFS2 296 { RTEMS_FILESYSTEM_TYPE_JFFS2, rtems_jffs2_initialize },
298 #ifdef CONFIGURE_FILESYSTEM_NFS 299 { RTEMS_FILESYSTEM_TYPE_NFS, rtems_nfs_initialize },
301 #ifdef CONFIGURE_FILESYSTEM_RFS 302 { RTEMS_FILESYSTEM_TYPE_RFS, rtems_rfs_rtems_initialise },
304 #ifdef CONFIGURE_FILESYSTEM_TFTPFS 305 { RTEMS_FILESYSTEM_TYPE_TFTPFS, rtems_tftpfs_initialize },
311 rtems_filesystem_root_configuration = {
315 RTEMS_FILESYSTEM_READ_WRITE,
316 &IMFS_root_mount_data
321 RTEMS_SYSINIT_ROOT_FILESYSTEM,
322 RTEMS_SYSINIT_ORDER_MIDDLE
327 #if CONFIGURE_MAXIMUM_FILE_DESCRIPTORS > 0 330 const uint32_t rtems_libio_number_iops =
RTEMS_ARRAY_SIZE( rtems_libio_iops );
void rtems_filesystem_initialize(void)
Base File System Initialization.
int rtems_filesystem_default_utime(const rtems_filesystem_location_info_t *loc, time_t actime, time_t modtime)
#define CONFIGURE_MAXIMUM_FILE_DESCRIPTORS
This configuration option is an integer define.
bool rtems_filesystem_default_are_nodes_equal(const rtems_filesystem_location_info_t *a, const rtems_filesystem_location_info_t *b)
Tests if the node access pointer of one location is equal to the node access pointer of the other loc...
int rtems_filesystem_default_link(const rtems_filesystem_location_info_t *parentloc, const rtems_filesystem_location_info_t *targetloc, const char *name, size_t namelen)
const rtems_filesystem_table_t rtems_filesystem_table[]
Static table of file systems.
int rtems_filesystem_default_unmount(rtems_filesystem_mount_table_entry_t *mt_entry)
void rtems_filesystem_default_unlock(const rtems_filesystem_mount_table_entry_t *mt_entry)
Releases the IO library mutex.
ssize_t rtems_filesystem_default_readlink(const rtems_filesystem_location_info_t *loc, char *buf, size_t bufsize)
int rtems_filesystem_default_fchmod(const rtems_filesystem_location_info_t *loc, mode_t mode)
int rtems_filesystem_default_symlink(const rtems_filesystem_location_info_t *parentloc, const char *name, size_t namelen, const char *target)
int rtems_filesystem_default_rmnod(const rtems_filesystem_location_info_t *parentloc, const rtems_filesystem_location_info_t *loc)
#define CONFIGURE_IMFS_MEMFILE_BYTES_PER_BLOCK
This configuration option is an integer define.
File system operations table.
int rtems_filesystem_default_mount(rtems_filesystem_mount_table_entry_t *mt_entry)
Evaluate BSP Related Configuration Options.
void rtems_filesystem_default_fsunmount(rtems_filesystem_mount_table_entry_t *mt_entry)
#define RTEMS_ARRAY_SIZE(_array)
Returns the element count of the specified array.
int rtems_filesystem_default_statvfs(const rtems_filesystem_location_info_t *loc, struct statvfs *buf)
An open file data structure.
int rtems_filesystem_default_rename(const rtems_filesystem_location_info_t *oldparentloc, const rtems_filesystem_location_info_t *oldloc, const rtems_filesystem_location_info_t *newparentloc, const char *name, size_t namelen)
int rtems_filesystem_default_mknod(const rtems_filesystem_location_info_t *parentloc, const char *name, size_t namelen, mode_t mode, dev_t dev)
int rtems_filesystem_default_chown(const rtems_filesystem_location_info_t *loc, uid_t owner, gid_t group)
void rtems_filesystem_default_lock(const rtems_filesystem_mount_table_entry_t *mt_entry)
Obtains the IO library mutex.