37#ifndef _RTEMS_CONFDEFS_LIBIO_H
38#define _RTEMS_CONFDEFS_LIBIO_H
40#ifndef __CONFIGURATION_TEMPLATE_h
41#error "Do not include this file directly, use <rtems/confdefs.h> instead"
49#ifdef CONFIGURE_FILESYSTEM_ALL
50 #define CONFIGURE_FILESYSTEM_DOSFS
51 #define CONFIGURE_FILESYSTEM_FATFS
52 #define CONFIGURE_FILESYSTEM_FTPFS
53 #define CONFIGURE_FILESYSTEM_IMFS
54 #define CONFIGURE_FILESYSTEM_JFFS2
56 #define CONFIGURE_FILESYSTEM_RFS
57 #define CONFIGURE_FILESYSTEM_TFTPFS
60#ifdef CONFIGURE_USE_MINIIMFS_AS_BASE_FILESYSTEM
61 #ifdef CONFIGURE_USE_DEVFS_AS_BASE_FILESYSTEM
62 #error "CONFIGURE_USE_MINIIMFS_AS_BASE_FILESYSTEM cannot be used together with CONFIGURE_USE_DEVFS_AS_BASE_FILESYSTEM"
65 #define CONFIGURE_IMFS_DISABLE_CHMOD
66 #define CONFIGURE_IMFS_DISABLE_CHOWN
67 #define CONFIGURE_IMFS_DISABLE_LINK
68 #define CONFIGURE_IMFS_DISABLE_READLINK
69 #define CONFIGURE_IMFS_DISABLE_RENAME
70 #define CONFIGURE_IMFS_DISABLE_SYMLINK
71 #define CONFIGURE_IMFS_DISABLE_UNMOUNT
72 #define CONFIGURE_IMFS_DISABLE_UTIME
75#ifdef CONFIGURE_USE_DEVFS_AS_BASE_FILESYSTEM
76 #define CONFIGURE_IMFS_DISABLE_CHMOD
77 #define CONFIGURE_IMFS_DISABLE_CHOWN
78 #define CONFIGURE_IMFS_DISABLE_LINK
79 #define CONFIGURE_IMFS_DISABLE_MKNOD_FILE
80 #define CONFIGURE_IMFS_DISABLE_MOUNT
81 #define CONFIGURE_IMFS_DISABLE_READDIR
82 #define CONFIGURE_IMFS_DISABLE_READLINK
83 #define CONFIGURE_IMFS_DISABLE_RENAME
84 #define CONFIGURE_IMFS_DISABLE_RMNOD
85 #define CONFIGURE_IMFS_DISABLE_SYMLINK
86 #define CONFIGURE_IMFS_DISABLE_UNMOUNT
87 #define CONFIGURE_IMFS_DISABLE_UTIME
90#ifndef CONFIGURE_MAXIMUM_FILE_DESCRIPTORS
91 #define CONFIGURE_MAXIMUM_FILE_DESCRIPTORS 3
94#if !defined(CONFIGURE_APPLICATION_DISABLE_FILESYSTEM) || \
95 CONFIGURE_MAXIMUM_FILE_DESCRIPTORS > 0
99#ifdef CONFIGURE_APPLICATION_DISABLE_FILESYSTEM
100 #ifdef CONFIGURE_USE_DEVFS_AS_BASE_FILESYSTEM
101 #error "CONFIGURE_APPLICATION_DISABLE_FILESYSTEM cannot be used together with CONFIGURE_USE_DEVFS_AS_BASE_FILESYSTEM"
104 #ifdef CONFIGURE_USE_MINIIMFS_AS_BASE_FILESYSTEM
105 #error "CONFIGURE_APPLICATION_DISABLE_FILESYSTEM cannot be used together with CONFIGURE_USE_MINIIMFS_AS_BASE_FILESYSTEM"
108 #ifdef CONFIGURE_FILESYSTEM_DOSFS
109 #error "CONFIGURE_APPLICATION_DISABLE_FILESYSTEM cannot be used together with CONFIGURE_FILESYSTEM_DOSFS"
112 #ifdef CONFIGURE_FILESYSTEM_FATFS
113 #error "CONFIGURE_APPLICATION_DISABLE_FILESYSTEM cannot be used together with CONFIGURE_FILESYSTEM_FATFS"
116 #ifdef CONFIGURE_FILESYSTEM_FTPFS
117 #error "CONFIGURE_APPLICATION_DISABLE_FILESYSTEM cannot be used together with CONFIGURE_FILESYSTEM_FTPFS"
120 #ifdef CONFIGURE_FILESYSTEM_IMFS
121 #error "CONFIGURE_APPLICATION_DISABLE_FILESYSTEM cannot be used together with CONFIGURE_FILESYSTEM_IMFS"
124 #ifdef CONFIGURE_FILESYSTEM_JFFS2
125 #error "CONFIGURE_APPLICATION_DISABLE_FILESYSTEM cannot be used together with CONFIGURE_FILESYSTEM_JFFS2"
128 #ifdef CONFIGURE_FILESYSTEM_NFS
129 #error "CONFIGURE_APPLICATION_DISABLE_FILESYSTEM cannot be used together with CONFIGURE_FILESYSTEM_NFS"
132 #ifdef CONFIGURE_FILESYSTEM_RFS
133 #error "CONFIGURE_APPLICATION_DISABLE_FILESYSTEM cannot be used together with CONFIGURE_FILESYSTEM_RFS"
136 #ifdef CONFIGURE_FILESYSTEM_TFTPFS
137 #error "CONFIGURE_APPLICATION_DISABLE_FILESYSTEM cannot be used together with CONFIGURE_FILESYSTEM_TFTPFS"
143#ifdef CONFIGURE_FILESYSTEM_DOSFS
147#ifdef CONFIGURE_FILESYSTEM_FATFS
151#ifdef CONFIGURE_FILESYSTEM_FTPFS
155#ifdef CONFIGURE_FILESYSTEM_JFFS2
156#include <rtems/jffs2.h>
158#ifndef CONFIGURE_JFFS2_DELAYED_WRITE_TASK_PRIORITY
159 #define CONFIGURE_JFFS2_DELAYED_WRITE_TASK_PRIORITY \
160 RTEMS_JFFS2_DELAYED_WRITE_TASK_PRIORITY_DEFAULT
169#ifdef CONFIGURE_FILESYSTEM_NFS
170#include <librtemsNfs.h>
173#ifdef CONFIGURE_FILESYSTEM_RFS
177#ifdef CONFIGURE_FILESYSTEM_TFTPFS
185#ifndef CONFIGURE_APPLICATION_DISABLE_FILESYSTEM
187#ifndef CONFIGURE_IMFS_MEMFILE_BYTES_PER_BLOCK
188 #define CONFIGURE_IMFS_MEMFILE_BYTES_PER_BLOCK \
189 IMFS_MEMFILE_DEFAULT_BYTES_PER_BLOCK
192#if CONFIGURE_IMFS_MEMFILE_BYTES_PER_BLOCK != 16 && \
193 CONFIGURE_IMFS_MEMFILE_BYTES_PER_BLOCK != 32 && \
194 CONFIGURE_IMFS_MEMFILE_BYTES_PER_BLOCK != 64 && \
195 CONFIGURE_IMFS_MEMFILE_BYTES_PER_BLOCK != 128 && \
196 CONFIGURE_IMFS_MEMFILE_BYTES_PER_BLOCK != 256 && \
197 CONFIGURE_IMFS_MEMFILE_BYTES_PER_BLOCK != 512 && \
198 CONFIGURE_IMFS_MEMFILE_BYTES_PER_BLOCK != 1024
199 #error "CONFIGURE_IMFS_MEMFILE_BYTES_PER_BLOCK must be a power of two between 16 and 1024"
202const size_t imfs_memfile_bytes_per_block =
208#ifndef CONFIGURE_IMFS_MEMFILE_OPS
209 #define CONFIGURE_IMFS_MEMFILE_OPS IMFS_MEMFILE_DEFAULT_OPS
219 #ifdef CONFIGURE_USE_DEVFS_AS_BASE_FILESYSTEM
224 #ifdef CONFIGURE_IMFS_DISABLE_LINK
230 #ifdef CONFIGURE_IMFS_DISABLE_MKNOD
235 #ifdef CONFIGURE_IMFS_DISABLE_RMNOD
240 #ifdef CONFIGURE_IMFS_DISABLE_CHMOD
245 #ifdef CONFIGURE_IMFS_DISABLE_CHOWN
252 #ifdef CONFIGURE_IMFS_DISABLE_MOUNT
257 #ifdef CONFIGURE_IMFS_DISABLE_UNMOUNT
263 #ifdef CONFIGURE_IMFS_DISABLE_UTIME
268 #ifdef CONFIGURE_IMFS_DISABLE_SYMLINK
273 #ifdef CONFIGURE_IMFS_DISABLE_READLINK
278 #ifdef CONFIGURE_IMFS_DISABLE_RENAME
287 #ifdef CONFIGURE_IMFS_DISABLE_READDIR
288 &IMFS_mknod_control_dir_minimal,
290 &IMFS_mknod_control_dir_default,
292 #ifdef CONFIGURE_IMFS_DISABLE_MKNOD_DEVICE
293 &IMFS_mknod_control_enosys,
295 &IMFS_mknod_control_device,
297 #ifdef CONFIGURE_IMFS_DISABLE_MKNOD_FILE
298 &IMFS_mknod_control_enosys,
300 &IMFS_mknod_control_memfile,
302 #ifdef CONFIGURE_IMFS_ENABLE_MKFIFO
303 &IMFS_mknod_control_fifo
305 &IMFS_mknod_control_enosys
312 &IMFS_root_mknod_controls
316 {
"/", IMFS_initialize_support },
317 #ifdef CONFIGURE_FILESYSTEM_DOSFS
318 { RTEMS_FILESYSTEM_TYPE_DOSFS, rtems_dosfs_initialize },
320 #ifdef CONFIGURE_FILESYSTEM_FATFS
323 #ifdef CONFIGURE_FILESYSTEM_FTPFS
326 #ifdef CONFIGURE_FILESYSTEM_IMFS
327 { RTEMS_FILESYSTEM_TYPE_IMFS, IMFS_initialize },
329 #ifdef CONFIGURE_FILESYSTEM_JFFS2
332 #ifdef CONFIGURE_FILESYSTEM_NFS
333 { RTEMS_FILESYSTEM_TYPE_NFS, rtems_nfs_initialize },
335 #ifdef CONFIGURE_FILESYSTEM_RFS
338 #ifdef CONFIGURE_FILESYSTEM_TFTPFS
345rtems_filesystem_root_configuration = {
349 RTEMS_FILESYSTEM_READ_WRITE,
350 &IMFS_root_mount_data
355 RTEMS_SYSINIT_ROOT_FILESYSTEM,
356 RTEMS_SYSINIT_ORDER_MIDDLE
361#if CONFIGURE_MAXIMUM_FILE_DESCRIPTORS > 0
364 const uint32_t rtems_libio_number_iops =
RTEMS_ARRAY_SIZE( rtems_libio_iops );
This header file evaluates configuration options related to the BSP configuration.
Application Interface to FAT Filesystem.
RTEMS FatFS Filesystem Public API.
File Transfer Protocol file system (FTP client).
int rtems_ftpfs_initialize(rtems_filesystem_mount_table_entry_t *mt_entry, const void *data)
Do not call directly, use mount().
Definition: ftpfs.c:1275
int rtems_fatfs_initialize(rtems_filesystem_mount_table_entry_t *mt_entry, const void *data)
Initialize FatFS filesystem.
Definition: rtems-fatfs-init.c:150
const rtems_filesystem_table_t rtems_filesystem_table[]
Static table of file systems.
int IMFS_statvfs(const rtems_filesystem_location_info_t *loc, struct statvfs *buf)
Sets buf with the IMFS statistics.
Definition: imfs_statvfs.c:41
int IMFS_chown(const rtems_filesystem_location_info_t *loc, uid_t owner, gid_t group)
Change the owner of IMFS.
Definition: imfs_chown.c:47
int IMFS_rmnod(const rtems_filesystem_location_info_t *parentloc, const rtems_filesystem_location_info_t *loc)
IMFS node removal handler.
Definition: imfs_rmnod.c:46
int IMFS_link(const rtems_filesystem_location_info_t *parentloc, const rtems_filesystem_location_info_t *targetloc, const char *name, size_t namelen)
Create a new IMFS link node.
Definition: imfs_link.c:45
int IMFS_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)
Rename the IMFS.
Definition: imfs_rename.c:69
int IMFS_mount(rtems_filesystem_mount_table_entry_t *mt_entry, const void *data)
Mount an IMFS.
Definition: imfs_mount.c:46
void IMFS_node_free(const rtems_filesystem_location_info_t *loc)
Free an IMFS node.
Definition: imfs_node.c:107
int IMFS_unmount(rtems_filesystem_mount_table_entry_t *mt_entry)
Unmount an IMFS.
Definition: imfs_unmount.c:46
int IMFS_symlink(const rtems_filesystem_location_info_t *parentloc, const char *name, size_t namelen, const char *target)
Create a new IMFS symbolic link node.
Definition: imfs_symlink.c:47
int IMFS_node_clone(rtems_filesystem_location_info_t *loc)
Clone an IMFS node.
Definition: imfs_node.c:91
int IMFS_utimens(const rtems_filesystem_location_info_t *loc, struct timespec times[2])
Set IMFS file access and modification times.
Definition: imfs_utimens.c:44
int IMFS_mknod(const rtems_filesystem_location_info_t *parentloc, const char *name, size_t namelen, mode_t mode, dev_t dev)
Create an IMFS node.
Definition: imfs_mknod.c:63
void IMFS_eval_path(rtems_filesystem_eval_path_context_t *ctx)
IMFS evaluation node support.
Definition: imfs_eval.c:199
ssize_t IMFS_readlink(const rtems_filesystem_location_info_t *loc, char *buf, size_t bufsize)
Put IMFS symbolic link into buffer.
Definition: imfs_symlink.c:76
int IMFS_fchmod(const rtems_filesystem_location_info_t *loc, mode_t mode)
Change the IMFS file mode.
Definition: imfs_fchmod.c:43
void IMFS_eval_path_devfs(rtems_filesystem_eval_path_context_t *ctx)
IMFS device filesystem evaluation node support.
Definition: imfs_eval_devfs.c:123
const rtems_jffs2_config jffs2_config
int rtems_jffs2_initialize(rtems_filesystem_mount_table_entry_t *mt_entry, const void *data)
Initialization handler of the JFFS2 file system.
Definition: fs-rtems.c:1369
int rtems_filesystem_default_unmount(rtems_filesystem_mount_table_entry_t *mt_entry)
Definition: default_unmount.c:41
void rtems_filesystem_default_lock(const rtems_filesystem_mount_table_entry_t *mt_entry)
Obtains the IO library mutex.
Definition: default_lock_and_unlock.c:42
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)
Definition: default_rename.c:44
int rtems_filesystem_default_mknod(const rtems_filesystem_location_info_t *parentloc, const char *name, size_t namelen, mode_t mode, dev_t dev)
Definition: default_mknod.c:44
int rtems_filesystem_default_fchmod(const rtems_filesystem_location_info_t *loc, mode_t mode)
Definition: default_fchmod.c:42
void rtems_filesystem_default_unlock(const rtems_filesystem_mount_table_entry_t *mt_entry)
Releases the IO library mutex.
Definition: default_lock_and_unlock.c:51
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...
Definition: default_are_nodes_equal.c:42
int rtems_filesystem_default_rmnod(const rtems_filesystem_location_info_t *parentloc, const rtems_filesystem_location_info_t *loc)
Definition: default_rmnod.c:44
void rtems_filesystem_default_fsunmount(rtems_filesystem_mount_table_entry_t *mt_entry)
Definition: default_fsunmount.c:39
int rtems_filesystem_default_symlink(const rtems_filesystem_location_info_t *parentloc, const char *name, size_t namelen, const char *target)
Definition: default_symlink.c:44
int rtems_filesystem_default_chown(const rtems_filesystem_location_info_t *loc, uid_t owner, gid_t group)
Definition: default_chown.c:42
ssize_t rtems_filesystem_default_readlink(const rtems_filesystem_location_info_t *loc, char *buf, size_t bufsize)
Definition: default_readlink.c:44
int rtems_filesystem_default_mount(rtems_filesystem_mount_table_entry_t *mt_entry, const void *data)
Definition: default_mount.c:41
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)
Definition: default_link.c:42
int rtems_filesystem_default_utimens(const rtems_filesystem_location_info_t *loc, struct timespec times[2])
Definition: default_utimens.c:43
void rtems_filesystem_initialize(void)
Base File System Initialization.
Definition: base_fs.c:51
#define RTEMS_ARRAY_SIZE(_array)
Gets the element count of the array.
Definition: basedefs.h:244
#define RTEMS_SYSINIT_ITEM(handler, module, order)
Creates the system initialization item associated with the handler, module, and order.
Definition: sysinit.h:204
#define CONFIGURE_IMFS_MEMFILE_BYTES_PER_BLOCK
This configuration option is an integer define.
Definition: appl-config.h:2476
#define CONFIGURE_JFFS2_DELAYED_WRITE_TASK_PRIORITY
This configuration option is an integer define.
Definition: appl-config.h:2496
#define CONFIGURE_MAXIMUM_FILE_DESCRIPTORS
This configuration option is an integer define.
Definition: appl-config.h:2920
int rtems_tftpfs_initialize(rtems_filesystem_mount_table_entry_t *mt_entry, const void *data)
Do not call directly, use mount().
Definition: tftpfs.c:150
int rtems_rfs_rtems_initialise(rtems_filesystem_mount_table_entry_t *mt_entry, const void *data)
Definition: rtems-rfs-rtems.c:769
This header file defines the API of the In-Memory File System.
RFS File system Initialization.
The ops table for user defined allocator-deallocator for IMFS memfile data blocks.
Definition: imfs.h:314
File system operations table.
Definition: libio.h:475
File system table entry.
Definition: libio.h:1714
An open file data structure.
Definition: libio.h:1325
This header file provides the API of the System Initialization Support.
This header file provides interfaces and functions used to implement the TFTP file system.