Changeset 56e17106 in rtems


Ignore:
Timestamp:
Sep 4, 2009, 1:09:48 PM (10 years ago)
Author:
Joel Sherrill <joel.sherrill@…>
Branches:
4.10, 4.11, master
Children:
d4f932c9
Parents:
4c7eb657
Message:

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.
Location:
cpukit
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • cpukit/ChangeLog

    r4c7eb657 r56e17106  
     12009-09-04      Sebastian Huber <Sebastian.Huber@embedded-brains.de>
     2
     3        * rtems/src/taskmode.c, sapi/src/exshutdown.c,
     4        score/include/rtems/score/sysstate.h,
     5        score/inline/rtems/score/sysstate.inl: Added
     6        _System_state_Is_shutdown().  Removed direct uses of
     7        _System_state_Current.  Documentation.
     8
    192009-08-28      Joel Sherrill <joel.sherrill@OARcorp.com>
    210
  • cpukit/rtems/src/taskmode.c

    r4c7eb657 r56e17106  
    123123  }
    124124
    125   if ( _System_state_Is_up(_System_state_Current) )
     125  if ( _System_state_Is_up( _System_state_Get() ) )
    126126    if ( _Thread_Evaluate_mode() || needs_asr_dispatching )
    127127      _Thread_Dispatch();
  • cpukit/sapi/src/exshutdown.c

    r4c7eb657 r56e17106  
    3636)
    3737{
    38   if ( _System_state_Current != SYSTEM_STATE_SHUTDOWN ) {
     38  if ( !_System_state_Is_shutdown( _System_state_Get() ) ) {
    3939    _System_state_Set( SYSTEM_STATE_SHUTDOWN );
    4040    _Thread_Stop_multitasking();
  • cpukit/score/include/rtems/score/sysstate.h

    r4c7eb657 r56e17106  
    11/**
    2  *  @file  rtems/score/sysstate.h
     2 * @file
    33 *
    4  *  This include file contains information regarding the system state.
     4 * @ingroup ScoreSysState
     5 *
     6 * @brief System State Handler API.
    57 */
    68
     
    1921#define _RTEMS_SCORE_SYSSTATE_H
    2022
    21 /**
    22  *  @defgroup ScoreSysState System State Handler
    23  *
    24  *  This handler encapsulates functionality related to the management of the
    25  *  internal system state of RTEMS.
    26  */
    27 /**@{*/
    28 
    2923#ifdef __cplusplus
    3024extern "C" {
    3125#endif
    3226
    33 /* types */
    34 
    35 /* enumerated constants */
     27/**
     28 * @defgroup ScoreSysState System State Handler
     29 *
     30 * @ingroup Score
     31 *
     32 * @brief Management of the internal system state of RTEMS.
     33 *
     34 * @{
     35 */
    3636
    3737/**
    38  *  The following type defines the possible system states.
     38 * @brief System states.
    3939 */
    4040typedef enum {
    41   /** This indicates that the system state is between the start
    42    *  of rtems_initialize_executive_early and the end of the first
    43    *  phase of initialization.
     41  /**
     42   * @brief The system is before the end of the first phase of initialization.
    4443   */
    4544  SYSTEM_STATE_BEFORE_INITIALIZATION,
    46   /** This indicates that the system state is between end of the first
    47    *  phase of initializatin but before  multitasking is started.
     45
     46  /**
     47   * @brief The system is between end of the first phase of initializatin but
     48   * before  multitasking is started.
    4849   */
    4950  SYSTEM_STATE_BEFORE_MULTITASKING,
    50   /** This indicates that the system state is attempting to initiate
    51    *  multitasking.
     51
     52  /**
     53   * @brief The system is attempting to initiate multitasking.
    5254   */
    5355  SYSTEM_STATE_BEGIN_MULTITASKING,
    54   /** This indicates that the system is up and operating normally. */
     56
     57  /**
     58   * @brief The system is up and operating normally.
     59   */
    5560  SYSTEM_STATE_UP,
    56   /** This indicates that the system is in the midst of a shutdown. */
     61
     62  /**
     63   * @brief The system is in the midst of a shutdown.
     64   */
    5765  SYSTEM_STATE_SHUTDOWN,
    58   /** This indicates that a fatal error has occurred. */
     66
     67  /**
     68   * @brief A fatal error has occurred.
     69   */
    5970  SYSTEM_STATE_FAILED
    6071} System_state_Codes;
    6172
    62 /** This defines the first system state. */
    6373#define SYSTEM_STATE_CODES_FIRST SYSTEM_STATE_BEFORE_INITIALIZATION
    64 /** This defines the highest value system state. */
    65 #define SYSTEM_STATE_CODES_LAST  SYSTEM_STATE_FAILED
     74
     75#define SYSTEM_STATE_CODES_LAST SYSTEM_STATE_FAILED
    6676
    6777#if defined(RTEMS_MULTIPROCESSING)
    68 /**
    69  *  The following variable indicates whether or not this is
    70  *  an multiprocessing system.
    71  */
    7278SCORE_EXTERN bool _System_state_Is_multiprocessing;
    7379#endif
    7480
    75 /**
    76  *  The following variable contains the current system state.
    77  */
    7881SCORE_EXTERN System_state_Codes _System_state_Current;
    7982
     
    8487#include <rtems/score/sysstate.inl>
    8588
     89/** @} */
     90
    8691#ifdef __cplusplus
    8792}
    8893#endif
    8994
    90 /**@}*/
    91 
    9295#endif
    9396/* end of include file */
  • cpukit/score/inline/rtems/score/sysstate.inl

    r4c7eb657 r56e17106  
    11/**
    2  *  @file  rtems/score/sysstate.inl
     2 * @file
    33 *
    4  *  This file contains the inline implementation of routines regarding the
    5  *  system state.
     4 * @ingroup ScoreSysState
     5 *
     6 * @brief System State Handler API.
    67 */
    78
     
    2526
    2627/**
    27  *  @addtogroup ScoreSysState
    28  *  @{
     28 * @addtogroup ScoreSysState
     29 *
     30 * @{
    2931 */
    3032
    31 /**
    32  *  This routine initializes the system state handler.
    33  */
     33RTEMS_INLINE_ROUTINE void _System_state_Set (
     34  System_state_Codes state
     35)
     36{
     37  _System_state_Current = state;
     38}
    3439 
    3540RTEMS_INLINE_ROUTINE void _System_state_Handler_initialization (
     
    4146)
    4247{
    43   _System_state_Current = SYSTEM_STATE_BEFORE_INITIALIZATION;
     48  _System_state_Set( SYSTEM_STATE_BEFORE_INITIALIZATION );
    4449#if defined(RTEMS_MULTIPROCESSING)
    4550    _System_state_Is_multiprocessing = is_multiprocessing;
    4651#endif
    4752}
    48  
    49 /**
    50  *  This routine sets the current system state to that specified by
    51  *  the called.
    52  */
    53 
    54 RTEMS_INLINE_ROUTINE void _System_state_Set (
    55   System_state_Codes state
    56 )
    57 {
    58   _System_state_Current = state;
    59 }
    60 
    61 /**
    62  *  This function returns the current system state.
    63  */
    6453
    6554RTEMS_INLINE_ROUTINE System_state_Codes _System_state_Get ( void )
     
    6756  return _System_state_Current;
    6857}
    69 
    70 /**
    71  *  This function returns true if the state is equal to the
    72  *  "before initialization" state, and false otherwise.
    73  */
    7458
    7559RTEMS_INLINE_ROUTINE bool _System_state_Is_before_initialization (
     
    8064}
    8165
    82 /**
    83  *  This function returns true if the state is equal to the
    84  *  "before multitasking" state, and false otherwise.
    85  */
    86 
    8766RTEMS_INLINE_ROUTINE bool _System_state_Is_before_multitasking (
    8867  System_state_Codes state
     
    9170  return (state == SYSTEM_STATE_BEFORE_MULTITASKING);
    9271}
    93 
    94 /**
    95  *  This function returns true if the state is equal to the
    96  *  "begin multitasking" state, and false otherwise.
    97  */
    9872
    9973RTEMS_INLINE_ROUTINE bool _System_state_Is_begin_multitasking (
     
    10478}
    10579
    106 /**
    107  *  This function returns true if the state is equal to the
    108  *  "up" state, and false otherwise.
    109  */
     80RTEMS_INLINE_ROUTINE bool _System_state_Is_shutdown (
     81  System_state_Codes state
     82)
     83{
     84  return (state == SYSTEM_STATE_SHUTDOWN);
     85}
    11086
    11187RTEMS_INLINE_ROUTINE bool _System_state_Is_up (
     
    11591  return (state == SYSTEM_STATE_UP);
    11692}
    117 
    118 /**
    119  *  This function returns true if the state is equal to the
    120  *  "failed" state, and false otherwise.
    121  */
    12293
    12394RTEMS_INLINE_ROUTINE bool _System_state_Is_failed (
Note: See TracChangeset for help on using the changeset viewer.