Changeset 2d637b2 in rtems


Ignore:
Timestamp:
Jun 23, 2010, 6:18:42 PM (9 years ago)
Author:
Joel Sherrill <joel.sherrill@…>
Branches:
4.11, master
Children:
6cb7221
Parents:
0ed275e
Message:

2010-06-23 Joel Sherrill <joel.sherrilL@…>

  • libmisc/stackchk/check.c: Clean up to improve coverage.
Location:
cpukit
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • cpukit/ChangeLog

    r0ed275e r2d637b2  
     12010-06-23      Joel Sherrill <joel.sherrilL@OARcorp.com>
     2
     3        * libmisc/stackchk/check.c: Clean up to improve coverage.
     4
    152010-06-23      Chris Johns <chrisj@rtems.org>
    26
  • cpukit/libmisc/stackchk/check.c

    r0ed275e r2d637b2  
    117117    ((_the_stack)->size - sizeof(Stack_check_Control))
    118118
    119 /*
    120  * Do we have an interrupt stack?
    121  * XXX it would sure be nice if the interrupt stack were also
    122  *     stored in a "stack" structure!
    123  */
    124 Stack_Control Stack_check_Interrupt_stack;
     119#if (CPU_ALLOCATE_INTERRUPT_STACK == TRUE)
     120  /*
     121   *  Did RTEMS allocate the interrupt stack? If so, put it in
     122   *  Stack_Control format.
     123   */
     124  Stack_Control Stack_check_Interrupt_stack;
     125#endif
    125126
    126127/*
     
    382383  char            name[5];
    383384
    384   if ( !the_thread )
    385     return;
    386 
    387   if ( !print_handler )
    388     return;
     385  /*
     386   *  The pointer passed in for the_thread is guaranteed to be non-NULL from
     387   *  rtems_iterate_over_all_threads() so no need to check it here.
     388   */
    389389
    390390  /*
    391391   *  Obtain interrupt stack information
    392392   */
    393 
    394   if (the_thread == (Thread_Control *) -1) {
    395     if (Stack_check_Interrupt_stack.area) {
     393  #if (CPU_ALLOCATE_INTERRUPT_STACK == TRUE)
     394    if (the_thread == (Thread_Control *) -1) {
     395      if (!Stack_check_Interrupt_stack.area)
     396        return;
    396397      stack = &Stack_check_Interrupt_stack;
    397398      the_thread = 0;
    398399      current = 0;
     400    } else
     401  #else
     402    {
     403      stack  = &the_thread->Start.Initial_stack;
     404      current = (void *)_CPU_Context_Get_SP( &the_thread->Registers );
    399405    }
    400     else
    401       return;
    402   } else {
    403     stack  = &the_thread->Start.Initial_stack;
    404     current = (void *)_CPU_Context_Get_SP( &the_thread->Registers );
    405   }
     406  #endif
    406407
    407408  low  = Stack_check_usable_stack_start(stack);
     
    469470)
    470471{
     472  if ( !print )
     473    return;
     474
    471475  print_context = context;
    472476  print_handler = print;
     
    480484  rtems_iterate_over_all_threads( Stack_check_Dump_threads_usage );
    481485
    482   /* dump interrupt stack info if any */
    483   Stack_check_Dump_threads_usage((Thread_Control *) -1);
     486  #if (CPU_ALLOCATE_INTERRUPT_STACK == TRUE)
     487    /* dump interrupt stack info if any */
     488    Stack_check_Dump_threads_usage((Thread_Control *) -1);
     489  #endif
    484490
    485491  print_context = NULL;
Note: See TracChangeset for help on using the changeset viewer.