apps/elftosb/common/GHSSecInfo.h
/*
* File: GHSSecInfo.h
*
* Copyright (c) Freescale Semiconductor, Inc. All rights reserved.
* See included license file for license details.
*/
#if !defined(_GHSSecInfo_h_)
#define _GHSSecInfo_h_
#include "StELFFile.h"
#include "smart_ptr.h"
namespace elftosb
{
class GHSSecInfo
{
public:
GHSSecInfo(StELFFile *elf);
bool hasSecinfo() const { return m_hasInfo; }
bool isSectionFilled(uint32_t addr, uint32_t length);
bool isSectionFilled(const Elf32_Shdr &section);
protected:
#pragma pack(1)
struct ghs_secinfo_t
{
uint32_t m_clearAddr;
uint32_t m_clearValue;
uint32_t m_numBytesToClear;
};
#pragma pack()
protected:
StELFFile *m_elf;
bool m_hasInfo;
smart_array_ptr<ghs_secinfo_t>
m_info;
unsigned m_entryCount;
};
}; // namespace elftosb
#endif // _GHSSecInfo_h_
Elf32_Shdr
ELF section header.
Definition: apps/elftosb/common/ELF.h:135
elftosb::GHSSecInfo::ghs_secinfo_t
The structure of one .secinfo entry.
Definition: apps/elftosb/common/GHSSecInfo.h:51
elftosb::GHSSecInfo
Wrapper around the GHS-specific .secinfo ELF section.
Definition: apps/elftosb/common/GHSSecInfo.h:31
elftosb::GHSSecInfo::hasSecinfo
bool hasSecinfo() const
Returns true if there is a .secinfo section present in the ELF file.
Definition: apps/elftosb/common/GHSSecInfo.h:38
elftosb::GHSSecInfo::ghs_secinfo_t::m_numBytesToClear
uint32_t m_numBytesToClear
Number of bytes to fill.
Definition: apps/elftosb/common/GHSSecInfo.h:55
elftosb::GHSSecInfo::GHSSecInfo
GHSSecInfo(StELFFile *elf)
Default constructor.
Definition: apps/elftosb/common/GHSSecInfo.cpp:22
elftosb::GHSSecInfo::ghs_secinfo_t::m_clearAddr
uint32_t m_clearAddr
Address to start filling from.
Definition: apps/elftosb/common/GHSSecInfo.h:53
elftosb
Definition: BootImage.h:13
elftosb::GHSSecInfo::m_hasInfo
bool m_hasInfo
Whether .secinfo is present in the ELF file.
Definition: apps/elftosb/common/GHSSecInfo.h:62
elftosb::GHSSecInfo::m_entryCount
unsigned m_entryCount
Number of entries in m_info.
Definition: apps/elftosb/common/GHSSecInfo.h:65
elftosb::GHSSecInfo::m_info
smart_array_ptr< ghs_secinfo_t > m_info
Pointer to the .secinfo entries. Will be NULL if there is no .secinfo section in the file...
Definition: apps/elftosb/common/GHSSecInfo.h:64
smart_array_ptr
Simple, standard smart pointer class that uses the array delete operator.
Definition: apps/elftosb/common/smart_ptr.h:121
elftosb::GHSSecInfo::ghs_secinfo_t::m_clearValue
uint32_t m_clearValue
Value to fill with.
Definition: apps/elftosb/common/GHSSecInfo.h:54
StELFFile
Parser for Executable and Linking Format (ELF) files.
Definition: apps/elftosb/common/StELFFile.h:42
elftosb::GHSSecInfo::isSectionFilled
bool isSectionFilled(uint32_t addr, uint32_t length)
Determines if a section should be filled.
Definition: apps/elftosb/common/GHSSecInfo.cpp:65
elftosb::GHSSecInfo::m_elf
StELFFile * m_elf
The parser object for our ELF file.
Definition: apps/elftosb/common/GHSSecInfo.h:61