Changeset 1608221 in rtems


Ignore:
Timestamp:
Feb 15, 2020, 5:57:57 PM (6 months ago)
Author:
Sebastian Huber <sebastian.huber@…>
Branches:
5, master
Children:
591e9736
Parents:
0f8e139e
git-author:
Sebastian Huber <sebastian.huber@…> (02/15/20 17:57:57)
git-committer:
Sebastian Huber <sebastian.huber@…> (02/25/20 06:18:36)
Message:

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.

Location:
cpukit
Files:
1 added
2 edited

Legend:

Unmodified
Added
Removed
  • cpukit/headers.am

    r0f8e139e r1608221  
    185185include_rtems_HEADERS += include/rtems/watchdogdrv.h
    186186include_rtems_confdefs_HEADERS += include/rtems/confdefs/bsp.h
     187include_rtems_confdefs_HEADERS += include/rtems/confdefs/libio.h
    187188include_rtems_confdefs_HEADERS += include/rtems/confdefs/libpci.h
    188189include_rtems_confdefs_HEADERS += include/rtems/confdefs/obsolete.h
  • cpukit/include/rtems/confdefs.h

    r0f8e139e r1608221  
    5151#include <rtems/posix/timer.h>
    5252#include <rtems/confdefs/obsolete.h>
     53#include <rtems/confdefs/libio.h>
    5354#include <rtems/confdefs/libpci.h>
    5455#include <rtems/confdefs/percpu.h>
     
    100101  #undef RTEMS_NEWLIB
    101102#endif
    102 
    103 #ifndef RTEMS_SCHEDSIM
    104 #include <rtems/libio_.h>
    105 
    106 #ifdef CONFIGURE_INIT
    107   #ifndef CONFIGURE_APPLICATION_DISABLE_FILESYSTEM
    108     RTEMS_SYSINIT_ITEM(
    109       rtems_filesystem_initialize,
    110       RTEMS_SYSINIT_ROOT_FILESYSTEM,
    111       RTEMS_SYSINIT_ORDER_MIDDLE
    112     );
    113   #endif
    114 #endif
    115 #endif
    116 
    117 /**
    118  * This macro defines the number of POSIX file descriptors allocated
    119  * and managed by libio.  These are the "integer" file descriptors that
    120  * are used by calls like open(2) and read(2).
    121  */
    122 #ifndef CONFIGURE_MAXIMUM_FILE_DESCRIPTORS
    123   #define CONFIGURE_MAXIMUM_FILE_DESCRIPTORS 3
    124 #endif
    125 
    126 #ifdef CONFIGURE_INIT
    127   rtems_libio_t rtems_libio_iops[CONFIGURE_MAXIMUM_FILE_DESCRIPTORS];
    128 
    129   /**
    130    * When instantiating the configuration tables, this variable is
    131    * initialized to specify the maximum number of file descriptors.
    132    */
    133   const uint32_t rtems_libio_number_iops = RTEMS_ARRAY_SIZE(rtems_libio_iops);
    134 #endif
    135 
    136 /*
    137  * This sets up the resources for the FIFOs/pipes.
    138  */
    139 
    140 /**
    141  *  @defgroup ConfigFilesystems Filesystems and Mount Table Configuration
    142  *
    143  *  @ingroup Configuration
    144  *
    145  *  Defines to control the file system:
    146  *
    147  *   - CONFIGURE_APPLICATION_DISABLE_FILESYSTEM:
    148  *     Disable the RTEMS filesystems. You get an empty DEVFS.
    149  *
    150  *   - CONFIGURE_USE_DEVFS_AS_BASE_FILESYSTEM:
    151  *     Use the DEVFS as the root file system. Limited functions are
    152  *     provided when this is used.
    153  *
    154  *   - CONFIGURE_FILESYSTEM_ALL:
    155  *     Add file filesystems to the default filesystem table.
    156  *
    157  *   List of available file systems. You can define as many as you like:
    158  *     - CONFIGURE_FILESYSTEM_IMFS   - In Memory File System (IMFS)
    159  *     - CONFIGURE_FILESYSTEM_DEVFS  - Device File System (DSVFS)
    160  *     - CONFIGURE_FILESYSTEM_TFTPFS - TFTP File System, networking enabled
    161  *     - CONFIGURE_FILESYSTEM_FTPFS  - FTP File System, networking enabled
    162  *     - CONFIGURE_FILESYSTEM_NFS    - Network File System, networking enabled
    163  *     - CONFIGURE_FILESYSTEM_DOSFS  - DOS File System, uses libblock
    164  *     - CONFIGURE_FILESYSTEM_RFS    - RTEMS File System (RFS), uses libblock
    165  *     - CONFIGURE_FILESYSTEM_JFFS2  - Journalling Flash File System, Version 2
    166  *
    167  *   Combinations:
    168  *
    169  *    - If nothing is defined the base file system is the IMFS.
    170  *
    171  *    - If CONFIGURE_APPLICATION_DISABLE_FILESYSTEM is defined all filesystems
    172  *      are disabled by force.
    173  *
    174  *    - If CONFIGURE_USE_DEVFS_AS_BASE_FILESYSTEM is defined all filesystems
    175  *      are disabled by force and DEVFS is defined.
    176  */
    177 /**@{*/
    178 
    179 #ifdef CONFIGURE_INIT
    180 
    181   /*
    182    * Include all file systems. Do this before checking if the filesystem has
    183    * been disabled.
    184    */
    185   #ifdef CONFIGURE_FILESYSTEM_ALL
    186     #define CONFIGURE_FILESYSTEM_IMFS
    187     #define CONFIGURE_FILESYSTEM_DEVFS
    188     #define CONFIGURE_FILESYSTEM_TFTPFS
    189     #define CONFIGURE_FILESYSTEM_FTPFS
    190     #define CONFIGURE_FILESYSTEM_NFS
    191     #define CONFIGURE_FILESYSTEM_DOSFS
    192     #define CONFIGURE_FILESYSTEM_RFS
    193     #define CONFIGURE_FILESYSTEM_JFFS2
    194   #endif
    195 
    196   /*
    197    * If disabling the file system, give a compile error if the user has
    198    * configured other filesystem parameters.
    199    */
    200   #if defined(CONFIGURE_APPLICATION_DISABLE_FILESYSTEM)
    201      #if defined(CONFIGURE_USE_DEVFS_AS_BASE_FILESYSTEM)
    202        #error "Filesystem disabled and a base filesystem configured."
    203      #endif
    204 
    205      #if defined(CONFIGURE_FILESYSTEM_IMFS) || \
    206        defined(CONFIGURE_FILESYSTEM_DEVFS) || \
    207        defined(CONFIGURE_FILESYSTEM_TFTPFS) || \
    208        defined(CONFIGURE_FILESYSTEM_FTPFS) || \
    209        defined(CONFIGURE_FILESYSTEM_NFS) || \
    210        defined(CONFIGURE_FILESYSTEM_DOSFS) || \
    211        defined(CONFIGURE_FILESYSTEM_RFS) || \
    212        defined(CONFIGURE_FILESYSTEM_JFFS2)
    213        #error "Filesystem disabled and a filesystem configured."
    214      #endif
    215   #endif
    216 
    217   /*
    218    * If the base filesystem is DEVFS define it else define IMFS.
    219    * We will have either DEVFS or IMFS defined after this.
    220    */
    221   #if !defined(CONFIGURE_APPLICATION_DISABLE_FILESYSTEM)
    222     #if defined(CONFIGURE_USE_DEVFS_AS_BASE_FILESYSTEM)
    223       #define CONFIGURE_FILESYSTEM_DEVFS
    224     #endif
    225   #endif
    226 
    227 #endif
    228 
    229 #ifndef RTEMS_SCHEDSIM
    230 /**
    231  * IMFS
    232  */
    233 #include <rtems/imfs.h>
    234 
    235 /**
    236  * This specifies the number of bytes per block for files within the IMFS.
    237  * There are a maximum number of blocks per file so this dictates the maximum
    238  * size of a file.  This has to be balanced with the unused portion of each
    239  * block that might be wasted.
    240  */
    241 #ifndef CONFIGURE_IMFS_MEMFILE_BYTES_PER_BLOCK
    242   #define CONFIGURE_IMFS_MEMFILE_BYTES_PER_BLOCK \
    243                     IMFS_MEMFILE_DEFAULT_BYTES_PER_BLOCK
    244 #endif
    245 
    246 /**
    247  * This defines the IMFS file system table entry.
    248  */
    249 #if !defined(CONFIGURE_FILESYSTEM_ENTRY_IMFS) && \
    250   defined(CONFIGURE_FILESYSTEM_IMFS)
    251   #define CONFIGURE_FILESYSTEM_ENTRY_IMFS \
    252     { RTEMS_FILESYSTEM_TYPE_IMFS, IMFS_initialize }
    253 #endif
    254 #endif
    255 
    256 #ifdef CONFIGURE_USE_MINIIMFS_AS_BASE_FILESYSTEM
    257   #define CONFIGURE_IMFS_DISABLE_CHMOD
    258   #define CONFIGURE_IMFS_DISABLE_CHOWN
    259   #define CONFIGURE_IMFS_DISABLE_UTIME
    260   #define CONFIGURE_IMFS_DISABLE_LINK
    261   #define CONFIGURE_IMFS_DISABLE_SYMLINK
    262   #define CONFIGURE_IMFS_DISABLE_READLINK
    263   #define CONFIGURE_IMFS_DISABLE_RENAME
    264   #define CONFIGURE_IMFS_DISABLE_UNMOUNT
    265 #endif
    266 
    267 /**
    268  * DEVFS
    269  */
    270 #if !defined(CONFIGURE_FILESYSTEM_ENTRY_DEVFS) && \
    271     defined(CONFIGURE_FILESYSTEM_DEVFS)
    272 #include <rtems/devfs.h>
    273   #define CONFIGURE_FILESYSTEM_ENTRY_DEVFS \
    274     { RTEMS_FILESYSTEM_TYPE_DEVFS, devFS_initialize }
    275 #endif
    276 
    277 /**
    278  * FTPFS
    279  */
    280 #if !defined(CONFIGURE_FILESYSTEM_ENTRY_FTPFS) && \
    281     defined(CONFIGURE_FILESYSTEM_FTPFS)
    282   #include <rtems/ftpfs.h>
    283   #define CONFIGURE_FILESYSTEM_ENTRY_FTPFS \
    284     { RTEMS_FILESYSTEM_TYPE_FTPFS, rtems_ftpfs_initialize }
    285 #endif
    286 
    287 /**
    288  * TFTPFS
    289  */
    290 #if !defined(CONFIGURE_FILESYSTEM_ENTRY_TFTPFS) && \
    291     defined(CONFIGURE_FILESYSTEM_TFTPFS)
    292   #include <rtems/tftp.h>
    293   #define CONFIGURE_FILESYSTEM_ENTRY_TFTPFS \
    294     { RTEMS_FILESYSTEM_TYPE_TFTPFS, rtems_tftpfs_initialize }
    295 #endif
    296 
    297 /**
    298  * NFS
    299  */
    300 #if !defined(CONFIGURE_FILESYSTEM_ENTRY_NFS) && \
    301     defined(CONFIGURE_FILESYSTEM_NFS)
    302   #include <librtemsNfs.h>
    303   #define CONFIGURE_FILESYSTEM_ENTRY_NFS \
    304     { RTEMS_FILESYSTEM_TYPE_NFS, rtems_nfs_initialize }
    305 #endif
    306 
    307 /**
    308  * DOSFS
    309  */
    310 #if !defined(CONFIGURE_FILESYSTEM_ENTRY_DOSFS) && \
    311     defined(CONFIGURE_FILESYSTEM_DOSFS)
    312   #include <rtems/dosfs.h>
    313   #define CONFIGURE_FILESYSTEM_ENTRY_DOSFS \
    314     { RTEMS_FILESYSTEM_TYPE_DOSFS, rtems_dosfs_initialize }
    315 #endif
    316 
    317 /**
    318  * RFS
    319  */
    320 #if !defined(CONFIGURE_FILESYSTEM_ENTRY_RFS) && \
    321     defined(CONFIGURE_FILESYSTEM_RFS)
    322   #include <rtems/rtems-rfs.h>
    323   #define CONFIGURE_FILESYSTEM_ENTRY_RFS \
    324     { RTEMS_FILESYSTEM_TYPE_RFS, rtems_rfs_rtems_initialise }
    325 #endif
    326 
    327 /**
    328  * JFFS2
    329  */
    330 #if !defined(CONFIGURE_FILESYSTEM_ENTRY_JFFS2) && \
    331     defined(CONFIGURE_FILESYSTEM_JFFS2)
    332   #include <rtems/jffs2.h>
    333   #define CONFIGURE_FILESYSTEM_ENTRY_JFFS2 \
    334     { RTEMS_FILESYSTEM_TYPE_JFFS2, rtems_jffs2_initialize }
    335 #endif
    336 
    337 #ifdef CONFIGURE_INIT
    338 
    339   /**
    340    * DEVFS variables.
    341    *
    342    * The number of individual devices that may be registered
    343    * in the system or the CONFIGURE_MAXIMUM_DEVICES variable
    344    * is defaulted to 4 when a filesystem is enabled, unless
    345    * the bsp overwrides this.  In which case the value is set
    346    * to BSP_MAXIMUM_DEVICES.
    347    */
    348   #ifdef CONFIGURE_FILESYSTEM_DEVFS
    349     #ifndef CONFIGURE_MAXIMUM_DEVICES
    350       #if defined(BSP_MAXIMUM_DEVICES)
    351         #define CONFIGURE_MAXIMUM_DEVICES BSP_MAXIMUM_DEVICES
    352       #else
    353         #define CONFIGURE_MAXIMUM_DEVICES 4
    354       #endif
    355     #endif
    356     #include <rtems/devfs.h>
    357   #endif
    358 
    359   /**
    360    * Table termination record.
    361    */
    362   #define CONFIGURE_FILESYSTEM_NULL { NULL, NULL }
    363 
    364 #ifndef RTEMS_SCHEDSIM
    365   #if !defined(CONFIGURE_APPLICATION_DISABLE_FILESYSTEM) && \
    366     !defined(CONFIGURE_USE_DEVFS_AS_BASE_FILESYSTEM)
    367     int imfs_rq_memfile_bytes_per_block =
    368       CONFIGURE_IMFS_MEMFILE_BYTES_PER_BLOCK;
    369   #endif
    370 
    371   /**
    372    * The default file system table. Must be terminated with the NULL entry if
    373    * you provide your own.
    374    */
    375   #ifndef CONFIGURE_APPLICATION_DISABLE_FILESYSTEM
    376     const rtems_filesystem_table_t rtems_filesystem_table[] = {
    377       #if !defined(CONFIGURE_USE_DEVFS_AS_BASE_FILESYSTEM)
    378         { "/", IMFS_initialize_support },
    379       #endif
    380       #if defined(CONFIGURE_FILESYSTEM_IMFS) && \
    381           defined(CONFIGURE_FILESYSTEM_ENTRY_IMFS)
    382         CONFIGURE_FILESYSTEM_ENTRY_IMFS,
    383       #endif
    384       #if defined(CONFIGURE_FILESYSTEM_DEVFS) && \
    385           defined(CONFIGURE_FILESYSTEM_ENTRY_DEVFS)
    386         CONFIGURE_FILESYSTEM_ENTRY_DEVFS,
    387       #endif
    388       #if defined(CONFIGURE_FILESYSTEM_TFTPFS) && \
    389           defined(CONFIGURE_FILESYSTEM_ENTRY_TFTPFS)
    390         CONFIGURE_FILESYSTEM_ENTRY_TFTPFS,
    391       #endif
    392       #if defined(CONFIGURE_FILESYSTEM_FTPFS) && \
    393           defined(CONFIGURE_FILESYSTEM_ENTRY_FTPFS)
    394         CONFIGURE_FILESYSTEM_ENTRY_FTPFS,
    395       #endif
    396       #if defined(CONFIGURE_FILESYSTEM_NFS) && \
    397           defined(CONFIGURE_FILESYSTEM_ENTRY_NFS)
    398         CONFIGURE_FILESYSTEM_ENTRY_NFS,
    399       #endif
    400       #if defined(CONFIGURE_FILESYSTEM_DOSFS) && \
    401           defined(CONFIGURE_FILESYSTEM_ENTRY_DOSFS)
    402         CONFIGURE_FILESYSTEM_ENTRY_DOSFS,
    403       #endif
    404       #if defined(CONFIGURE_FILESYSTEM_RFS) && \
    405           defined(CONFIGURE_FILESYSTEM_ENTRY_RFS)
    406         CONFIGURE_FILESYSTEM_ENTRY_RFS,
    407       #endif
    408       #if defined(CONFIGURE_FILESYSTEM_JFFS2) && \
    409           defined(CONFIGURE_FILESYSTEM_ENTRY_JFFS2)
    410         CONFIGURE_FILESYSTEM_ENTRY_JFFS2,
    411       #endif
    412       CONFIGURE_FILESYSTEM_NULL
    413     };
    414 
    415     #if defined(CONFIGURE_USE_DEVFS_AS_BASE_FILESYSTEM)
    416       static devFS_node devFS_root_filesystem_nodes [CONFIGURE_MAXIMUM_DEVICES];
    417       static const devFS_data devFS_root_filesystem_data = {
    418         devFS_root_filesystem_nodes,
    419         CONFIGURE_MAXIMUM_DEVICES
    420       };
    421     #else
    422       static IMFS_fs_info_t _Configure_IMFS_fs_info;
    423 
    424       static const rtems_filesystem_operations_table _Configure_IMFS_ops = {
    425         rtems_filesystem_default_lock,
    426         rtems_filesystem_default_unlock,
    427         IMFS_eval_path,
    428         #ifdef CONFIGURE_IMFS_DISABLE_LINK
    429           rtems_filesystem_default_link,
    430         #else
    431           IMFS_link,
    432         #endif
    433         rtems_filesystem_default_are_nodes_equal,
    434         #ifdef CONFIGURE_IMFS_DISABLE_MKNOD
    435           rtems_filesystem_default_mknod,
    436         #else
    437           IMFS_mknod,
    438         #endif
    439         #ifdef CONFIGURE_IMFS_DISABLE_RMNOD
    440           rtems_filesystem_default_rmnod,
    441         #else
    442           IMFS_rmnod,
    443         #endif
    444         #ifdef CONFIGURE_IMFS_DISABLE_CHMOD
    445           rtems_filesystem_default_fchmod,
    446         #else
    447           IMFS_fchmod,
    448         #endif
    449         #ifdef CONFIGURE_IMFS_DISABLE_CHOWN
    450           rtems_filesystem_default_chown,
    451         #else
    452           IMFS_chown,
    453         #endif
    454         IMFS_node_clone,
    455         IMFS_node_free,
    456         #ifdef CONFIGURE_IMFS_DISABLE_MOUNT
    457           rtems_filesystem_default_mount,
    458         #else
    459           IMFS_mount,
    460         #endif
    461         #ifdef CONFIGURE_IMFS_DISABLE_UNMOUNT
    462           rtems_filesystem_default_unmount,
    463         #else
    464           IMFS_unmount,
    465         #endif
    466         rtems_filesystem_default_fsunmount,
    467         #ifdef CONFIGURE_IMFS_DISABLE_UTIME
    468           rtems_filesystem_default_utime,
    469         #else
    470           IMFS_utime,
    471         #endif
    472         #ifdef CONFIGURE_IMFS_DISABLE_SYMLINK
    473           rtems_filesystem_default_symlink,
    474         #else
    475           IMFS_symlink,
    476         #endif
    477         #ifdef CONFIGURE_IMFS_DISABLE_READLINK
    478           rtems_filesystem_default_readlink,
    479         #else
    480           IMFS_readlink,
    481         #endif
    482         #ifdef CONFIGURE_IMFS_DISABLE_RENAME
    483           rtems_filesystem_default_rename,
    484         #else
    485           IMFS_rename,
    486         #endif
    487         rtems_filesystem_default_statvfs
    488       };
    489 
    490       static const IMFS_mknod_controls _Configure_IMFS_mknod_controls = {
    491         #ifdef CONFIGURE_IMFS_DISABLE_READDIR
    492           &IMFS_mknod_control_dir_minimal,
    493         #else
    494           &IMFS_mknod_control_dir_default,
    495         #endif
    496         &IMFS_mknod_control_device,
    497         #ifdef CONFIGURE_IMFS_DISABLE_MKNOD_FILE
    498           &IMFS_mknod_control_enosys,
    499         #else
    500           &IMFS_mknod_control_memfile,
    501         #endif
    502         #ifdef CONFIGURE_IMFS_ENABLE_MKFIFO
    503           &IMFS_mknod_control_fifo
    504         #else
    505           &IMFS_mknod_control_enosys
    506         #endif
    507       };
    508 
    509       static const IMFS_mount_data _Configure_IMFS_mount_data = {
    510         &_Configure_IMFS_fs_info,
    511         &_Configure_IMFS_ops,
    512         &_Configure_IMFS_mknod_controls
    513       };
    514     #endif
    515 
    516     const rtems_filesystem_mount_configuration
    517       rtems_filesystem_root_configuration = {
    518       NULL,
    519       NULL,
    520       #if defined(CONFIGURE_USE_DEVFS_AS_BASE_FILESYSTEM)
    521         RTEMS_FILESYSTEM_TYPE_DEVFS,
    522       #else
    523         "/",
    524       #endif
    525       RTEMS_FILESYSTEM_READ_WRITE,
    526       #if defined(CONFIGURE_USE_DEVFS_AS_BASE_FILESYSTEM)
    527         &devFS_root_filesystem_data
    528       #else
    529         &_Configure_IMFS_mount_data
    530       #endif
    531     };
    532   #endif
    533 
    534 #endif
    535 #endif
    536 /**@}*/ /* end of file system group */
    537103
    538104/**
     
    25922158#endif
    25932159
    2594 /*
    2595  * IMFS block size for in memory files (memfiles) must be a power of
    2596  * two between 16 and 512 inclusive.
    2597  */
    2598 #if ((CONFIGURE_IMFS_MEMFILE_BYTES_PER_BLOCK != 16) && \
    2599      (CONFIGURE_IMFS_MEMFILE_BYTES_PER_BLOCK != 32) && \
    2600      (CONFIGURE_IMFS_MEMFILE_BYTES_PER_BLOCK != 64) && \
    2601      (CONFIGURE_IMFS_MEMFILE_BYTES_PER_BLOCK != 128) && \
    2602      (CONFIGURE_IMFS_MEMFILE_BYTES_PER_BLOCK != 256) && \
    2603      (CONFIGURE_IMFS_MEMFILE_BYTES_PER_BLOCK != 512))
    2604   #error "IMFS Memfile block size must be a power of 2 between 16 and 512"
    2605 #endif
    2606 
    26072160#endif
    26082161/* end of include file */
Note: See TracChangeset for help on using the changeset viewer.