1 | /** |
---|
2 | * @file |
---|
3 | * |
---|
4 | * @ingroup ScoreSysState |
---|
5 | * |
---|
6 | * @brief System State Handler API. |
---|
7 | */ |
---|
8 | |
---|
9 | /* |
---|
10 | * COPYRIGHT (c) 1989-2004. |
---|
11 | * On-Line Applications Research Corporation (OAR). |
---|
12 | * |
---|
13 | * The license and distribution terms for this file may be |
---|
14 | * found in the file LICENSE in this distribution or at |
---|
15 | * http://www.rtems.com/license/LICENSE. |
---|
16 | * |
---|
17 | * $Id$ |
---|
18 | */ |
---|
19 | |
---|
20 | #ifndef _RTEMS_SCORE_SYSSTATE_H |
---|
21 | # error "Never use <rtems/score/sysstate.inl> directly; include <rtems/score/sysstate.h> instead." |
---|
22 | #endif |
---|
23 | |
---|
24 | #ifndef _RTEMS_SCORE_SYSSTATE_INL |
---|
25 | #define _RTEMS_SCORE_SYSSTATE_INL |
---|
26 | |
---|
27 | /** |
---|
28 | * @addtogroup ScoreSysState |
---|
29 | * |
---|
30 | * @{ |
---|
31 | */ |
---|
32 | |
---|
33 | RTEMS_INLINE_ROUTINE void _System_state_Set ( |
---|
34 | System_state_Codes state |
---|
35 | ) |
---|
36 | { |
---|
37 | _System_state_Current = state; |
---|
38 | } |
---|
39 | |
---|
40 | RTEMS_INLINE_ROUTINE void _System_state_Handler_initialization ( |
---|
41 | #if defined(RTEMS_MULTIPROCESSING) |
---|
42 | bool is_multiprocessing |
---|
43 | #else |
---|
44 | bool is_multiprocessing __attribute__((unused)) |
---|
45 | #endif |
---|
46 | ) |
---|
47 | { |
---|
48 | _System_state_Set( SYSTEM_STATE_BEFORE_INITIALIZATION ); |
---|
49 | #if defined(RTEMS_MULTIPROCESSING) |
---|
50 | _System_state_Is_multiprocessing = is_multiprocessing; |
---|
51 | #endif |
---|
52 | } |
---|
53 | |
---|
54 | RTEMS_INLINE_ROUTINE System_state_Codes _System_state_Get ( void ) |
---|
55 | { |
---|
56 | return _System_state_Current; |
---|
57 | } |
---|
58 | |
---|
59 | RTEMS_INLINE_ROUTINE bool _System_state_Is_before_initialization ( |
---|
60 | System_state_Codes state |
---|
61 | ) |
---|
62 | { |
---|
63 | return (state == SYSTEM_STATE_BEFORE_INITIALIZATION); |
---|
64 | } |
---|
65 | |
---|
66 | RTEMS_INLINE_ROUTINE bool _System_state_Is_before_multitasking ( |
---|
67 | System_state_Codes state |
---|
68 | ) |
---|
69 | { |
---|
70 | return (state == SYSTEM_STATE_BEFORE_MULTITASKING); |
---|
71 | } |
---|
72 | |
---|
73 | RTEMS_INLINE_ROUTINE bool _System_state_Is_begin_multitasking ( |
---|
74 | System_state_Codes state |
---|
75 | ) |
---|
76 | { |
---|
77 | return (state == SYSTEM_STATE_BEGIN_MULTITASKING); |
---|
78 | } |
---|
79 | |
---|
80 | RTEMS_INLINE_ROUTINE bool _System_state_Is_shutdown ( |
---|
81 | System_state_Codes state |
---|
82 | ) |
---|
83 | { |
---|
84 | return (state == SYSTEM_STATE_SHUTDOWN); |
---|
85 | } |
---|
86 | |
---|
87 | RTEMS_INLINE_ROUTINE bool _System_state_Is_up ( |
---|
88 | System_state_Codes state |
---|
89 | ) |
---|
90 | { |
---|
91 | return (state == SYSTEM_STATE_UP); |
---|
92 | } |
---|
93 | |
---|
94 | RTEMS_INLINE_ROUTINE bool _System_state_Is_failed ( |
---|
95 | System_state_Codes state |
---|
96 | ) |
---|
97 | { |
---|
98 | return (state == SYSTEM_STATE_FAILED); |
---|
99 | } |
---|
100 | |
---|
101 | /**@}*/ |
---|
102 | |
---|
103 | #endif |
---|
104 | /* end of include file */ |
---|