summaryrefslogtreecommitdiffstats
path: root/cpukit/libmisc/stackchk
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2018-09-24 09:15:10 +0200
committerSebastian Huber <sebastian.huber@embedded-brains.de>2018-09-24 09:16:31 +0200
commit7d1acc03f1d4ac13a5ab42727f61810eda052a1c (patch)
tree3549ad1714d43b3f221af15869b6b2b72f5e0d18 /cpukit/libmisc/stackchk
parentstackchk: Improve support for interrupt stacks (diff)
downloadrtems-7d1acc03f1d4ac13a5ab42727f61810eda052a1c.tar.bz2
stackchk: Fix interrupt stack preparation
We have to prepare the interrupt stack of each processor. Update #3459.
Diffstat (limited to 'cpukit/libmisc/stackchk')
-rw-r--r--cpukit/libmisc/stackchk/check.c20
1 files changed, 11 insertions, 9 deletions
diff --git a/cpukit/libmisc/stackchk/check.c b/cpukit/libmisc/stackchk/check.c
index 29fa81480f..3670210f5b 100644
--- a/cpukit/libmisc/stackchk/check.c
+++ b/cpukit/libmisc/stackchk/check.c
@@ -495,22 +495,24 @@ void rtems_stack_checker_report_usage( void )
rtems_stack_checker_report_usage_with_plugin( &printer );
}
-static void Stack_check_Prepare_interrupt_stack( void )
+static void Stack_check_Prepare_interrupt_stacks( void )
{
- uint32_t cpu_self_index;
Stack_Control stack;
+ uint32_t cpu_index;
+ uint32_t cpu_max;
- cpu_self_index = _SMP_Get_current_processor();
stack.size = rtems_configuration_get_interrupt_stack_size();
- stack.area = _Addresses_Add_offset(
- _Configuration_Interrupt_stack_area_begin,
- cpu_self_index * stack.size
- );
- Stack_check_Add_sanity_pattern( &stack );
+ stack.area = _Configuration_Interrupt_stack_area_begin;
+ cpu_max = rtems_configuration_get_maximum_processors();
+
+ for ( cpu_index = 0; cpu_index < cpu_max; ++cpu_index ) {
+ Stack_check_Add_sanity_pattern( &stack );
+ stack.area = _Addresses_Add_offset( stack.area, stack.size );
+ }
}
RTEMS_SYSINIT_ITEM(
- Stack_check_Prepare_interrupt_stack,
+ Stack_check_Prepare_interrupt_stacks,
RTEMS_SYSINIT_BSP_WORK_AREAS,
RTEMS_SYSINIT_ORDER_SECOND
);