source: rtems/cpukit/rtems/inline/rtems/rtems/asr.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: 2.7 KB
Line 
1/*  inline/asr.inl
2 *
3 *  This include file contains the implemenation of all routines
4 *  associated with the asynchronous signal handler which are inlined.
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 __INLINE_ASR_inl
18#define __INLINE_ASR_inl
19
20#include <rtems/score/isr.h>
21
22/*PAGE
23 *
24 *  _ASR_Initialize
25 *
26 *  DESCRIPTION:
27 *
28 *  This routine initializes the given RTEMS_ASR information record.
29 */
30
31STATIC INLINE void _ASR_Initialize (
32  ASR_Information *information
33)
34{
35  information->is_enabled      = TRUE;
36  information->handler         = NULL;
37  information->mode_set        = RTEMS_DEFAULT_MODES;
38  information->signals_posted  = 0;
39  information->signals_pending = 0;
40  information->nest_level      = 0;
41}
42
43/*PAGE
44 *
45 *  _ASR_Swap_signals
46 *
47 *  DESCRIPTION:
48 *
49 *  This routine atomically swaps the pending and posted signal
50 *  sets.  This is done when the thread alters its mode in such a
51 *  way that the RTEMS_ASR disable/enable flag changes.
52 */
53
54STATIC INLINE void _ASR_Swap_signals (
55  ASR_Information *information
56)
57{
58  rtems_signal_set _signals;
59  ISR_Level        _level;
60
61  _ISR_Disable( _level );
62    _signals                     = information->signals_pending;
63    information->signals_pending = information->signals_posted;
64    information->signals_posted  = _signals;
65  _ISR_Enable( _level );
66}
67
68/*PAGE
69 *
70 *  _ASR_Is_null_handler
71 *
72 *  DESCRIPTION:
73 *
74 *  This function returns TRUE if the given asr_handler is NULL and
75 *  FALSE otherwise.
76 */
77
78STATIC INLINE boolean _ASR_Is_null_handler (
79  rtems_asr_entry asr_handler
80)
81{
82  return asr_handler == NULL;
83}
84
85/*PAGE
86 *
87 *  _ASR_Are_signals_pending
88 *
89 *  DESCRIPTION:
90 *
91 *  This function returns TRUE if there are signals pending in the
92 *  given RTEMS_ASR information record and FALSE otherwise.
93 */
94
95STATIC INLINE boolean _ASR_Are_signals_pending (
96  ASR_Information *information
97)
98{
99  return information->signals_posted != 0;
100}
101
102/*PAGE
103 *
104 *  _ASR_Post_signals
105 *
106 *  DESCRIPTION:
107 *
108 *  This routine posts the given signals into the signal_set
109 *  passed in.  The result is returned to the user in signal_set.
110 *
111 *  NOTE:  This must be implemented as a macro.
112 */
113
114STATIC INLINE void _ASR_Post_signals(
115  rtems_signal_set  signals,
116  rtems_signal_set *signal_set
117)
118{
119  ISR_Level              _level;
120
121  _ISR_Disable( _level );
122    *signal_set |= signals;
123  _ISR_Enable( _level );
124}
125
126
127#endif
128/* end of include file */
Note: See TracBrowser for help on using the repository browser.