mirror of
https://gitlab.rtems.org/rtems/rtos/rtems.git
synced 2025-12-26 22:48:23 +00:00
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.
This commit is contained in:
@@ -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 <stackchk.h>
|
||||
#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
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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 <stackchk.h>
|
||||
#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
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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(
|
||||
|
||||
@@ -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.
|
||||
*/
|
||||
|
||||
@@ -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.
|
||||
*/
|
||||
|
||||
@@ -17,6 +17,8 @@
|
||||
#ifndef __USER_EXTENSIONS_inl
|
||||
#define __USER_EXTENSIONS_inl
|
||||
|
||||
#include <rtems/score/wkspace.h>
|
||||
|
||||
/*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 ; i<number_of_extensions ; i++ ) {
|
||||
extension =
|
||||
_Workspace_Allocate_or_fatal_error( sizeof(User_extensions_Control) );
|
||||
|
||||
extension->Callouts = initial_extensions[i];
|
||||
_Chain_Append( &_User_extensions_List, &extension->Node );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -17,6 +17,8 @@
|
||||
#ifndef __USER_EXTENSIONS_inl
|
||||
#define __USER_EXTENSIONS_inl
|
||||
|
||||
#include <rtems/score/wkspace.h>
|
||||
|
||||
/*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 ; i<number_of_extensions ; i++ ) {
|
||||
extension =
|
||||
_Workspace_Allocate_or_fatal_error( sizeof(User_extensions_Control) );
|
||||
|
||||
extension->Callouts = initial_extensions[i];
|
||||
_Chain_Append( &_User_extensions_List, &extension->Node );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user