Go to the documentation of this file.
30 #include "debug/Loader.hh"
31 #include "params/KernelWorkload.hh"
38 _loadAddrMask(
p.load_addr_mask), _loadAddrOffset(
p.load_addr_offset),
39 commandLine(
p.command_line)
41 if (
params().object_file ==
"") {
42 inform(
"No kernel set for full system simulation. "
43 "Assuming you know what you're doing.");
49 "Could not load kernel file %s",
params().object_file);
69 ->rename([](std::string &
name) {
81 if (extras_addrs.empty())
82 extras_addrs.resize(
p.extras.size(),
MaxAddr);
83 fatal_if(
p.extras.size() != extras_addrs.size(),
84 "Additional kernel objects, not all load addresses specified\n");
85 for (
int ker_idx = 0; ker_idx <
p.extras.size(); ker_idx++) {
86 const std::string &obj_name =
p.extras[ker_idx];
87 const bool raw = extras_addrs[ker_idx] !=
MaxAddr;
89 fatal_if(!obj,
"Failed to build additional kernel object '%s'.\n",
102 auto mapper = [
this](
Addr a) {
105 if (
params().object_file !=
"") {
106 if (
params().addr_check) {
110 "Kernel is mapped to invalid location (not memory). "
111 "start (%#x) - end (%#x) %#x:%#x\n",
120 DPRINTF(Loader,
"Kernel loaded...\n");
124 if (extras_addrs.empty())
126 for (
int idx = 0; idx <
extras.size(); idx++) {
127 const Addr load_addr = extras_addrs[idx];
KernelWorkload(const Params &p)
Addr _loadAddrMask
Mask that should be anded for binary/symbol loading.
PortProxy physProxy
Port to physical memory used for writing object files into ram at boot.
void unserialize(const std::string &base, CheckpointIn &cp, Symbol::Binding default_binding=Symbol::Binding::Global)
Populate the table by unserializing a checkpoint.
const SymbolTable & symtab() const
loader::ObjectFile * kernelObj
constexpr uint64_t mask(unsigned nbits)
Generate a 64-bit mask of 'nbits' 1s, right justified.
bool isMemAddr(Addr addr) const
Check if a physical address is within a range of a memory that is part of the global address map.
virtual std::string name() const
MemoryImage & offset(Addr by)
const Params & params() const
MemoryImage & move(std::function< Addr(Addr)> mapper)
loader::SymbolTable kernelSymtab
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.
ObjectFile * createObjectFile(const std::string &fname, bool raw)
bool insert(const Symbol &symbol)
Insert a new symbol in the table if it does not already exist.
void unserialize(CheckpointIn &cp) override
Unserialize an object.
void serialize(CheckpointOut &cp) const override
Serialize an object.
bool write(const PortProxy &proxy) const
constexpr int findMsbSet(uint64_t val)
Returns the bit position of the MSB that is set in the input.
std::ostream CheckpointOut
virtual MemoryImage buildImage() const =0
SymbolTable debugSymbolTable
Global unified debugging symbol table (for target).
std::vector< loader::ObjectFile * > extras
#define fatal_if(cond,...)
Conditional fatal macro that checks the supplied condition and only causes a fatal error if the condi...
Reference material can be found at the JEDEC website: UFS standard http://www.jedec....
loader::MemoryImage image
Addr _loadAddrOffset
Offset that should be used for binary/symbol loading.
void serialize(const std::string &base, CheckpointOut &cp) const
Serialize the table's contents.
SymbolTablePtr mask(Addr m) const
Generate a new table by a mask to the symbols of the current table.
void initState() override
initState() is called on each SimObject when not restoring from a checkpoint.
Generated on Sun Jul 30 2023 01:56:59 for gem5 by doxygen 1.8.17