1 | /** |
---|
2 | * @file rtems/score/sysstate.inl |
---|
3 | * |
---|
4 | * This file contains the inline implementation of routines regarding the |
---|
5 | * system state. |
---|
6 | */ |
---|
7 | |
---|
8 | /* |
---|
9 | * COPYRIGHT (c) 1989-2004. |
---|
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_SCORE_SYSSTATE_INL |
---|
20 | #define _RTEMS_SCORE_SYSSTATE_INL |
---|
21 | |
---|
22 | /** |
---|
23 | * @addtogroup ScoreSysState |
---|
24 | * @{ |
---|
25 | */ |
---|
26 | |
---|
27 | /** |
---|
28 | * This routine initializes the system state handler. |
---|
29 | */ |
---|
30 | |
---|
31 | RTEMS_INLINE_ROUTINE void _System_state_Handler_initialization ( |
---|
32 | boolean is_multiprocessing |
---|
33 | ) |
---|
34 | { |
---|
35 | _System_state_Current = SYSTEM_STATE_BEFORE_INITIALIZATION; |
---|
36 | #if defined(RTEMS_MULTIPROCESSING) |
---|
37 | _System_state_Is_multiprocessing = is_multiprocessing; |
---|
38 | #endif |
---|
39 | } |
---|
40 | |
---|
41 | /** |
---|
42 | * This routine sets the current system state to that specified by |
---|
43 | * the called. |
---|
44 | */ |
---|
45 | |
---|
46 | RTEMS_INLINE_ROUTINE void _System_state_Set ( |
---|
47 | System_state_Codes state |
---|
48 | ) |
---|
49 | { |
---|
50 | _System_state_Current = state; |
---|
51 | } |
---|
52 | |
---|
53 | /** |
---|
54 | * This function returns the current system state. |
---|
55 | */ |
---|
56 | |
---|
57 | RTEMS_INLINE_ROUTINE System_state_Codes _System_state_Get ( void ) |
---|
58 | { |
---|
59 | return _System_state_Current; |
---|
60 | } |
---|
61 | |
---|
62 | /** |
---|
63 | * This function returns TRUE if the state is equal to the |
---|
64 | * "before initialization" state, and FALSE otherwise. |
---|
65 | */ |
---|
66 | |
---|
67 | RTEMS_INLINE_ROUTINE boolean _System_state_Is_before_initialization ( |
---|
68 | System_state_Codes state |
---|
69 | ) |
---|
70 | { |
---|
71 | return (state == SYSTEM_STATE_BEFORE_INITIALIZATION); |
---|
72 | } |
---|
73 | |
---|
74 | /** |
---|
75 | * This function returns TRUE if the state is equal to the |
---|
76 | * "before multitasking" state, and FALSE otherwise. |
---|
77 | */ |
---|
78 | |
---|
79 | RTEMS_INLINE_ROUTINE boolean _System_state_Is_before_multitasking ( |
---|
80 | System_state_Codes state |
---|
81 | ) |
---|
82 | { |
---|
83 | return (state == SYSTEM_STATE_BEFORE_MULTITASKING); |
---|
84 | } |
---|
85 | |
---|
86 | /** |
---|
87 | * This function returns TRUE if the state is equal to the |
---|
88 | * "begin multitasking" state, and FALSE otherwise. |
---|
89 | */ |
---|
90 | |
---|
91 | RTEMS_INLINE_ROUTINE boolean _System_state_Is_begin_multitasking ( |
---|
92 | System_state_Codes state |
---|
93 | ) |
---|
94 | { |
---|
95 | return (state == SYSTEM_STATE_BEGIN_MULTITASKING); |
---|
96 | } |
---|
97 | |
---|
98 | /** |
---|
99 | * This function returns TRUE if the state is equal to the |
---|
100 | * "up" state, and FALSE otherwise. |
---|
101 | */ |
---|
102 | |
---|
103 | RTEMS_INLINE_ROUTINE boolean _System_state_Is_up ( |
---|
104 | System_state_Codes state |
---|
105 | ) |
---|
106 | { |
---|
107 | return (state == SYSTEM_STATE_UP); |
---|
108 | } |
---|
109 | |
---|
110 | /** |
---|
111 | * This function returns TRUE if the state is equal to the |
---|
112 | * "failed" state, and FALSE otherwise. |
---|
113 | */ |
---|
114 | |
---|
115 | RTEMS_INLINE_ROUTINE boolean _System_state_Is_failed ( |
---|
116 | System_state_Codes state |
---|
117 | ) |
---|
118 | { |
---|
119 | return (state == SYSTEM_STATE_FAILED); |
---|
120 | } |
---|
121 | |
---|
122 | /**@}*/ |
---|
123 | |
---|
124 | #endif |
---|
125 | /* end of include file */ |
---|