source: rtems/cpukit/rtems/inline/rtems/rtems/modes.inl @ 1a8fde6c

4.104.114.84.95
Last change on this file since 1a8fde6c was 1a8fde6c, checked in by Joel Sherrill <joel.sherrill@…>, on 03/06/96 at 21:34:57

Removed prototyes for static inline routines and moved the comments into
the inline implementation. The impetus for this was twofold. First,
it is incorrect to have static inline prototypes when using the macro
implementation. Second, this reduced the number of lines in the include
files seen by rtems.h by about 2000 lines.

Next we restricted visibility for the inline routines to inside the
executive itself EXCEPT for a handful of objects. This reduced the
number of include files included by rtems.h by 40 files and reduced
the lines in the include files seen by rtems.h by about 6000 lines.

In total, these reduced the compile time of the entire RTEMS tree by 20%.
This results in about 8 minutes savings on the SparcStation? 10 morgana.

  • Property mode set to 100644
File size: 3.0 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 *  _Modes_Mask_changed
23 *
24 *  DESCRIPTION:
25 *
26 *  This function returns TRUE if any of the mode flags in mask
27 *  are set in mode_set, and FALSE otherwise.
28 */
29
30STATIC INLINE boolean _Modes_Mask_changed (
31  Modes_Control mode_set,
32  Modes_Control masks
33)
34{
35   return ( mode_set & masks );
36}
37
38/*PAGE
39 *
40 *  _Modes_Is_asr_disabled
41 *
42 *  DESCRIPTION:
43 *
44 *  This function returns TRUE if mode_set indicates that Asynchronous
45 *  Signal Processing is disabled, and FALSE otherwise.
46 */
47
48STATIC INLINE boolean _Modes_Is_asr_disabled (
49  Modes_Control mode_set
50)
51{
52   return (mode_set & RTEMS_ASR_MASK) == RTEMS_NO_ASR;
53}
54
55/*PAGE
56 *
57 *  _Modes_Is_preempt
58 *
59 *  DESCRIPTION:
60 *
61 *  This function returns TRUE if mode_set indicates that preemption
62 *  is enabled, and FALSE otherwise.
63 */
64
65STATIC INLINE boolean _Modes_Is_preempt (
66  Modes_Control mode_set
67)
68{
69   return (mode_set & RTEMS_PREEMPT_MASK) == RTEMS_PREEMPT;
70}
71
72/*PAGE
73 *
74 *  _Modes_Is_timeslice
75 *
76 *  DESCRIPTION:
77 *
78 *  This function returns TRUE if mode_set indicates that timeslicing
79 *  is enabled, and FALSE otherwise.
80 */
81
82STATIC INLINE boolean _Modes_Is_timeslice (
83  Modes_Control mode_set
84)
85{
86  return (mode_set & RTEMS_TIMESLICE_MASK) == RTEMS_TIMESLICE;
87}
88
89/*PAGE
90 *
91 *  _Modes_Get_interrupt_level
92 *
93 *  DESCRIPTION:
94 *
95 *  This function returns the interrupt level portion of the mode_set.
96 */
97
98STATIC INLINE ISR_Level _Modes_Get_interrupt_level (
99  Modes_Control mode_set
100)
101{
102  return ( mode_set & RTEMS_INTERRUPT_MASK );
103}
104
105/*PAGE
106 *
107 *  _Modes_Set_interrupt_level
108 *
109 *  DESCRIPTION:
110 *
111 *  This routine sets the current interrupt level to that specified
112 *  in the mode_set.
113 */
114
115STATIC INLINE void _Modes_Set_interrupt_level (
116  Modes_Control mode_set
117)
118{
119  _ISR_Set_level( _Modes_Get_interrupt_level( mode_set ) );
120}
121
122/*PAGE
123 *
124 *  _Modes_Change
125 *
126 *  DESCRIPTION:
127 *
128 *  This routine changes the modes in old_mode_set indicated by
129 *  mask to the requested values in new_mode_set.  The resulting
130 *  mode set is returned in out_mode_set and the modes that changed
131 *  is returned in changed.
132 */
133
134STATIC INLINE void _Modes_Change (
135  Modes_Control  old_mode_set,
136  Modes_Control  new_mode_set,
137  Modes_Control  mask,
138  Modes_Control *out_mode_set,
139  Modes_Control *changed
140)
141{
142  Modes_Control _out_mode;
143
144  _out_mode      =  old_mode_set;
145  _out_mode     &= ~mask;
146  _out_mode     |= new_mode_set & mask;
147  *changed       = _out_mode ^ old_mode_set;
148  *out_mode_set  = _out_mode;
149}
150
151#endif
152/* end of include file */
Note: See TracBrowser for help on using the repository browser.