diff options
author | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2020-05-28 13:47:15 +0200 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2020-09-18 09:56:29 +0200 |
commit | 801a6315fae1a23b3ae13fcb93a0da421c1479c1 (patch) | |
tree | 313112c5e2eb101bfbec8f410201434256872998 | |
parent | 87c6be6145ef9c5180d9977726d2e9d349719e5c (diff) |
Generate <rtems/config.h>
-rw-r--r-- | cpukit/include/rtems/config.h | 362 |
1 files changed, 260 insertions, 102 deletions
diff --git a/cpukit/include/rtems/config.h b/cpukit/include/rtems/config.h index 1fbcf22f2e..2db824b222 100644 --- a/cpukit/include/rtems/config.h +++ b/cpukit/include/rtems/config.h @@ -1,189 +1,347 @@ +/* SPDX-License-Identifier: BSD-2-Clause */ + /** * @file * - * @brief Table of User Defined Configuration Parameters + * @ingroup RTEMSAPIConfig * - * This include file contains the table of user defined configuration - * parameters. + * @brief This header file defines parts of the application configuration + * information API. */ /* - * COPYRIGHT (c) 1989-2014. - * On-Line Applications Research Corporation (OAR). + * Copyright (C) 2020 embedded brains GmbH (http://www.embedded-brains.de) + * Copyright (C) 1988, 2008 On-Line Applications Research Corporation (OAR) + * + * 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. * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.rtems.org/license/LICENSE. + * 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. */ -#ifndef _RTEMS_CONFIG_H -#define _RTEMS_CONFIG_H - /* - * Unlimited object support. Changes the configuration table entry for POSIX - * or RTEMS APIs to bounded only by the memory of the work-space. + * This file was automatically generated. Do not edit it manually. + * Please have a look at * - * Use the macro to define the resource unlimited before placing in - * the configuration table. + * https://docs.rtems.org/branches/master/eng/req/howto.html + * + * for information how to maintain and re-generate this file. */ +#ifndef _RTEMS_CONFIG_H +#define _RTEMS_CONFIG_H + +#include <stddef.h> +#include <stdint.h> +#include <rtems/rtems/config.h> #include <rtems/score/cpu.h> -#include <rtems/score/object.h> #include <rtems/score/isr.h> #include <rtems/score/memory.h> +#include <rtems/score/object.h> #include <rtems/score/smp.h> #include <rtems/score/stack.h> -#include <rtems/score/userextdata.h> #include <rtems/score/threadidledata.h> +#include <rtems/score/userextdata.h> #include <rtems/score/watchdogticks.h> #include <rtems/score/wkspacedata.h> -#include <rtems/rtems/config.h> -#include <rtems/extension.h> + #if defined(RTEMS_MULTIPROCESSING) -#include <rtems/rtems/types.h> + #include <rtems/rtems/types.h> + #include <rtems/score/mpci.h> #endif #ifdef __cplusplus extern "C" { #endif -#define RTEMS_UNLIMITED_OBJECTS OBJECTS_UNLIMITED_OBJECTS - -#define rtems_resource_unlimited(resource) \ - ( resource | RTEMS_UNLIMITED_OBJECTS ) - -#define rtems_resource_is_unlimited(resource) \ - _Objects_Is_unlimited(resource) - -#define rtems_resource_maximum_per_allocation(resource) \ - _Objects_Maximum_per_allocation(resource) - /** - * @copydoc Stack_Allocator_initialize + * @defgroup RTEMSAPIConfig Application Configuration + * + * @ingroup RTEMSAPI + * + * @brief This group contains defines and macros to create an application + * configuration as well as functions to get values of the application + * configuration. */ -typedef Stack_Allocator_initialize rtems_stack_allocate_init_hook; /** - * @copydoc Stack_Allocator_allocate + * @ingroup RTEMSAPIConfig + * + * @brief Returns the thread stack space size in bytes of configured for this + * application. */ -typedef Stack_Allocator_allocate rtems_stack_allocate_hook; +uintptr_t rtems_configuration_get_stack_space_size( void ); /** - * @copydoc Stack_Allocator_free + * @ingroup RTEMSAPIConfig + * + * @brief Returns true, if the thread stack allocator avoids the workspace, + * otherwise returns false. */ -typedef Stack_Allocator_free rtems_stack_free_hook; +#define rtems_configuration_get_stack_allocator_avoids_work_space() \ + _Stack_Allocator_avoids_workspace -/* - * Some handy macros to avoid dependencies on either the BSP - * or the exact format of the configuration table. +/** + * @ingroup RTEMSAPIConfig + * + * @brief This flag is used in resource numbers to indicate an unlimited + * resource. */ +#define RTEMS_UNLIMITED_OBJECTS OBJECTS_UNLIMITED_OBJECTS -#define rtems_configuration_get_unified_work_area() \ - (_Workspace_Is_unified) +/** + * @ingroup RTEMSAPIConfig + * + * @brief % + */ +const char *rtems_get_copyright_notice( void ); /** - * @brief Return if the stack allocator avoids the work space. + * @ingroup RTEMSAPIConfig * - * @retval true The stack allocator must not allocate the thread stacks from the - * RTEMS Workspace + * @brief Returns true, if the workspace is zeroed during system + * initialization, otherwise returns false. + */ +#define rtems_configuration_get_do_zero_of_workspace() _Memory_Zero_before_use + +/** + * @ingroup RTEMSAPIConfig * - * @retval false The stack allocator should allocate the thread stacks from the - * RTEMS Workspace. + * @brief Returns the configured IDLE task entry of this application. */ -#define rtems_configuration_get_stack_allocator_avoids_work_space() \ - (_Stack_Allocator_avoids_workspace) +#define rtems_configuration_get_idle_task() _Thread_Idle_body -uintptr_t rtems_configuration_get_stack_space_size( void ); +/** + * @ingroup RTEMSAPIConfig + * + * @brief Returns the configured IDLE task stack size in bytes of this + * application. + */ +#define rtems_configuration_get_idle_task_stack_size() _Thread_Idle_stack_size -#define rtems_configuration_get_work_space_size() \ - (_Workspace_Size + \ - (rtems_configuration_get_stack_allocator_avoids_work_space() ? \ - 0 : rtems_configuration_get_stack_space_size())) +/** + * @ingroup RTEMSAPIConfig + * + * @brief Returns the configured interrupt stack size in bytes of this + * application. + */ +#define rtems_configuration_get_interrupt_stack_size() \ + ((size_t) _ISR_Stack_size) +/** + * @ingroup RTEMSAPIConfig + * + * @brief Returns the maximum number of Classic API User Extensions which are + * configured for this application. + */ uint32_t rtems_configuration_get_maximum_extensions( void ); +/** + * @ingroup RTEMSAPIConfig + * + * @brief Returns the maximum number of processors which are configured for + * this application. + * + * The actual number of processors available for the application will be less + * than or equal to the configured maximum number of processors. + * + * On uniprocessor configurations this macro is a compile time constant which + * evaluates to one. + */ +#define rtems_configuration_get_maximum_processors() \ + _SMP_Processor_configured_maximum + +/** + * @ingroup RTEMSAPIConfig + * + * @brief Returns the number of microseconds per tick configured for this + * application. + */ #define rtems_configuration_get_microseconds_per_tick() \ - (_Watchdog_Microseconds_per_tick) -#define rtems_configuration_get_milliseconds_per_tick() \ - (_Watchdog_Microseconds_per_tick / 1000) -#define rtems_configuration_get_nanoseconds_per_tick() \ - (_Watchdog_Nanoseconds_per_tick) + _Watchdog_Microseconds_per_tick -#define rtems_configuration_get_ticks_per_timeslice() \ - (_Watchdog_Ticks_per_timeslice) +/** + * @ingroup RTEMSAPIConfig + * + * @brief Returns the number of milliseconds per tick configured for this + * application. + */ +#define rtems_configuration_get_milliseconds_per_tick() \ + (_Watchdog_Microseconds_per_tick / 1000) -#define rtems_configuration_get_idle_task() \ - (_Thread_Idle_entry) +/** + * @ingroup RTEMSAPIConfig + * + * @brief Returns the number of microseconds per tick configured for this + * application. + */ +#define rtems_configuration_get_nanoseconds_per_tick() \ + _Watchdog_Nanoseconds_per_tick -#define rtems_configuration_get_idle_task_stack_size() \ - (_Thread_Idle_stack_size) +/** + * @ingroup RTEMSAPIConfig + * + * @brief Returns the number of initial extensions configured for this + * application. + */ +#define rtems_configuration_get_number_of_initial_extensions() \ + ((uint32_t) _User_extensions_Initial_count) -#define rtems_configuration_get_interrupt_stack_size() \ - ((size_t) _ISR_Stack_size) +/** + * @ingroup RTEMSAPIConfig + * + * @brief Returns the thread stack allocator allocate hook. + */ +#define rtems_configuration_get_stack_allocate_hook() _Stack_Allocator_allocate +/** + * @ingroup RTEMSAPIConfig + * + * @brief Returns the thread stack allocator initialization hook. + */ #define rtems_configuration_get_stack_allocate_init_hook() \ - (_Stack_Allocator_initialize) - -#define rtems_configuration_get_stack_allocate_hook() \ - (_Stack_Allocator_allocate) + _Stack_Allocator_initialize -#define rtems_configuration_get_stack_free_hook() \ - (_Stack_Allocator_free) +/** + * @ingroup RTEMSAPIConfig + * + * @brief Returns the thread stack allocator free hook. + */ +#define rtems_configuration_get_stack_free_hook() _Stack_Allocator_free - /** - * This macro assists in accessing the field which indicates whether - * RTEMS is responsible for zeroing the Executive Workspace. - */ -#define rtems_configuration_get_do_zero_of_workspace() \ - _Memory_Zero_before_use +/** + * @ingroup RTEMSAPIConfig + * + * @brief Returns the ticks per timeslice configured for this application. + */ +#define rtems_configuration_get_ticks_per_timeslice() \ + _Watchdog_Ticks_per_timeslice -#define rtems_configuration_get_number_of_initial_extensions() \ - ((uint32_t) _User_extensions_Initial_count) +/** + * @ingroup RTEMSAPIConfig + * + * @brief Returns true, if the RTEMS Workspace and C Program Heap are unified, + * otherwise returns false. + */ +#define rtems_configuration_get_unified_work_area() _Workspace_Is_unified +/** + * @ingroup RTEMSAPIConfig + * + * @brief Returns the pointer to the initial extensions table configured for + * this application. + */ #define rtems_configuration_get_user_extension_table() \ - (&_User_extensions_Initial_extensions[ 0 ]) + _User_extensions_Initial_extensions +/** + * @ingroup RTEMSAPIConfig + * + * @brief Returns the pointer to the MPCI configuration table configured for + * this application. + */ #if defined(RTEMS_MULTIPROCESSING) #define rtems_configuration_get_user_multiprocessing_table() \ - (&_MPCI_Configuration) + ( &_MPCI_Configuration ) #else - #define rtems_configuration_get_user_multiprocessing_table() \ - NULL + #define rtems_configuration_get_user_multiprocessing_table() NULL #endif /** - * @brief Returns the configured maximum count of processors. + * @ingroup RTEMSAPIConfig * - * The actual number of processors available for the application will be less - * than or equal to the configured maximum count of processors. + * @brief % + */ +const char *rtems_get_version_string( void ); + +/** + * @ingroup RTEMSAPIConfig * - * On single-processor configurations this is a compile time constant which - * evaluates to one. + * @brief Returns the RTEMS Workspace size in bytes configured for this + * application. + */ +#define rtems_configuration_get_work_space_size() \ + (_Workspace_Size + \ + (rtems_configuration_get_stack_allocator_avoids_work_space() ? \ + 0 : rtems_configuration_get_stack_space_size())) + +/** + * @ingroup RTEMSAPIConfig * - * @return The configured maximum count of processors. + * @brief % */ -#define rtems_configuration_get_maximum_processors() \ - (_SMP_Processor_configured_maximum) +#define RTEMS_HAS_HARDWARE_FP CPU_HARDWARE_FP /** - * @brief Returns the pointer to the RTEMS copyright notice. + * @ingroup RTEMSAPIConfig + * + * @brief Returns true, if the resource is unlimited, otherwise returns false. + * + * @param _resource is the resource number. */ -const char *rtems_get_copyright_notice(void); +#define rtems_resource_is_unlimited( _resource ) \ + _Objects_Is_unlimited(_resource) /** - * @brief Returns the pointer to the RTEMS version string. + * @ingroup RTEMSAPIConfig + * + * @brief Returns the resource maximum number per allocation. + * + * @param _resource is the resource number. */ -const char *rtems_get_version_string(void); +#define rtems_resource_maximum_per_allocation( _resource ) \ + _Objects_Maximum_per_allocation(_resource) /** - * @brief Indicates whether this processor variant has hardware floating point - * support. + * @ingroup RTEMSAPIConfig + * + * @brief Returns the specified resource number configured for unlimited + * resources. + * + * @param _resource is the resource number. */ -#define RTEMS_HAS_HARDWARE_FP CPU_HARDWARE_FP +#define rtems_resource_unlimited( _resource ) \ + ((_resource) | RTEMS_UNLIMITED_OBJECTS) + +/** + * @ingroup RTEMSAPIConfig + * + * @brief The thread stack allocator allocate handler. + */ +typedef Stack_Allocator_allocate rtems_stack_allocate_hook; + +/** + * @ingroup RTEMSAPIConfig + * + * @brief The thread stack allocator initialization handler. + */ +typedef Stack_Allocator_initialize rtems_stack_allocate_init_hook; + +/** + * @ingroup RTEMSAPIConfig + * + * @brief The thread stack allocator free handler. + */ +typedef Stack_Allocator_free rtems_stack_free_hook; #ifdef __cplusplus } #endif -#endif -/* end of include file */ +#endif /* _RTEMS_CONFIG_H */ |