source: rtems/c/src/exec/score/headers/context.h @ c627b2a3

4.104.114.84.95
Last change on this file since c627b2a3 was c627b2a3, checked in by Joel Sherrill <joel.sherrill@…>, on 05/28/96 at 21:40:52

split the inclusion of "EXTERN" data based on whether it was sapi,
score, rtems api, or posix api related.

  • Property mode set to 100644
File size: 3.1 KB
Line 
1/*  context.h
2 *
3 *  This include file contains all information about a context.
4 *
5 *  COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994.
6 *  On-Line Applications Research Corporation (OAR).
7 *  All rights assigned to U.S. Government, 1994.
8 *
9 *  This material may be reproduced by or for the U.S. Government pursuant
10 *  to the copyright license under the clause at DFARS 252.227-7013.  This
11 *  notice must appear in all copies of this file and its derivatives.
12 *
13 *  $Id$
14 */
15
16#ifndef __RTEMS_CONTEXT_h
17#define __RTEMS_CONTEXT_h
18
19#ifdef __cplusplus
20extern "C" {
21#endif
22
23#include <rtems/score/cpu.h>
24
25/*
26 *  The following constant defines the number of bytes required
27 *  to store a full floating point context.
28 */
29
30#define CONTEXT_FP_SIZE CPU_CONTEXT_FP_SIZE
31
32/*
33 *  The following variable is set to TRUE when a reschedule operation
34 *  has determined that the processor should be taken away from the
35 *  currently executing thread and given to the heir thread.
36 */
37
38SCORE_EXTERN boolean _Context_Switch_necessary;
39
40/*
41 *  _Context_Initialize
42 *
43 *  DESCRIPTION:
44 *
45 *  This routine initializes THE_CONTEXT such that the stack
46 *  pointer, interrupt level, and entry point are correct for the
47 *  thread's initial state.
48 */
49
50#define \
51   _Context_Initialize( _the_context, _stack, _size, _isr, _entry, _is_fp ) \
52   _CPU_Context_Initialize( _the_context, _stack, _size, _isr, _entry, _is_fp )
53
54/*
55 *  _Context_Switch
56 *
57 *  DESCRIPTION:
58 *
59 *  This routine saves the current context into the EXECUTING
60 *  context record and restores the context specified by HEIR.
61 */
62
63#define _Context_Switch( _executing, _heir ) \
64   _CPU_Context_switch( _executing, _heir )
65
66/*
67 *  _Context_Restart_self
68 *
69 *  DESCRIPTION:
70 *
71 *  This routine restarts the calling thread by restoring its initial
72 *  stack pointer and returning to the thread's entry point.
73 */
74
75#define _Context_Restart_self( _the_context ) \
76   _CPU_Context_Restart_self( _the_context )
77
78/*
79 *  _Context_Fp_start
80 *
81 *  DESCRIPTION:
82 *
83 *  This function returns the starting address of the floating
84 *  point context save area.  It is assumed that the are reserved
85 *  for the floating point save area is large enough.
86 */
87
88#define _Context_Fp_start( _base, _offset ) \
89   _CPU_Context_Fp_start( (_base), (_offset) )
90
91/*
92 *  _Context_Initialize_fp
93 *
94 *  DESCRIPTION:
95 *
96 *  This routine initializes the floating point context save
97 *  area to contain an initial known state.
98 */
99
100#define _Context_Initialize_fp( _fp_area ) \
101   _CPU_Context_Initialize_fp( _fp_area )
102
103/*
104 *  _Context_Restore_fp
105 *
106 *  DESCRIPTION:
107 *
108 *  This routine restores the floating point context contained
109 *  in the FP_CONTEXT area.  It is assumed that the current
110 *  floating point context has been saved by a previous invocation
111 *  of SAVE_FP.
112 */
113
114#define _Context_Restore_fp( _fp ) \
115   _CPU_Context_restore_fp( _fp )
116
117/*
118 *  _Context_Save_fp
119 *
120 *  DESCRIPTION:
121 *
122 *  This routine saves the current floating point context
123 *  in the FP_CONTEXT area.
124 */
125
126#define _Context_Save_fp( _fp ) \
127   _CPU_Context_save_fp( _fp )
128
129#ifdef __cplusplus
130}
131#endif
132
133#endif
134/* end of include file */
Note: See TracBrowser for help on using the repository browser.