RTEMS 6.1-rc6
Loading...
Searching...
No Matches
context.h
Go to the documentation of this file.
1/* SPDX-License-Identifier: BSD-2-Clause */
2
12/*
13 * COPYRIGHT (c) 1989-2011.
14 * On-Line Applications Research Corporation (OAR).
15 *
16 * Redistribution and use in source and binary forms, with or without
17 * modification, are permitted provided that the following conditions
18 * are met:
19 * 1. Redistributions of source code must retain the above copyright
20 * notice, this list of conditions and the following disclaimer.
21 * 2. Redistributions in binary form must reproduce the above copyright
22 * notice, this list of conditions and the following disclaimer in the
23 * documentation and/or other materials provided with the distribution.
24 *
25 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
26 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
27 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
28 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
29 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
30 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
31 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
32 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
33 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
34 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
35 * POSSIBILITY OF SUCH DAMAGE.
36 */
37
38#ifndef _RTEMS_SCORE_CONTEXT_H
39#define _RTEMS_SCORE_CONTEXT_H
40
57#ifdef __cplusplus
58extern "C" {
59#endif
60
61#include <rtems/score/cpu.h>
62
69#if ( CPU_HARDWARE_FP == TRUE ) || ( CPU_SOFTWARE_FP == TRUE )
70 #define CONTEXT_FP_SIZE \
71 RTEMS_ALIGN_UP( CPU_CONTEXT_FP_SIZE, CPU_STACK_ALIGNMENT )
72#else
73 #define CONTEXT_FP_SIZE 0
74#endif
75
93#define _Context_Initialize( _the_context, _stack, _size, _isr, _entry, \
94 _is_fp, _tls_area ) \
95 _CPU_Context_Initialize( _the_context, _stack, _size, _isr, _entry, \
96 _is_fp, _tls_area )
97
107#if defined(_CPU_Context_Initialization_at_thread_begin)
108 #define _Context_Initialization_at_thread_begin() \
109 _CPU_Context_Initialization_at_thread_begin()
110#else
111 #define _Context_Initialization_at_thread_begin()
112#endif
113
123#define _Context_Switch( _executing, _heir ) \
124 _CPU_Context_switch( _executing, _heir )
125
134#define _Context_Restart_self( _the_context ) \
135 _CPU_Context_Restart_self( _the_context )
136
146#define _Context_Initialize_fp( _fp_area ) \
147 _CPU_Context_Initialize_fp( _fp_area )
148
159#define _Context_Restore_fp( _fp ) \
160 _CPU_Context_restore_fp( _fp )
161
170#define _Context_Save_fp( _fp ) \
171 _CPU_Context_save_fp( _fp )
172
173#if defined(_CPU_Context_Destroy)
174 #define _Context_Destroy( _the_thread, _the_context ) \
175 _CPU_Context_Destroy( _the_thread, _the_context )
176#else
177 #define _Context_Destroy( _the_thread, _the_context )
178#endif
179
180#ifdef __cplusplus
181}
182#endif
183
186#endif
187/* end of include file */