source: rtems/c/src/exec/rtems/inline/rtems/rtems/modes.inl @ 7f6a24ab

4.104.114.84.95
Last change on this file since 7f6a24ab was 7f6a24ab, checked in by Joel Sherrill <joel.sherrill@…>, on 08/28/95 at 15:30:29

Added unused priority ceiling parameter to rtems_semaphore_create.

Rearranged code to created thread handler routines to initialize,
start, restart, and "close/delete" a thread.

Made internal threads their own object class. This now uses the
thread support routines for starting and initializing a thread.

Insured deleted tasks are freed to the Inactive pool associated with the
correct Information block.

Added an RTEMS API specific data area to the thread control block.

Beginnings of removing the word "rtems" from the core.

  • Property mode set to 100644
File size: 2.3 KB
RevLine 
[ac7d5ef0]1/*  modes.inl
2 *
3 *  This include file contains the static inline implementation of the
4 *  inlined routines in the Mode Handler
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 __MODES_inl
18#define __MODES_inl
19
20/*PAGE
21 *
22 *  RTEMS_INTERRUPT_LEVEL
23 */
24
25STATIC INLINE unsigned32 RTEMS_INTERRUPT_LEVEL (
[7f6a24ab]26  Modes_Control mode_set
[ac7d5ef0]27)
28{
29  return mode_set & RTEMS_INTERRUPT_MASK;
30}
31
32/*PAGE
33 *
34 *  _Modes_Mask_changed
35 *
36 */
37
38STATIC INLINE boolean _Modes_Mask_changed (
[7f6a24ab]39  Modes_Control mode_set,
40  Modes_Control masks
[ac7d5ef0]41)
42{
43   return ( mode_set & masks );
44}
45
46/*PAGE
47 *
48 *  _Modes_Is_asr_disabled
49 *
50 */
51
52STATIC INLINE boolean _Modes_Is_asr_disabled (
[7f6a24ab]53  Modes_Control mode_set
[ac7d5ef0]54)
55{
56   return ( mode_set & RTEMS_ASR_MASK );
57}
58
59/*PAGE
60 *
61 *  _Modes_Is_preempt
62 *
63 */
64
65STATIC INLINE boolean _Modes_Is_preempt (
[7f6a24ab]66  Modes_Control mode_set
[ac7d5ef0]67)
68{
69   return ( ( mode_set & RTEMS_PREEMPT_MASK ) == RTEMS_PREEMPT );
70}
71
72/*PAGE
73 *
74 *  _Modes_Is_timeslice
75 *
76 */
77
78STATIC INLINE boolean _Modes_Is_timeslice (
[7f6a24ab]79  Modes_Control mode_set
[ac7d5ef0]80)
81{
82  return ((mode_set & (RTEMS_TIMESLICE_MASK|RTEMS_PREEMPT_MASK)) ==
83                  (RTEMS_TIMESLICE|RTEMS_PREEMPT) );
84}
85
86/*PAGE
87 *
88 *  _Modes_Get_interrupt_level
89 *
90 */
91
92STATIC INLINE ISR_Level _Modes_Get_interrupt_level (
[7f6a24ab]93  Modes_Control mode_set
[ac7d5ef0]94)
95{
96  return ( mode_set & RTEMS_INTERRUPT_MASK );
97}
98
99/*PAGE
100 *
101 *  _Modes_Set_interrupt_level
102 *
103 */
104
105STATIC INLINE void _Modes_Set_interrupt_level (
[7f6a24ab]106  Modes_Control mode_set
[ac7d5ef0]107)
108{
109  _ISR_Set_level( _Modes_Get_interrupt_level( mode_set ) );
110}
111
112/*PAGE
113 *
114 *  _Modes_Change
115 *
116 */
117
118STATIC INLINE void _Modes_Change (
[7f6a24ab]119  Modes_Control  old_mode_set,
120  Modes_Control  new_mode_set,
121  Modes_Control  mask,
122  Modes_Control *out_mode_set,
123  Modes_Control *changed
[ac7d5ef0]124)
125{
[7f6a24ab]126  Modes_Control _out_mode;
[ac7d5ef0]127
128  _out_mode      =  old_mode_set;
129  _out_mode     &= ~mask;
130  _out_mode     |= new_mode_set & mask;
131  *changed       = _out_mode ^ old_mode_set;
132  *out_mode_set  = _out_mode;
133}
134
135#endif
136/* end of include file */
Note: See TracBrowser for help on using the repository browser.