source: rtems/cpukit/score/macros/rtems/score/thread.inl @ eb02f47

4.104.114.84.95
Last change on this file since eb02f47 was eb02f47, checked in by Joel Sherrill <joel.sherrill@…>, on 11/10/99 at 13:48:27

Committed modifications from ITRON Task and Task Dependendent Synchronization
Working Group. Included are tests.

  • Property mode set to 100644
File size: 3.5 KB
Line 
1/*  thread.inl
2 *
3 *  This file contains the macro implementation of the inlined
4 *  routines from the Thread handler.
5 *
6 *  COPYRIGHT (c) 1989-1998.
7 *  On-Line Applications Research Corporation (OAR).
8 *  Copyright assigned to U.S. Government, 1994.
9 *
10 *  The license and distribution terms for this file may be
11 *  found in the file LICENSE in this distribution or at
12 *  http://www.OARcorp.com/rtems/license.html.
13 *
14 *  $Id$
15 */
16
17#ifndef __THREAD_inl
18#define __THREAD_inl
19
20/*PAGE
21 *
22 *  _Thread_Stop_multitasking
23 *
24 */
25
26#define _Thread_Stop_multitasking() \
27  _Context_Switch( &_Thread_Executing->Registers, &_Thread_BSP_context );
28
29/*PAGE
30 *
31 *  _Thread_Is_executing
32 *
33 */
34
35#define _Thread_Is_executing( _the_thread ) \
36        ( (_the_thread) == _Thread_Executing )
37
38/*PAGE
39 *
40 *  _Thread_Is_heir
41 *
42 */
43
44#define _Thread_Is_heir( _the_thread ) \
45        ( (_the_thread) == _Thread_Heir )
46
47/*PAGE
48 *
49 *  _Thread_Is_executing_also_the_heir
50 *
51 */
52
53#define _Thread_Is_executing_also_the_heir() \
54        ( _Thread_Executing == _Thread_Heir )
55
56/*PAGE
57 *
58 *  _Thread_Unblock
59 *
60 */
61
62#define _Thread_Unblock( _the_thread ) \
63        _Thread_Clear_state( (_the_thread), STATES_BLOCKED );
64
65/*PAGE
66 *
67 *  _Thread_Restart_self
68 *
69 */
70
71#define _Thread_Restart_self()  \
72  {  \
73     if ( _Thread_Executing->fp_context != NULL ) \
74       _Context_Restore_fp( &_Thread_Executing->fp_context ); \
75     \
76    _CPU_Context_Restart_self( &_Thread_Executing->Registers ); \
77  }
78
79/*PAGE
80 *
81 *  _Thread_Calculate_heir
82 *
83 */
84
85#define _Thread_Calculate_heir() \
86 { \
87   Priority_Control  highest; \
88   \
89   _Priority_Get_highest( highest ); \
90   \
91   _Thread_Heir = (Thread_Control *) _Thread_Ready_chain[ highest ].first; \
92  }
93
94/*PAGE
95 *
96 *  _Thread_Is_allocated_fp
97 *
98 */
99
100#define _Thread_Is_allocated_fp( _the_thread ) \
101        ( (_the_thread) == _Thread_Allocated_fp )
102
103/*PAGE
104 *
105 *  _Thread_Deallocate_fp
106 *
107 */
108
109#define _Thread_Deallocate_fp() \
110        _Thread_Allocated_fp = NULL
111
112/*PAGE
113 *
114 *  _Thread_Disable_dispatch
115 *
116 */
117
118#define _Thread_Disable_dispatch() \
119  _Thread_Dispatch_disable_level += 1
120
121/*PAGE
122 *
123 *  _Thread_Enable_dispatch
124 *
125 */
126
127#if ( CPU_INLINE_ENABLE_DISPATCH == TRUE )
128#define _Thread_Enable_dispatch()  \
129      { if ( (--_Thread_Dispatch_disable_level) == 0 ) \
130             _Thread_Dispatch();  \
131      }
132#endif
133
134#if ( CPU_INLINE_ENABLE_DISPATCH == FALSE )
135void _Thread_Enable_dispatch( void );
136#endif
137
138/*PAGE
139 *
140 *  _Thread_Unnest_dispatch
141 *
142 */
143
144#define _Thread_Unnest_dispatch()  \
145  _Thread_Dispatch_disable_level -= 1
146
147/*PAGE
148 *
149 *  _Thread_Is_dispatching_enabled
150 *
151 */
152
153#define _Thread_Is_dispatching_enabled() \
154  ( _Thread_Dispatch_disable_level == 0 )
155
156/*PAGE
157 *
158 *  _Thread_Is_context_switch_necessary
159 *
160 */
161
162#define _Thread_Is_context_switch_necessary() \
163  ( _Context_Switch_necessary == TRUE )
164
165/*PAGE
166 *
167 *  _Thread_Dispatch_initialization
168 *
169 */
170
171#define _Thread_Dispatch_initialization() \
172  _Thread_Dispatch_disable_level = 1
173
174/*PAGE
175 *
176 *  _Thread_Is_null
177 *
178 */
179
180#define _Thread_Is_null( _the_thread ) \
181  ( (_the_thread) == NULL )
182
183/*
184 *  _Thread_Is_proxy_blocking
185 *
186 */
187 
188#define _Thread_Is_proxy_blocking( _code ) \
189  ( (_code) == THREAD_STATUS_PROXY_BLOCKING )
190
191/*
192 *  _Thread_Internal_allocate
193 *
194 */
195 
196#define _Thread_Internal_allocate() \
197  ((Thread_Control *) _Objects_Allocate( &_Thread_Internal_information ))
198 
199/*
200 *  _Thread_Internal_free
201 *
202 */
203 
204#define _Thread_Internal_free( _the_task ) \
205  _Objects_Free( &_Thread_Internal_information, &(_the_task)->Object )
206
207#endif
208/* end of include file */
Note: See TracBrowser for help on using the repository browser.