source:
rtems/c/src/exec/rtems/inline/rtems/rtems/modes.inl
@
3a4ae6c
Last change on this file since 3a4ae6c was 3a4ae6c, checked in by Joel Sherrill <joel.sherrill@…>, on 09/11/95 at 19:35:39 | |
---|---|
|
|
File size: 2.2 KB |
Rev | Line | |
---|---|---|
[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 | ||
25 | STATIC 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 | ||
38 | STATIC 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 | ||
52 | STATIC INLINE boolean _Modes_Is_asr_disabled ( | |
[7f6a24ab] | 53 | Modes_Control mode_set |
[ac7d5ef0] | 54 | ) |
55 | { | |
[3a4ae6c] | 56 | return (mode_set & RTEMS_ASR_MASK) == RTEMS_NO_ASR; |
[ac7d5ef0] | 57 | } |
58 | ||
59 | /*PAGE | |
60 | * | |
61 | * _Modes_Is_preempt | |
62 | * | |
63 | */ | |
64 | ||
65 | STATIC INLINE boolean _Modes_Is_preempt ( | |
[7f6a24ab] | 66 | Modes_Control mode_set |
[ac7d5ef0] | 67 | ) |
68 | { | |
[3a4ae6c] | 69 | return (mode_set & RTEMS_PREEMPT_MASK) == RTEMS_PREEMPT; |
[ac7d5ef0] | 70 | } |
71 | ||
72 | /*PAGE | |
73 | * | |
74 | * _Modes_Is_timeslice | |
75 | * | |
76 | */ | |
77 | ||
78 | STATIC INLINE boolean _Modes_Is_timeslice ( | |
[7f6a24ab] | 79 | Modes_Control mode_set |
[ac7d5ef0] | 80 | ) |
81 | { | |
[3a4ae6c] | 82 | return (mode_set & RTEMS_TIMESLICE_MASK) == RTEMS_TIMESLICE; |
[ac7d5ef0] | 83 | } |
84 | ||
85 | /*PAGE | |
86 | * | |
87 | * _Modes_Get_interrupt_level | |
88 | * | |
89 | */ | |
90 | ||
91 | STATIC INLINE ISR_Level _Modes_Get_interrupt_level ( | |
[7f6a24ab] | 92 | Modes_Control mode_set |
[ac7d5ef0] | 93 | ) |
94 | { | |
95 | return ( mode_set & RTEMS_INTERRUPT_MASK ); | |
96 | } | |
97 | ||
98 | /*PAGE | |
99 | * | |
100 | * _Modes_Set_interrupt_level | |
101 | * | |
102 | */ | |
103 | ||
104 | STATIC INLINE void _Modes_Set_interrupt_level ( | |
[7f6a24ab] | 105 | Modes_Control mode_set |
[ac7d5ef0] | 106 | ) |
107 | { | |
108 | _ISR_Set_level( _Modes_Get_interrupt_level( mode_set ) ); | |
109 | } | |
110 | ||
111 | /*PAGE | |
112 | * | |
113 | * _Modes_Change | |
114 | * | |
115 | */ | |
116 | ||
117 | STATIC INLINE void _Modes_Change ( | |
[7f6a24ab] | 118 | Modes_Control old_mode_set, |
119 | Modes_Control new_mode_set, | |
120 | Modes_Control mask, | |
121 | Modes_Control *out_mode_set, | |
122 | Modes_Control *changed | |
[ac7d5ef0] | 123 | ) |
124 | { | |
[7f6a24ab] | 125 | Modes_Control _out_mode; |
[ac7d5ef0] | 126 | |
127 | _out_mode = old_mode_set; | |
128 | _out_mode &= ~mask; | |
129 | _out_mode |= new_mode_set & mask; | |
130 | *changed = _out_mode ^ old_mode_set; | |
131 | *out_mode_set = _out_mode; | |
132 | } | |
133 | ||
134 | #endif | |
135 | /* end of include file */ |
Note: See TracBrowser
for help on using the repository browser.