source: rtems/c/src/exec/rtems/macros/tasks.inl @ ac7d5ef0

4.104.114.84.95
Last change on this file since ac7d5ef0 was ac7d5ef0, checked in by Joel Sherrill <joel.sherrill@…>, on 05/11/95 at 17:39:37

Initial revision

  • Property mode set to 100644
File size: 2.2 KB
Line 
1/*  tasks.inl
2 *
3 *  This file contains the macro implementation of all inlined
4 *  routines in the with RTEMS Tasks Manager.
5 *
6 *  COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994.
7 *  On-Line Applications Research Corporation (OAR).
8 *  All rights assigned to U.S. Government, 1994.
9 *
10 *  This material may be reproduced by or for the U.S. Government pursuant
11 *  to the copyright license under the clause at DFARS 252.227-7013.  This
12 *  notice must appear in all copies of this file and its derivatives.
13 *
14 *  $Id$
15 */
16
17#ifndef __RTEMS_TASKS_inl
18#define __RTEMS_TASKS_inl
19
20/*PAGE
21 *
22 *  _RTEMS_tasks_Allocate
23 *
24 */
25
26#define _RTEMS_tasks_Allocate() \
27  (Thread_Control *) _Objects_Allocate( &_Thread_Information )
28
29/*PAGE
30 *
31 *  _RTEMS_tasks_Free
32 *
33 */
34
35#define _RTEMS_tasks_Free( _the_task ) \
36  _Objects_Free( &_Thread_Information, &(_the_task)->Object )
37
38/*PAGE
39 *
40 *  _RTEMS_tasks_Cancel_wait
41 *
42 */
43
44#define _RTEMS_tasks_Cancel_wait( _the_thread ) \
45  { \
46    States_Control _state; \
47    States_Control _remote_state; \
48    \
49    _state = (_the_thread)->current_state; \
50    \
51    if ( _States_Is_waiting_on_thread_queue( _state ) ) { \
52      if ( _States_Is_waiting_for_rpc_reply( _state ) && \
53            _States_Is_locally_blocked( _state ) ) { \
54        _remote_state = _States_Clear( \
55                       STATES_WAITING_FOR_RPC_REPLY + STATES_TRANSIENT, \
56                       _state \
57                     ); \
58        \
59        switch ( _remote_state ) { \
60          \
61          case STATES_WAITING_FOR_BUFFER: \
62            _Partition_MP_Send_extract_proxy( (_the_thread) ); \
63            break; \
64          case STATES_WAITING_FOR_SEGMENT: \
65            _Region_MP_Send_extract_proxy( (_the_thread) ); \
66            break; \
67          case STATES_WAITING_FOR_SEMAPHORE: \
68            _Semaphore_MP_Send_extract_proxy( (_the_thread) ); \
69            break; \
70          case STATES_WAITING_FOR_MESSAGE: \
71            _Message_queue_MP_Send_extract_proxy( (_the_thread) ); \
72            break; \
73        } \
74      } \
75      _Thread_queue_Extract( (_the_thread)->Wait.queue, (_the_thread) ); \
76    } \
77    else if ( _Watchdog_Is_active( &(_the_thread)->Timer ) ) \
78      (void) _Watchdog_Remove( &(_the_thread)->Timer ); \
79  }
80
81#endif
82/* end of include file */
Note: See TracBrowser for help on using the repository browser.