gem5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
DtbObject Class Reference

#include <dtb_object.hh>

Inheritance diagram for DtbObject:
ObjectFile

Public Member Functions

virtual ~DtbObject ()
 
bool addBootCmdLine (const char *_args, size_t len)
 Adds the passed in Command Line options for the kernel to the proper location in the device tree. More...
 
Addr findReleaseAddr ()
 Parse the DTB file enough to find the provided release address and return it. More...
 
bool loadAllSymbols (SymbolTable *symtab, Addr base=0, Addr offset=0, Addr addrMask=maxAddr)
 
bool loadGlobalSymbols (SymbolTable *symtab, Addr base=0, Addr offset=0, Addr addrMask=maxAddr)
 
bool loadLocalSymbols (SymbolTable *symtab, Addr base=0, Addr offset=0, Addr addrMask=maxAddr)
 
- Public Member Functions inherited from ObjectFile
virtual ~ObjectFile ()
 
virtual bool loadSections (PortProxy &mem_proxy, Addr mask=maxAddr, Addr offset=0)
 
virtual bool loadWeakSymbols (SymbolTable *symtab, Addr base=0, Addr offset=0, Addr mask=maxAddr)
 
virtual ObjectFilegetInterpreter () const
 
virtual bool relocatable () const
 
virtual Addr mapSize () const
 
virtual void updateBias (Addr bias_addr)
 
virtual Addr bias () const
 
virtual bool hasTLS ()
 
Arch getArch () const
 
OpSys getOpSys () const
 
Addr entryPoint () const
 
Addr globalPointer () const
 
Addr textBase () const
 
Addr dataBase () const
 
Addr bssBase () const
 
size_t textSize () const
 
size_t dataSize () const
 
size_t bssSize () const
 
void setTextBase (Addr a)
 

Static Public Member Functions

static ObjectFiletryFile (const std::string &fname, size_t len, uint8_t *data)
 Static function that tries to load file as a flattened device tree blob. More...
 

Protected Member Functions

 DtbObject (const std::string &_filename, size_t _len, uint8_t *_data, Arch _arch, OpSys _opSys)
 
- Protected Member Functions inherited from ObjectFile
 ObjectFile (const std::string &_filename, size_t _len, uint8_t *_data, Arch _arch, OpSys _opSys)
 
bool loadSection (Section *sec, PortProxy &mem_proxy, Addr mask, Addr offset=0)
 
void setGlobalPointer (Addr global_ptr)
 

Protected Attributes

bool fileDataMmapped
 Bool marking if this dtb file has replaced the original read in DTB file with a new modified buffer. More...
 
- Protected Attributes inherited from ObjectFile
const std::string filename
 
uint8_t * fileData
 
size_t len
 
Arch arch
 
OpSys opSys
 
Addr entry
 
Addr globalPtr
 
Section text
 
Section data
 
Section bss
 

Additional Inherited Members

- Public Types inherited from ObjectFile
enum  Arch {
  UnknownArch, Alpha, SPARC64, SPARC32,
  Mips, X86_64, I386, Arm64,
  Arm, Thumb, Power, Riscv
}
 
enum  OpSys {
  UnknownOpSys, Tru64, Linux, Solaris,
  LinuxArmOABI, FreeBSD
}
 
- Static Public Attributes inherited from ObjectFile
static const Addr maxAddr = std::numeric_limits<Addr>::max()
 

Detailed Description

Definition at line 41 of file dtb_object.hh.

Constructor & Destructor Documentation

DtbObject::DtbObject ( const std::string &  _filename,
size_t  _len,
uint8_t *  _data,
Arch  _arch,
OpSys  _opSys 
)
protected
DtbObject::~DtbObject ( )
virtual

Definition at line 73 of file dtb_object.cc.

References ObjectFile::fileData, fileDataMmapped, and ObjectFile::len.

Member Function Documentation

bool DtbObject::addBootCmdLine ( const char *  _args,
size_t  len 
)

Adds the passed in Command Line options for the kernel to the proper location in the device tree.

Parameters
_argscommand line to append
lenlength of the command line string
Returns
returns true on success, false otherwise

Definition at line 87 of file dtb_object.cc.

References ObjectFile::fileData, fileDataMmapped, ObjectFile::Section::fileImage, ObjectFile::len, ArmISA::offset, ObjectFile::Section::size, ObjectFile::text, and warn.

Referenced by FreebsdArmSystem::initState(), and LinuxArmSystem::initState().

Addr DtbObject::findReleaseAddr ( )

Parse the DTB file enough to find the provided release address and return it.

Returns
release address for SMP boot

Definition at line 156 of file dtb_object.cc.

References betoh(), ArmISA::fd, ObjectFile::fileData, ObjectFile::len, and ArmISA::offset.

Referenced by FreebsdArmSystem::initState().

bool DtbObject::loadAllSymbols ( SymbolTable symtab,
Addr  base = 0,
Addr  offset = 0,
Addr  addrMask = maxAddr 
)
virtual

Implements ObjectFile.

Definition at line 175 of file dtb_object.cc.

bool DtbObject::loadGlobalSymbols ( SymbolTable symtab,
Addr  base = 0,
Addr  offset = 0,
Addr  addrMask = maxAddr 
)
virtual

Implements ObjectFile.

Definition at line 182 of file dtb_object.cc.

bool DtbObject::loadLocalSymbols ( SymbolTable symtab,
Addr  base = 0,
Addr  offset = 0,
Addr  addrMask = maxAddr 
)
virtual

Implements ObjectFile.

Definition at line 190 of file dtb_object.cc.

ObjectFile * DtbObject::tryFile ( const std::string &  fname,
size_t  len,
uint8_t *  data 
)
static

Static function that tries to load file as a flattened device tree blob.

Parameters
fnamepath to file
lenlength of file
datammap'ed data buffer containing file contents
Returns
ObjectFile representing closest match of file type

Definition at line 43 of file dtb_object.cc.

References DtbObject(), ObjectFile::UnknownArch, and ObjectFile::UnknownOpSys.

Referenced by createObjectFile().

Member Data Documentation

bool DtbObject::fileDataMmapped
protected

Bool marking if this dtb file has replaced the original read in DTB file with a new modified buffer.

Definition at line 50 of file dtb_object.hh.

Referenced by addBootCmdLine(), DtbObject(), and ~DtbObject().


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

Generated on Fri Jun 9 2017 13:04:09 for gem5 by doxygen 1.8.6