2006-09-13 Joel Sherrill <joel@OARcorp.com>

* libmisc/stackchk/check.c, libmisc/stackchk/internal.h,
	libmisc/stackchk/stackchk.h: Move stack to first class citizen
	status. Include it in User Manual and rename to start with rtems_.
This commit is contained in:
Joel Sherrill
2006-09-13 16:22:24 +00:00
parent aba8a85d4b
commit 7ac4ae92d0
4 changed files with 78 additions and 70 deletions

View File

@@ -1,3 +1,9 @@
2006-09-13 Joel Sherrill <joel@OARcorp.com>
* libmisc/stackchk/check.c, libmisc/stackchk/internal.h,
libmisc/stackchk/stackchk.h: Move stack to first class citizen
status. Include it in User Manual and rename to start with rtems_.
2006-09-11 Joel Sherrill <joel@OARcorp.com> 2006-09-11 Joel Sherrill <joel@OARcorp.com>
* libmisc/mw-fb/mw_fb.c, libmisc/mw-fb/mw_fb.h, libmisc/mw-fb/mw_uid.c, * libmisc/mw-fb/mw_fb.c, libmisc/mw-fb/mw_fb.h, libmisc/mw-fb/mw_uid.c,

View File

@@ -6,7 +6,7 @@
* CPU grows up or down and installs the correct * CPU grows up or down and installs the correct
* extension routines for that direction. * extension routines for that direction.
* *
* COPYRIGHT (c) 1989-1999. * COPYRIGHT (c) 1989-2006.
* On-Line Applications Research Corporation (OAR). * On-Line Applications Research Corporation (OAR).
* *
* The license and distribution terms for this file may be * The license and distribution terms for this file may be
@@ -55,18 +55,17 @@ Thread_Control *Stack_check_Blown_task;
* The extension table for the stack checker. * The extension table for the stack checker.
*/ */
rtems_extensions_table Stack_check_Extension_table = { rtems_extensions_table rtems_stack_checker_extension_table = {
Stack_check_Create_extension, /* rtems_task_create */ rtems_stack_checker_create_extension, /* rtems_task_create */
0, /* rtems_task_start */ 0, /* rtems_task_start */
0, /* rtems_task_restart */ 0, /* rtems_task_restart */
0, /* rtems_task_delete */ 0, /* rtems_task_delete */
Stack_check_Switch_extension, /* task_switch */ rtems_stack_checker_switch_extension, /* task_switch */
Stack_check_Begin_extension, /* task_begin */ rtems_stack_checker_begin_extension, /* task_begin */ 0, /* task_exitted */
0, /* task_exitted */
#ifdef DONT_USE_FATAL_EXTENSION #ifdef DONT_USE_FATAL_EXTENSION
0, /* fatal */ 0, /* fatal */
#else #else
Stack_check_Fatal_extension, /* fatal */ rtems_stack_checker_fatal_extension, /* fatal */
#endif #endif
}; };
@@ -124,7 +123,7 @@ Stack_Control stack_check_interrupt_stack;
* Prototypes necessary for forward references * Prototypes necessary for forward references
*/ */
void Stack_check_Dump_usage( void ); void rtems_stack_checker_dump_usage( void );
/* /*
* Fill an entire stack area with BYTE_PATTERN. * Fill an entire stack area with BYTE_PATTERN.
@@ -141,12 +140,12 @@ stack_check_dope_stack(Stack_Control *stack)
/*PAGE /*PAGE
* *
* Stack_check_Initialize * rtems_stack_checker_initialize
*/ */
static int stack_check_initialized = 0; static int stack_check_initialized = 0;
void Stack_check_Initialize( void ) void rtems_stack_checker_initialize( void )
{ {
#if 0 #if 0
rtems_status_code status; rtems_status_code status;
@@ -202,9 +201,11 @@ void Stack_check_Initialize( void )
* happened. So just run through them and fix the situation. * happened. So just run through them and fix the situation.
*/ */
#if 0 #if 0
if (_Thread_Executing) if (_Thread_Executing) {
{ rtems_stack_checker_create_extension(
Stack_check_Create_extension(_Thread_Executing, _Thread_Executing); _Thread_Executing,
_Thread_Executing
);
} }
#endif #endif
@@ -218,7 +219,7 @@ void Stack_check_Initialize( void )
if ( information ) { if ( information ) {
for ( i=1 ; i <= information->maximum ; i++ ) { for ( i=1 ; i <= information->maximum ; i++ ) {
the_thread = (Thread_Control *)information->local_table[ i ]; the_thread = (Thread_Control *)information->local_table[ i ];
Stack_check_Create_extension( the_thread, the_thread ); rtems_stack_checker_create_extension( the_thread, the_thread );
} }
} }
} }
@@ -246,7 +247,7 @@ void Stack_check_Initialize( void )
* handler, but we don't run fatal extensions unless * handler, but we don't run fatal extensions unless
* we fatal error. * we fatal error.
*/ */
atexit(Stack_check_Dump_usage); atexit(rtems_stack_checker_dump_usage);
#endif #endif
#endif #endif
@@ -255,16 +256,16 @@ void Stack_check_Initialize( void )
/*PAGE /*PAGE
* *
* Stack_check_Create_extension * rtems_stack_checker_create_extension
*/ */
boolean Stack_check_Create_extension( boolean rtems_stack_checker_create_extension(
Thread_Control *running, Thread_Control *running,
Thread_Control *the_thread Thread_Control *the_thread
) )
{ {
if (!stack_check_initialized) if (!stack_check_initialized)
Stack_check_Initialize(); rtems_stack_checker_initialize();
if (the_thread /* XXX && (the_thread != _Thread_Executing) */ ) if (the_thread /* XXX && (the_thread != _Thread_Executing) */ )
stack_check_dope_stack(&the_thread->Start.Initial_stack); stack_check_dope_stack(&the_thread->Start.Initial_stack);
@@ -274,17 +275,17 @@ boolean Stack_check_Create_extension(
/*PAGE /*PAGE
* *
* Stack_check_Begin_extension * rtems_stack_checker_Begin_extension
*/ */
void Stack_check_Begin_extension( void rtems_stack_checker_begin_extension(
Thread_Control *the_thread Thread_Control *the_thread
) )
{ {
Stack_check_Control *the_pattern; Stack_check_Control *the_pattern;
if (!stack_check_initialized) if (!stack_check_initialized)
Stack_check_Initialize(); rtems_stack_checker_initialize();
if ( the_thread->Object.id == 0 ) /* skip system tasks */ if ( the_thread->Object.id == 0 ) /* skip system tasks */
return; return;
@@ -354,21 +355,22 @@ void Stack_check_report_blown_task(void)
/*PAGE /*PAGE
* *
* Stack_check_Switch_extension * rtems_stack_checker_switch_extension
*/ */
void Stack_check_Switch_extension( void rtems_stack_checker_switch_extension(
Thread_Control *running, Thread_Control *running,
Thread_Control *heir Thread_Control *heir
) )
{ {
void *pattern;
if ( running->Object.id == 0 ) /* skip system tasks */ if ( running->Object.id == 0 ) /* skip system tasks */
return; return;
pattern = (void *)
Stack_check_Get_pattern_area(&running->Start.Initial_stack)->pattern;
if (0 != memcmp( (void *) Stack_check_Get_pattern_area( &running->Start.Initial_stack)->pattern, if (0 != memcmp( pattern,
(void *) Stack_check_Pattern.pattern, (void *) Stack_check_Pattern.pattern, PATTERN_SIZE_BYTES)) {
PATTERN_SIZE_BYTES))
{
Stack_check_Blown_task = running; Stack_check_Blown_task = running;
Stack_check_report_blown_task(); Stack_check_report_blown_task();
} }
@@ -412,7 +414,7 @@ void *Stack_check_find_high_water_mark(
/*PAGE /*PAGE
* *
* Stack_check_Dump_threads_usage * Stack_check_Dump_threads_usage(
* Try to print out how much stack was actually used by the task. * Try to print out how much stack was actually used by the task.
* *
*/ */
@@ -495,10 +497,10 @@ void Stack_check_Dump_threads_usage(
/*PAGE /*PAGE
* *
* Stack_check_Fatal_extension * rtems_stack_checker_fatal_extension
*/ */
void Stack_check_Fatal_extension( void rtems_stack_checker_fatal_extension(
Internal_errors_Source source, Internal_errors_Source source,
boolean is_internal, boolean is_internal,
uint32_t status uint32_t status
@@ -506,17 +508,17 @@ void Stack_check_Fatal_extension(
{ {
#ifndef DONT_USE_FATAL_EXTENSION #ifndef DONT_USE_FATAL_EXTENSION
if (status == 0) if (status == 0)
Stack_check_Dump_usage(); rtems_stack_checker_dump_usage();
#endif #endif
} }
/*PAGE /*PAGE
* *
* Stack_check_Dump_usage * rtems_stack_checker_dump_usage
*/ */
void Stack_check_Dump_usage( void ) void rtems_stack_checker_dump_usage( void )
{ {
uint32_t i; uint32_t i;
uint32_t api_index; uint32_t api_index;

View File

@@ -3,7 +3,7 @@
* This include file contains internal information * This include file contains internal information
* for the RTEMS stack checker. * for the RTEMS stack checker.
* *
* COPYRIGHT (c) 1989-1999. * COPYRIGHT (c) 1989-2006.
* On-Line Applications Research Corporation (OAR). * On-Line Applications Research Corporation (OAR).
* *
* The license and distribution terms for this file may be * The license and distribution terms for this file may be
@@ -46,46 +46,46 @@ typedef struct {
#define U32_PATTERN 0xA5A5A5A5 #define U32_PATTERN 0xA5A5A5A5
/* /*
* Stack_check_Create_extension * rtems_stack_checker_create_extension
*/ */
boolean Stack_check_Create_extension( boolean rtems_stack_checker_create_extension(
Thread_Control *running, Thread_Control *running,
Thread_Control *the_thread Thread_Control *the_thread
); );
/* /*
* Stack_check_Begin_extension * rtems_stack_checker_begin_extension
*/ */
void Stack_check_Begin_extension( void rtems_stack_checker_begin_extension(
Thread_Control *the_thread Thread_Control *the_thread
); );
/* /*
* Stack_check_Switch_extension * rtems_stack_checker_switch_extension
*/ */
void Stack_check_Switch_extension( void rtems_stack_checker_switch_extension(
Thread_Control *running, Thread_Control *running,
Thread_Control *heir Thread_Control *heir
); );
/* /*
* Stack_check_Fatal_extension * rtems_stack_checker_fatal_extension
*/ */
void Stack_check_Fatal_extension( void rtems_stack_checker_fatal_extension(
Internal_errors_Source source, Internal_errors_Source source,
boolean is_internal, boolean is_internal,
uint32_t status uint32_t status
); );
/* /*
* Stack_check_Dump_usage * rtems_stack_checker_dump_usage
*/ */
void Stack_check_Dump_usage( void ); void rtems_stack_checker_dump_usage( void );
#ifdef __cplusplus #ifdef __cplusplus
} }

View File

@@ -3,7 +3,7 @@
* This include file contains information necessary to utilize * This include file contains information necessary to utilize
* and install the stack checker mechanism. * and install the stack checker mechanism.
* *
* COPYRIGHT (c) 1989-1999. * COPYRIGHT (c) 1989-2006.
* On-Line Applications Research Corporation (OAR). * On-Line Applications Research Corporation (OAR).
* *
* The license and distribution terms for this file may be * The license and distribution terms for this file may be
@@ -13,47 +13,47 @@
* $Id$ * $Id$
*/ */
#ifndef __STACK_CHECK_h #ifndef __RTEMS_STACK_CHECKER_h
#define __STACK_CHECK_h #define __RTEMS_STACK_CHECKER_h
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
/* /*
* Stack_check_Initialize * rtems_stack_checker_initialize
*/ */
void Stack_check_Initialize( void ); void rtems_stack_checker_initialize( void );
/* /*
* Stack_check_Dump_usage * rtems_stack_checker_Dump_usage
*/ */
void Stack_check_Dump_usage( void ); void rtems_stack_checker_dump_usage( void );
/* /*
* Stack_check_Create_extension * rtems_stack_checker_create_extension
*/ */
boolean Stack_check_Create_extension( boolean rtems_stack_checker_create_extension(
Thread_Control *running, Thread_Control *running,
Thread_Control *the_thread Thread_Control *the_thread
); );
/* /*
* Stack_check_Begin_extension * rtems_stack_checker_begin_extension
*/ */
void Stack_check_Begin_extension( void rtems_stack_checker_begin_extension(
Thread_Control *the_thread Thread_Control *the_thread
); );
/* /*
* Stack_check_Switch_extension * rtems_stack_checker_switch_extension
*/ */
void Stack_check_Switch_extension( void rtems_stack_checker_switch_extension(
Thread_Control *running, Thread_Control *running,
Thread_Control *heir Thread_Control *heir
); );
@@ -62,16 +62,16 @@ void Stack_check_Switch_extension(
* Extension set definition * Extension set definition
*/ */
#define STACK_CHECKER_EXTENSION \ #define RTEMS_STACK_CHECKER_EXTENSION \
{ \ { \
Stack_check_Create_extension, /* rtems_task_create */ \ rtems_stack_checker_create_extension, /* rtems_task_create */ \
0, /* rtems_task_start */ \ 0, /* rtems_task_start */ \
0, /* rtems_task_restart */ \ 0, /* rtems_task_restart */ \
0, /* rtems_task_delete */ \ 0, /* rtems_task_delete */ \
Stack_check_Switch_extension, /* task_switch */ \ rtems_stack_checker_switch_extension, /* task_switch */ \
Stack_check_Begin_extension, /* task_begin */ \ rtems_stack_checker_begin_extension, /* task_begin */ \
0, /* task_exitted */ \ 0, /* task_exitted */ \
0 /* Stack_check_Fatal_extension */, /* fatal */ \ 0 /* rtems_stack_checker_fatal_extension */, /* fatal */ \
} }
#ifdef __cplusplus #ifdef __cplusplus