From ee13a74e4c6e8478a721753a266e99b998c497bc Mon Sep 17 00:00:00 2001 From: Joel Sherrill Date: Mon, 1 Jul 2002 22:18:13 +0000 Subject: 2002-07-01 Joel Sherrill * stackchk/check.c: Corrected use of _Objects_Information_table now that it is a two dimensional array based upon API and class. --- c/src/libmisc/ChangeLog | 6 ++++++ c/src/libmisc/stackchk/check.c | 28 ++++++++++++++++------------ cpukit/libmisc/ChangeLog | 6 ++++++ cpukit/libmisc/stackchk/check.c | 28 ++++++++++++++++------------ 4 files changed, 44 insertions(+), 24 deletions(-) diff --git a/c/src/libmisc/ChangeLog b/c/src/libmisc/ChangeLog index fbcc1f9506..347754fb94 100644 --- a/c/src/libmisc/ChangeLog +++ b/c/src/libmisc/ChangeLog @@ -1,3 +1,9 @@ +2002-07-01 Joel Sherrill + + * stackchk/check.c: Corrected use of + _Objects_Information_table now that it is a two dimensional + array based upon API and class. + 2002-06-25 Thomas Doerfler * With the addition of serdbg, the standard polled I/O functions diff --git a/c/src/libmisc/stackchk/check.c b/c/src/libmisc/stackchk/check.c index 8e811e493d..297f161752 100644 --- a/c/src/libmisc/stackchk/check.c +++ b/c/src/libmisc/stackchk/check.c @@ -150,7 +150,7 @@ void Stack_check_Initialize( void ) unsigned32 *p; #if 0 unsigned32 i; - unsigned32 class_index; + unsigned32 api_index; Thread_Control *the_thread; Objects_Information *information; #endif @@ -204,11 +204,13 @@ void Stack_check_Initialize( void ) #endif #if 0 - for ( class_index = OBJECTS_CLASSES_FIRST ; - class_index <= OBJECTS_CLASSES_LAST ; - class_index++ ) { - information = _Objects_Information_table[ class_index ]; - if ( information && information->is_thread ) { + for ( api_index = 1; + api_index <= OBJECTS_APIS_LAST ; + api_index++ ) { + if ( !_Objects_Information_table[ api_index ] ) + continue; + information = _Objects_Information_table[ api_index ][ 1 ]; + if ( information ) { for ( i=1 ; i <= information->maximum ; i++ ) { the_thread = (Thread_Control *)information->local_table[ i ]; Stack_check_Create_extension( the_thread, the_thread ); @@ -495,7 +497,7 @@ void Stack_check_Fatal_extension( void Stack_check_Dump_usage( void ) { unsigned32 i; - unsigned32 class_index; + unsigned32 api_index; Thread_Control *the_thread; unsigned32 hit_running = 0; Objects_Information *information; @@ -508,11 +510,13 @@ void Stack_check_Dump_usage( void ) " ID NAME LOW HIGH AVAILABLE USED\n" ); - for ( class_index = OBJECTS_CLASSES_FIRST ; - class_index <= OBJECTS_CLASSES_LAST ; - class_index++ ) { - information = _Objects_Information_table[ class_index ]; - if ( information && information->is_thread ) { + for ( api_index = 1 ; + api_index <= OBJECTS_APIS_LAST ; + api_index++ ) { + if ( !_Objects_Information_table[ api_index ] ) + continue; + information = _Objects_Information_table[ api_index ][ 1 ]; + if ( information ) { for ( i=1 ; i <= information->maximum ; i++ ) { the_thread = (Thread_Control *)information->local_table[ i ]; Stack_check_Dump_threads_usage( the_thread ); diff --git a/cpukit/libmisc/ChangeLog b/cpukit/libmisc/ChangeLog index fbcc1f9506..347754fb94 100644 --- a/cpukit/libmisc/ChangeLog +++ b/cpukit/libmisc/ChangeLog @@ -1,3 +1,9 @@ +2002-07-01 Joel Sherrill + + * stackchk/check.c: Corrected use of + _Objects_Information_table now that it is a two dimensional + array based upon API and class. + 2002-06-25 Thomas Doerfler * With the addition of serdbg, the standard polled I/O functions diff --git a/cpukit/libmisc/stackchk/check.c b/cpukit/libmisc/stackchk/check.c index 8e811e493d..297f161752 100644 --- a/cpukit/libmisc/stackchk/check.c +++ b/cpukit/libmisc/stackchk/check.c @@ -150,7 +150,7 @@ void Stack_check_Initialize( void ) unsigned32 *p; #if 0 unsigned32 i; - unsigned32 class_index; + unsigned32 api_index; Thread_Control *the_thread; Objects_Information *information; #endif @@ -204,11 +204,13 @@ void Stack_check_Initialize( void ) #endif #if 0 - for ( class_index = OBJECTS_CLASSES_FIRST ; - class_index <= OBJECTS_CLASSES_LAST ; - class_index++ ) { - information = _Objects_Information_table[ class_index ]; - if ( information && information->is_thread ) { + for ( api_index = 1; + api_index <= OBJECTS_APIS_LAST ; + api_index++ ) { + if ( !_Objects_Information_table[ api_index ] ) + continue; + information = _Objects_Information_table[ api_index ][ 1 ]; + if ( information ) { for ( i=1 ; i <= information->maximum ; i++ ) { the_thread = (Thread_Control *)information->local_table[ i ]; Stack_check_Create_extension( the_thread, the_thread ); @@ -495,7 +497,7 @@ void Stack_check_Fatal_extension( void Stack_check_Dump_usage( void ) { unsigned32 i; - unsigned32 class_index; + unsigned32 api_index; Thread_Control *the_thread; unsigned32 hit_running = 0; Objects_Information *information; @@ -508,11 +510,13 @@ void Stack_check_Dump_usage( void ) " ID NAME LOW HIGH AVAILABLE USED\n" ); - for ( class_index = OBJECTS_CLASSES_FIRST ; - class_index <= OBJECTS_CLASSES_LAST ; - class_index++ ) { - information = _Objects_Information_table[ class_index ]; - if ( information && information->is_thread ) { + for ( api_index = 1 ; + api_index <= OBJECTS_APIS_LAST ; + api_index++ ) { + if ( !_Objects_Information_table[ api_index ] ) + continue; + information = _Objects_Information_table[ api_index ][ 1 ]; + if ( information ) { for ( i=1 ; i <= information->maximum ; i++ ) { the_thread = (Thread_Control *)information->local_table[ i ]; Stack_check_Dump_threads_usage( the_thread ); -- cgit v1.2.3