summaryrefslogtreecommitdiffstats
path: root/cpukit/include/rtems/confdefs.h
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2020-02-15 18:57:57 +0100
committerSebastian Huber <sebastian.huber@embedded-brains.de>2020-02-25 07:18:36 +0100
commit16082210d61d00ac83d1aa39055e8562755864ab (patch)
tree3242219e9be2c37490cea430c3e9c47a9f5f1c88 /cpukit/include/rtems/confdefs.h
parentconfig: Add <rtems/confdefs/percpu.h> (diff)
downloadrtems-16082210d61d00ac83d1aa39055e8562755864ab.tar.bz2
config: Add <rtems/confdefs/libio.h>
Remove all comments and copyrightable content from the moved content. Use BSD-2-Clause license for new file. Update #3053. Update #3875.
Diffstat (limited to 'cpukit/include/rtems/confdefs.h')
-rw-r--r--cpukit/include/rtems/confdefs.h449
1 files changed, 1 insertions, 448 deletions
diff --git a/cpukit/include/rtems/confdefs.h b/cpukit/include/rtems/confdefs.h
index 240dd855cc..a51693834b 100644
--- a/cpukit/include/rtems/confdefs.h
+++ b/cpukit/include/rtems/confdefs.h
@@ -50,6 +50,7 @@
#include <rtems/posix/shm.h>
#include <rtems/posix/timer.h>
#include <rtems/confdefs/obsolete.h>
+#include <rtems/confdefs/libio.h>
#include <rtems/confdefs/libpci.h>
#include <rtems/confdefs/percpu.h>
@@ -100,441 +101,6 @@ extern "C" {
#undef RTEMS_NEWLIB
#endif
-#ifndef RTEMS_SCHEDSIM
-#include <rtems/libio_.h>
-
-#ifdef CONFIGURE_INIT
- #ifndef CONFIGURE_APPLICATION_DISABLE_FILESYSTEM
- RTEMS_SYSINIT_ITEM(
- rtems_filesystem_initialize,
- RTEMS_SYSINIT_ROOT_FILESYSTEM,
- RTEMS_SYSINIT_ORDER_MIDDLE
- );
- #endif
-#endif
-#endif
-
-/**
- * This macro defines the number of POSIX file descriptors allocated
- * and managed by libio. These are the "integer" file descriptors that
- * are used by calls like open(2) and read(2).
- */
-#ifndef CONFIGURE_MAXIMUM_FILE_DESCRIPTORS
- #define CONFIGURE_MAXIMUM_FILE_DESCRIPTORS 3
-#endif
-
-#ifdef CONFIGURE_INIT
- rtems_libio_t rtems_libio_iops[CONFIGURE_MAXIMUM_FILE_DESCRIPTORS];
-
- /**
- * When instantiating the configuration tables, this variable is
- * initialized to specify the maximum number of file descriptors.
- */
- const uint32_t rtems_libio_number_iops = RTEMS_ARRAY_SIZE(rtems_libio_iops);
-#endif
-
-/*
- * This sets up the resources for the FIFOs/pipes.
- */
-
-/**
- * @defgroup ConfigFilesystems Filesystems and Mount Table Configuration
- *
- * @ingroup Configuration
- *
- * Defines to control the file system:
- *
- * - CONFIGURE_APPLICATION_DISABLE_FILESYSTEM:
- * Disable the RTEMS filesystems. You get an empty DEVFS.
- *
- * - CONFIGURE_USE_DEVFS_AS_BASE_FILESYSTEM:
- * Use the DEVFS as the root file system. Limited functions are
- * provided when this is used.
- *
- * - CONFIGURE_FILESYSTEM_ALL:
- * Add file filesystems to the default filesystem table.
- *
- * List of available file systems. You can define as many as you like:
- * - CONFIGURE_FILESYSTEM_IMFS - In Memory File System (IMFS)
- * - CONFIGURE_FILESYSTEM_DEVFS - Device File System (DSVFS)
- * - CONFIGURE_FILESYSTEM_TFTPFS - TFTP File System, networking enabled
- * - CONFIGURE_FILESYSTEM_FTPFS - FTP File System, networking enabled
- * - CONFIGURE_FILESYSTEM_NFS - Network File System, networking enabled
- * - CONFIGURE_FILESYSTEM_DOSFS - DOS File System, uses libblock
- * - CONFIGURE_FILESYSTEM_RFS - RTEMS File System (RFS), uses libblock
- * - CONFIGURE_FILESYSTEM_JFFS2 - Journalling Flash File System, Version 2
- *
- * Combinations:
- *
- * - If nothing is defined the base file system is the IMFS.
- *
- * - If CONFIGURE_APPLICATION_DISABLE_FILESYSTEM is defined all filesystems
- * are disabled by force.
- *
- * - If CONFIGURE_USE_DEVFS_AS_BASE_FILESYSTEM is defined all filesystems
- * are disabled by force and DEVFS is defined.
- */
-/**@{*/
-
-#ifdef CONFIGURE_INIT
-
- /*
- * Include all file systems. Do this before checking if the filesystem has
- * been disabled.
- */
- #ifdef CONFIGURE_FILESYSTEM_ALL
- #define CONFIGURE_FILESYSTEM_IMFS
- #define CONFIGURE_FILESYSTEM_DEVFS
- #define CONFIGURE_FILESYSTEM_TFTPFS
- #define CONFIGURE_FILESYSTEM_FTPFS
- #define CONFIGURE_FILESYSTEM_NFS
- #define CONFIGURE_FILESYSTEM_DOSFS
- #define CONFIGURE_FILESYSTEM_RFS
- #define CONFIGURE_FILESYSTEM_JFFS2
- #endif
-
- /*
- * If disabling the file system, give a compile error if the user has
- * configured other filesystem parameters.
- */
- #if defined(CONFIGURE_APPLICATION_DISABLE_FILESYSTEM)
- #if defined(CONFIGURE_USE_DEVFS_AS_BASE_FILESYSTEM)
- #error "Filesystem disabled and a base filesystem configured."
- #endif
-
- #if defined(CONFIGURE_FILESYSTEM_IMFS) || \
- defined(CONFIGURE_FILESYSTEM_DEVFS) || \
- defined(CONFIGURE_FILESYSTEM_TFTPFS) || \
- defined(CONFIGURE_FILESYSTEM_FTPFS) || \
- defined(CONFIGURE_FILESYSTEM_NFS) || \
- defined(CONFIGURE_FILESYSTEM_DOSFS) || \
- defined(CONFIGURE_FILESYSTEM_RFS) || \
- defined(CONFIGURE_FILESYSTEM_JFFS2)
- #error "Filesystem disabled and a filesystem configured."
- #endif
- #endif
-
- /*
- * If the base filesystem is DEVFS define it else define IMFS.
- * We will have either DEVFS or IMFS defined after this.
- */
- #if !defined(CONFIGURE_APPLICATION_DISABLE_FILESYSTEM)
- #if defined(CONFIGURE_USE_DEVFS_AS_BASE_FILESYSTEM)
- #define CONFIGURE_FILESYSTEM_DEVFS
- #endif
- #endif
-
-#endif
-
-#ifndef RTEMS_SCHEDSIM
-/**
- * IMFS
- */
-#include <rtems/imfs.h>
-
-/**
- * This specifies the number of bytes per block for files within the IMFS.
- * There are a maximum number of blocks per file so this dictates the maximum
- * size of a file. This has to be balanced with the unused portion of each
- * block that might be wasted.
- */
-#ifndef CONFIGURE_IMFS_MEMFILE_BYTES_PER_BLOCK
- #define CONFIGURE_IMFS_MEMFILE_BYTES_PER_BLOCK \
- IMFS_MEMFILE_DEFAULT_BYTES_PER_BLOCK
-#endif
-
-/**
- * This defines the IMFS file system table entry.
- */
-#if !defined(CONFIGURE_FILESYSTEM_ENTRY_IMFS) && \
- defined(CONFIGURE_FILESYSTEM_IMFS)
- #define CONFIGURE_FILESYSTEM_ENTRY_IMFS \
- { RTEMS_FILESYSTEM_TYPE_IMFS, IMFS_initialize }
-#endif
-#endif
-
-#ifdef CONFIGURE_USE_MINIIMFS_AS_BASE_FILESYSTEM
- #define CONFIGURE_IMFS_DISABLE_CHMOD
- #define CONFIGURE_IMFS_DISABLE_CHOWN
- #define CONFIGURE_IMFS_DISABLE_UTIME
- #define CONFIGURE_IMFS_DISABLE_LINK
- #define CONFIGURE_IMFS_DISABLE_SYMLINK
- #define CONFIGURE_IMFS_DISABLE_READLINK
- #define CONFIGURE_IMFS_DISABLE_RENAME
- #define CONFIGURE_IMFS_DISABLE_UNMOUNT
-#endif
-
-/**
- * DEVFS
- */
-#if !defined(CONFIGURE_FILESYSTEM_ENTRY_DEVFS) && \
- defined(CONFIGURE_FILESYSTEM_DEVFS)
-#include <rtems/devfs.h>
- #define CONFIGURE_FILESYSTEM_ENTRY_DEVFS \
- { RTEMS_FILESYSTEM_TYPE_DEVFS, devFS_initialize }
-#endif
-
-/**
- * FTPFS
- */
-#if !defined(CONFIGURE_FILESYSTEM_ENTRY_FTPFS) && \
- defined(CONFIGURE_FILESYSTEM_FTPFS)
- #include <rtems/ftpfs.h>
- #define CONFIGURE_FILESYSTEM_ENTRY_FTPFS \
- { RTEMS_FILESYSTEM_TYPE_FTPFS, rtems_ftpfs_initialize }
-#endif
-
-/**
- * TFTPFS
- */
-#if !defined(CONFIGURE_FILESYSTEM_ENTRY_TFTPFS) && \
- defined(CONFIGURE_FILESYSTEM_TFTPFS)
- #include <rtems/tftp.h>
- #define CONFIGURE_FILESYSTEM_ENTRY_TFTPFS \
- { RTEMS_FILESYSTEM_TYPE_TFTPFS, rtems_tftpfs_initialize }
-#endif
-
-/**
- * NFS
- */
-#if !defined(CONFIGURE_FILESYSTEM_ENTRY_NFS) && \
- defined(CONFIGURE_FILESYSTEM_NFS)
- #include <librtemsNfs.h>
- #define CONFIGURE_FILESYSTEM_ENTRY_NFS \
- { RTEMS_FILESYSTEM_TYPE_NFS, rtems_nfs_initialize }
-#endif
-
-/**
- * DOSFS
- */
-#if !defined(CONFIGURE_FILESYSTEM_ENTRY_DOSFS) && \
- defined(CONFIGURE_FILESYSTEM_DOSFS)
- #include <rtems/dosfs.h>
- #define CONFIGURE_FILESYSTEM_ENTRY_DOSFS \
- { RTEMS_FILESYSTEM_TYPE_DOSFS, rtems_dosfs_initialize }
-#endif
-
-/**
- * RFS
- */
-#if !defined(CONFIGURE_FILESYSTEM_ENTRY_RFS) && \
- defined(CONFIGURE_FILESYSTEM_RFS)
- #include <rtems/rtems-rfs.h>
- #define CONFIGURE_FILESYSTEM_ENTRY_RFS \
- { RTEMS_FILESYSTEM_TYPE_RFS, rtems_rfs_rtems_initialise }
-#endif
-
-/**
- * JFFS2
- */
-#if !defined(CONFIGURE_FILESYSTEM_ENTRY_JFFS2) && \
- defined(CONFIGURE_FILESYSTEM_JFFS2)
- #include <rtems/jffs2.h>
- #define CONFIGURE_FILESYSTEM_ENTRY_JFFS2 \
- { RTEMS_FILESYSTEM_TYPE_JFFS2, rtems_jffs2_initialize }
-#endif
-
-#ifdef CONFIGURE_INIT
-
- /**
- * DEVFS variables.
- *
- * The number of individual devices that may be registered
- * in the system or the CONFIGURE_MAXIMUM_DEVICES variable
- * is defaulted to 4 when a filesystem is enabled, unless
- * the bsp overwrides this. In which case the value is set
- * to BSP_MAXIMUM_DEVICES.
- */
- #ifdef CONFIGURE_FILESYSTEM_DEVFS
- #ifndef CONFIGURE_MAXIMUM_DEVICES
- #if defined(BSP_MAXIMUM_DEVICES)
- #define CONFIGURE_MAXIMUM_DEVICES BSP_MAXIMUM_DEVICES
- #else
- #define CONFIGURE_MAXIMUM_DEVICES 4
- #endif
- #endif
- #include <rtems/devfs.h>
- #endif
-
- /**
- * Table termination record.
- */
- #define CONFIGURE_FILESYSTEM_NULL { NULL, NULL }
-
-#ifndef RTEMS_SCHEDSIM
- #if !defined(CONFIGURE_APPLICATION_DISABLE_FILESYSTEM) && \
- !defined(CONFIGURE_USE_DEVFS_AS_BASE_FILESYSTEM)
- int imfs_rq_memfile_bytes_per_block =
- CONFIGURE_IMFS_MEMFILE_BYTES_PER_BLOCK;
- #endif
-
- /**
- * The default file system table. Must be terminated with the NULL entry if
- * you provide your own.
- */
- #ifndef CONFIGURE_APPLICATION_DISABLE_FILESYSTEM
- const rtems_filesystem_table_t rtems_filesystem_table[] = {
- #if !defined(CONFIGURE_USE_DEVFS_AS_BASE_FILESYSTEM)
- { "/", IMFS_initialize_support },
- #endif
- #if defined(CONFIGURE_FILESYSTEM_IMFS) && \
- defined(CONFIGURE_FILESYSTEM_ENTRY_IMFS)
- CONFIGURE_FILESYSTEM_ENTRY_IMFS,
- #endif
- #if defined(CONFIGURE_FILESYSTEM_DEVFS) && \
- defined(CONFIGURE_FILESYSTEM_ENTRY_DEVFS)
- CONFIGURE_FILESYSTEM_ENTRY_DEVFS,
- #endif
- #if defined(CONFIGURE_FILESYSTEM_TFTPFS) && \
- defined(CONFIGURE_FILESYSTEM_ENTRY_TFTPFS)
- CONFIGURE_FILESYSTEM_ENTRY_TFTPFS,
- #endif
- #if defined(CONFIGURE_FILESYSTEM_FTPFS) && \
- defined(CONFIGURE_FILESYSTEM_ENTRY_FTPFS)
- CONFIGURE_FILESYSTEM_ENTRY_FTPFS,
- #endif
- #if defined(CONFIGURE_FILESYSTEM_NFS) && \
- defined(CONFIGURE_FILESYSTEM_ENTRY_NFS)
- CONFIGURE_FILESYSTEM_ENTRY_NFS,
- #endif
- #if defined(CONFIGURE_FILESYSTEM_DOSFS) && \
- defined(CONFIGURE_FILESYSTEM_ENTRY_DOSFS)
- CONFIGURE_FILESYSTEM_ENTRY_DOSFS,
- #endif
- #if defined(CONFIGURE_FILESYSTEM_RFS) && \
- defined(CONFIGURE_FILESYSTEM_ENTRY_RFS)
- CONFIGURE_FILESYSTEM_ENTRY_RFS,
- #endif
- #if defined(CONFIGURE_FILESYSTEM_JFFS2) && \
- defined(CONFIGURE_FILESYSTEM_ENTRY_JFFS2)
- CONFIGURE_FILESYSTEM_ENTRY_JFFS2,
- #endif
- CONFIGURE_FILESYSTEM_NULL
- };
-
- #if defined(CONFIGURE_USE_DEVFS_AS_BASE_FILESYSTEM)
- static devFS_node devFS_root_filesystem_nodes [CONFIGURE_MAXIMUM_DEVICES];
- static const devFS_data devFS_root_filesystem_data = {
- devFS_root_filesystem_nodes,
- CONFIGURE_MAXIMUM_DEVICES
- };
- #else
- static IMFS_fs_info_t _Configure_IMFS_fs_info;
-
- static const rtems_filesystem_operations_table _Configure_IMFS_ops = {
- rtems_filesystem_default_lock,
- rtems_filesystem_default_unlock,
- IMFS_eval_path,
- #ifdef CONFIGURE_IMFS_DISABLE_LINK
- rtems_filesystem_default_link,
- #else
- IMFS_link,
- #endif
- rtems_filesystem_default_are_nodes_equal,
- #ifdef CONFIGURE_IMFS_DISABLE_MKNOD
- rtems_filesystem_default_mknod,
- #else
- IMFS_mknod,
- #endif
- #ifdef CONFIGURE_IMFS_DISABLE_RMNOD
- rtems_filesystem_default_rmnod,
- #else
- IMFS_rmnod,
- #endif
- #ifdef CONFIGURE_IMFS_DISABLE_CHMOD
- rtems_filesystem_default_fchmod,
- #else
- IMFS_fchmod,
- #endif
- #ifdef CONFIGURE_IMFS_DISABLE_CHOWN
- rtems_filesystem_default_chown,
- #else
- IMFS_chown,
- #endif
- IMFS_node_clone,
- IMFS_node_free,
- #ifdef CONFIGURE_IMFS_DISABLE_MOUNT
- rtems_filesystem_default_mount,
- #else
- IMFS_mount,
- #endif
- #ifdef CONFIGURE_IMFS_DISABLE_UNMOUNT
- rtems_filesystem_default_unmount,
- #else
- IMFS_unmount,
- #endif
- rtems_filesystem_default_fsunmount,
- #ifdef CONFIGURE_IMFS_DISABLE_UTIME
- rtems_filesystem_default_utime,
- #else
- IMFS_utime,
- #endif
- #ifdef CONFIGURE_IMFS_DISABLE_SYMLINK
- rtems_filesystem_default_symlink,
- #else
- IMFS_symlink,
- #endif
- #ifdef CONFIGURE_IMFS_DISABLE_READLINK
- rtems_filesystem_default_readlink,
- #else
- IMFS_readlink,
- #endif
- #ifdef CONFIGURE_IMFS_DISABLE_RENAME
- rtems_filesystem_default_rename,
- #else
- IMFS_rename,
- #endif
- rtems_filesystem_default_statvfs
- };
-
- static const IMFS_mknod_controls _Configure_IMFS_mknod_controls = {
- #ifdef CONFIGURE_IMFS_DISABLE_READDIR
- &IMFS_mknod_control_dir_minimal,
- #else
- &IMFS_mknod_control_dir_default,
- #endif
- &IMFS_mknod_control_device,
- #ifdef CONFIGURE_IMFS_DISABLE_MKNOD_FILE
- &IMFS_mknod_control_enosys,
- #else
- &IMFS_mknod_control_memfile,
- #endif
- #ifdef CONFIGURE_IMFS_ENABLE_MKFIFO
- &IMFS_mknod_control_fifo
- #else
- &IMFS_mknod_control_enosys
- #endif
- };
-
- static const IMFS_mount_data _Configure_IMFS_mount_data = {
- &_Configure_IMFS_fs_info,
- &_Configure_IMFS_ops,
- &_Configure_IMFS_mknod_controls
- };
- #endif
-
- const rtems_filesystem_mount_configuration
- rtems_filesystem_root_configuration = {
- NULL,
- NULL,
- #if defined(CONFIGURE_USE_DEVFS_AS_BASE_FILESYSTEM)
- RTEMS_FILESYSTEM_TYPE_DEVFS,
- #else
- "/",
- #endif
- RTEMS_FILESYSTEM_READ_WRITE,
- #if defined(CONFIGURE_USE_DEVFS_AS_BASE_FILESYSTEM)
- &devFS_root_filesystem_data
- #else
- &_Configure_IMFS_mount_data
- #endif
- };
- #endif
-
-#endif
-#endif
-/**@}*/ /* end of file system group */
-
/**
* @brief Maximum priority configuration.
*
@@ -2591,18 +2157,5 @@ struct _reent *__getreent(void)
#endif
#endif
-/*
- * IMFS block size for in memory files (memfiles) must be a power of
- * two between 16 and 512 inclusive.
- */
-#if ((CONFIGURE_IMFS_MEMFILE_BYTES_PER_BLOCK != 16) && \
- (CONFIGURE_IMFS_MEMFILE_BYTES_PER_BLOCK != 32) && \
- (CONFIGURE_IMFS_MEMFILE_BYTES_PER_BLOCK != 64) && \
- (CONFIGURE_IMFS_MEMFILE_BYTES_PER_BLOCK != 128) && \
- (CONFIGURE_IMFS_MEMFILE_BYTES_PER_BLOCK != 256) && \
- (CONFIGURE_IMFS_MEMFILE_BYTES_PER_BLOCK != 512))
- #error "IMFS Memfile block size must be a power of 2 between 16 and 512"
-#endif
-
#endif
/* end of include file */