source: rtems/cpukit/score/src/threaddisabledispatch.c @ e8fffc2d

4.115
Last change on this file since e8fffc2d was c499856, checked in by Chris Johns <chrisj@…>, on 03/20/14 at 21:10:47

Change all references of rtems.com to rtems.org.

  • Property mode set to 100644
File size: 1.6 KB
Line 
1/**
2 * @file
3 *
4 * @brief Disaable Thread Dispatching
5 * @ingroup ScoreThread
6 */
7
8/*
9 *
10 *
11 *  COPYRIGHT (c) 1989-2011.
12 *  On-Line Applications Research Corporation (OAR).
13 *
14 *  The license and distribution terms for this file may be
15 *  found in the file LICENSE in this distribution or at
16 *  http://www.rtems.org/license/LICENSE.
17 */
18
19#if HAVE_CONFIG_H
20#include "config.h"
21#endif
22
23#include <rtems/system.h>
24#include <rtems/score/sysstate.h>
25#include <rtems/score/thread.h>
26#include <rtems/score/threaddispatch.h>
27
28#if defined ( __THREAD_DO_NOT_INLINE_DISABLE_DISPATCH__ )
29void _Thread_Disable_dispatch( void )
30{
31  /*
32   *  This check is very brutal to system performance but is very helpful
33   *  at finding blown stack problems.  If you have a stack problem and
34   *  need help finding it, then uncomment this code.  Every system
35   *  call will check the stack and since mutexes are used frequently
36   *  in most systems, you might get lucky.
37   */
38  #if defined(RTEMS_HEAVY_STACK_DEBUG)
39    if (_System_state_Is_up(_System_state_Get()) && (_ISR_Nest_level == 0)) {
40      if ( rtems_stack_checker_is_blown() ) {
41        printk( "Stack blown!!\n" );
42        rtems_fatal_error_occurred( 99 );
43      }
44    }
45  #endif
46
47  _Thread_Dispatch_increment_disable_level();
48  RTEMS_COMPILER_MEMORY_BARRIER();
49
50  /*
51   * This check is even more brutal than the other one.  This enables
52   * malloc heap integrity checking upon entry to every system call.
53   */
54  #if defined(RTEMS_HEAVY_MALLOC_DEBUG)
55    if ( _Thread_Dispatch_get_disable_level() == 1 ) {
56      _Heap_Walk( RTEMS_Malloc_Heap,99, false );
57    }
58  #endif
59}
60#endif
Note: See TracBrowser for help on using the repository browser.