From 0451b44f3600f2e05859b931324b823b62a8251d Mon Sep 17 00:00:00 2001 From: Joel Sherrill Date: Wed, 15 Apr 1998 00:02:10 +0000 Subject: Per suggestion from Eric Norum, went from one initial extension set to multiple. This lets the stack check extension be installed at system initialization time and avoids the BSP having to even know about its existence. --- cpukit/sapi/include/confdefs.h | 28 +++++++++++++++++++++++++--- cpukit/sapi/include/rtems/config.h | 1 + cpukit/sapi/src/exinit.c | 9 +++++---- cpukit/score/include/rtems/score/userext.h | 7 ------- cpukit/score/inline/rtems/score/userext.inl | 15 +++++++++++++-- 5 files changed, 44 insertions(+), 16 deletions(-) (limited to 'cpukit') diff --git a/cpukit/sapi/include/confdefs.h b/cpukit/sapi/include/confdefs.h index fae6ba76b4..446ab040e5 100644 --- a/cpukit/sapi/include/confdefs.h +++ b/cpukit/sapi/include/confdefs.h @@ -284,8 +284,29 @@ rtems_multiprocessing_table Multiprocessing_configuration = { #define CONFIGURE_TICKS_PER_TIMESLICE 50 #endif -#ifndef CONFIGURE_INITIAL_EXTENSIONS -#define CONFIGURE_INITIAL_EXTENSIONS NULL +/* + * Initial Extension Set + */ + +#ifdef CONFIGURE_INIT +#ifdef STACK_CHECKER_ON +#include +#endif + +rtems_extensions_table Configuration_Initial_Extensions[] = { +#ifdef CONFIGURE_INITIAL_EXTENSIONS + CONFIGURE_INITIAL_EXTENSIONS, +#endif +#ifdef STACK_CHECKER_ON + STACK_CHECKER_EXTENSION, +#endif + { NULL, NULL, NULL, NULL, NULL, NULL, NULL } +}; + +#define CONFIGURE_NUMBER_OF_INITIAL_EXTENSIONS \ + ((sizeof(Configuration_Initial_Extensions) / \ + sizeof(rtems_extensions_table)) - 1) + #endif /* @@ -530,7 +551,8 @@ rtems_configuration_table Configuration = { sizeof (Device_drivers)/ sizeof(rtems_driver_address_table), /* number of device drivers */ Device_drivers, /* pointer to driver table */ - CONFIGURE_INITIAL_EXTENSIONS, /* pointer to initial extensions */ + CONFIGURE_NUMBER_OF_INITIAL_EXTENSIONS, /* number of initial extensions */ + Configuration_Initial_Extensions, /* pointer to initial extensions */ CONFIGURE_MULTIPROCESSING_TABLE, /* pointer to MP config table */ &Configuration_RTEMS_API, /* pointer to RTEMS API config */ #ifdef RTEMS_POSIX_API diff --git a/cpukit/sapi/include/rtems/config.h b/cpukit/sapi/include/rtems/config.h index 03e9796c75..e3ae50d7d1 100644 --- a/cpukit/sapi/include/rtems/config.h +++ b/cpukit/sapi/include/rtems/config.h @@ -81,6 +81,7 @@ typedef struct { unsigned32 maximum_devices; unsigned32 number_of_device_drivers; rtems_driver_address_table *Device_driver_table; + unsigned32 number_of_initial_extensions; rtems_extensions_table *User_extension_table; rtems_multiprocessing_table *User_multiprocessing_table; rtems_api_configuration_table *RTEMS_api_configuration; diff --git a/cpukit/sapi/src/exinit.c b/cpukit/sapi/src/exinit.c index ce45bb31e8..dabf21dcc0 100644 --- a/cpukit/sapi/src/exinit.c +++ b/cpukit/sapi/src/exinit.c @@ -149,15 +149,16 @@ rtems_interrupt_level rtems_initialize_executive_early( _Thread_Dispatch_initialization(); - _User_extensions_Handler_initialization( - configuration_table->User_extension_table - ); - _Workspace_Handler_initialization( (void *)configuration_table->work_space_start, configuration_table->work_space_size ); + _User_extensions_Handler_initialization( + configuration_table->number_of_initial_extensions, + configuration_table->User_extension_table + ); + _ISR_Handler_initialization(); _Objects_Handler_initialization( diff --git a/cpukit/score/include/rtems/score/userext.h b/cpukit/score/include/rtems/score/userext.h index b97923d88b..29b0e9564e 100644 --- a/cpukit/score/include/rtems/score/userext.h +++ b/cpukit/score/include/rtems/score/userext.h @@ -100,13 +100,6 @@ typedef struct { User_extensions_Table Callouts; } User_extensions_Control; -/* - * The following contains the static extension set which may be - * configured by the application. - */ - -SCORE_EXTERN User_extensions_Control _User_extensions_Initial; - /* * The following is used to manage the list of active extensions. */ diff --git a/cpukit/score/inline/rtems/score/userext.inl b/cpukit/score/inline/rtems/score/userext.inl index 3ddb8459b8..29f7975aaa 100644 --- a/cpukit/score/inline/rtems/score/userext.inl +++ b/cpukit/score/inline/rtems/score/userext.inl @@ -17,6 +17,8 @@ #ifndef __USER_EXTENSIONS_inl #define __USER_EXTENSIONS_inl +#include + /*PAGE * * _User_extensions_Handler_initialization @@ -27,14 +29,23 @@ */ RTEMS_INLINE_ROUTINE void _User_extensions_Handler_initialization ( + unsigned32 number_of_extensions, User_extensions_Table *initial_extensions ) { + User_extensions_Control *extension; + unsigned32 i; + _Chain_Initialize_empty( &_User_extensions_List ); if ( initial_extensions ) { - _User_extensions_Initial.Callouts = *initial_extensions; - _Chain_Append( &_User_extensions_List, &_User_extensions_Initial.Node ); + for (i=0 ; iCallouts = initial_extensions[i]; + _Chain_Append( &_User_extensions_List, &extension->Node ); + } } } -- cgit v1.2.3