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