source: rtems/cpukit/score/inline/rtems/score/sysstate.inl @ 56e17106

4.104.115
Last change on this file since 56e17106 was 56e17106, checked in by Joel Sherrill <joel.sherrill@…>, on 09/04/09 at 13:09:48

2009-09-04 Sebastian Huber <Sebastian.Huber@…>

  • rtems/src/taskmode.c, sapi/src/exshutdown.c, score/include/rtems/score/sysstate.h, score/inline/rtems/score/sysstate.inl: Added _System_state_Is_shutdown(). Removed direct uses of _System_state_Current. Documentation.
  • Property mode set to 100644
File size: 2.0 KB
Line 
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
33RTEMS_INLINE_ROUTINE void _System_state_Set (
34  System_state_Codes state
35)
36{
37  _System_state_Current = state;
38}
39 
40RTEMS_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
54RTEMS_INLINE_ROUTINE System_state_Codes _System_state_Get ( void )
55{
56  return _System_state_Current;
57}
58
59RTEMS_INLINE_ROUTINE bool _System_state_Is_before_initialization (
60  System_state_Codes state
61)
62{
63  return (state == SYSTEM_STATE_BEFORE_INITIALIZATION);
64}
65
66RTEMS_INLINE_ROUTINE bool _System_state_Is_before_multitasking (
67  System_state_Codes state
68)
69{
70  return (state == SYSTEM_STATE_BEFORE_MULTITASKING);
71}
72
73RTEMS_INLINE_ROUTINE bool _System_state_Is_begin_multitasking (
74  System_state_Codes state
75)
76{
77  return (state == SYSTEM_STATE_BEGIN_MULTITASKING);
78}
79
80RTEMS_INLINE_ROUTINE bool _System_state_Is_shutdown (
81  System_state_Codes state
82)
83{
84  return (state == SYSTEM_STATE_SHUTDOWN);
85}
86
87RTEMS_INLINE_ROUTINE bool _System_state_Is_up (
88  System_state_Codes state
89)
90{
91  return (state == SYSTEM_STATE_UP);
92}
93
94RTEMS_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 */
Note: See TracBrowser for help on using the repository browser.