summaryrefslogtreecommitdiffstats
path: root/cpukit/libmisc/stackchk
diff options
context:
space:
mode:
authorJoel Sherrill <joel.sherrill@OARcorp.com>2010-06-23 23:28:46 +0000
committerJoel Sherrill <joel.sherrill@OARcorp.com>2010-06-23 23:28:46 +0000
commitda9b5389650f33581f91424cc29655e7eeb048f4 (patch)
tree768d2a252ed1de9eaebed4fba47b5aa51faecd2d /cpukit/libmisc/stackchk
parent2010-06-23 Joel Sherrill <joel.sherrilL@OARcorp.com> (diff)
downloadrtems-da9b5389650f33581f91424cc29655e7eeb048f4.tar.bz2
2010-06-23 Joel Sherrill <joel.sherrilL@OARcorp.com>
* libmisc/stackchk/check.c: More clean up and coverage improvements..
Diffstat (limited to 'cpukit/libmisc/stackchk')
-rw-r--r--cpukit/libmisc/stackchk/check.c25
1 files changed, 15 insertions, 10 deletions
diff --git a/cpukit/libmisc/stackchk/check.c b/cpukit/libmisc/stackchk/check.c
index f81a47a727..7b4d6d1c72 100644
--- a/cpukit/libmisc/stackchk/check.c
+++ b/cpukit/libmisc/stackchk/check.c
@@ -143,7 +143,6 @@ void Stack_check_Initialize( void )
0xDEADF00D, 0x600D0D06 /* DEAD FOOD but GOOD DOG */
};
- if (Stack_check_Initialized)
return;
/*
@@ -164,7 +163,7 @@ void Stack_check_Initialize( void )
Stack_check_Interrupt_stack.size = (char *) _CPU_Interrupt_stack_high -
(char *) _CPU_Interrupt_stack_low;
Stack_check_Dope_stack(&Stack_check_Interrupt_stack);
- }
+ }
#endif
Stack_check_Initialized = 1;
@@ -212,6 +211,11 @@ void rtems_stack_checker_begin_extension(
* NOTE: The system is in a questionable state... we may not get
* the following message out.
*/
+void Stack_check_report_blown_task(
+ Thread_Control *running,
+ bool pattern_ok
+) RTEMS_COMPILER_NO_RETURN_ATTRIBUTE;
+
void Stack_check_report_blown_task(Thread_Control *running, bool pattern_ok)
{
Stack_Control *stack = &running->Start.Initial_stack;
@@ -311,23 +315,25 @@ bool rtems_stack_checker_is_blown( void )
));
}
+
/*
- * The Stack Pointer and the Pattern Area are OK so return false.
+ * Let's report as much as we can.
*/
- if ( sp_ok && pattern_ok )
- return false;
+ if ( !sp_ok || !pattern_ok ) {
+ Stack_check_report_blown_task( _Thread_Executing, pattern_ok );
+ /* DOES NOT RETURN */
+ }
/*
- * Let's report as much as we can.
+ * The Stack Pointer and the Pattern Area are OK so return false.
*/
- Stack_check_report_blown_task( _Thread_Executing, pattern_ok );
- return true;
+ return false;
}
/*
* Stack_check_find_high_water_mark
*/
-void *Stack_check_find_high_water_mark(
+static inline void *Stack_check_find_high_water_mark(
const void *s,
size_t n
)
@@ -490,7 +496,6 @@ void rtems_stack_checker_report_usage_with_plugin(
print_context = NULL;
print_handler = NULL;
-
}
void rtems_stack_checker_report_usage( void )