source: rtems/cpukit/rtems/macros/rtems/rtems/modes.inl @ 27b299d9

4.104.114.84.95
Last change on this file since 27b299d9 was 27b299d9, checked in by Ralf Corsepius <ralf.corsepius@…>, on 02/21/05 at 07:39:58

New header guards.

  • Property mode set to 100644
File size: 1.7 KB
Line 
1/**
2 * @file rtems/rtems/modes.inl
3 */
4
5/*
6 *  This include file contains the macro implementation of the
7 *  inlined routines in the Mode Handler.
8 *
9 *  COPYRIGHT (c) 1989-1999.
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.com/license/LICENSE.
15 *
16 *  $Id$
17 */
18
19#ifndef _RTEMS_RTEMS_MODES_INL
20#define _RTEMS_RTEMS_MODES_INL
21
22/*PAGE
23 *
24 *  _Modes_Mask_changed
25 *
26 */
27
28#define _Modes_Mask_changed( _mode_set, _masks ) \
29   ( (_mode_set) & (_masks) )
30
31/*PAGE
32 *
33 *  _Modes_Is_asr_disabled
34 *
35 */
36
37#define _Modes_Is_asr_disabled( _mode_set ) \
38   (((_mode_set) & RTEMS_ASR_MASK) == RTEMS_NO_ASR)
39
40/*PAGE
41 *
42 *  _Modes_Is_preempt
43 *
44 */
45
46#define _Modes_Is_preempt( _mode_set ) \
47   ( ( (_mode_set) & RTEMS_PREEMPT_MASK ) == RTEMS_PREEMPT )
48
49/*PAGE
50 *
51 *  _Modes_Is_timeslice
52 *
53 */
54
55#define _Modes_Is_timeslice( _mode_set ) \
56  (((_mode_set) & RTEMS_TIMESLICE_MASK) == RTEMS_TIMESLICE)
57
58/*PAGE
59 *
60 *  _Modes_Get_interrupt_level
61 *
62 */
63
64#define _Modes_Get_interrupt_level( _mode_set ) \
65  ( (_mode_set) & RTEMS_INTERRUPT_MASK )
66
67/*PAGE
68 *
69 *  _Modes_Set_interrupt_level
70 *
71 */
72
73#define _Modes_Set_interrupt_level( _mode_set ) \
74   _ISR_Set_level( _Modes_Get_interrupt_level( (_mode_set) ) )
75
76/*PAGE
77 *
78 *  _Modes_Change
79 *
80 */
81
82#define _Modes_Change( _old_mode_set, _new_mode_set, \
83                       _mask, _out_mode_set, _changed ) \
84  { Modes_Control _out_mode; \
85    \
86    _out_mode         =  (_old_mode_set); \
87    _out_mode        &= ~(_mask); \
88    _out_mode        |= (_new_mode_set) & (_mask); \
89    *(_changed)       = _out_mode ^ (_old_mode_set); \
90    *(_out_mode_set)  = _out_mode; \
91  }
92
93#endif
94/* end of include file */
Note: See TracBrowser for help on using the repository browser.