From da9b5389650f33581f91424cc29655e7eeb048f4 Mon Sep 17 00:00:00 2001 From: Joel Sherrill Date: Wed, 23 Jun 2010 23:28:46 +0000 Subject: 2010-06-23 Joel Sherrill * libmisc/stackchk/check.c: More clean up and coverage improvements.. --- cpukit/libmisc/stackchk/check.c | 25 +++++++++++++++---------- 1 file changed, 15 insertions(+), 10 deletions(-) (limited to 'cpukit/libmisc/stackchk') 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 ) -- cgit v1.2.3