OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [rtos/] [rtems/] [c/] [src/] [exec/] [rtems/] [inline/] [rtems/] [rtems/] [asr.inl] - Blame information for rev 173

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 30 unneback
/*  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-1999.
7
 *  On-Line Applications Research Corporation (OAR).
8
 *
9
 *  The license and distribution terms for this file may be
10
 *  found in the file LICENSE in this distribution or at
11
 *  http://www.OARcorp.com/rtems/license.html.
12
 *
13
 *  $Id: asr.inl,v 1.2 2001-09-27 11:59:18 chris Exp $
14
 */
15
 
16
#ifndef __INLINE_ASR_inl
17
#define __INLINE_ASR_inl
18
 
19
#include 
20
 
21
/*PAGE
22
 *
23
 *  _ASR_Initialize
24
 *
25
 *  DESCRIPTION:
26
 *
27
 *  This routine initializes the given RTEMS_ASR information record.
28
 */
29
 
30
RTEMS_INLINE_ROUTINE void _ASR_Initialize (
31
  ASR_Information *information
32
)
33
{
34
  information->is_enabled      = TRUE;
35
  information->handler         = NULL;
36
  information->mode_set        = RTEMS_DEFAULT_MODES;
37
  information->signals_posted  = 0;
38
  information->signals_pending = 0;
39
  information->nest_level      = 0;
40
}
41
 
42
/*PAGE
43
 *
44
 *  _ASR_Swap_signals
45
 *
46
 *  DESCRIPTION:
47
 *
48
 *  This routine atomically swaps the pending and posted signal
49
 *  sets.  This is done when the thread alters its mode in such a
50
 *  way that the RTEMS_ASR disable/enable flag changes.
51
 */
52
 
53
RTEMS_INLINE_ROUTINE void _ASR_Swap_signals (
54
  ASR_Information *information
55
)
56
{
57
  rtems_signal_set _signals;
58
  ISR_Level        _level;
59
 
60
  _ISR_Disable( _level );
61
    _signals                     = information->signals_pending;
62
    information->signals_pending = information->signals_posted;
63
    information->signals_posted  = _signals;
64
  _ISR_Enable( _level );
65
}
66
 
67
/*PAGE
68
 *
69
 *  _ASR_Is_null_handler
70
 *
71
 *  DESCRIPTION:
72
 *
73
 *  This function returns TRUE if the given asr_handler is NULL and
74
 *  FALSE otherwise.
75
 */
76
 
77
RTEMS_INLINE_ROUTINE boolean _ASR_Is_null_handler (
78
  rtems_asr_entry asr_handler
79
)
80
{
81
  return asr_handler == NULL;
82
}
83
 
84
/*PAGE
85
 *
86
 *  _ASR_Are_signals_pending
87
 *
88
 *  DESCRIPTION:
89
 *
90
 *  This function returns TRUE if there are signals pending in the
91
 *  given RTEMS_ASR information record and FALSE otherwise.
92
 */
93
 
94
RTEMS_INLINE_ROUTINE boolean _ASR_Are_signals_pending (
95
  ASR_Information *information
96
)
97
{
98
  return information->signals_posted != 0;
99
}
100
 
101
/*PAGE
102
 *
103
 *  _ASR_Post_signals
104
 *
105
 *  DESCRIPTION:
106
 *
107
 *  This routine posts the given signals into the signal_set
108
 *  passed in.  The result is returned to the user in signal_set.
109
 *
110
 *  NOTE:  This must be implemented as a macro.
111
 */
112
 
113
RTEMS_INLINE_ROUTINE void _ASR_Post_signals(
114
  rtems_signal_set  signals,
115
  rtems_signal_set *signal_set
116
)
117
{
118
  ISR_Level              _level;
119
 
120
  _ISR_Disable( _level );
121
    *signal_set |= signals;
122
  _ISR_Enable( _level );
123
}
124
 
125
 
126
#endif
127
/* end of include file */

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.