gem5  v22.1.0.0
Public Member Functions | Protected Attributes | List of all members
gem5::loader::DtbFile Class Reference

#include <dtb_file.hh>

Inheritance diagram for gem5::loader::DtbFile:
gem5::loader::ImageFile

Public Member Functions

 DtbFile (const std::string &name)
 
 ~DtbFile ()
 
bool addBootData (const char *_cmdline, size_t cmdline_len, off_t initrd_addr, size_t initrd_len)
 Adds the passed in Command Line options and initrd for the kernel to the proper location in the device tree. More...
 
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...
 
MemoryImage buildImage () const override
 

Protected Attributes

bool fileDataMmapped
 Bool marking if this dtb file has replaced the original read in DTB file with a new modified buffer. More...
 
uint8_t * fileData = nullptr
 
size_t length = 0
 
- Protected Attributes inherited from gem5::loader::ImageFile
ImageFileDataPtr imageData
 

Additional Inherited Members

- Protected Member Functions inherited from gem5::loader::ImageFile
 ImageFile (ImageFileDataPtr data)
 
virtual ~ImageFile ()
 

Detailed Description

Definition at line 47 of file dtb_file.hh.

Constructor & Destructor Documentation

◆ DtbFile()

gem5::loader::DtbFile::DtbFile ( const std::string &  name)

Definition at line 47 of file dtb_file.cc.

References fileData, fileDataMmapped, gem5::loader::ImageFile::imageData, length, and panic_if.

◆ ~DtbFile()

gem5::loader::DtbFile::~DtbFile ( )

Definition at line 57 of file dtb_file.cc.

References fileData, and fileDataMmapped.

Member Function Documentation

◆ addBootCmdLine()

bool gem5::loader::DtbFile::addBootCmdLine ( const char *  _args,
size_t  len 
)
inline

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 79 of file dtb_file.hh.

References addBootData(), and len.

◆ addBootData()

bool gem5::loader::DtbFile::addBootData ( const char *  _cmdline,
size_t  cmdline_len,
off_t  initrd_addr,
size_t  initrd_len 
)

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

Parameters
_cmdlinecommand line to append
cmdline_lenlength of the command line string
initrd_addrstarting physical address of initrd
initrd_lenlength of initrd data in memory
Returns
returns true on success, false otherwise

Definition at line 66 of file dtb_file.cc.

References fileData, fileDataMmapped, length, gem5::ArmISA::offset, and warn.

Referenced by addBootCmdLine().

◆ buildImage()

MemoryImage gem5::loader::DtbFile::buildImage ( ) const
overridevirtual

Implements gem5::loader::ImageFile.

Definition at line 182 of file dtb_file.cc.

References fileData, fileDataMmapped, gem5::loader::ImageFile::imageData, and length.

◆ findReleaseAddr()

Addr gem5::loader::DtbFile::findReleaseAddr ( )

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

Returns
release address for SMP boot

Definition at line 161 of file dtb_file.cc.

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

Member Data Documentation

◆ fileData

uint8_t* gem5::loader::DtbFile::fileData = nullptr
protected

Definition at line 54 of file dtb_file.hh.

Referenced by addBootData(), buildImage(), DtbFile(), findReleaseAddr(), and ~DtbFile().

◆ fileDataMmapped

bool gem5::loader::DtbFile::fileDataMmapped
protected

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

Definition at line 53 of file dtb_file.hh.

Referenced by addBootData(), buildImage(), DtbFile(), and ~DtbFile().

◆ length

size_t gem5::loader::DtbFile::length = 0
protected

Definition at line 55 of file dtb_file.hh.

Referenced by addBootData(), buildImage(), and DtbFile().


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

Generated on Wed Dec 21 2022 10:24:15 for gem5 by doxygen 1.9.1