[PATCH 02/23] sapi: Use rtems_config*_get_interrupt_stack_size

Sebastian Huber sebastian.huber at embedded-brains.de
Tue Nov 6 12:56:24 UTC 2012


---
 .../libbsp/powerpc/mpc55xxevb/startup/bspstart.c   |    2 +-
 .../powerpc/mpc55xxevb/startup/bspworkareainit.c   |    8 ++++-
 c/src/lib/libbsp/powerpc/qoriq/startup/bspstart.c  |    2 +-
 .../lib/libbsp/powerpc/t32mppc/startup/bspstart.c  |    2 +-
 c/src/lib/libbsp/shared/bspgetworkarea.c           |    2 +-
 cpukit/score/src/isr.c                             |   29 +++++++++++---------
 cpukit/score/src/percpu.c                          |    2 +-
 7 files changed, 27 insertions(+), 20 deletions(-)

diff --git a/c/src/lib/libbsp/powerpc/mpc55xxevb/startup/bspstart.c b/c/src/lib/libbsp/powerpc/mpc55xxevb/startup/bspstart.c
index 314930a..94f2f93 100644
--- a/c/src/lib/libbsp/powerpc/mpc55xxevb/startup/bspstart.c
+++ b/c/src/lib/libbsp/powerpc/mpc55xxevb/startup/bspstart.c
@@ -122,7 +122,7 @@ void bsp_start(void)
 	sc = ppc_exc_initialize(
 		PPC_INTERRUPT_DISABLE_MASK_DEFAULT,
                 (uintptr_t) bsp_section_work_begin,
-                Configuration.interrupt_stack_size
+                rtems_configuration_get_interrupt_stack_size()
 	);
 	if (sc != RTEMS_SUCCESSFUL) {
 		BSP_panic( "Cannot initialize exceptions");
diff --git a/c/src/lib/libbsp/powerpc/mpc55xxevb/startup/bspworkareainit.c b/c/src/lib/libbsp/powerpc/mpc55xxevb/startup/bspworkareainit.c
index 3b989db..2b42be9 100644
--- a/c/src/lib/libbsp/powerpc/mpc55xxevb/startup/bspworkareainit.c
+++ b/c/src/lib/libbsp/powerpc/mpc55xxevb/startup/bspworkareainit.c
@@ -38,8 +38,12 @@ void bsp_work_area_initialize(void)
   };
 
   #ifdef BSP_INTERRUPT_STACK_AT_WORK_AREA_BEGIN
-    areas [0].begin = (char *) areas [0].begin + Configuration.interrupt_stack_size;
-    areas [0].size -= Configuration.interrupt_stack_size;
+    {
+      uint32_t stack_size = rtems_configuration_get_interrupt_stack_size();
+
+      areas [0].begin = (char *) areas [0].begin + stack_size;
+      areas [0].size -= stack_size;
+    }
   #endif
 
   bsp_work_area_initialize_with_table(
diff --git a/c/src/lib/libbsp/powerpc/qoriq/startup/bspstart.c b/c/src/lib/libbsp/powerpc/qoriq/startup/bspstart.c
index f2eb46d..147254b 100644
--- a/c/src/lib/libbsp/powerpc/qoriq/startup/bspstart.c
+++ b/c/src/lib/libbsp/powerpc/qoriq/startup/bspstart.c
@@ -112,7 +112,7 @@ void bsp_start(void)
   sc = ppc_exc_initialize(
     PPC_INTERRUPT_DISABLE_MASK_DEFAULT,
     (uintptr_t) bsp_section_work_begin,
-    Configuration.interrupt_stack_size
+    rtems_configuration_get_interrupt_stack_size()
   );
   if (sc != RTEMS_SUCCESSFUL) {
     BSP_panic("cannot initialize exceptions");
diff --git a/c/src/lib/libbsp/powerpc/t32mppc/startup/bspstart.c b/c/src/lib/libbsp/powerpc/t32mppc/startup/bspstart.c
index b856c8d..299f760 100644
--- a/c/src/lib/libbsp/powerpc/t32mppc/startup/bspstart.c
+++ b/c/src/lib/libbsp/powerpc/t32mppc/startup/bspstart.c
@@ -70,7 +70,7 @@ void bsp_start(void)
   sc = ppc_exc_initialize(
     PPC_INTERRUPT_DISABLE_MASK_DEFAULT,
     (uintptr_t) bsp_section_work_begin,
-    Configuration.interrupt_stack_size
+    rtems_configuration_get_interrupt_stack_size()
   );
   if (sc != RTEMS_SUCCESSFUL) {
     BSP_panic("cannot initialize exceptions");
diff --git a/c/src/lib/libbsp/shared/bspgetworkarea.c b/c/src/lib/libbsp/shared/bspgetworkarea.c
index 4122c9b..cb2e074 100644
--- a/c/src/lib/libbsp/shared/bspgetworkarea.c
+++ b/c/src/lib/libbsp/shared/bspgetworkarea.c
@@ -51,7 +51,7 @@ void bsp_work_area_initialize(void)
   #endif
 
   #ifdef BSP_INTERRUPT_STACK_AT_WORK_AREA_BEGIN
-    work_base += Configuration.interrupt_stack_size;
+    work_base += rtems_configuration_get_interrupt_stack_size();
   #endif
 
   bsp_work_area_initialize_default( (void *) work_base, ram_end - work_base );
diff --git a/cpukit/score/src/isr.c b/cpukit/score/src/isr.c
index 2306f78..4407be5 100644
--- a/cpukit/score/src/isr.c
+++ b/cpukit/score/src/isr.c
@@ -46,22 +46,25 @@ void _ISR_Handler_initialization( void )
 #endif
 
 #if ( CPU_ALLOCATE_INTERRUPT_STACK == TRUE )
+  {
+    size_t stack_size = rtems_configuration_get_interrupt_stack_size();
 
-  if ( !_Stack_Is_enough(Configuration.interrupt_stack_size) )
-    _Internal_error_Occurred(
-      INTERNAL_ERROR_CORE,
-      true,
-      INTERNAL_ERROR_INTERRUPT_STACK_TOO_SMALL
-    );
+    if ( !_Stack_Is_enough( stack_size ) )
+      _Internal_error_Occurred(
+        INTERNAL_ERROR_CORE,
+        true,
+        INTERNAL_ERROR_INTERRUPT_STACK_TOO_SMALL
+      );
 
-  _CPU_Interrupt_stack_low = _Workspace_Allocate_or_fatal_error(
-    Configuration.interrupt_stack_size
-  );
+    _CPU_Interrupt_stack_low = _Workspace_Allocate_or_fatal_error(
+      stack_size
+    );
 
-  _CPU_Interrupt_stack_high = _Addresses_Add_offset(
-    _CPU_Interrupt_stack_low,
-    Configuration.interrupt_stack_size
-  );
+    _CPU_Interrupt_stack_high = _Addresses_Add_offset(
+      _CPU_Interrupt_stack_low,
+      stack_size
+    );
+  }
 
 #if (CPU_STACK_ALIGNMENT != 0)
   _CPU_Interrupt_stack_high = (void *)
diff --git a/cpukit/score/src/percpu.c b/cpukit/score/src/percpu.c
index 3278dc5..5f1a808 100644
--- a/cpukit/score/src/percpu.c
+++ b/cpukit/score/src/percpu.c
@@ -37,7 +37,7 @@
     /*
      *  Initialize per cpu pointer table
      */
-    size = Configuration.interrupt_stack_size;
+    size = rtems_configuration_get_interrupt_stack_size();
     _Per_CPU_Information_p[0] = &_Per_CPU_Information[0];
     for (cpu=1 ; cpu < rtems_configuration_smp_maximum_processors; cpu++ ) {
 
-- 
1.7.7




More information about the devel mailing list