summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoel Sherrill <joel.sherrill@OARcorp.com>1998-04-15 00:02:10 +0000
committerJoel Sherrill <joel.sherrill@OARcorp.com>1998-04-15 00:02:10 +0000
commit0451b44f3600f2e05859b931324b823b62a8251d (patch)
tree5a518a8684ff8a03493306def19baa477aa2846e
parentchanged version to ralf-980414 (diff)
downloadrtems-0451b44f3600f2e05859b931324b823b62a8251d.tar.bz2
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.
-rw-r--r--c/src/exec/sapi/headers/confdefs.h28
-rw-r--r--c/src/exec/sapi/headers/config.h1
-rw-r--r--c/src/exec/sapi/include/confdefs.h28
-rw-r--r--c/src/exec/sapi/include/rtems/config.h1
-rw-r--r--c/src/exec/sapi/src/exinit.c9
-rw-r--r--c/src/exec/score/headers/userext.h7
-rw-r--r--c/src/exec/score/include/rtems/score/userext.h7
-rw-r--r--c/src/exec/score/inline/rtems/score/userext.inl15
-rw-r--r--c/src/exec/score/inline/userext.inl15
-rw-r--r--cpukit/sapi/include/confdefs.h28
-rw-r--r--cpukit/sapi/include/rtems/config.h1
-rw-r--r--cpukit/sapi/src/exinit.c9
-rw-r--r--cpukit/score/include/rtems/score/userext.h7
-rw-r--r--cpukit/score/inline/rtems/score/userext.inl15
14 files changed, 127 insertions, 44 deletions
diff --git a/c/src/exec/sapi/headers/confdefs.h b/c/src/exec/sapi/headers/confdefs.h
index fae6ba76b4..446ab040e5 100644
--- a/c/src/exec/sapi/headers/confdefs.h
+++ b/c/src/exec/sapi/headers/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 <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
diff --git a/c/src/exec/sapi/headers/config.h b/c/src/exec/sapi/headers/config.h
index 03e9796c75..e3ae50d7d1 100644
--- a/c/src/exec/sapi/headers/config.h
+++ b/c/src/exec/sapi/headers/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/c/src/exec/sapi/include/confdefs.h b/c/src/exec/sapi/include/confdefs.h
index fae6ba76b4..446ab040e5 100644
--- a/c/src/exec/sapi/include/confdefs.h
+++ b/c/src/exec/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 <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
diff --git a/c/src/exec/sapi/include/rtems/config.h b/c/src/exec/sapi/include/rtems/config.h
index 03e9796c75..e3ae50d7d1 100644
--- a/c/src/exec/sapi/include/rtems/config.h
+++ b/c/src/exec/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/c/src/exec/sapi/src/exinit.c b/c/src/exec/sapi/src/exinit.c
index ce45bb31e8..dabf21dcc0 100644
--- a/c/src/exec/sapi/src/exinit.c
+++ b/c/src/exec/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/c/src/exec/score/headers/userext.h b/c/src/exec/score/headers/userext.h
index b97923d88b..29b0e9564e 100644
--- a/c/src/exec/score/headers/userext.h
+++ b/c/src/exec/score/headers/userext.h
@@ -101,13 +101,6 @@ typedef struct {
} 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/c/src/exec/score/include/rtems/score/userext.h b/c/src/exec/score/include/rtems/score/userext.h
index b97923d88b..29b0e9564e 100644
--- a/c/src/exec/score/include/rtems/score/userext.h
+++ b/c/src/exec/score/include/rtems/score/userext.h
@@ -101,13 +101,6 @@ typedef struct {
} 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/c/src/exec/score/inline/rtems/score/userext.inl b/c/src/exec/score/inline/rtems/score/userext.inl
index 3ddb8459b8..29f7975aaa 100644
--- a/c/src/exec/score/inline/rtems/score/userext.inl
+++ b/c/src/exec/score/inline/rtems/score/userext.inl
@@ -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 );
+ }
}
}
diff --git a/c/src/exec/score/inline/userext.inl b/c/src/exec/score/inline/userext.inl
index 3ddb8459b8..29f7975aaa 100644
--- a/c/src/exec/score/inline/userext.inl
+++ b/c/src/exec/score/inline/userext.inl
@@ -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 );
+ }
}
}
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 <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
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
@@ -101,13 +101,6 @@ typedef struct {
} 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 <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 );
+ }
}
}