Kinetis Bootloader Host  2.0.0
Host Tools for Kinetis devices
elftosb::EncoreBootImage::JumpCommand Class Reference

Jump to address bootloader command. More...

#include <EncoreBootImage.h>

+ Inheritance diagram for elftosb::EncoreBootImage::JumpCommand:
+ Collaboration diagram for elftosb::EncoreBootImage::JumpCommand:

Public Member Functions

 JumpCommand ()
 Default constructor.
 
virtual void initFromData (const cipher_block_t *blocks, unsigned count, unsigned *consumed)
 Read the command contents from raw data. More...
 
virtual void debugPrint () const
 Print out a string representation of the object.
 
Header
virtual uint8_t getTag () const
 Returns the tag value for this command.
 
virtual void fillCommandHeader (boot_command_t &header)
 Constructs the header for this boot command.
 
Accessors
void setAddress (uint32_t address)
 
uint32_t getAddress () const
 
void setArgument (uint32_t argument)
 
uint32_t getArgument () const
 
void setIsHAB (bool isHAB)
 
bool isHAB () const
 
void setIVTSize (uint32_t ivtSize)
 
uint32_t getIVTSize () const
 
void setStackPointer (uint32_t sp)
 
uint32_t getStackPointer ()
 
void setIsStackPointerSet (bool isSP)
 
bool IsStackPointerSet () const
 
- Public Member Functions inherited from elftosb::EncoreBootImage::BootCommand
 BootCommand ()
 Default constructor.
 
virtual ~BootCommand ()
 Destructor.
 
virtual uint8_t calculateChecksum (const boot_command_t &header)
 Calculates the checksum for the given command header. More...
 
virtual unsigned getBlockCount () const
 Returns the total number of cipher blocks. More...
 
virtual unsigned getBlocks (unsigned offset, unsigned maxCount, cipher_block_t *data)
 Returns the contents of up to maxCount cipher blocks. More...
 
virtual unsigned getDataBlockCount () const
 Returns the number of data cipher blocks that follow this command. More...
 
virtual unsigned getDataBlocks (unsigned offset, unsigned maxCount, cipher_block_t *data)
 Returns the contents of up to maxCount data blocks. More...
 
Cipher blocks

Protected Attributes

uint32_t m_address
 Address of the code to execute.
 
uint32_t m_argument
 Sole argument to pass to code.
 
uint32_t m_stackPointer
 Stack pointer for "jump sp" command.
 
bool m_isHAB
 
bool m_isStackPointerSet
 
uint32_t m_ivtSize
 Whether this jump call has an initial stack pointer set. More...
 

Additional Inherited Members

- Static Public Member Functions inherited from elftosb::EncoreBootImage::BootCommand
static BootCommandcreateFromData (const cipher_block_t *blocks, unsigned count, unsigned *consumed)
 Creates the correct subclass of BootCommand for the given raw data. More...
 
- Protected Types inherited from elftosb::EncoreBootImage::BootCommand
enum  {
  CMD_TAG_FIELD = 1,
  CMD_FLAGS_FIELD = 2,
  CMD_ADDRESS_FIELD = 4,
  CMD_COUNT_FIELD = 8,
  CMD_DATA_FIELD = 16
}
 The flag bit values for the whichFields parameter of validateHeader().
 
- Protected Member Functions inherited from elftosb::EncoreBootImage::BootCommand
void validateHeader (const boot_command_t *modelHeader, const boot_command_t *testHeader, unsigned whichFields)
 

Detailed Description

Jump to address bootloader command.

Member Function Documentation

void EncoreBootImage::JumpCommand::initFromData ( const cipher_block_t *  blocks,
unsigned  count,
unsigned *  consumed 
)
virtual

Read the command contents from raw data.

Parameters
blocksPointer to the raw data blocks.
countNumber of blocks pointed to by blocks.
[out]consumedOn exit, this points to the number of cipher blocks that were occupied by the command. Should be at least 1 for every command. This must not be NULL on entry!
Exceptions
std::runtime_errorThrown if header fields are invalid.

Implements elftosb::EncoreBootImage::BootCommand.

Member Data Documentation

bool elftosb::EncoreBootImage::JumpCommand::m_isHAB
protected

Whether this jump/call is a special HAB jump/call. When this flag is set, m_address becomes the IVT address and m_ivtSize is the IVT size.

uint32_t elftosb::EncoreBootImage::JumpCommand::m_ivtSize
protected

Whether this jump call has an initial stack pointer set.

Size of the IVT for a HAB jump/call.


The documentation for this class was generated from the following files: