Remove all comments and copyrightable content from the moved content. Use BSD-2-Clause license for new file.
Update #3053. Update #3875. --- cpukit/headers.am | 1 + cpukit/include/rtems/confdefs.h | 148 +------------------------- cpukit/include/rtems/confdefs/iodrivers.h | 166 ++++++++++++++++++++++++++++++ 3 files changed, 168 insertions(+), 147 deletions(-) create mode 100644 cpukit/include/rtems/confdefs/iodrivers.h diff --git a/cpukit/headers.am b/cpukit/headers.am index 2456c42f94..9f2e06b870 100644 --- a/cpukit/headers.am +++ b/cpukit/headers.am @@ -190,6 +190,7 @@ include_rtems_confdefs_HEADERS += include/rtems/confdefs/console.h include_rtems_confdefs_HEADERS += include/rtems/confdefs/extensions.h include_rtems_confdefs_HEADERS += include/rtems/confdefs/inittask.h include_rtems_confdefs_HEADERS += include/rtems/confdefs/initthread.h +include_rtems_confdefs_HEADERS += include/rtems/confdefs/iodrivers.h include_rtems_confdefs_HEADERS += include/rtems/confdefs/libio.h include_rtems_confdefs_HEADERS += include/rtems/confdefs/libpci.h include_rtems_confdefs_HEADERS += include/rtems/confdefs/malloc.h diff --git a/cpukit/include/rtems/confdefs.h b/cpukit/include/rtems/confdefs.h index 052f958b1a..e1b23ddaef 100644 --- a/cpukit/include/rtems/confdefs.h +++ b/cpukit/include/rtems/confdefs.h @@ -26,7 +26,6 @@ * Include the executive's configuration */ #include <rtems.h> -#include <rtems/ioimpl.h> #include <rtems/sysinit.h> #include <rtems/score/apimutex.h> #include <rtems/score/context.h> @@ -54,6 +53,7 @@ #include <rtems/confdefs/extensions.h> #include <rtems/confdefs/inittask.h> #include <rtems/confdefs/initthread.h> +#include <rtems/confdefs/iodrivers.h> #include <rtems/confdefs/libio.h> #include <rtems/confdefs/libpci.h> #include <rtems/confdefs/malloc.h> @@ -146,151 +146,6 @@ extern "C" { #endif /**@}*/ -/** - * @defgroup ConfigurationDriverTable Device Driver Table Configuration - * - * @addtogroup Configuration - * - * This group contains parameters related to generating a Device Driver - * Table. - * - * Default Device Driver Table. Each driver needed by the test is explicitly - * chosen by the application. There is always a null driver entry. - */ -/**@{*/ - -/** - * This is an empty device driver slot. - */ -#define NULL_DRIVER_TABLE_ENTRY \ - { NULL, NULL, NULL, NULL, NULL, NULL } - -#if (defined(CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER) && \ - defined(CONFIGURE_APPLICATION_NEEDS_SIMPLE_CONSOLE_DRIVER)) || \ - (defined(CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER) && \ - defined(CONFIGURE_APPLICATION_NEEDS_SIMPLE_TASK_CONSOLE_DRIVER)) || \ - (defined(CONFIGURE_APPLICATION_NEEDS_SIMPLE_CONSOLE_DRIVER) && \ - defined(CONFIGURE_APPLICATION_NEEDS_SIMPLE_TASK_CONSOLE_DRIVER)) -#error "CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER, CONFIGURE_APPLICATION_NEEDS_SIMPLE_CONSOLE_DRIVER, and CONFIGURE_APPLICATION_NEEDS_SIMPLE_TASK_CONSOLE_DRIVER are mutually exclusive" -#endif - -#ifdef CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER - #include <rtems/console.h> -#endif - -#ifdef CONFIGURE_APPLICATION_NEEDS_TIMER_DRIVER - #include <rtems/btimer.h> -#endif - -#ifdef CONFIGURE_APPLICATION_NEEDS_RTC_DRIVER - #include <rtems/rtc.h> -#endif - -#ifdef CONFIGURE_APPLICATION_NEEDS_WATCHDOG_DRIVER - #include <rtems/watchdogdrv.h> -#endif - -#ifdef CONFIGURE_APPLICATION_NEEDS_FRAME_BUFFER_DRIVER - #include <rtems/framebuffer.h> -#endif - -#ifdef CONFIGURE_APPLICATION_NEEDS_STUB_DRIVER - #include <rtems/devnull.h> -#endif - -#ifdef CONFIGURE_APPLICATION_NEEDS_ZERO_DRIVER - #include <rtems/devzero.h> -#endif - -#ifdef CONFIGURE_APPLICATION_NEEDS_IDE_DRIVER - /* the ide driver needs the ATA driver */ - #ifndef CONFIGURE_APPLICATION_NEEDS_ATA_DRIVER - #define CONFIGURE_APPLICATION_NEEDS_ATA_DRIVER - #endif - #include <libchip/ide_ctrl.h> -#endif - -#ifdef CONFIGURE_APPLICATION_NEEDS_ATA_DRIVER - #include <libchip/ata.h> -#endif - -/** - * This specifies the maximum number of device drivers that - * can be installed in the system at one time. It must account - * for both the statically and dynamically installed drivers. - */ -#ifndef CONFIGURE_MAXIMUM_DRIVERS - #define CONFIGURE_MAXIMUM_DRIVERS -#endif - -#ifdef CONFIGURE_INIT - rtems_driver_address_table - _IO_Driver_address_table[ CONFIGURE_MAXIMUM_DRIVERS ] = { - #ifdef CONFIGURE_BSP_PREREQUISITE_DRIVERS - CONFIGURE_BSP_PREREQUISITE_DRIVERS, - #endif - #ifdef CONFIGURE_APPLICATION_PREREQUISITE_DRIVERS - CONFIGURE_APPLICATION_PREREQUISITE_DRIVERS, - #endif - #ifdef CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER - CONSOLE_DRIVER_TABLE_ENTRY, - #endif - #ifdef CONFIGURE_APPLICATION_NEEDS_RTC_DRIVER - RTC_DRIVER_TABLE_ENTRY, - #endif - #ifdef CONFIGURE_APPLICATION_NEEDS_WATCHDOG_DRIVER - WATCHDOG_DRIVER_TABLE_ENTRY, - #endif - #ifdef CONFIGURE_APPLICATION_NEEDS_STUB_DRIVER - DEVNULL_DRIVER_TABLE_ENTRY, - #endif - #ifdef CONFIGURE_APPLICATION_NEEDS_ZERO_DRIVER - DEVZERO_DRIVER_TABLE_ENTRY, - #endif - #ifdef CONFIGURE_APPLICATION_NEEDS_IDE_DRIVER - IDE_CONTROLLER_DRIVER_TABLE_ENTRY, - #endif - #ifdef CONFIGURE_APPLICATION_NEEDS_ATA_DRIVER - ATA_DRIVER_TABLE_ENTRY, - #endif - #ifdef CONFIGURE_APPLICATION_NEEDS_FRAME_BUFFER_DRIVER - FRAME_BUFFER_DRIVER_TABLE_ENTRY, - #endif - #ifdef CONFIGURE_APPLICATION_EXTRA_DRIVERS - CONFIGURE_APPLICATION_EXTRA_DRIVERS, - #endif - #ifdef CONFIGURE_APPLICATION_NEEDS_NULL_DRIVER - NULL_DRIVER_TABLE_ENTRY - #elif !defined(CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER) && \ - !defined(CONFIGURE_APPLICATION_NEEDS_RTC_DRIVER) && \ - !defined(CONFIGURE_APPLICATION_NEEDS_STUB_DRIVER) && \ - !defined(CONFIGURE_APPLICATION_NEEDS_ZERO_DRIVER) && \ - !defined(CONFIGURE_APPLICATION_NEEDS_IDE_DRIVER) && \ - !defined(CONFIGURE_APPLICATION_NEEDS_ATA_DRIVER) && \ - !defined(CONFIGURE_APPLICATION_NEEDS_FRAME_BUFFER_DRIVER) && \ - !defined(CONFIGURE_APPLICATION_EXTRA_DRIVERS) - NULL_DRIVER_TABLE_ENTRY - #endif - }; - - const size_t _IO_Number_of_drivers = - RTEMS_ARRAY_SIZE( _IO_Driver_address_table ); -#endif - -#ifdef CONFIGURE_APPLICATION_NEEDS_ATA_DRIVER - /* - * configure the priority of the ATA driver task - */ - #ifndef CONFIGURE_ATA_DRIVER_TASK_PRIORITY - #define CONFIGURE_ATA_DRIVER_TASK_PRIORITY ATA_DRIVER_TASK_DEFAULT_PRIORITY - #endif - #ifdef CONFIGURE_INIT - rtems_task_priority rtems_ata_driver_task_priority - = CONFIGURE_ATA_DRIVER_TASK_PRIORITY; - #endif /* CONFIGURE_INIT */ -#endif -/**@}*/ /* end of Device Driver Table Configuration */ - /** * This macro specifies that the user wants to use unlimited objects for any * classic or posix objects that have not already been given resource limits. @@ -378,7 +233,6 @@ extern "C" { #endif /* RTEMS_POSIX_API */ #endif /* CONFIGURE_UNLIMITED_OBJECTS */ - /** * @defgroup ConfigurationClassicAPI Classic API Configuration * diff --git a/cpukit/include/rtems/confdefs/iodrivers.h b/cpukit/include/rtems/confdefs/iodrivers.h new file mode 100644 index 0000000000..f6649f7994 --- /dev/null +++ b/cpukit/include/rtems/confdefs/iodrivers.h @@ -0,0 +1,166 @@ +/* + * SPDX-License-Identifier: BSD-2-Clause + * + * Copyright (C) 2020 embedded brains GmbH (http://www.embedded-brains.de) + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ + +/** + * @file + * + * @ingroup RTEMSApplicationConfiguration + * + * @brief Evaluate IO Driver Configuration Options + */ + +#ifndef _RTEMS_CONFDEFS_IODRIVERS_H +#define _RTEMS_CONFDEFS_IODRIVERS_H + +#ifndef __CONFIGURATION_TEMPLATE_h +#error "Do not include this file directly, use <rtems/confdefs.h> instead" +#endif + +#ifdef CONFIGURE_INIT + +#include <rtems/ioimpl.h> + +#ifdef CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER + #if defined(CONFIGURE_APPLICATION_NEEDS_SIMPLE_CONSOLE_DRIVER) \ + || defined(CONFIGURE_APPLICATION_NEEDS_SIMPLE_TASK_CONSOLE_DRIVER) + #error "CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER, CONFIGURE_APPLICATION_NEEDS_SIMPLE_CONSOLE_DRIVER, and CONFIGURE_APPLICATION_NEEDS_SIMPLE_TASK_CONSOLE_DRIVER are mutually exclusive" + #endif + + #include <rtems/console.h> +#endif + +#ifdef CONFIGURE_APPLICATION_NEEDS_TIMER_DRIVER + #include <rtems/btimer.h> +#endif + +#ifdef CONFIGURE_APPLICATION_NEEDS_RTC_DRIVER + #include <rtems/rtc.h> +#endif + +#ifdef CONFIGURE_APPLICATION_NEEDS_WATCHDOG_DRIVER + #include <rtems/watchdogdrv.h> +#endif + +#ifdef CONFIGURE_APPLICATION_NEEDS_FRAME_BUFFER_DRIVER + #include <rtems/framebuffer.h> +#endif + +#ifdef CONFIGURE_APPLICATION_NEEDS_STUB_DRIVER + #include <rtems/devnull.h> +#endif + +#ifdef CONFIGURE_APPLICATION_NEEDS_ZERO_DRIVER + #include <rtems/devzero.h> +#endif + +#ifdef CONFIGURE_APPLICATION_NEEDS_IDE_DRIVER + #ifndef CONFIGURE_APPLICATION_NEEDS_ATA_DRIVER + #define CONFIGURE_APPLICATION_NEEDS_ATA_DRIVER + #endif + + #include <libchip/ide_ctrl.h> +#endif + +#ifdef CONFIGURE_APPLICATION_NEEDS_ATA_DRIVER + #include <libchip/ata.h> +#endif + +#ifndef CONFIGURE_MAXIMUM_DRIVERS + #define CONFIGURE_MAXIMUM_DRIVERS +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +rtems_driver_address_table +_IO_Driver_address_table[ CONFIGURE_MAXIMUM_DRIVERS ] = { + #ifdef CONFIGURE_BSP_PREREQUISITE_DRIVERS + CONFIGURE_BSP_PREREQUISITE_DRIVERS, + #endif + #ifdef CONFIGURE_APPLICATION_PREREQUISITE_DRIVERS + CONFIGURE_APPLICATION_PREREQUISITE_DRIVERS, + #endif + #ifdef CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER + CONSOLE_DRIVER_TABLE_ENTRY, + #endif + #ifdef CONFIGURE_APPLICATION_NEEDS_RTC_DRIVER + RTC_DRIVER_TABLE_ENTRY, + #endif + #ifdef CONFIGURE_APPLICATION_NEEDS_WATCHDOG_DRIVER + WATCHDOG_DRIVER_TABLE_ENTRY, + #endif + #ifdef CONFIGURE_APPLICATION_NEEDS_STUB_DRIVER + DEVNULL_DRIVER_TABLE_ENTRY, + #endif + #ifdef CONFIGURE_APPLICATION_NEEDS_ZERO_DRIVER + DEVZERO_DRIVER_TABLE_ENTRY, + #endif + #ifdef CONFIGURE_APPLICATION_NEEDS_IDE_DRIVER + IDE_CONTROLLER_DRIVER_TABLE_ENTRY, + #endif + #ifdef CONFIGURE_APPLICATION_NEEDS_ATA_DRIVER + ATA_DRIVER_TABLE_ENTRY, + #endif + #ifdef CONFIGURE_APPLICATION_NEEDS_FRAME_BUFFER_DRIVER + FRAME_BUFFER_DRIVER_TABLE_ENTRY, + #endif + #ifdef CONFIGURE_APPLICATION_EXTRA_DRIVERS + CONFIGURE_APPLICATION_EXTRA_DRIVERS, + #endif + #if defined(CONFIGURE_APPLICATION_NEEDS_NULL_DRIVER) \ + || ( !defined(CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER) \ + && !defined(CONFIGURE_APPLICATION_NEEDS_RTC_DRIVER) \ + && !defined(CONFIGURE_APPLICATION_NEEDS_STUB_DRIVER) \ + && !defined(CONFIGURE_APPLICATION_NEEDS_ZERO_DRIVER) \ + && !defined(CONFIGURE_APPLICATION_NEEDS_IDE_DRIVER) \ + && !defined(CONFIGURE_APPLICATION_NEEDS_ATA_DRIVER) \ + && !defined(CONFIGURE_APPLICATION_NEEDS_FRAME_BUFFER_DRIVER) \ + && !defined(CONFIGURE_APPLICATION_EXTRA_DRIVERS) ) + { NULL, NULL, NULL, NULL, NULL, NULL } + #endif +}; + +const size_t _IO_Number_of_drivers = + RTEMS_ARRAY_SIZE( _IO_Driver_address_table ); + +#ifdef CONFIGURE_APPLICATION_NEEDS_ATA_DRIVER + #ifndef CONFIGURE_ATA_DRIVER_TASK_PRIORITY + #define CONFIGURE_ATA_DRIVER_TASK_PRIORITY ATA_DRIVER_TASK_DEFAULT_PRIORITY + #endif + + rtems_task_priority rtems_ata_driver_task_priority + = CONFIGURE_ATA_DRIVER_TASK_PRIORITY; +#endif + +#ifdef __cplusplus +} +#endif + +#endif /* CONFIGURE_INIT */ + +#endif /* _RTEMS_CONFDEFS_IODRIVERS_H */ -- 2.16.4 _______________________________________________ devel mailing list devel@rtems.org http://lists.rtems.org/mailman/listinfo/devel