Changeset 71f4beb in rtems for c/src/libmisc/stackchk


Ignore:
Timestamp:
04/15/98 15:08:49 (26 years ago)
Author:
Joel Sherrill <joel.sherrill@…>
Branches:
4.10, 4.11, 4.8, 4.9, 5, master
Children:
d07d3eec
Parents:
9b64c2d5
Message:

Stack check now initialized as part of initial extension set.

Location:
c/src/libmisc/stackchk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • c/src/libmisc/stackchk/README

    r9b64c2d5 r71f4beb  
    22#  $Id$
    33#
     4
     5Introduction
     6============
    47
    58This directory contains a stack bounds checker.  It provides two
     
    811   + check for stack overflow at each context switch
    912   + provides an educated guess at each task's stack usage
     13
     14Enabling
     15========
     16
     17Add the stack checker extension to the initial user extension set.
     18If using confdefs.h to build your configuration table, this is
     19as simple as adding -DSTACK_CHECK_ON to the gcc command line which
     20compiles the file defining the configuration table.  In the RTEMS
     21test suites and samples, this is always init.c
     22
     23Background
     24==========
    1025
    1126The stack overflow check at context switch works by looking for
  • c/src/libmisc/stackchk/check.c

    r9b64c2d5 r71f4beb  
    176176  };
    177177
     178#if 0
    178179  status = rtems_extension_create(
    179180    rtems_build_name( 'S', 'T', 'C', 'K' ),
     
    182183  );
    183184  assert ( status == RTEMS_SUCCESSFUL );
     185#endif
    184186
    185187  Stack_check_Blown_task = 0;
     
    255257)
    256258{
     259    if (!stack_check_initialized)
     260      Stack_check_Initialize();
     261
    257262    if (the_thread /* XXX && (the_thread != _Thread_Executing) */ )
    258263        stack_check_dope_stack(&the_thread->Start.Initial_stack);
     
    271276{
    272277  Stack_check_Control  *the_pattern;
     278
     279  if (!stack_check_initialized)
     280    Stack_check_Initialize();
    273281
    274282  if ( the_thread->Object.id == 0 )        /* skip system tasks */
  • c/src/libmisc/stackchk/stackchk.h

    r9b64c2d5 r71f4beb  
    3434void Stack_check_Dump_usage( void );
    3535
     36/*
     37 *  Stack_check_Create_extension
     38 */
     39
     40boolean Stack_check_Create_extension(
     41  Thread_Control *running,
     42  Thread_Control *the_thread
     43);
     44
     45/*
     46 *  Stack_check_Begin_extension
     47 */
     48
     49void Stack_check_Begin_extension(
     50  Thread_Control *the_thread
     51);
     52
     53/*
     54 *  Stack_check_Switch_extension
     55 */
     56
     57void Stack_check_Switch_extension(
     58  Thread_Control *running,
     59  Thread_Control *heir
     60);
     61
     62/*
     63 *  Extension set definition
     64 */
     65
     66#define STACK_CHECKER_EXTENSION \
     67{ \
     68  Stack_check_Create_extension,        /* rtems_task_create  */ \
     69  0,                                   /* rtems_task_start   */ \
     70  0,                                   /* rtems_task_restart */ \
     71  0,                                   /* rtems_task_delete  */ \
     72  Stack_check_Switch_extension,        /* task_switch  */ \
     73  Stack_check_Begin_extension,         /* task_begin   */ \
     74  0,                                   /* task_exitted */ \
     75  0 /* Stack_check_Fatal_extension */, /* fatal        */ \
     76}
     77
    3678#ifdef __cplusplus
    3779}
Note: See TracChangeset for help on using the changeset viewer.