RTEMS: cpukit/include/rtems/rtems/modesimpl.h Source File

| RTEMS 5.4-rc2

Loading...
Searching...
No Matches
modesimpl.h
Go to the documentation of this file.
1
9/* COPYRIGHT (c) 1989-2008.
10 * On-Line Applications Research Corporation (OAR).
11 *
12 * The license and distribution terms for this file may be
13 * found in the file LICENSE in this distribution or at
14 * http://www.rtems.org/license/LICENSE.
15 */
16
17#ifndef _RTEMS_RTEMS_MODESIMPL_H
18#define _RTEMS_RTEMS_MODESIMPL_H
19
20#include <rtems/rtems/modes.h>
21#include <rtems/score/isrlevel.h>
22
23#ifdef __cplusplus
24extern "C" {
25#endif
26
41 RTEMS_INLINE_ROUTINE bool _Modes_Mask_changed (
42 rtems_mode mode_set,
43 rtems_mode masks
44)
45{
46 return ( mode_set & masks ) ? true : false;
47}
48
55 RTEMS_INLINE_ROUTINE bool _Modes_Is_asr_disabled (
56 rtems_mode mode_set
57)
58{
59 return (mode_set & RTEMS_ASR_MASK) == RTEMS_NO_ASR;
60}
61
68 RTEMS_INLINE_ROUTINE bool _Modes_Is_preempt (
69 rtems_mode mode_set
70)
71{
72 return (mode_set & RTEMS_PREEMPT_MASK) == RTEMS_PREEMPT;
73}
74
81 RTEMS_INLINE_ROUTINE bool _Modes_Is_timeslice (
82 rtems_mode mode_set
83)
84{
85 return (mode_set & RTEMS_TIMESLICE_MASK) == RTEMS_TIMESLICE;
86}
87
93 RTEMS_INLINE_ROUTINE ISR_Level _Modes_Get_interrupt_level (
94 rtems_mode mode_set
95)
96{
97 return ( mode_set & RTEMS_INTERRUPT_MASK );
98}
99
106 RTEMS_INLINE_ROUTINE void _Modes_Set_interrupt_level (
107 rtems_mode mode_set
108)
109{
110 _ISR_Set_level( _Modes_Get_interrupt_level( mode_set ) );
111}
112
122 RTEMS_INLINE_ROUTINE void _Modes_Change (
123 rtems_mode old_mode_set,
124 rtems_mode new_mode_set,
125 rtems_mode mask,
126 rtems_mode *out_mode_set,
127 rtems_mode *changed
128)
129{
130 rtems_mode _out_mode;
131
132 _out_mode = old_mode_set;
133 _out_mode &= ~mask;
134 _out_mode |= new_mode_set & mask;
135 *changed = _out_mode ^ old_mode_set;
136 *out_mode_set = _out_mode;
137}
138
139#ifdef __cplusplus
140}
141#endif
142
145#endif
146/* end of include file */
_Modes_Mask_changed
RTEMS_INLINE_ROUTINE bool _Modes_Mask_changed(rtems_mode mode_set, rtems_mode masks)
Checks if any of the mode flags in mask are set in mode_set.
Definition: modesimpl.h:41
_Modes_Set_interrupt_level
RTEMS_INLINE_ROUTINE void _Modes_Set_interrupt_level(rtems_mode mode_set)
Sets the current interrupt level to that specified in the mode_set.
Definition: modesimpl.h:106
_Modes_Is_asr_disabled
RTEMS_INLINE_ROUTINE bool _Modes_Is_asr_disabled(rtems_mode mode_set)
Checks if mode_set says that Asynchronous Signal Processing is disabled.
Definition: modesimpl.h:55
_Modes_Is_timeslice
RTEMS_INLINE_ROUTINE bool _Modes_Is_timeslice(rtems_mode mode_set)
Checks if mode_set indicates that timeslicing is enabled.
Definition: modesimpl.h:81
_Modes_Get_interrupt_level
RTEMS_INLINE_ROUTINE ISR_Level _Modes_Get_interrupt_level(rtems_mode mode_set)
Gets the interrupt level portion of the mode_set.
Definition: modesimpl.h:93
_Modes_Is_preempt
RTEMS_INLINE_ROUTINE bool _Modes_Is_preempt(rtems_mode mode_set)
Checks if mode_set indicates that preemption is enabled.
Definition: modesimpl.h:68
_Modes_Change
RTEMS_INLINE_ROUTINE void _Modes_Change(rtems_mode old_mode_set, rtems_mode new_mode_set, rtems_mode mask, rtems_mode *out_mode_set, rtems_mode *changed)
Changes the modes in old_mode_set indicated by mask to the requested values in new_mode_set.
Definition: modesimpl.h:122
RTEMS_TIMESLICE
#define RTEMS_TIMESLICE
Definition: modes.h:80
RTEMS_ASR_MASK
#define RTEMS_ASR_MASK
Definition: modes.h:67
rtems_mode
uint32_t rtems_mode
Definition: modes.h:41
RTEMS_NO_ASR
#define RTEMS_NO_ASR
Definition: modes.h:85
RTEMS_PREEMPT_MASK
#define RTEMS_PREEMPT_MASK
Definition: modes.h:64
RTEMS_TIMESLICE_MASK
#define RTEMS_TIMESLICE_MASK
Definition: modes.h:61
RTEMS_INTERRUPT_MASK
#define RTEMS_INTERRUPT_MASK
Definition: modes.h:70
RTEMS_PREEMPT
#define RTEMS_PREEMPT
Definition: modes.h:73
RTEMS_INLINE_ROUTINE
#define RTEMS_INLINE_ROUTINE
Definition: basedefs.h:66
ISR_Level
uint32_t ISR_Level
Definition: isrlevel.h:41
_ISR_Set_level
#define _ISR_Set_level(_new_level)
Set current interrupt level.
Definition: isrlevel.h:140
isrlevel.h
ISR Level Type.
modes.h