RTEMS  5.1
context.h
Go to the documentation of this file.
1 
11 /*
12  * COPYRIGHT (c) 1989-2011.
13  * On-Line Applications Research Corporation (OAR).
14  *
15  * The license and distribution terms for this file may be
16  * found in the file LICENSE in this distribution or at
17  * http://www.rtems.org/license/LICENSE.
18  */
19 
20 #ifndef _RTEMS_SCORE_CONTEXT_H
21 #define _RTEMS_SCORE_CONTEXT_H
22 
39 #ifdef __cplusplus
40 extern "C" {
41 #endif
42 
43 #include <rtems/score/cpu.h>
44 
51 #if ( CPU_HARDWARE_FP == TRUE ) || ( CPU_SOFTWARE_FP == TRUE )
52  #define CONTEXT_FP_SIZE \
53  ( ( CPU_CONTEXT_FP_SIZE + CPU_HEAP_ALIGNMENT - 1 ) \
54  & ~( CPU_HEAP_ALIGNMENT - 1 ) )
55 #else
56  #define CONTEXT_FP_SIZE 0
57 #endif
58 
76 #define _Context_Initialize( _the_context, _stack, _size, _isr, _entry, \
77  _is_fp, _tls_area ) \
78  _CPU_Context_Initialize( _the_context, _stack, _size, _isr, _entry, \
79  _is_fp, _tls_area )
80 
90 #if defined(_CPU_Context_Initialization_at_thread_begin)
91  #define _Context_Initialization_at_thread_begin() \
92  _CPU_Context_Initialization_at_thread_begin()
93 #else
94  #define _Context_Initialization_at_thread_begin()
95 #endif
96 
106 #define _Context_Switch( _executing, _heir ) \
107  _CPU_Context_switch( _executing, _heir )
108 
117 #define _Context_Restart_self( _the_context ) \
118  _CPU_Context_Restart_self( _the_context )
119 
129 #define _Context_Initialize_fp( _fp_area ) \
130  _CPU_Context_Initialize_fp( _fp_area )
131 
142 #define _Context_Restore_fp( _fp ) \
143  _CPU_Context_restore_fp( _fp )
144 
153 #define _Context_Save_fp( _fp ) \
154  _CPU_Context_save_fp( _fp )
155 
156 #if defined(_CPU_Context_Destroy)
157  #define _Context_Destroy( _the_thread, _the_context ) \
158  _CPU_Context_Destroy( _the_thread, _the_context )
159 #else
160  #define _Context_Destroy( _the_thread, _the_context )
161 #endif
162 
163 #ifdef __cplusplus
164 }
165 #endif
166 
169 #endif
170 /* end of include file */