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

Subversion Repositories openrisc

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

Details | Compare with Previous | View Log

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

powered by: WebSVN 2.1.0

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