FreeBSD/sys/dev/isci/scil/sci_base_state_machine.c
/**
 * @brief This method will set the initial state and state table
 *        for the state machine. The caller should follow this
 *        request with the initialize request to cause the state
 *        machine to start.
 *
 * @param[in] this_state_machine This parameter provides the state machine
 *            object to be constructed.
 * @param[in] state_machine_owner This parameter indicates the object that
 *            is owns the state machine being constructed.
 * @param[in] state_table This parameter specifies the table of state objects
 *            that is managed by this state machine.
 * @param[in] initial_state This parameter specifies the value of the initial
 *            state for this state machine.
 *
 * @return none
 */
@brief This method will set the initial state and state table
for the state machine. The caller should follow this
request with the initialize request to cause the state
machine to start.

@param[in] this_state_machine This parameter provides the state machine
object to be constructed.
@param[in] state_machine_owner This parameter indicates the object that
is owns the state machine being constructed.
@param[in] state_table This parameter specifies the table of state objects
that is managed by this state machine.
@param[in] initial_state This parameter specifies the value of the initial
state for this state machine.

@return none
@brief This method will set the initial state and state table for the state machine . The caller should follow this request with the initialize request to cause the state machine to start . @param [ in ] this_state_machine This parameter provides the state machine object to be constructed . @param [ in ] state_machine_owner This parameter indicates the object that is owns the state machine being constructed . @param [ in ] state_table This parameter specifies the table of state objects that is managed by this state machine . @param [ in ] initial_state This parameter specifies the value of the initial state for this state machine . @return none
void sci_base_state_machine_construct(
   SCI_BASE_STATE_MACHINE_T * this_state_machine,
   SCI_BASE_OBJECT_T        * my_state_machine_owner,
   SCI_BASE_STATE_T         * state_table,
   U32                        initial_state
)
{
#if defined(SCI_LOGGING)
   sci_base_subject_construct(&this_state_machine->parent);
#endif 
   this_state_machine->state_machine_owner = my_state_machine_owner;
   this_state_machine->initial_state_id  = initial_state;
   this_state_machine->previous_state_id = initial_state;
   this_state_machine->current_state_id  = initial_state;
   this_state_machine->state_table       = state_table;
}
void sci_base_state_machine_construct ( SCI_BASE_STATE_MACHINE_T * this_state_machine , SCI_BASE_OBJECT_T * my_state_machine_owner , SCI_BASE_STATE_T * state_table , U32 initial_state ) { #if defined ( SCI_LOGGING ) sci_base_subject_construct ( & this_state_machine -> parent ) ; #endif this_state_machine -> state_machine_owner = my_state_machine_owner ; this_state_machine -> initial_state_id = initial_state ; this_state_machine -> previous_state_id = initial_state ; this_state_machine -> current_state_id = initial_state ; this_state_machine -> state_table = state_table ; }
@brief This method will set the initial state and state table
        for the state machine.
@brief This method will set the initial state and state table for the state machine .
// defined(SCI_LOGGING)