source: rtems/c/src/exec/rtems/inline/rtems/rtems/modes.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/*  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 (
26  rtems_mode mode_set
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 (
39  rtems_mode mode_set,
40  rtems_mode masks
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 (
53  rtems_mode mode_set
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 (
66  rtems_mode mode_set
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 (
79  rtems_mode mode_set
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 (
93  rtems_mode mode_set
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 (
106  rtems_mode mode_set
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 (
119  rtems_mode  old_mode_set,
120  rtems_mode  new_mode_set,
121  rtems_mode  mask,
122  rtems_mode *out_mode_set,
123  rtems_mode *changed
124)
125{
126  rtems_mode _out_mode;
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.