From 5ae6112559e6767c50d7669440ee0074587bf724 Mon Sep 17 00:00:00 2001 From: Sebastian Huber Date: Thu, 5 Dec 2019 15:14:51 +0100 Subject: userext: Simplify configuration Avoid the use of the workspace and use statically allocated switch controls for the initial extensions. --- cpukit/include/rtems/confdefs.h | 28 +++++++--------------------- cpukit/include/rtems/config.h | 6 +++--- cpukit/include/rtems/score/userextdata.h | 22 ++++++++++++++++++++++ 3 files changed, 32 insertions(+), 24 deletions(-) (limited to 'cpukit/include') diff --git a/cpukit/include/rtems/confdefs.h b/cpukit/include/rtems/confdefs.h index 4e6b91ad2c..f04717006d 100644 --- a/cpukit/include/rtems/confdefs.h +++ b/cpukit/include/rtems/confdefs.h @@ -2124,7 +2124,7 @@ extern rtems_initialization_tasks_table Initialization_tasks[]; defined(CONFIGURE_INITIAL_EXTENSIONS) || \ defined(CONFIGURE_STACK_CHECKER_ENABLED) || \ (defined(RTEMS_NEWLIB) && !defined(CONFIGURE_DISABLE_NEWLIB_REENTRANCY)) - static const rtems_extensions_table Configuration_Initial_Extensions[] = { + const User_extensions_Table _User_extensions_Initial_extensions[] = { #if CONFIGURE_RECORD_PER_PROCESSOR_ITEMS > 0 && \ defined(CONFIGURE_RECORD_EXTENSIONS_ENABLED) RECORD_EXTENSION, @@ -2143,18 +2143,18 @@ extern rtems_initialization_tasks_table Initialization_tasks[]; #endif }; - #define _CONFIGURE_INITIAL_EXTENSION_TABLE Configuration_Initial_Extensions - #define _CONFIGURE_NUMBER_OF_INITIAL_EXTENSIONS \ - RTEMS_ARRAY_SIZE(Configuration_Initial_Extensions) + const size_t _User_extensions_Initial_count = + RTEMS_ARRAY_SIZE( _User_extensions_Initial_extensions ); + + User_extensions_Switch_control _User_extensions_Initial_switch_controls[ + RTEMS_ARRAY_SIZE( _User_extensions_Initial_extensions ) + ]; RTEMS_SYSINIT_ITEM( _User_extensions_Handler_initialization, RTEMS_SYSINIT_INITIAL_EXTENSIONS, RTEMS_SYSINIT_ORDER_MIDDLE ); -#else - #define _CONFIGURE_INITIAL_EXTENSION_TABLE NULL - #define _CONFIGURE_NUMBER_OF_INITIAL_EXTENSIONS 0 #endif #if defined(RTEMS_NEWLIB) && !defined(CONFIGURE_DISABLE_NEWLIB_REENTRANCY) @@ -2486,17 +2486,6 @@ struct _reent *__getreent(void) #define _CONFIGURE_MEMORY_FOR_SYSTEM_OVERHEAD \ _CONFIGURE_MEMORY_FOR_INTERNAL_TASKS -/** - * This macro reserves the memory required by the statically configured - * user extensions. - */ -#define _CONFIGURE_MEMORY_FOR_STATIC_EXTENSIONS \ - (_CONFIGURE_NUMBER_OF_INITIAL_EXTENSIONS == 0 ? 0 : \ - _Configure_From_workspace( \ - _CONFIGURE_NUMBER_OF_INITIAL_EXTENSIONS \ - * sizeof(User_extensions_Switch_control) \ - )) - /** * This calculates the memory required for the executive workspace. * @@ -2517,7 +2506,6 @@ struct _reent *__getreent(void) _CONFIGURE_MEMORY_FOR_POSIX_SHMS( \ CONFIGURE_MAXIMUM_POSIX_SHMS) + \ _CONFIGURE_MEMORY_FOR_POSIX_QUEUED_SIGNALS + \ - _CONFIGURE_MEMORY_FOR_STATIC_EXTENSIONS + \ _CONFIGURE_MEMORY_FOR_MP + \ CONFIGURE_MESSAGE_BUFFER_MEMORY + \ (CONFIGURE_MEMORY_OVERHEAD * 1024) + \ @@ -2923,8 +2911,6 @@ struct _reent *__getreent(void) false, #endif #endif - _CONFIGURE_NUMBER_OF_INITIAL_EXTENSIONS, /* number of static extensions */ - _CONFIGURE_INITIAL_EXTENSION_TABLE, /* pointer to static extensions */ #if defined(RTEMS_MULTIPROCESSING) CONFIGURE_MULTIPROCESSING_TABLE, /* pointer to MP config table */ #endif diff --git a/cpukit/include/rtems/config.h b/cpukit/include/rtems/config.h index ae11fd9df8..c0302d96cf 100644 --- a/cpukit/include/rtems/config.h +++ b/cpukit/include/rtems/config.h @@ -29,6 +29,7 @@ #include #include +#include #include #include #include @@ -206,7 +207,6 @@ typedef struct { #endif uint32_t number_of_initial_extensions; - const rtems_extensions_table *User_extension_table; #if defined(RTEMS_MULTIPROCESSING) rtems_multiprocessing_table *User_multiprocessing_table; #endif @@ -302,10 +302,10 @@ uint32_t rtems_configuration_get_maximum_extensions( void ); (Configuration.do_zero_of_workspace) #define rtems_configuration_get_number_of_initial_extensions() \ - (Configuration.number_of_initial_extensions) + ((uint32_t) _User_extensions_Initial_count) #define rtems_configuration_get_user_extension_table() \ - (Configuration.User_extension_table) + (&_User_extensions_Initial_extensions[ 0 ]) #if defined(RTEMS_MULTIPROCESSING) #define rtems_configuration_get_user_multiprocessing_table() \ diff --git a/cpukit/include/rtems/score/userextdata.h b/cpukit/include/rtems/score/userextdata.h index 7b7a2eb95f..04dead889d 100644 --- a/cpukit/include/rtems/score/userextdata.h +++ b/cpukit/include/rtems/score/userextdata.h @@ -53,6 +53,28 @@ typedef struct { User_extensions_Table Callouts; } User_extensions_Control; +/** + * @brief The count of initial user extensions. + * + * Application provided via . + */ +extern const size_t _User_extensions_Initial_count; + +/** + * @brief The table of initial user extensions. + * + * Application provided via . + */ +extern const User_extensions_Table _User_extensions_Initial_extensions[]; + +/** + * @brief A spare switch control for each initial user extension. + * + * Application provided via . + */ +extern User_extensions_Switch_control + _User_extensions_Initial_switch_controls[]; + /** @} */ #ifdef __cplusplus -- cgit v1.2.3