source: rtems/cpukit/score/src/threaddisabledispatch.c @ 4fc370e

4.115
Last change on this file since 4fc370e was 4fc370e, checked in by Sebastian Huber <sebastian.huber@…>, on Jun 5, 2013 at 10:08:23 AM

score: Move thread dispatch content to new file

Move thread dispatch declarations and inline functions to new header
<rtems/score/threaddispatch.h> to make it independent of the
Thread_Control structure. This avoids a cyclic dependency in case
thread dispatch functions are used for the object implementation.

  • Property mode set to 100644
File size: 1.5 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.com/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/thread.h>
25#include <rtems/score/threaddispatch.h>
26
27#if defined ( __THREAD_DO_NOT_INLINE_DISABLE_DISPATCH__ )
28void _Thread_Disable_dispatch( void )
29{
30  /*
31   *  This check is very brutal to system performance but is very helpful
32   *  at finding blown stack problems.  If you have a stack problem and
33   *  need help finding it, then uncomment this code.  Every system
34   *  call will check the stack and since mutexes are used frequently
35   *  in most systems, you might get lucky.
36   */
37  #if defined(RTEMS_HEAVY_STACK_DEBUG)
38    if (_System_state_Is_up(_System_state_Get()) && (_ISR_Nest_level == 0)) {
39      if ( rtems_stack_checker_is_blown() ) {
40        printk( "Stack blown!!\n" );
41        rtems_fatal_error_occurred( 99 );
42      }
43    }
44  #endif
45
46  _Thread_Dispatch_increment_disable_level();
47  RTEMS_COMPILER_MEMORY_BARRIER();
48
49  /*
50   * This check is even more brutal than the other one.  This enables
51   * malloc heap integrity checking upon entry to every system call.
52   */
53  #if defined(RTEMS_HEAVY_MALLOC_DEBUG)
54    if ( _Thread_Dispatch_get_disable_level() == 1 ) {
55      _Heap_Walk( RTEMS_Malloc_Heap,99, false );
56    }
57  #endif
58}
59#endif
Note: See TracBrowser for help on using the repository browser.