/*
* File: Operation.h
*
* Copyright (c) Freescale Semiconductor, Inc. All rights reserved.
* See included license file for license details.
*/
#if !defined(_Operation_h_)
#define _Operation_h_
/*!
* \brief Operation to execute code at a certain address.
*/
class ExecuteOperation : public Operation
{
public:
enum execute_type_t
{
kJump,
kCall
};
/*!
* \brief Authenticate with HAB and execute the entry point.
*/
class HABExecuteOperation : public ExecuteOperation
{
public:
HABExecuteOperation() : ExecuteOperation() {}
};
/*!
* \brief Operation to switch boot modes.
*/
class BootModeOperation : public Operation
{
public:
BootModeOperation() : Operation() {}
protected:
uint32_t m_bootMode; //!< The new boot mode value.
};
/*!
* \brief Ordered sequence of operations.
*
* The operation objects owned by the sequence are \e not deleted when the
* sequence is destroyed. The owner of the sequence must manually delete
* the operation objects.
*/
class OperationSequence
{
public:
typedef std::vector<Operation*> operation_list_t; //!< Type for a list of operation objects.
typedef operation_list_t::iterator iterator_t; //!< Iterator over operations.
typedef operation_list_t::const_iterator const_iterator_t; //!< Const iterator over operations.
//! \name Status
//@{
//! \brief Returns the number of operations in the sequence.
inline unsigned getCount() const { return m_operations.size(); }
//@}
//! \name Operations
//@{
//! \brief Append one operation object to the sequence.
inline void append(Operation * op) { m_operations.push_back(op); }
//! \brief Append the contents of \a other onto this sequence.
void append(const OperationSequence * other);