1 | /* modes.inl |
---|
2 | * |
---|
3 | * This include file contains the macro implementation of the |
---|
4 | * inlined routines in the Mode Handler. |
---|
5 | * |
---|
6 | * COPYRIGHT (c) 1989-1997. |
---|
7 | * On-Line Applications Research Corporation (OAR). |
---|
8 | * Copyright assigned to U.S. Government, 1994. |
---|
9 | * |
---|
10 | * The license and distribution terms for this file may in |
---|
11 | * the file LICENSE in this distribution or at |
---|
12 | * http://www.OARcorp.com/rtems/license.html. |
---|
13 | * |
---|
14 | * $Id$ |
---|
15 | */ |
---|
16 | |
---|
17 | #ifndef __MODES_inl |
---|
18 | #define __MODES_inl |
---|
19 | |
---|
20 | /*PAGE |
---|
21 | * |
---|
22 | * _Modes_Mask_changed |
---|
23 | * |
---|
24 | */ |
---|
25 | |
---|
26 | #define _Modes_Mask_changed( _mode_set, _masks ) \ |
---|
27 | ( (_mode_set) & (_masks) ) |
---|
28 | |
---|
29 | /*PAGE |
---|
30 | * |
---|
31 | * _Modes_Is_asr_disabled |
---|
32 | * |
---|
33 | */ |
---|
34 | |
---|
35 | #define _Modes_Is_asr_disabled( _mode_set ) \ |
---|
36 | (((_mode_set) & RTEMS_ASR_MASK) == RTEMS_NO_ASR) |
---|
37 | |
---|
38 | /*PAGE |
---|
39 | * |
---|
40 | * _Modes_Is_preempt |
---|
41 | * |
---|
42 | */ |
---|
43 | |
---|
44 | #define _Modes_Is_preempt( _mode_set ) \ |
---|
45 | ( ( (_mode_set) & RTEMS_PREEMPT_MASK ) == RTEMS_PREEMPT ) |
---|
46 | |
---|
47 | /*PAGE |
---|
48 | * |
---|
49 | * _Modes_Is_timeslice |
---|
50 | * |
---|
51 | */ |
---|
52 | |
---|
53 | #define _Modes_Is_timeslice( _mode_set ) \ |
---|
54 | (((_mode_set) & RTEMS_TIMESLICE_MASK) == RTEMS_TIMESLICE) |
---|
55 | |
---|
56 | /*PAGE |
---|
57 | * |
---|
58 | * _Modes_Get_interrupt_level |
---|
59 | * |
---|
60 | */ |
---|
61 | |
---|
62 | #define _Modes_Get_interrupt_level( _mode_set ) \ |
---|
63 | ( (_mode_set) & RTEMS_INTERRUPT_MASK ) |
---|
64 | |
---|
65 | /*PAGE |
---|
66 | * |
---|
67 | * _Modes_Set_interrupt_level |
---|
68 | * |
---|
69 | */ |
---|
70 | |
---|
71 | #define _Modes_Set_interrupt_level( _mode_set ) \ |
---|
72 | _ISR_Set_level( _Modes_Get_interrupt_level( (_mode_set) ) ) |
---|
73 | |
---|
74 | /*PAGE |
---|
75 | * |
---|
76 | * _Modes_Change |
---|
77 | * |
---|
78 | */ |
---|
79 | |
---|
80 | #define _Modes_Change( _old_mode_set, _new_mode_set, \ |
---|
81 | _mask, _out_mode_set, _changed ) \ |
---|
82 | { Modes_Control _out_mode; \ |
---|
83 | \ |
---|
84 | _out_mode = (_old_mode_set); \ |
---|
85 | _out_mode &= ~(_mask); \ |
---|
86 | _out_mode |= (_new_mode_set) & (_mask); \ |
---|
87 | *(_changed) = _out_mode ^ (_old_mode_set); \ |
---|
88 | *(_out_mode_set) = _out_mode; \ |
---|
89 | } |
---|
90 | |
---|
91 | #endif |
---|
92 | /* end of include file */ |
---|