15 #if !defined(_IVTDataSource_h_) 16 #define _IVTDataSource_h_ 18 #include "DataSource.h" 23 typedef struct hab_hdr
37 typedef void (*hab_image_entry_f)(void);
120 typedef struct hab_ivt hab_ivt_t;
125 #define HAB_CMD_UNS 0xff 127 #define DEFAULT_IMG_KEY_IDX 2 129 #define GEN_MASK(width) ((1UL << (width)) - 1) 131 #define GEN_FIELD(f, width, shift) (((f)&GEN_MASK(width)) << (shift)) 133 #define PACK_UINT32(a, b, c, d) ((((a)&0xFF) << 24) | (((b)&0xFF) << 16) | (((c)&0xFF) << 8) | (((d)&0xFF))) 135 #define EXPAND_UINT32(w) (uint8_t)((w) >> 24), (uint8_t)((w) >> 16), (uint8_t)((w) >> 8), (uint8_t)(w) 137 #define HDR(tag, bytes, par) (uint8_t)(tag), (uint8_t)((bytes) >> 8), (uint8_t)(bytes), (uint8_t)(par) 139 #define HAB_VER(maj, min) \ 140 (GEN_FIELD((maj), HAB_VER_MAJ_WIDTH, HAB_VER_MAJ_SHIFT) | GEN_FIELD((min), HAB_VER_MIN_WIDTH, HAB_VER_MIN_SHIFT)) 146 #define CSF_HDR(bytes, HABVER) HDR(HAB_TAG_CSF, (bytes), HABVER) 152 #define DCD_HDR(bytes, HABVER) HDR(HAB_TAG_DCD, (bytes), HABVER) 157 #define IVT_HDR(bytes, HABVER) \ 159 HAB_TAG_IVT, { (uint8_t)((bytes) >> 8), (uint8_t)(bytes) }, HABVER \ 169 #define HAB_TAG_IVT 0xd1 170 #define HAB_TAG_DCD 0xd2 171 #define HAB_TAG_CSF 0xd4 172 #define HAB_TAG_CRT 0xd7 173 #define HAB_TAG_SIG 0xd8 174 #define HAB_TAG_EVT 0xdb 175 #define HAB_TAG_RVT 0xdd 192 #define HAB_MAJOR_VERSION 4 193 #define HAB_MINOR_VERSION 0 194 #define HAB_VER_MAJ_WIDTH 4 195 #define HAB_VER_MAJ_SHIFT 4 196 #define HAB_VER_MIN_WIDTH 4 197 #define HAB_VER_MIN_SHIFT 0 199 #define HAB_VERSION HAB_VER(HAB_MAJOR_VERSION, HAB_MINOR_VERSION) 201 #define HAB_BASE_VERSION HAB_VER(HAB_MAJOR_VERSION, 0) 235 virtual unsigned getData(
unsigned offset,
unsigned maxBytes, uint8_t *buffer);
238 virtual unsigned getLength();
241 virtual bool hasNaturalLocation();
244 virtual uint32_t getBaseAddress();
272 bool setFieldByName(
const std::string &name, uint32_t value);
285 #endif // _IVTDataSource_h_ hab_hdr_t hdr
Definition: IVTDataSource.h:96
Abstract base class for data sources.
Definition: apps/elftosb/common/DataSource.h:33
Definition: IVTDataSource.h:23
virtual DataSource::Segment * getSegmentAt(unsigned index)
Returns this object, as it is its own segment.
Definition: IVTDataSource.h:229
uint32_t entry
Definition: IVTDataSource.h:100
bool m_isSelfSet
True if the IVT self pointer was explicitly set.
Definition: IVTDataSource.h:280
uint32_t dcd
Definition: IVTDataSource.h:104
uint32_t boot_data
Definition: IVTDataSource.h:108
uint8_t par
Definition: IVTDataSource.h:27
Data source for an IVT structure used by HAB4.
Definition: IVTDataSource.h:220
Definition: BootImage.h:13
uint32_t csf
Definition: IVTDataSource.h:112
hab_ivt_t & getIVT()
Returns a reference to the IVT structure.
Definition: IVTDataSource.h:275
Definition: IVTDataSource.h:91
Discrete, contiguous part of the source's data.
Definition: apps/elftosb/common/DataSource.h:42
virtual unsigned getSegmentCount()
There is only one segment.
Definition: IVTDataSource.h:227
uint32_t reserved1
Definition: IVTDataSource.h:102
hab_ivt_t m_ivt
The IVT structure.
Definition: IVTDataSource.h:279
uint8_t tag
Definition: IVTDataSource.h:25
uint32_t reserved2
Definition: IVTDataSource.h:114