// it is helpful.
if (params()->early_kernel_symbols) {
kernelObj->loadGlobalSymbols(kernelSymtab, 0, 0, _loadAddrMask);
- kernelObj->loadGlobalSymbols(debugSymbolTable, 0, 0, _loadAddrMask);
+ kernelObj->loadGlobalSymbols(
+ Loader::debugSymbolTable, 0, 0, _loadAddrMask);
}
// Check if the kernel image has a symbol that tells us it supports
inform("Loading DTB file: %s at address %#x\n", params()->dtb_filename,
params()->atags_addr + _loadAddrOffset);
- DtbFile *dtb_file = new DtbFile(params()->dtb_filename);
+ auto *dtb_file = new ::Loader::DtbFile(params()->dtb_filename);
warn_if(!dtb_file->addBootCmdLine(commandLine.c_str(), commandLine.size()),
"Couldn't append bootargs to DTB file: %s",
{
public:
Process *
- load(ProcessParams *params, ObjectFile *obj_file) override
+ load(ProcessParams *params, ::Loader::ObjectFile *obj_file) override
{
auto arch = obj_file->getArch();
auto opsys = obj_file->getOpSys();
- if (arch != ObjectFile::Arm && arch != ObjectFile::Thumb &&
- arch != ObjectFile::Arm64) {
+ if (arch != ::Loader::Arm && arch != ::Loader::Thumb &&
+ arch != ::Loader::Arm64) {
return nullptr;
}
- if (opsys != ObjectFile::FreeBSD)
+ if (opsys != ::Loader::FreeBSD)
return nullptr;
- if (arch == ObjectFile::Arm64)
+ if (arch == ::Loader::Arm64)
return new ArmFreebsdProcess64(params, obj_file, arch);
else
return new ArmFreebsdProcess32(params, obj_file, arch);
};
ArmFreebsdProcess32::ArmFreebsdProcess32(ProcessParams * params,
- ObjectFile *objFile, ObjectFile::Arch _arch) :
+ ::Loader::ObjectFile *objFile, ::Loader::Arch _arch) :
ArmProcess32(params, objFile, _arch)
{}
ArmFreebsdProcess64::ArmFreebsdProcess64(ProcessParams * params,
- ObjectFile *objFile, ObjectFile::Arch _arch) :
+ ::Loader::ObjectFile *objFile, ::Loader::Arch _arch) :
ArmProcess64(params, objFile, _arch)
{}
class ArmFreebsdProcess32 : public ArmProcess32, public ArmFreebsdProcessBits
{
public:
- ArmFreebsdProcess32(ProcessParams * params, ObjectFile *objFile,
- ObjectFile::Arch _arch);
+ ArmFreebsdProcess32(ProcessParams * params, ::Loader::ObjectFile *objFile,
+ ::Loader::Arch _arch);
void initState() override;
class ArmFreebsdProcess64 : public ArmProcess64, public ArmFreebsdProcessBits
{
public:
- ArmFreebsdProcess64(ProcessParams * params, ObjectFile *objFile,
- ObjectFile::Arch _arch);
+ ArmFreebsdProcess64(ProcessParams * params, ::Loader::ObjectFile *objFile,
+ ::Loader::Arch _arch);
void initState() override;
void syscall(ThreadContext *tc, Fault *fault) override;
{
bootLoaders.reserve(p->boot_loader.size());
for (const auto &bl : p->boot_loader) {
- std::unique_ptr<ObjectFile> bl_obj;
- bl_obj.reset(createObjectFile(bl));
+ std::unique_ptr<Loader::ObjectFile> bl_obj;
+ bl_obj.reset(Loader::createObjectFile(bl));
fatal_if(!bl_obj, "Could not read bootloader: %s", bl);
bootLoaders.emplace_back(std::move(bl_obj));
"Can't find a matching boot loader / kernel combination!");
if (bootldr)
- bootldr->loadGlobalSymbols(debugSymbolTable);
+ bootldr->loadGlobalSymbols(Loader::debugSymbolTable);
}
void
}
}
-ObjectFile *
-FsWorkload::getBootLoader(ObjectFile *const obj)
+ Loader::ObjectFile *
+FsWorkload::getBootLoader(Loader::ObjectFile *const obj)
{
if (obj) {
for (auto &bl : bootLoaders) {
{
protected:
/** Bootloaders */
- std::vector<std::unique_ptr<ObjectFile>> bootLoaders;
+ std::vector<std::unique_ptr<Loader::ObjectFile>> bootLoaders;
/**
* Pointer to the bootloader object
*/
- ObjectFile *bootldr = nullptr;
+ Loader::ObjectFile *bootldr = nullptr;
/**
* This differs from entry since it takes into account where
* @return Pointer to boot loader ObjectFile or nullptr if there
* is no matching boot loader.
*/
- ObjectFile *getBootLoader(ObjectFile *const obj);
+ Loader::ObjectFile *getBootLoader(Loader::ObjectFile *const obj);
public:
typedef ArmFsWorkloadParams Params;
return kernelEntry;
}
- ObjectFile::Arch
+ Loader::Arch
getArch() const override
{
if (bootldr)
else if (kernelObj)
return kernelObj->getArch();
else
- return ObjectFile::Arm64;
+ return Loader::Arm64;
}
FsWorkload(Params *p);
namespace ArmISA {
std::string
-BranchReg::generateDisassembly(Addr pc, const SymbolTable *symtab) const
+BranchReg::generateDisassembly(
+ Addr pc, const Loader::SymbolTable *symtab) const
{
std::stringstream ss;
printMnemonic(ss, "", false);
}
std::string
-BranchImm::generateDisassembly(Addr pc, const SymbolTable *symtab) const
+BranchImm::generateDisassembly(
+ Addr pc, const Loader::SymbolTable *symtab) const
{
std::stringstream ss;
printMnemonic(ss, "", false);
}
std::string
-BranchRegReg::generateDisassembly(Addr pc, const SymbolTable *symtab) const
+BranchRegReg::generateDisassembly(
+ Addr pc, const Loader::SymbolTable *symtab) const
{
std::stringstream ss;
printMnemonic(ss, "", false);
PredOp(mnem, _machInst, __opClass), imm(_imm)
{}
- std::string generateDisassembly(Addr pc, const SymbolTable *symtab) const;
+ std::string generateDisassembly(
+ Addr pc, const Loader::SymbolTable *symtab) const;
};
// Conditionally Branch to a target computed with an immediate
PredOp(mnem, _machInst, __opClass), op1(_op1)
{}
- std::string generateDisassembly(Addr pc, const SymbolTable *symtab) const;
+ std::string generateDisassembly(
+ Addr pc, const Loader::SymbolTable *symtab) const;
};
// Conditionally Branch to a target computed with a register
PredOp(mnem, _machInst, __opClass), op1(_op1), op2(_op2)
{}
- std::string generateDisassembly(Addr pc, const SymbolTable *symtab) const;
+ std::string generateDisassembly(
+ Addr pc, const Loader::SymbolTable *symtab) const;
};
// Branch to a target computed with an immediate and a register
std::string
BranchImmCond64::generateDisassembly(
- Addr pc, const SymbolTable *symtab) const
+ Addr pc, const Loader::SymbolTable *symtab) const
{
std::stringstream ss;
printMnemonic(ss, "", false, true, condCode);
std::string
BranchImm64::generateDisassembly(
- Addr pc, const SymbolTable *symtab) const
+ Addr pc, const Loader::SymbolTable *symtab) const
{
std::stringstream ss;
printMnemonic(ss, "", false);
std::string
BranchReg64::generateDisassembly(
- Addr pc, const SymbolTable *symtab) const
+ Addr pc, const Loader::SymbolTable *symtab) const
{
std::stringstream ss;
printMnemonic(ss, "", false);
std::string
BranchRegReg64::generateDisassembly(
- Addr pc, const SymbolTable *symtab) const
+ Addr pc, const Loader::SymbolTable *symtab) const
{
std::stringstream ss;
printMnemonic(ss, "", false);
std::string
BranchRet64::generateDisassembly(
- Addr pc, const SymbolTable *symtab) const
+ Addr pc, const Loader::SymbolTable *symtab) const
{
std::stringstream ss;
printMnemonic(ss, "", false);
std::string
BranchRetA64::generateDisassembly(
- Addr pc, const SymbolTable *symtab) const
+ Addr pc, const Loader::SymbolTable *symtab) const
{
std::stringstream ss;
printMnemonic(ss, "", false);
std::string
BranchEret64::generateDisassembly(
- Addr pc, const SymbolTable *symtab) const
+ Addr pc, const Loader::SymbolTable *symtab) const
{
std::stringstream ss;
printMnemonic(ss, "", false);
std::string
BranchEretA64::generateDisassembly(
- Addr pc, const SymbolTable *symtab) const
+ Addr pc, const Loader::SymbolTable *symtab) const
{
std::stringstream ss;
printMnemonic(ss, "", false);
std::string
BranchImmReg64::generateDisassembly(
- Addr pc, const SymbolTable *symtab) const
+ Addr pc, const Loader::SymbolTable *symtab) const
{
std::stringstream ss;
printMnemonic(ss, "", false);
std::string
BranchImmImmReg64::generateDisassembly(
- Addr pc, const SymbolTable *symtab) const
+ Addr pc, const Loader::SymbolTable *symtab) const
{
std::stringstream ss;
printMnemonic(ss, "", false);
using StaticInst::branchTarget;
std::string generateDisassembly(
- Addr pc, const SymbolTable *symtab) const override;
+ Addr pc, const Loader::SymbolTable *symtab) const override;
};
// Conditionally Branch to a target computed with an immediate
{}
std::string generateDisassembly(
- Addr pc, const SymbolTable *symtab) const override;
+ Addr pc, const Loader::SymbolTable *symtab) const override;
};
// Branch to a target computed with two registers
{}
std::string generateDisassembly(
- Addr pc, const SymbolTable *symtab) const override;
+ Addr pc, const Loader::SymbolTable *symtab) const override;
};
// Branch to a target computed with a register
{}
std::string generateDisassembly(
- Addr pc, const SymbolTable *symtab) const override;
+ Addr pc, const Loader::SymbolTable *symtab) const override;
};
// Ret instruction
{}
std::string generateDisassembly(
- Addr pc, const SymbolTable *symtab) const override;
+ Addr pc, const Loader::SymbolTable *symtab) const override;
};
// RetAA/RetAB instruction
{}
std::string generateDisassembly(
- Addr pc, const SymbolTable *symtab) const override;
+ Addr pc, const Loader::SymbolTable *symtab) const override;
};
// Eret instruction
{}
std::string generateDisassembly(
- Addr pc, const SymbolTable *symtab) const override;
+ Addr pc, const Loader::SymbolTable *symtab) const override;
};
// EretA/B instruction
{}
std::string generateDisassembly(
- Addr pc, const SymbolTable *symtab) const override;
+ Addr pc, const Loader::SymbolTable *symtab) const override;
};
// Branch to a target computed with an immediate and a register
class BranchImmReg64 : public ArmStaticInst
using StaticInst::branchTarget;
std::string generateDisassembly(
- Addr pc, const SymbolTable *symtab) const override;
+ Addr pc, const Loader::SymbolTable *symtab) const override;
};
// Branch to a target computed with two immediates
using StaticInst::branchTarget;
std::string generateDisassembly(
- Addr pc, const SymbolTable *symtab) const override;
+ Addr pc, const Loader::SymbolTable *symtab) const override;
};
}
{
std::string
-DataXImmOp::generateDisassembly(Addr pc, const SymbolTable *symtab) const
+DataXImmOp::generateDisassembly(
+ Addr pc, const Loader::SymbolTable *symtab) const
{
std::stringstream ss;
printDataInst(ss, true, false, /*XXX not really s*/ false, dest, op1,
}
std::string
-DataXImmOnlyOp::generateDisassembly(Addr pc, const SymbolTable *symtab) const
+DataXImmOnlyOp::generateDisassembly(
+ Addr pc, const Loader::SymbolTable *symtab) const
{
std::stringstream ss;
printMnemonic(ss, "", false);
}
std::string
-DataXSRegOp::generateDisassembly(Addr pc, const SymbolTable *symtab) const
+DataXSRegOp::generateDisassembly(
+ Addr pc, const Loader::SymbolTable *symtab) const
{
std::stringstream ss;
printDataInst(ss, false, true, /*XXX not really s*/ false, dest, op1,
}
std::string
-DataXERegOp::generateDisassembly(Addr pc, const SymbolTable *symtab) const
+DataXERegOp::generateDisassembly(
+ Addr pc, const Loader::SymbolTable *symtab) const
{
std::stringstream ss;
printDataInst(ss, false, true, /*XXX not really s*/ false, dest, op1,
}
std::string
-DataX1RegOp::generateDisassembly(Addr pc, const SymbolTable *symtab) const
+DataX1RegOp::generateDisassembly(
+ Addr pc, const Loader::SymbolTable *symtab) const
{
std::stringstream ss;
printMnemonic(ss, "", false);
}
std::string
-DataX1RegImmOp::generateDisassembly(Addr pc, const SymbolTable *symtab) const
+DataX1RegImmOp::generateDisassembly(
+ Addr pc, const Loader::SymbolTable *symtab) const
{
std::stringstream ss;
printMnemonic(ss, "", false);
}
std::string
-DataX1Reg2ImmOp::generateDisassembly(Addr pc, const SymbolTable *symtab) const
+DataX1Reg2ImmOp::generateDisassembly(
+ Addr pc, const Loader::SymbolTable *symtab) const
{
std::stringstream ss;
printMnemonic(ss, "", false);
}
std::string
-DataX2RegOp::generateDisassembly(Addr pc, const SymbolTable *symtab) const
+DataX2RegOp::generateDisassembly(
+ Addr pc, const Loader::SymbolTable *symtab) const
{
std::stringstream ss;
printMnemonic(ss, "", false);
}
std::string
-DataX2RegImmOp::generateDisassembly(Addr pc, const SymbolTable *symtab) const
+DataX2RegImmOp::generateDisassembly(
+ Addr pc, const Loader::SymbolTable *symtab) const
{
std::stringstream ss;
printMnemonic(ss, "", false);
}
std::string
-DataX3RegOp::generateDisassembly(Addr pc, const SymbolTable *symtab) const
+DataX3RegOp::generateDisassembly(
+ Addr pc, const Loader::SymbolTable *symtab) const
{
std::stringstream ss;
printMnemonic(ss, "", false);
std::string
DataXCondCompImmOp::generateDisassembly(
- Addr pc, const SymbolTable *symtab) const
+ Addr pc, const Loader::SymbolTable *symtab) const
{
std::stringstream ss;
printMnemonic(ss, "", false);
std::string
DataXCondCompRegOp::generateDisassembly(
- Addr pc, const SymbolTable *symtab) const
+ Addr pc, const Loader::SymbolTable *symtab) const
{
std::stringstream ss;
printMnemonic(ss, "", false);
std::string
DataXCondSelOp::generateDisassembly(
- Addr pc, const SymbolTable *symtab) const
+ Addr pc, const Loader::SymbolTable *symtab) const
{
std::stringstream ss;
printMnemonic(ss, "", false);
{}
std::string generateDisassembly(
- Addr pc, const SymbolTable *symtab) const override;
+ Addr pc, const Loader::SymbolTable *symtab) const override;
};
class DataXImmOnlyOp : public ArmStaticInst
{}
std::string generateDisassembly(
- Addr pc, const SymbolTable *symtab) const override;
+ Addr pc, const Loader::SymbolTable *symtab) const override;
};
class DataXSRegOp : public ArmStaticInst
{}
std::string generateDisassembly(
- Addr pc, const SymbolTable *symtab) const override;
+ Addr pc, const Loader::SymbolTable *symtab) const override;
};
class DataXERegOp : public ArmStaticInst
{}
std::string generateDisassembly(
- Addr pc, const SymbolTable *symtab) const override;
+ Addr pc, const Loader::SymbolTable *symtab) const override;
};
class DataX1RegOp : public ArmStaticInst
{}
std::string generateDisassembly(
- Addr pc, const SymbolTable *symtab) const override;
+ Addr pc, const Loader::SymbolTable *symtab) const override;
};
class DataX1RegImmOp : public ArmStaticInst
{}
std::string generateDisassembly(
- Addr pc, const SymbolTable *symtab) const override;
+ Addr pc, const Loader::SymbolTable *symtab) const override;
};
class DataX1Reg2ImmOp : public ArmStaticInst
{}
std::string generateDisassembly(
- Addr pc, const SymbolTable *symtab) const override;
+ Addr pc, const Loader::SymbolTable *symtab) const override;
};
class DataX2RegOp : public ArmStaticInst
{}
std::string generateDisassembly(
- Addr pc, const SymbolTable *symtab) const override;
+ Addr pc, const Loader::SymbolTable *symtab) const override;
};
class DataX2RegImmOp : public ArmStaticInst
{}
std::string generateDisassembly(
- Addr pc, const SymbolTable *symtab) const override;
+ Addr pc, const Loader::SymbolTable *symtab) const override;
};
class DataX3RegOp : public ArmStaticInst
{}
std::string generateDisassembly(
- Addr pc, const SymbolTable *symtab) const override;
+ Addr pc, const Loader::SymbolTable *symtab) const override;
};
class DataXCondCompImmOp : public ArmStaticInst
{}
std::string generateDisassembly(
- Addr pc, const SymbolTable *symtab) const override;
+ Addr pc, const Loader::SymbolTable *symtab) const override;
};
class DataXCondCompRegOp : public ArmStaticInst
{}
std::string generateDisassembly(
- Addr pc, const SymbolTable *symtab) const override;
+ Addr pc, const Loader::SymbolTable *symtab) const override;
};
class DataXCondSelOp : public ArmStaticInst
{}
std::string generateDisassembly(
- Addr pc, const SymbolTable *symtab) const override;
+ Addr pc, const Loader::SymbolTable *symtab) const override;
};
}
}
std::string
-MicroIntImmOp::generateDisassembly(Addr pc, const SymbolTable *symtab) const
+MicroIntImmOp::generateDisassembly(
+ Addr pc, const Loader::SymbolTable *symtab) const
{
std::stringstream ss;
printMnemonic(ss);
}
std::string
-MicroIntImmXOp::generateDisassembly(Addr pc, const SymbolTable *symtab) const
+MicroIntImmXOp::generateDisassembly(
+ Addr pc, const Loader::SymbolTable *symtab) const
{
std::stringstream ss;
printMnemonic(ss);
}
std::string
-MicroSetPCCPSR::generateDisassembly(Addr pc, const SymbolTable *symtab) const
+MicroSetPCCPSR::generateDisassembly(
+ Addr pc, const Loader::SymbolTable *symtab) const
{
std::stringstream ss;
printMnemonic(ss);
}
std::string
-MicroIntRegXOp::generateDisassembly(Addr pc, const SymbolTable *symtab) const
+MicroIntRegXOp::generateDisassembly(
+ Addr pc, const Loader::SymbolTable *symtab) const
{
std::stringstream ss;
printMnemonic(ss);
}
std::string
-MicroIntMov::generateDisassembly(Addr pc, const SymbolTable *symtab) const
+MicroIntMov::generateDisassembly(
+ Addr pc, const Loader::SymbolTable *symtab) const
{
std::stringstream ss;
printMnemonic(ss);
}
std::string
-MicroIntOp::generateDisassembly(Addr pc, const SymbolTable *symtab) const
+MicroIntOp::generateDisassembly(
+ Addr pc, const Loader::SymbolTable *symtab) const
{
std::stringstream ss;
printMnemonic(ss);
}
std::string
-MicroMemOp::generateDisassembly(Addr pc, const SymbolTable *symtab) const
+MicroMemOp::generateDisassembly(
+ Addr pc, const Loader::SymbolTable *symtab) const
{
std::stringstream ss;
printMnemonic(ss);
}
std::string
-MicroMemPairOp::generateDisassembly(Addr pc, const SymbolTable *symtab) const
+MicroMemPairOp::generateDisassembly(
+ Addr pc, const Loader::SymbolTable *symtab) const
{
std::stringstream ss;
printMnemonic(ss);
}
std::string generateDisassembly(
- Addr pc, const SymbolTable *symtab) const override;
+ Addr pc, const Loader::SymbolTable *symtab) const override;
};
/**
}
std::string generateDisassembly(
- Addr pc, const SymbolTable *symtab) const override;
+ Addr pc, const Loader::SymbolTable *symtab) const override;
};
/**
}
std::string generateDisassembly(
- Addr pc, const SymbolTable *symtab) const override;
+ Addr pc, const Loader::SymbolTable *symtab) const override;
};
class MicroIntImmXOp : public MicroOpX
}
std::string generateDisassembly(
- Addr pc, const SymbolTable *symtab) const override;
+ Addr pc, const Loader::SymbolTable *symtab) const override;
};
/**
}
std::string generateDisassembly(
- Addr pc, const SymbolTable *symtab) const override;
+ Addr pc, const Loader::SymbolTable *symtab) const override;
};
class MicroIntRegXOp : public MicroOp
}
std::string generateDisassembly(
- Addr pc, const SymbolTable *symtab) const override;
+ Addr pc, const Loader::SymbolTable *symtab) const override;
};
/**
}
std::string generateDisassembly(
- Addr pc, const SymbolTable *symtab) const override;
+ Addr pc, const Loader::SymbolTable *symtab) const override;
};
class MicroMemPairOp : public MicroOp
}
std::string generateDisassembly(
- Addr pc, const SymbolTable *symtab) const override;
+ Addr pc, const Loader::SymbolTable *symtab) const override;
};
/**
}
string
-RfeOp::generateDisassembly(Addr pc, const SymbolTable *symtab) const
+RfeOp::generateDisassembly(Addr pc, const Loader::SymbolTable *symtab) const
{
stringstream ss;
switch (mode) {
}
string
-SrsOp::generateDisassembly(Addr pc, const SymbolTable *symtab) const
+SrsOp::generateDisassembly(Addr pc, const Loader::SymbolTable *symtab) const
{
stringstream ss;
switch (mode) {
}
std::string generateDisassembly(
- Addr pc, const SymbolTable *symtab) const override;
+ Addr pc, const Loader::SymbolTable *symtab) const override;
};
// The address is a base register plus an immediate.
}
std::string generateDisassembly(
- Addr pc, const SymbolTable *symtab) const override;
+ Addr pc, const Loader::SymbolTable *symtab) const override;
};
class Memory : public MightBeMicro
{}
std::string
- generateDisassembly(Addr pc, const SymbolTable *symtab) const
+ generateDisassembly(Addr pc, const Loader::SymbolTable *symtab) const
{
std::stringstream ss;
this->printInst(ss, Memory::AddrMd_Offset);
{}
std::string
- generateDisassembly(Addr pc, const SymbolTable *symtab) const
+ generateDisassembly(Addr pc, const Loader::SymbolTable *symtab) const
{
std::stringstream ss;
this->printInst(ss, Memory::AddrMd_PreIndex);
{}
std::string
- generateDisassembly(Addr pc, const SymbolTable *symtab) const
+ generateDisassembly(Addr pc, const Loader::SymbolTable *symtab) const
{
std::stringstream ss;
this->printInst(ss, Memory::AddrMd_PostIndex);
{
std::string
-SysDC64::generateDisassembly(Addr pc, const SymbolTable *symtab) const
+SysDC64::generateDisassembly(Addr pc, const Loader::SymbolTable *symtab) const
{
std::stringstream ss;
printMnemonic(ss, "", false);
}
std::string
-MemoryImm64::generateDisassembly(Addr pc, const SymbolTable *symtab) const
+MemoryImm64::generateDisassembly(
+ Addr pc, const Loader::SymbolTable *symtab) const
{
std::stringstream ss;
startDisassembly(ss);
}
std::string
-MemoryDImm64::generateDisassembly(Addr pc, const SymbolTable *symtab) const
+MemoryDImm64::generateDisassembly(
+ Addr pc, const Loader::SymbolTable *symtab) const
{
std::stringstream ss;
printMnemonic(ss, "", false);
}
std::string
-MemoryDImmEx64::generateDisassembly(Addr pc, const SymbolTable *symtab) const
+MemoryDImmEx64::generateDisassembly(
+ Addr pc, const Loader::SymbolTable *symtab) const
{
std::stringstream ss;
printMnemonic(ss, "", false);
}
std::string
-MemoryPreIndex64::generateDisassembly(Addr pc, const SymbolTable *symtab) const
+MemoryPreIndex64::generateDisassembly(
+ Addr pc, const Loader::SymbolTable *symtab) const
{
std::stringstream ss;
startDisassembly(ss);
}
std::string
-MemoryPostIndex64::generateDisassembly(Addr pc, const SymbolTable *symtab) const
+MemoryPostIndex64::generateDisassembly(
+ Addr pc, const Loader::SymbolTable *symtab) const
{
std::stringstream ss;
startDisassembly(ss);
}
std::string
-MemoryReg64::generateDisassembly(Addr pc, const SymbolTable *symtab) const
+MemoryReg64::generateDisassembly(
+ Addr pc, const Loader::SymbolTable *symtab) const
{
std::stringstream ss;
startDisassembly(ss);
}
std::string
-MemoryRaw64::generateDisassembly(Addr pc, const SymbolTable *symtab) const
+MemoryRaw64::generateDisassembly(
+ Addr pc, const Loader::SymbolTable *symtab) const
{
std::stringstream ss;
startDisassembly(ss);
}
std::string
-MemoryEx64::generateDisassembly(Addr pc, const SymbolTable *symtab) const
+MemoryEx64::generateDisassembly(
+ Addr pc, const Loader::SymbolTable *symtab) const
{
std::stringstream ss;
printMnemonic(ss, "", false);
}
std::string
-MemoryLiteral64::generateDisassembly(Addr pc, const SymbolTable *symtab) const
+MemoryLiteral64::generateDisassembly(
+ Addr pc, const Loader::SymbolTable *symtab) const
{
std::stringstream ss;
printMnemonic(ss, "", false);
{}
std::string generateDisassembly(
- Addr pc, const SymbolTable *symtab) const override;
+ Addr pc, const Loader::SymbolTable *symtab) const override;
};
class MightBeMicro64 : public ArmStaticInst
{}
std::string generateDisassembly(
- Addr pc, const SymbolTable *symtab) const override;
+ Addr pc, const Loader::SymbolTable *symtab) const override;
};
class MemoryDImm64 : public MemoryImm64
{}
std::string generateDisassembly(
- Addr pc, const SymbolTable *symtab) const override;
+ Addr pc, const Loader::SymbolTable *symtab) const override;
};
class MemoryDImmEx64 : public MemoryDImm64
{}
std::string generateDisassembly(
- Addr pc, const SymbolTable *symtab) const override;
+ Addr pc, const Loader::SymbolTable *symtab) const override;
};
class MemoryPreIndex64 : public MemoryImm64
{}
std::string generateDisassembly(
- Addr pc, const SymbolTable *symtab) const override;
+ Addr pc, const Loader::SymbolTable *symtab) const override;
};
class MemoryPostIndex64 : public MemoryImm64
{}
std::string generateDisassembly(
- Addr pc, const SymbolTable *symtab) const override;
+ Addr pc, const Loader::SymbolTable *symtab) const override;
};
class MemoryReg64 : public Memory64
{}
std::string generateDisassembly(
- Addr pc, const SymbolTable *symtab) const override;
+ Addr pc, const Loader::SymbolTable *symtab) const override;
};
class MemoryRaw64 : public Memory64
{}
std::string generateDisassembly(
- Addr pc, const SymbolTable *symtab) const override;
+ Addr pc, const Loader::SymbolTable *symtab) const override;
};
class MemoryEx64 : public Memory64
{}
std::string generateDisassembly(
- Addr pc, const SymbolTable *symtab) const override;
+ Addr pc, const Loader::SymbolTable *symtab) const override;
};
class MemoryLiteral64 : public Memory64
{}
std::string generateDisassembly(
- Addr pc, const SymbolTable *symtab) const override;
+ Addr pc, const Loader::SymbolTable *symtab) const override;
};
}
#include "cpu/reg_class.hh"
std::string
-MrsOp::generateDisassembly(Addr pc, const SymbolTable *symtab) const
+MrsOp::generateDisassembly(Addr pc, const Loader::SymbolTable *symtab) const
{
std::stringstream ss;
printMnemonic(ss);
}
std::string
-MsrImmOp::generateDisassembly(Addr pc, const SymbolTable *symtab) const
+MsrImmOp::generateDisassembly(Addr pc, const Loader::SymbolTable *symtab) const
{
std::stringstream ss;
printMsrBase(ss);
}
std::string
-MsrRegOp::generateDisassembly(Addr pc, const SymbolTable *symtab) const
+MsrRegOp::generateDisassembly(Addr pc, const Loader::SymbolTable *symtab) const
{
std::stringstream ss;
printMsrBase(ss);
}
std::string
-MrrcOp::generateDisassembly(Addr pc, const SymbolTable *symtab) const
+MrrcOp::generateDisassembly(Addr pc, const Loader::SymbolTable *symtab) const
{
std::stringstream ss;
printMnemonic(ss);
}
std::string
-McrrOp::generateDisassembly(Addr pc, const SymbolTable *symtab) const
+McrrOp::generateDisassembly(Addr pc, const Loader::SymbolTable *symtab) const
{
std::stringstream ss;
printMnemonic(ss);
}
std::string
-ImmOp::generateDisassembly(Addr pc, const SymbolTable *symtab) const
+ImmOp::generateDisassembly(Addr pc, const Loader::SymbolTable *symtab) const
{
std::stringstream ss;
printMnemonic(ss);
}
std::string
-RegImmOp::generateDisassembly(Addr pc, const SymbolTable *symtab) const
+RegImmOp::generateDisassembly(Addr pc, const Loader::SymbolTable *symtab) const
{
std::stringstream ss;
printMnemonic(ss);
}
std::string
-RegRegOp::generateDisassembly(Addr pc, const SymbolTable *symtab) const
+RegRegOp::generateDisassembly(Addr pc, const Loader::SymbolTable *symtab) const
{
std::stringstream ss;
printMnemonic(ss);
}
std::string
-RegOp::generateDisassembly(Addr pc, const SymbolTable *symtab) const
+RegOp::generateDisassembly(Addr pc, const Loader::SymbolTable *symtab) const
{
std::stringstream ss;
printMnemonic(ss);
printIntReg(ss, dest);
return ss.str();
}
+
std::string
-RegRegRegImmOp::generateDisassembly(Addr pc, const SymbolTable *symtab) const
+RegRegRegImmOp::generateDisassembly(
+ Addr pc, const Loader::SymbolTable *symtab) const
{
std::stringstream ss;
printMnemonic(ss);
}
std::string
-RegRegRegRegOp::generateDisassembly(Addr pc, const SymbolTable *symtab) const
+RegRegRegRegOp::generateDisassembly(
+ Addr pc, const Loader::SymbolTable *symtab) const
{
std::stringstream ss;
printMnemonic(ss);
}
std::string
-RegRegRegOp::generateDisassembly(Addr pc, const SymbolTable *symtab) const
+RegRegRegOp::generateDisassembly(
+ Addr pc, const Loader::SymbolTable *symtab) const
{
std::stringstream ss;
printMnemonic(ss);
}
std::string
-RegRegImmOp::generateDisassembly(Addr pc, const SymbolTable *symtab) const
+RegRegImmOp::generateDisassembly(
+ Addr pc, const Loader::SymbolTable *symtab) const
{
std::stringstream ss;
printMnemonic(ss);
}
std::string
-MiscRegRegImmOp::generateDisassembly(Addr pc, const SymbolTable *symtab) const
+MiscRegRegImmOp::generateDisassembly(
+ Addr pc, const Loader::SymbolTable *symtab) const
{
std::stringstream ss;
printMnemonic(ss);
}
std::string
-RegMiscRegImmOp::generateDisassembly(Addr pc, const SymbolTable *symtab) const
+RegMiscRegImmOp::generateDisassembly(
+ Addr pc, const Loader::SymbolTable *symtab) const
{
std::stringstream ss;
printMnemonic(ss);
}
std::string
-RegImmImmOp::generateDisassembly(Addr pc, const SymbolTable *symtab) const
+RegImmImmOp::generateDisassembly(
+ Addr pc, const Loader::SymbolTable *symtab) const
{
std::stringstream ss;
printMnemonic(ss);
}
std::string
-RegRegImmImmOp::generateDisassembly(Addr pc, const SymbolTable *symtab) const
+RegRegImmImmOp::generateDisassembly(
+ Addr pc, const Loader::SymbolTable *symtab) const
{
std::stringstream ss;
printMnemonic(ss);
}
std::string
-RegImmRegOp::generateDisassembly(Addr pc, const SymbolTable *symtab) const
+RegImmRegOp::generateDisassembly(
+ Addr pc, const Loader::SymbolTable *symtab) const
{
std::stringstream ss;
printMnemonic(ss);
}
std::string
-RegImmRegShiftOp::generateDisassembly(Addr pc, const SymbolTable *symtab) const
+RegImmRegShiftOp::generateDisassembly(
+ Addr pc, const Loader::SymbolTable *symtab) const
{
std::stringstream ss;
printMnemonic(ss);
}
std::string
-UnknownOp::generateDisassembly(Addr pc, const SymbolTable *symtab) const
+UnknownOp::generateDisassembly(
+ Addr pc, const Loader::SymbolTable *symtab) const
{
return csprintf("%-10s (inst %#08x)", "unknown", encoding());
}
}
std::string
-McrMrcMiscInst::generateDisassembly(Addr pc, const SymbolTable *symtab) const
+McrMrcMiscInst::generateDisassembly(
+ Addr pc, const Loader::SymbolTable *symtab) const
{
return csprintf("%-10s (pipe flush)", mnemonic);
}
}
std::string
-McrMrcImplDefined::generateDisassembly(Addr pc,
- const SymbolTable *symtab) const
+McrMrcImplDefined::generateDisassembly(
+ Addr pc, const Loader::SymbolTable *symtab) const
{
return csprintf("%-10s (implementation defined)", mnemonic);
}
{}
std::string generateDisassembly(
- Addr pc, const SymbolTable *symtab) const override;
+ Addr pc, const Loader::SymbolTable *symtab) const override;
};
class MsrBase : public PredOp
{}
std::string generateDisassembly(
- Addr pc, const SymbolTable *symtab) const override;
+ Addr pc, const Loader::SymbolTable *symtab) const override;
};
class MsrRegOp : public MsrBase
{}
std::string generateDisassembly(
- Addr pc, const SymbolTable *symtab) const override;
+ Addr pc, const Loader::SymbolTable *symtab) const override;
};
class MrrcOp : public PredOp
{}
std::string generateDisassembly(
- Addr pc, const SymbolTable *symtab) const override;
+ Addr pc, const Loader::SymbolTable *symtab) const override;
};
class McrrOp : public PredOp
{}
std::string generateDisassembly(
- Addr pc, const SymbolTable *symtab) const override;
+ Addr pc, const Loader::SymbolTable *symtab) const override;
};
class ImmOp : public PredOp
{}
std::string generateDisassembly(
- Addr pc, const SymbolTable *symtab) const override;
+ Addr pc, const Loader::SymbolTable *symtab) const override;
};
class RegImmOp : public PredOp
{}
std::string generateDisassembly(
- Addr pc, const SymbolTable *symtab) const override;
+ Addr pc, const Loader::SymbolTable *symtab) const override;
};
class RegRegOp : public PredOp
{}
std::string generateDisassembly(
- Addr pc, const SymbolTable *symtab) const override;
+ Addr pc, const Loader::SymbolTable *symtab) const override;
};
class RegOp : public PredOp
{}
std::string generateDisassembly(
- Addr pc, const SymbolTable *symtab) const override;
+ Addr pc, const Loader::SymbolTable *symtab) const override;
};
class RegImmRegOp : public PredOp
{}
std::string generateDisassembly(
- Addr pc, const SymbolTable *symtab) const override;
+ Addr pc, const Loader::SymbolTable *symtab) const override;
};
class RegRegRegImmOp : public PredOp
{}
std::string generateDisassembly(
- Addr pc, const SymbolTable *symtab) const override;
+ Addr pc, const Loader::SymbolTable *symtab) const override;
};
class RegRegRegRegOp : public PredOp
{}
std::string generateDisassembly(
- Addr pc, const SymbolTable *symtab) const override;
+ Addr pc, const Loader::SymbolTable *symtab) const override;
};
class RegRegRegOp : public PredOp
{}
std::string generateDisassembly(
- Addr pc, const SymbolTable *symtab) const override;
+ Addr pc, const Loader::SymbolTable *symtab) const override;
};
class RegRegImmOp : public PredOp
{}
std::string generateDisassembly(
- Addr pc, const SymbolTable *symtab) const override;
+ Addr pc, const Loader::SymbolTable *symtab) const override;
};
class MiscRegRegImmOp : public PredOp
{}
std::string generateDisassembly(
- Addr pc, const SymbolTable *symtab) const override;
+ Addr pc, const Loader::SymbolTable *symtab) const override;
};
class RegMiscRegImmOp : public PredOp
{}
std::string generateDisassembly(
- Addr pc, const SymbolTable *symtab) const override;
+ Addr pc, const Loader::SymbolTable *symtab) const override;
};
class RegImmImmOp : public PredOp
{}
std::string generateDisassembly(
- Addr pc, const SymbolTable *symtab) const override;
+ Addr pc, const Loader::SymbolTable *symtab) const override;
};
class RegRegImmImmOp : public PredOp
{}
std::string generateDisassembly(
- Addr pc, const SymbolTable *symtab) const override;
+ Addr pc, const Loader::SymbolTable *symtab) const override;
};
class RegImmRegShiftOp : public PredOp
{}
std::string generateDisassembly(
- Addr pc, const SymbolTable *symtab) const override;
+ Addr pc, const Loader::SymbolTable *symtab) const override;
};
class UnknownOp : public PredOp
{}
std::string generateDisassembly(
- Addr pc, const SymbolTable *symtab) const override;
+ Addr pc, const Loader::SymbolTable *symtab) const override;
};
/**
Trace::InstRecord *traceData) const override;
std::string generateDisassembly(
- Addr pc, const SymbolTable *symtab) const override;
+ Addr pc, const Loader::SymbolTable *symtab) const override;
};
Trace::InstRecord *traceData) const override;
std::string generateDisassembly(
- Addr pc, const SymbolTable *symtab) const override;
+ Addr pc, const Loader::SymbolTable *symtab) const override;
};
#include "arch/arm/isa.hh"
std::string
-ImmOp64::generateDisassembly(Addr pc, const SymbolTable *symtab) const
+ImmOp64::generateDisassembly(Addr pc, const Loader::SymbolTable *symtab) const
{
std::stringstream ss;
printMnemonic(ss, "", false);
}
std::string
-RegRegImmImmOp64::generateDisassembly(Addr pc, const SymbolTable *symtab) const
+RegRegImmImmOp64::generateDisassembly(
+ Addr pc, const Loader::SymbolTable *symtab) const
{
std::stringstream ss;
printMnemonic(ss, "", false);
std::string
RegRegRegImmOp64::generateDisassembly(
- Addr pc, const SymbolTable *symtab) const
+ Addr pc, const Loader::SymbolTable *symtab) const
{
std::stringstream ss;
printMnemonic(ss, "", false);
}
std::string
-UnknownOp64::generateDisassembly(Addr pc, const SymbolTable *symtab) const
+UnknownOp64::generateDisassembly(
+ Addr pc, const Loader::SymbolTable *symtab) const
{
return csprintf("%-10s (inst %#08x)", "unknown", encoding());
}
}
std::string
-MiscRegImmOp64::generateDisassembly(Addr pc, const SymbolTable *symtab) const
+MiscRegImmOp64::generateDisassembly(
+ Addr pc, const Loader::SymbolTable *symtab) const
{
std::stringstream ss;
printMnemonic(ss);
std::string
MiscRegRegImmOp64::generateDisassembly(
- Addr pc, const SymbolTable *symtab) const
+ Addr pc, const Loader::SymbolTable *symtab) const
{
std::stringstream ss;
printMnemonic(ss);
std::string
RegMiscRegImmOp64::generateDisassembly(
- Addr pc, const SymbolTable *symtab) const
+ Addr pc, const Loader::SymbolTable *symtab) const
{
std::stringstream ss;
printMnemonic(ss);
}
std::string
-MiscRegImplDefined64::generateDisassembly(Addr pc,
- const SymbolTable *symtab) const
+MiscRegImplDefined64::generateDisassembly(
+ Addr pc, const Loader::SymbolTable *symtab) const
{
return csprintf("%-10s (implementation defined)", fullMnemonic.c_str());
}
{}
std::string generateDisassembly(
- Addr pc, const SymbolTable *symtab) const override;
+ Addr pc, const Loader::SymbolTable *symtab) const override;
};
class RegRegImmImmOp64 : public ArmStaticInst
{}
std::string generateDisassembly(
- Addr pc, const SymbolTable *symtab) const override;
+ Addr pc, const Loader::SymbolTable *symtab) const override;
};
class RegRegRegImmOp64 : public ArmStaticInst
{}
std::string generateDisassembly(
- Addr pc, const SymbolTable *symtab) const override;
+ Addr pc, const Loader::SymbolTable *symtab) const override;
};
class UnknownOp64 : public ArmStaticInst
{}
std::string generateDisassembly(
- Addr pc, const SymbolTable *symtab) const override;
+ Addr pc, const Loader::SymbolTable *symtab) const override;
};
/**
RegVal miscRegImm() const;
std::string generateDisassembly(
- Addr pc, const SymbolTable *symtab) const override;
+ Addr pc, const Loader::SymbolTable *symtab) const override;
};
class MiscRegRegImmOp64 : public MiscRegOp64
{}
std::string generateDisassembly(
- Addr pc, const SymbolTable *symtab) const override;
+ Addr pc, const Loader::SymbolTable *symtab) const override;
};
class RegMiscRegImmOp64 : public MiscRegOp64
{}
std::string generateDisassembly(
- Addr pc, const SymbolTable *symtab) const override;
+ Addr pc, const Loader::SymbolTable *symtab) const override;
};
class MiscRegImplDefined64 : public MiscRegOp64
Trace::InstRecord *traceData) const override;
std::string generateDisassembly(
- Addr pc, const SymbolTable *symtab) const override;
+ Addr pc, const Loader::SymbolTable *symtab) const override;
};
#endif
namespace ArmISA
{
std::string
-PredIntOp::generateDisassembly(Addr pc, const SymbolTable *symtab) const
+PredIntOp::generateDisassembly(
+ Addr pc, const Loader::SymbolTable *symtab) const
{
std::stringstream ss;
unsigned rotate = machInst.rotate * 2;
}
std::string
-PredImmOp::generateDisassembly(Addr pc, const SymbolTable *symtab) const
+PredImmOp::generateDisassembly(
+ Addr pc, const Loader::SymbolTable *symtab) const
{
std::stringstream ss;
printDataInst(ss, true, machInst.opcode4 == 0, machInst.sField,
}
std::string
-DataImmOp::generateDisassembly(Addr pc, const SymbolTable *symtab) const
+DataImmOp::generateDisassembly(
+ Addr pc, const Loader::SymbolTable *symtab) const
{
std::stringstream ss;
printDataInst(ss, true, false, /*XXX not really s*/ false, dest, op1,
}
std::string
-DataRegOp::generateDisassembly(Addr pc, const SymbolTable *symtab) const
+DataRegOp::generateDisassembly(
+ Addr pc, const Loader::SymbolTable *symtab) const
{
std::stringstream ss;
printDataInst(ss, false, true, /*XXX not really s*/ false, dest, op1,
}
std::string
-DataRegRegOp::generateDisassembly(Addr pc, const SymbolTable *symtab) const
+DataRegRegOp::generateDisassembly(
+ Addr pc, const Loader::SymbolTable *symtab) const
{
std::stringstream ss;
printDataInst(ss, false, false, /*XXX not really s*/ false, dest, op1,
}
std::string
-PredMacroOp::generateDisassembly(Addr pc, const SymbolTable *symtab) const
+PredMacroOp::generateDisassembly(
+ Addr pc, const Loader::SymbolTable *symtab) const
{
std::stringstream ss;
}
std::string generateDisassembly(
- Addr pc, const SymbolTable *symtab) const override;
+ Addr pc, const Loader::SymbolTable *symtab) const override;
};
/**
}
std::string generateDisassembly(
- Addr pc, const SymbolTable *symtab) const override;
+ Addr pc, const Loader::SymbolTable *symtab) const override;
};
class DataImmOp : public PredOp
{}
std::string generateDisassembly(
- Addr pc, const SymbolTable *symtab) const override;
+ Addr pc, const Loader::SymbolTable *symtab) const override;
};
class DataRegOp : public PredOp
{}
std::string generateDisassembly(
- Addr pc, const SymbolTable *symtab) const override;
+ Addr pc, const Loader::SymbolTable *symtab) const override;
};
class DataRegRegOp : public PredOp
{}
std::string generateDisassembly(
- Addr pc, const SymbolTable *symtab) const override;
+ Addr pc, const Loader::SymbolTable *symtab) const override;
};
/**
}
std::string generateDisassembly(
- Addr pc, const SymbolTable *symtab) const override;
+ Addr pc, const Loader::SymbolTable *symtab) const override;
};
/**
}
std::string
-DecoderFaultInst::generateDisassembly(Addr pc, const SymbolTable *symtab) const
+DecoderFaultInst::generateDisassembly(
+ Addr pc, const Loader::SymbolTable *symtab) const
{
return csprintf("gem5fault %s", faultName());
}
}
std::string
-FailUnimplemented::generateDisassembly(Addr pc, const SymbolTable *symtab) const
+FailUnimplemented::generateDisassembly(
+ Addr pc, const Loader::SymbolTable *symtab) const
{
return csprintf("%-10s (unimplemented)",
fullMnemonic.size() ? fullMnemonic.c_str() : mnemonic);
}
std::string
-WarnUnimplemented::generateDisassembly(Addr pc, const SymbolTable *symtab) const
+WarnUnimplemented::generateDisassembly(
+ Addr pc, const Loader::SymbolTable *symtab) const
{
return csprintf("%-10s (unimplemented)",
fullMnemonic.size() ? fullMnemonic.c_str() : mnemonic);
Trace::InstRecord *traceData) const override;
std::string generateDisassembly(
- Addr pc, const SymbolTable *symtab) const override;
+ Addr pc, const Loader::SymbolTable *symtab) const override;
};
/**
Trace::InstRecord *traceData) const override;
std::string generateDisassembly(
- Addr pc, const SymbolTable *symtab) const override;
+ Addr pc, const Loader::SymbolTable *symtab) const override;
};
/**
Trace::InstRecord *traceData) const override;
std::string generateDisassembly(
- Addr pc, const SymbolTable *symtab) const override;
+ Addr pc, const Loader::SymbolTable *symtab) const override;
};
/**
void
ArmStaticInst::printTarget(std::ostream &os, Addr target,
- const SymbolTable *symtab) const
+ const Loader::SymbolTable *symtab) const
{
Addr symbolAddr;
std::string symbol;
void
ArmStaticInst::printMemSymbol(std::ostream &os,
- const SymbolTable *symtab,
+ const Loader::SymbolTable *symtab,
const std::string &prefix,
const Addr addr,
const std::string &suffix) const
std::string
ArmStaticInst::generateDisassembly(Addr pc,
- const SymbolTable *symtab) const
+ const Loader::SymbolTable *symtab) const
{
std::stringstream ss;
printMnemonic(ss);
bool withCond64 = false,
ConditionCode cond64 = COND_UC) const;
void printTarget(std::ostream &os, Addr target,
- const SymbolTable *symtab) const;
+ const Loader::SymbolTable *symtab) const;
void printCondition(std::ostream &os, unsigned code,
bool noImplicit=false) const;
- void printMemSymbol(std::ostream &os, const SymbolTable *symtab,
+ void printMemSymbol(std::ostream &os, const Loader::SymbolTable *symtab,
const std::string &prefix, const Addr addr,
const std::string &suffix) const;
void printShiftOperand(std::ostream &os, IntRegIndex rm,
}
std::string generateDisassembly(
- Addr pc, const SymbolTable *symtab) const override;
+ Addr pc, const Loader::SymbolTable *symtab) const override;
static inline uint32_t
cpsrWriteByInstr(CPSR cpsr, uint32_t val, SCR scr, NSACR nsacr,
std::string
SvePredCountPredOp::generateDisassembly(Addr pc,
- const SymbolTable *symtab) const
+ const Loader::SymbolTable *symtab) const
{
std::stringstream ss;
printMnemonic(ss, "", false);
}
std::string
-SvePredCountOp::generateDisassembly(Addr pc, const SymbolTable *symtab) const
+SvePredCountOp::generateDisassembly(
+ Addr pc, const Loader::SymbolTable *symtab) const
{
std::stringstream ss;
printMnemonic(ss, "", false);
}
std::string
-SveIndexIIOp::generateDisassembly(Addr pc, const SymbolTable *symtab) const
+SveIndexIIOp::generateDisassembly(
+ Addr pc, const Loader::SymbolTable *symtab) const
{
std::stringstream ss;
printMnemonic(ss, "", false);
}
std::string
-SveIndexIROp::generateDisassembly(Addr pc, const SymbolTable *symtab) const
+SveIndexIROp::generateDisassembly(
+ Addr pc, const Loader::SymbolTable *symtab) const
{
std::stringstream ss;
printMnemonic(ss, "", false);
}
std::string
-SveIndexRIOp::generateDisassembly(Addr pc, const SymbolTable *symtab) const
+SveIndexRIOp::generateDisassembly(
+ Addr pc, const Loader::SymbolTable *symtab) const
{
std::stringstream ss;
printMnemonic(ss, "", false);
}
std::string
-SveIndexRROp::generateDisassembly(Addr pc, const SymbolTable *symtab) const
+SveIndexRROp::generateDisassembly(
+ Addr pc, const Loader::SymbolTable *symtab) const
{
std::stringstream ss;
printMnemonic(ss, "", false);
}
std::string
-SveWhileOp::generateDisassembly(Addr pc, const SymbolTable *symtab) const
+SveWhileOp::generateDisassembly(
+ Addr pc, const Loader::SymbolTable *symtab) const
{
std::stringstream ss;
printMnemonic(ss, "", false);
}
std::string
-SveCompTermOp::generateDisassembly(Addr pc, const SymbolTable *symtab) const
+SveCompTermOp::generateDisassembly(
+ Addr pc, const Loader::SymbolTable *symtab) const
{
std::stringstream ss;
printMnemonic(ss, "", false);
}
std::string
-SveUnaryPredOp::generateDisassembly(Addr pc, const SymbolTable *symtab) const
+SveUnaryPredOp::generateDisassembly(
+ Addr pc, const Loader::SymbolTable *symtab) const
{
std::stringstream ss;
printMnemonic(ss, "", false);
}
std::string
-SveUnaryUnpredOp::generateDisassembly(Addr pc, const SymbolTable *symtab) const
+SveUnaryUnpredOp::generateDisassembly(
+ Addr pc, const Loader::SymbolTable *symtab) const
{
std::stringstream ss;
printMnemonic(ss, "", false);
}
std::string
-SveUnaryWideImmUnpredOp::generateDisassembly(Addr pc,
- const SymbolTable *symtab) const
+SveUnaryWideImmUnpredOp::generateDisassembly(
+ Addr pc, const Loader::SymbolTable *symtab) const
{
std::stringstream ss;
printMnemonic(ss, "", false);
}
std::string
-SveUnaryWideImmPredOp::generateDisassembly(Addr pc,
- const SymbolTable *symtab) const
+SveUnaryWideImmPredOp::generateDisassembly(
+ Addr pc, const Loader::SymbolTable *symtab) const
{
std::stringstream ss;
printMnemonic(ss, "", false);
}
std::string
-SveBinImmUnpredConstrOp::generateDisassembly(Addr pc,
- const SymbolTable *symtab) const
+SveBinImmUnpredConstrOp::generateDisassembly(
+ Addr pc, const Loader::SymbolTable *symtab) const
{
std::stringstream ss;
printMnemonic(ss, "", false);
}
std::string
-SveBinImmPredOp::generateDisassembly(Addr pc, const SymbolTable *symtab) const
+SveBinImmPredOp::generateDisassembly(
+ Addr pc, const Loader::SymbolTable *symtab) const
{
std::stringstream ss;
printMnemonic(ss, "", false);
}
std::string
-SveBinWideImmUnpredOp::generateDisassembly(Addr pc,
- const SymbolTable *symtab) const
+SveBinWideImmUnpredOp::generateDisassembly(
+ Addr pc, const Loader::SymbolTable *symtab) const
{
std::stringstream ss;
printMnemonic(ss, "", false);
}
std::string
-SveBinDestrPredOp::generateDisassembly(Addr pc,
- const SymbolTable *symtab) const
+SveBinDestrPredOp::generateDisassembly(
+ Addr pc, const Loader::SymbolTable *symtab) const
{
std::stringstream ss;
printMnemonic(ss, "", false);
}
std::string
-SveBinConstrPredOp::generateDisassembly(Addr pc,
- const SymbolTable *symtab) const
+SveBinConstrPredOp::generateDisassembly(
+ Addr pc, const Loader::SymbolTable *symtab) const
{
std::stringstream ss;
printMnemonic(ss, "", false);
}
std::string
-SveBinUnpredOp::generateDisassembly(Addr pc, const SymbolTable *symtab) const
+SveBinUnpredOp::generateDisassembly(
+ Addr pc, const Loader::SymbolTable *symtab) const
{
std::stringstream ss;
printMnemonic(ss, "", false);
}
std::string
-SveBinIdxUnpredOp::generateDisassembly(Addr pc,
- const SymbolTable *symtab) const
+SveBinIdxUnpredOp::generateDisassembly(
+ Addr pc, const Loader::SymbolTable *symtab) const
{
std::stringstream ss;
printMnemonic(ss, "", false);
}
std::string
-SvePredLogicalOp::generateDisassembly(Addr pc, const SymbolTable *symtab) const
+SvePredLogicalOp::generateDisassembly(
+ Addr pc, const Loader::SymbolTable *symtab) const
{
std::stringstream ss;
printMnemonic(ss, "", false);
}
std::string
-SvePredBinPermOp::generateDisassembly(Addr pc, const SymbolTable *symtab) const
+SvePredBinPermOp::generateDisassembly(
+ Addr pc, const Loader::SymbolTable *symtab) const
{
std::stringstream ss;
printMnemonic(ss, "", false);
}
std::string
-SveCmpOp::generateDisassembly(Addr pc, const SymbolTable *symtab) const
+SveCmpOp::generateDisassembly(Addr pc, const Loader::SymbolTable *symtab) const
{
std::stringstream ss;
printMnemonic(ss, "", false);
}
std::string
-SveCmpImmOp::generateDisassembly(Addr pc, const SymbolTable *symtab) const
+SveCmpImmOp::generateDisassembly(
+ Addr pc, const Loader::SymbolTable *symtab) const
{
std::stringstream ss;
printMnemonic(ss, "", false);
}
std::string
-SveTerPredOp::generateDisassembly(Addr pc, const SymbolTable *symtab) const
+SveTerPredOp::generateDisassembly(
+ Addr pc, const Loader::SymbolTable *symtab) const
{
std::stringstream ss;
printMnemonic(ss, "", false);
}
std::string
-SveTerImmUnpredOp::generateDisassembly(Addr pc,
- const SymbolTable *symtab) const
+SveTerImmUnpredOp::generateDisassembly(
+ Addr pc, const Loader::SymbolTable *symtab) const
{
std::stringstream ss;
printMnemonic(ss, "", false);
}
std::string
-SveReducOp::generateDisassembly(Addr pc,
- const SymbolTable *symtab) const
+SveReducOp::generateDisassembly(
+ Addr pc, const Loader::SymbolTable *symtab) const
{
std::stringstream ss;
printMnemonic(ss, "", false);
}
std::string
-SveOrdReducOp::generateDisassembly(Addr pc,
- const SymbolTable *symtab) const
+SveOrdReducOp::generateDisassembly(
+ Addr pc, const Loader::SymbolTable *symtab) const
{
std::stringstream ss;
printMnemonic(ss, "", false);
}
std::string
-SvePtrueOp::generateDisassembly(Addr pc,
- const SymbolTable *symtab) const
+SvePtrueOp::generateDisassembly(
+ Addr pc, const Loader::SymbolTable *symtab) const
{
std::stringstream ss;
printMnemonic(ss, "", false);
}
std::string
-SveIntCmpOp::generateDisassembly(Addr pc,
- const SymbolTable *symtab) const
+SveIntCmpOp::generateDisassembly(
+ Addr pc, const Loader::SymbolTable *symtab) const
{
std::stringstream ss;
printMnemonic(ss, "", false);
}
std::string
-SveIntCmpImmOp::generateDisassembly(Addr pc,
- const SymbolTable *symtab) const
+SveIntCmpImmOp::generateDisassembly(
+ Addr pc, const Loader::SymbolTable *symtab) const
{
std::stringstream ss;
printMnemonic(ss, "", false);
}
std::string
-SveAdrOp::generateDisassembly(Addr pc, const SymbolTable *symtab) const
+SveAdrOp::generateDisassembly(Addr pc, const Loader::SymbolTable *symtab) const
{
std::stringstream ss;
printMnemonic(ss, "", false);
}
std::string
-SveElemCountOp::generateDisassembly(Addr pc,
- const SymbolTable *symtab) const
+SveElemCountOp::generateDisassembly(
+ Addr pc, const Loader::SymbolTable *symtab) const
{
static const char suffix[9] =
{'\0', 'b', 'h', '\0', 'w', '\0', '\0', '\0', 'd'};
}
std::string
-SvePartBrkOp::generateDisassembly(Addr pc,
- const SymbolTable *symtab) const
+SvePartBrkOp::generateDisassembly(
+ Addr pc, const Loader::SymbolTable *symtab) const
{
std::stringstream ss;
printMnemonic(ss, "", false);
}
std::string
-SvePartBrkPropOp::generateDisassembly(Addr pc,
- const SymbolTable *symtab) const
+SvePartBrkPropOp::generateDisassembly(
+ Addr pc, const Loader::SymbolTable *symtab) const
{
std::stringstream ss;
printMnemonic(ss, "", false);
}
std::string
-SveSelectOp::generateDisassembly(Addr pc,
- const SymbolTable *symtab) const
+SveSelectOp::generateDisassembly(
+ Addr pc, const Loader::SymbolTable *symtab) const
{
std::stringstream ss;
printMnemonic(ss, "", false);
}
std::string
-SveUnaryPredPredOp::generateDisassembly(Addr pc,
- const SymbolTable *symtab) const
+SveUnaryPredPredOp::generateDisassembly(
+ Addr pc, const Loader::SymbolTable *symtab) const
{
std::stringstream ss;
printMnemonic(ss, "", false);
}
std::string
-SveTblOp::generateDisassembly(Addr pc,
- const SymbolTable *symtab) const
+SveTblOp::generateDisassembly(Addr pc, const Loader::SymbolTable *symtab) const
{
std::stringstream ss;
printMnemonic(ss, "", false);
}
std::string
-SveUnpackOp::generateDisassembly(Addr pc,
- const SymbolTable *symtab) const
+SveUnpackOp::generateDisassembly(
+ Addr pc, const Loader::SymbolTable *symtab) const
{
std::stringstream ss;
printMnemonic(ss, "", false);
}
std::string
-SvePredTestOp::generateDisassembly(Addr pc,
- const SymbolTable *symtab) const
+SvePredTestOp::generateDisassembly(
+ Addr pc, const Loader::SymbolTable *symtab) const
{
std::stringstream ss;
printMnemonic(ss, "", false);
}
std::string
-SvePredUnaryWImplicitSrcOp::generateDisassembly(Addr pc,
- const SymbolTable *symtab) const
+SvePredUnaryWImplicitSrcOp::generateDisassembly(
+ Addr pc, const Loader::SymbolTable *symtab) const
{
std::stringstream ss;
printMnemonic(ss, "", false);
}
std::string
-SvePredUnaryWImplicitSrcPredOp::generateDisassembly(Addr pc,
- const SymbolTable *symtab) const
+SvePredUnaryWImplicitSrcPredOp::generateDisassembly(
+ Addr pc, const Loader::SymbolTable *symtab) const
{
std::stringstream ss;
printMnemonic(ss, "", false);
}
std::string
-SvePredUnaryWImplicitDstOp::generateDisassembly(Addr pc,
- const SymbolTable *symtab) const
+SvePredUnaryWImplicitDstOp::generateDisassembly(
+ Addr pc, const Loader::SymbolTable *symtab) const
{
std::stringstream ss;
printMnemonic(ss, "", false);
}
std::string
-SveWImplicitSrcDstOp::generateDisassembly(Addr pc,
- const SymbolTable *symtab) const
+SveWImplicitSrcDstOp::generateDisassembly(
+ Addr pc, const Loader::SymbolTable *symtab) const
{
std::stringstream ss;
printMnemonic(ss, "", false);
}
std::string
-SveBinImmUnpredDestrOp::generateDisassembly(Addr pc,
- const SymbolTable *symtab) const
+SveBinImmUnpredDestrOp::generateDisassembly(
+ Addr pc, const Loader::SymbolTable *symtab) const
{
std::stringstream ss;
printMnemonic(ss, "", false);
}
std::string
-SveBinImmIdxUnpredOp::generateDisassembly(Addr pc,
- const SymbolTable *symtab) const
+SveBinImmIdxUnpredOp::generateDisassembly(
+ Addr pc, const Loader::SymbolTable *symtab) const
{
std::stringstream ss;
printMnemonic(ss, "", false);
}
std::string
-SveUnarySca2VecUnpredOp::generateDisassembly(Addr pc,
- const SymbolTable *symtab) const
+SveUnarySca2VecUnpredOp::generateDisassembly(
+ Addr pc, const Loader::SymbolTable *symtab) const
{
std::stringstream ss;
printMnemonic(ss, "", false);
}
std::string
-SveDotProdIdxOp::generateDisassembly(Addr pc,
- const SymbolTable *symtab) const
+SveDotProdIdxOp::generateDisassembly(
+ Addr pc, const Loader::SymbolTable *symtab) const
{
std::stringstream ss;
printMnemonic(ss, "", false);
}
std::string
-SveDotProdOp::generateDisassembly(Addr pc,
- const SymbolTable *symtab) const
+SveDotProdOp::generateDisassembly(
+ Addr pc, const Loader::SymbolTable *symtab) const
{
std::stringstream ss;
printMnemonic(ss, "", false);
}
std::string
-SveComplexOp::generateDisassembly(Addr pc,
- const SymbolTable *symtab) const
+SveComplexOp::generateDisassembly(
+ Addr pc, const Loader::SymbolTable *symtab) const
{
std::stringstream ss;
printMnemonic(ss, "", false);
}
std::string
-SveComplexIdxOp::generateDisassembly(Addr pc,
- const SymbolTable *symtab) const
+SveComplexIdxOp::generateDisassembly(
+ Addr pc, const Loader::SymbolTable *symtab) const
{
std::stringstream ss;
printMnemonic(ss, "", false);
ArmStaticInst(mnem, _machInst, __opClass),
dest(_dest), imm1(_imm1), imm2(_imm2)
{}
- std::string generateDisassembly(Addr pc, const SymbolTable *symtab) const;
+ std::string generateDisassembly(
+ Addr pc, const Loader::SymbolTable *symtab) const;
};
class SveIndexIROp : public ArmStaticInst {
ArmStaticInst(mnem, _machInst, __opClass),
dest(_dest), imm1(_imm1), op2(_op2)
{}
- std::string generateDisassembly(Addr pc, const SymbolTable *symtab) const;
+ std::string generateDisassembly(
+ Addr pc, const Loader::SymbolTable *symtab) const;
};
class SveIndexRIOp : public ArmStaticInst {
ArmStaticInst(mnem, _machInst, __opClass),
dest(_dest), op1(_op1), imm2(_imm2)
{}
- std::string generateDisassembly(Addr pc, const SymbolTable *symtab) const;
+ std::string generateDisassembly(
+ Addr pc, const Loader::SymbolTable *symtab) const;
};
class SveIndexRROp : public ArmStaticInst {
ArmStaticInst(mnem, _machInst, __opClass),
dest(_dest), op1(_op1), op2(_op2)
{}
- std::string generateDisassembly(Addr pc, const SymbolTable *symtab) const;
+ std::string generateDisassembly(
+ Addr pc, const Loader::SymbolTable *symtab) const;
};
// Predicate count SVE instruction.
dest(_dest), gp(_gp),
srcIs32b(_srcIs32b), destIsVec(_destIsVec)
{}
- std::string generateDisassembly(Addr pc, const SymbolTable *symtab) const;
+ std::string generateDisassembly(
+ Addr pc, const Loader::SymbolTable *symtab) const;
};
// Predicate count SVE instruction (predicated).
ArmStaticInst(mnem, _machInst, __opClass),
dest(_dest), op1(_op1), gp(_gp)
{}
- std::string generateDisassembly(Addr pc, const SymbolTable *symtab) const;
+ std::string generateDisassembly(
+ Addr pc, const Loader::SymbolTable *symtab) const;
};
/// While predicate generation SVE instruction.
ArmStaticInst(mnem, _machInst, __opClass),
dest(_dest), op1(_op1), op2(_op2), srcIs32b(_srcIs32b)
{}
- std::string generateDisassembly(Addr pc, const SymbolTable *symtab) const;
+ std::string generateDisassembly(
+ Addr pc, const Loader::SymbolTable *symtab) const;
};
/// Compare and terminate loop SVE instruction.
ArmStaticInst(mnem, _machInst, __opClass),
op1(_op1), op2(_op2)
{}
- std::string generateDisassembly(Addr pc, const SymbolTable *symtab) const;
+ std::string generateDisassembly(
+ Addr pc, const Loader::SymbolTable *symtab) const;
};
/// Unary, constructive, predicated (merging) SVE instruction.
dest(_dest), op1(_op1), gp(_gp)
{}
- std::string generateDisassembly(Addr pc, const SymbolTable *symtab) const;
+ std::string generateDisassembly(
+ Addr pc, const Loader::SymbolTable *symtab) const;
};
/// Unary, constructive, unpredicated SVE instruction.
dest(_dest), op1(_op1)
{}
- std::string generateDisassembly(Addr pc, const SymbolTable *symtab) const;
+ std::string generateDisassembly(
+ Addr pc, const Loader::SymbolTable *symtab) const;
};
/// Unary with wide immediate, constructive, unpredicated SVE instruction.
dest(_dest), imm(_imm)
{}
- std::string generateDisassembly(Addr pc, const SymbolTable *symtab) const;
+ std::string generateDisassembly(
+ Addr pc, const Loader::SymbolTable *symtab) const;
};
/// Unary with wide immediate, constructive, predicated SVE instruction.
dest(_dest), imm(_imm), gp(_gp), isMerging(_isMerging)
{}
- std::string generateDisassembly(Addr pc, const SymbolTable *symtab) const;
+ std::string generateDisassembly(
+ Addr pc, const Loader::SymbolTable *symtab) const;
};
/// Binary with immediate, destructive, unpredicated SVE instruction.
dest(_dest), op1(_op1), imm(_imm)
{}
- std::string generateDisassembly(Addr pc, const SymbolTable *symtab) const;
+ std::string generateDisassembly(
+ Addr pc, const Loader::SymbolTable *symtab) const;
};
/// Binary with immediate, destructive, predicated (merging) SVE instruction.
dest(_dest), gp(_gp), imm(_imm)
{}
- std::string generateDisassembly(Addr pc, const SymbolTable *symtab) const;
+ std::string generateDisassembly(
+ Addr pc, const Loader::SymbolTable *symtab) const;
};
/// Binary with wide immediate, destructive, unpredicated SVE instruction.
dest(_dest), imm(_imm)
{}
- std::string generateDisassembly(Addr pc, const SymbolTable *symtab) const;
+ std::string generateDisassembly(
+ Addr pc, const Loader::SymbolTable *symtab) const;
};
/// Binary, destructive, predicated (merging) SVE instruction.
dest(_dest), op2(_op2), gp(_gp)
{}
- std::string generateDisassembly(Addr pc, const SymbolTable *symtab) const;
+ std::string generateDisassembly(
+ Addr pc, const Loader::SymbolTable *symtab) const;
};
/// Binary, constructive, predicated SVE instruction.
dest(_dest), op1(_op1), op2(_op2), gp(_gp), predType(_predType)
{}
- std::string generateDisassembly(Addr pc, const SymbolTable *symtab) const;
+ std::string generateDisassembly(
+ Addr pc, const Loader::SymbolTable *symtab) const;
};
/// Binary, unpredicated SVE instruction with indexed operand
dest(_dest), op1(_op1), op2(_op2)
{}
- std::string generateDisassembly(Addr pc, const SymbolTable *symtab) const;
+ std::string generateDisassembly(
+ Addr pc, const Loader::SymbolTable *symtab) const;
};
/// Binary, unpredicated SVE instruction
dest(_dest), op1(_op1), op2(_op2), index(_index)
{}
- std::string generateDisassembly(Addr pc, const SymbolTable *symtab) const;
+ std::string generateDisassembly(
+ Addr pc, const Loader::SymbolTable *symtab) const;
};
/// Predicate logical instruction.
dest(_dest), op1(_op1), op2(_op2), gp(_gp), isSel(_isSel)
{}
- std::string generateDisassembly(Addr pc, const SymbolTable *symtab) const;
+ std::string generateDisassembly(
+ Addr pc, const Loader::SymbolTable *symtab) const;
};
/// Predicate binary permute instruction.
dest(_dest), op1(_op1), op2(_op2)
{}
- std::string generateDisassembly(Addr pc, const SymbolTable *symtab) const;
+ std::string generateDisassembly(
+ Addr pc, const Loader::SymbolTable *symtab) const;
};
/// SVE compare instructions, predicated (zeroing).
dest(_dest), gp(_gp), op1(_op1), op2(_op2)
{}
- std::string generateDisassembly(Addr pc, const SymbolTable *symtab) const;
+ std::string generateDisassembly(
+ Addr pc, const Loader::SymbolTable *symtab) const;
};
/// SVE compare-with-immediate instructions, predicated (zeroing).
dest(_dest), gp(_gp), op1(_op1), imm(_imm)
{}
- std::string generateDisassembly(Addr pc, const SymbolTable *symtab) const;
+ std::string generateDisassembly(
+ Addr pc, const Loader::SymbolTable *symtab) const;
};
/// Ternary, destructive, predicated (merging) SVE instruction.
dest(_dest), op1(_op1), op2(_op2), gp(_gp)
{}
- std::string generateDisassembly(Addr pc, const SymbolTable *symtab) const;
+ std::string generateDisassembly(
+ Addr pc, const Loader::SymbolTable *symtab) const;
};
/// Ternary with immediate, destructive, unpredicated SVE instruction.
dest(_dest), op2(_op2), imm(_imm)
{}
- std::string generateDisassembly(Addr pc, const SymbolTable *symtab) const;
+ std::string generateDisassembly(
+ Addr pc, const Loader::SymbolTable *symtab) const;
};
/// SVE reductions.
dest(_dest), op1(_op1), gp(_gp)
{}
- std::string generateDisassembly(Addr pc, const SymbolTable *symtab) const;
+ std::string generateDisassembly(
+ Addr pc, const Loader::SymbolTable *symtab) const;
};
/// SVE ordered reductions.
dest(_dest), op1(_op1), gp(_gp)
{}
- std::string generateDisassembly(Addr pc, const SymbolTable *symtab) const;
+ std::string generateDisassembly(
+ Addr pc, const Loader::SymbolTable *symtab) const;
};
/// PTRUE, PTRUES.
dest(_dest), imm(_imm)
{}
- std::string generateDisassembly(Addr pc, const SymbolTable *symtab) const;
+ std::string generateDisassembly(
+ Addr pc, const Loader::SymbolTable *symtab) const;
};
/// Integer compare SVE instruction.
ArmStaticInst(mnem, _machInst, __opClass),
dest(_dest), op1(_op1), op2(_op2), gp(_gp), op2IsWide(_op2IsWide)
{}
- std::string generateDisassembly(Addr pc, const SymbolTable *symtab) const;
+ std::string generateDisassembly(
+ Addr pc, const Loader::SymbolTable *symtab) const;
};
/// Integer compare with immediate SVE instruction.
ArmStaticInst(mnem, _machInst, __opClass),
dest(_dest), op1(_op1), imm(_imm), gp(_gp)
{}
- std::string generateDisassembly(Addr pc, const SymbolTable *symtab) const;
+ std::string generateDisassembly(
+ Addr pc, const Loader::SymbolTable *symtab) const;
};
/// ADR.
dest(_dest), op1(_op1), op2(_op2), mult(_mult),
offsetFormat(_offsetFormat)
{}
- std::string generateDisassembly(Addr pc, const SymbolTable *symtab) const;
+ std::string generateDisassembly(
+ Addr pc, const Loader::SymbolTable *symtab) const;
};
/// Element count SVE instruction.
dest(_dest), pattern(_pattern), imm(_imm), dstIsVec(_dstIsVec),
dstIs32b(_dstIs32b)
{}
- std::string generateDisassembly(Addr pc, const SymbolTable *symtab) const;
+ std::string generateDisassembly(
+ Addr pc, const Loader::SymbolTable *symtab) const;
};
/// Partition break SVE instruction.
ArmStaticInst(mnem, _machInst, __opClass),
dest(_dest), gp(_gp), op1(_op1), isMerging(_isMerging)
{}
- std::string generateDisassembly(Addr pc, const SymbolTable *symtab) const;
+ std::string generateDisassembly(
+ Addr pc, const Loader::SymbolTable *symtab) const;
};
/// Partition break with propagation SVE instruction.
ArmStaticInst(mnem, _machInst, __opClass),
dest(_dest), op1(_op1), op2(_op2), gp(_gp)
{}
- std::string generateDisassembly(Addr pc, const SymbolTable *symtab) const;
+ std::string generateDisassembly(
+ Addr pc, const Loader::SymbolTable *symtab) const;
};
/// Scalar element select SVE instruction.
dest(_dest), op1(_op1), gp(_gp), conditional(_conditional),
scalar(_scalar), simdFp(_simdFp)
{}
- std::string generateDisassembly(Addr pc, const SymbolTable *symtab) const;
+ std::string generateDisassembly(
+ Addr pc, const Loader::SymbolTable *symtab) const;
};
/// SVE unary operation on predicate (predicated)
ArmStaticInst(mnem, _machInst, __opClass),
dest(_dest), op1(_op1), gp(_gp)
{}
- std::string generateDisassembly(Addr pc, const SymbolTable *symtab) const;
+ std::string generateDisassembly(
+ Addr pc, const Loader::SymbolTable *symtab) const;
};
/// SVE table lookup/permute using vector of element indices (TBL)
ArmStaticInst(mnem, _machInst, __opClass),
dest(_dest), op1(_op1), op2(_op2)
{}
- std::string generateDisassembly(Addr pc, const SymbolTable *symtab) const;
+ std::string generateDisassembly(
+ Addr pc, const Loader::SymbolTable *symtab) const;
};
/// SVE unpack and widen predicate
ArmStaticInst(mnem, _machInst, __opClass),
dest(_dest), op1(_op1)
{}
- std::string generateDisassembly(Addr pc, const SymbolTable *symtab) const;
+ std::string generateDisassembly(
+ Addr pc, const Loader::SymbolTable *symtab) const;
};
/// SVE predicate test
ArmStaticInst(mnem, _machInst, __opClass),
op1(_op1), gp(_gp)
{}
- std::string generateDisassembly(Addr pc, const SymbolTable *symtab) const;
+ std::string generateDisassembly(
+ Addr pc, const Loader::SymbolTable *symtab) const;
};
/// SVE unary predicate instructions with implicit source operand
ArmStaticInst(mnem, _machInst, __opClass),
dest(_dest)
{}
- std::string generateDisassembly(Addr pc, const SymbolTable *symtab) const;
+ std::string generateDisassembly(
+ Addr pc, const Loader::SymbolTable *symtab) const;
};
/// SVE unary predicate instructions, predicated, with implicit source operand
ArmStaticInst(mnem, _machInst, __opClass),
dest(_dest), gp(_gp)
{}
- std::string generateDisassembly(Addr pc, const SymbolTable *symtab) const;
+ std::string generateDisassembly(
+ Addr pc, const Loader::SymbolTable *symtab) const;
};
/// SVE unary predicate instructions with implicit destination operand
ArmStaticInst(mnem, _machInst, __opClass),
op1(_op1)
{}
- std::string generateDisassembly(Addr pc, const SymbolTable *symtab) const;
+ std::string generateDisassembly(
+ Addr pc, const Loader::SymbolTable *symtab) const;
};
/// SVE unary predicate instructions with implicit destination operand
OpClass __opClass) :
ArmStaticInst(mnem, _machInst, __opClass)
{}
- std::string generateDisassembly(Addr pc, const SymbolTable *symtab) const;
+ std::string generateDisassembly(
+ Addr pc, const Loader::SymbolTable *symtab) const;
};
/// SVE vector - immediate binary operation
ArmStaticInst(mnem, _machInst, __opClass),
dest(_dest), op1(_op1), imm(_imm)
{}
- std::string generateDisassembly(Addr pc, const SymbolTable *symtab) const;
+ std::string generateDisassembly(
+ Addr pc, const Loader::SymbolTable *symtab) const;
};
/// Binary with immediate index, destructive, unpredicated SVE instruction.
dest(_dest), op1(_op1), imm(_imm)
{}
- std::string generateDisassembly(Addr pc, const SymbolTable *symtab) const;
+ std::string generateDisassembly(
+ Addr pc, const Loader::SymbolTable *symtab) const;
};
/// Unary unpredicated scalar to vector instruction
dest(_dest), op1(_op1), simdFp(_simdFp)
{}
- std::string generateDisassembly(Addr pc, const SymbolTable *symtab) const;
+ std::string generateDisassembly(
+ Addr pc, const Loader::SymbolTable *symtab) const;
};
/// SVE dot product instruction (indexed)
dest(_dest), op1(_op1), op2(_op2), imm(_imm)
{}
- std::string generateDisassembly(Addr pc, const SymbolTable *symtab) const;
+ std::string generateDisassembly(
+ Addr pc, const Loader::SymbolTable *symtab) const;
};
/// SVE dot product instruction (vectors)
dest(_dest), op1(_op1), op2(_op2)
{}
- std::string generateDisassembly(Addr pc, const SymbolTable *symtab) const;
+ std::string generateDisassembly(
+ Addr pc, const Loader::SymbolTable *symtab) const;
};
/// SVE Complex Instructions (vectors)
dest(_dest), op1(_op1), op2(_op2), gp(_gp), rot(_rot)
{}
- std::string generateDisassembly(Addr pc, const SymbolTable *symtab) const;
+ std::string generateDisassembly(
+ Addr pc, const Loader::SymbolTable *symtab) const;
};
/// SVE Complex Instructions (indexed)
dest(_dest), op1(_op1), op2(_op2), rot(_rot), imm(_imm)
{}
- std::string generateDisassembly(Addr pc, const SymbolTable *symtab) const;
+ std::string generateDisassembly(
+ Addr pc, const Loader::SymbolTable *symtab) const;
};
}
std::string
- generateDisassembly(Addr pc, const SymbolTable *symtab) const
+ generateDisassembly(Addr pc, const Loader::SymbolTable *symtab) const
{
std::stringstream ss;
printMnemonic(ss, "", false);
}
std::string
- generateDisassembly(Addr pc, const SymbolTable *symtab) const
+ generateDisassembly(Addr pc, const Loader::SymbolTable *symtab) const
{
std::stringstream ss;
printMnemonic(ss, "", false);
}
std::string
- generateDisassembly(Addr pc, const SymbolTable *symtab) const
+ generateDisassembly(Addr pc, const Loader::SymbolTable *symtab) const
{
std::stringstream ss;
printMnemonic(ss, "", false);
}
std::string
- generateDisassembly(Addr pc, const SymbolTable *symtab) const
+ generateDisassembly(Addr pc, const Loader::SymbolTable *symtab) const
{
std::stringstream ss;
printMnemonic(ss, "", false);
}
std::string
- generateDisassembly(Addr pc, const SymbolTable *symtab) const
+ generateDisassembly(Addr pc, const Loader::SymbolTable *symtab) const
{
// TODO: add suffix to transfer and base registers
std::stringstream ss;
}
std::string
- generateDisassembly(Addr pc, const SymbolTable *symtab) const
+ generateDisassembly(Addr pc, const Loader::SymbolTable *symtab) const
{
// TODO: add suffix to transfer and base registers
std::stringstream ss;
{
std::string
-SveMemVecFillSpill::generateDisassembly(Addr pc,
- const SymbolTable *symtab) const
+SveMemVecFillSpill::generateDisassembly(
+ Addr pc, const Loader::SymbolTable *symtab) const
{
std::stringstream ss;
printMnemonic(ss, "", false);
}
std::string
-SveMemPredFillSpill::generateDisassembly(Addr pc,
- const SymbolTable *symtab) const
+SveMemPredFillSpill::generateDisassembly(
+ Addr pc, const Loader::SymbolTable *symtab) const
{
std::stringstream ss;
printMnemonic(ss, "", false);
}
std::string
-SveContigMemSS::generateDisassembly(Addr pc, const SymbolTable *symtab) const
+SveContigMemSS::generateDisassembly(
+ Addr pc, const Loader::SymbolTable *symtab) const
{
// TODO: add suffix to transfer register and scaling factor (LSL #<x>)
std::stringstream ss;
}
std::string
-SveContigMemSI::generateDisassembly(Addr pc, const SymbolTable *symtab) const
+SveContigMemSI::generateDisassembly(
+ Addr pc, const Loader::SymbolTable *symtab) const
{
// TODO: add suffix to transfer register
std::stringstream ss;
baseIsSP = isSP(_base);
}
- std::string generateDisassembly(Addr pc, const SymbolTable *symtab) const;
+ std::string generateDisassembly(
+ Addr pc, const Loader::SymbolTable *symtab) const;
};
class SveMemPredFillSpill : public ArmStaticInst
baseIsSP = isSP(_base);
}
- std::string generateDisassembly(Addr pc, const SymbolTable *symtab) const;
+ std::string generateDisassembly(
+ Addr pc, const Loader::SymbolTable *symtab) const;
};
class SveContigMemSS : public ArmStaticInst
baseIsSP = isSP(_base);
}
- std::string generateDisassembly(Addr pc, const SymbolTable *symtab) const;
+ std::string generateDisassembly(
+ Addr pc, const Loader::SymbolTable *symtab) const;
};
class SveContigMemSI : public ArmStaticInst
baseIsSP = isSP(_base);
}
- std::string generateDisassembly(Addr pc, const SymbolTable *symtab) const;
+ std::string generateDisassembly(
+ Addr pc, const Loader::SymbolTable *symtab) const;
};
} // namespace ArmISA
std::string
FpCondCompRegOp::generateDisassembly(
- Addr pc, const SymbolTable *symtab) const
+ Addr pc, const Loader::SymbolTable *symtab) const
{
std::stringstream ss;
printMnemonic(ss, "", false);
std::string
FpCondSelOp::generateDisassembly(
- Addr pc, const SymbolTable *symtab) const
+ Addr pc, const Loader::SymbolTable *symtab) const
{
std::stringstream ss;
printMnemonic(ss, "", false);
}
std::string
-FpRegRegOp::generateDisassembly(Addr pc, const SymbolTable *symtab) const
+FpRegRegOp::generateDisassembly(
+ Addr pc, const Loader::SymbolTable *symtab) const
{
std::stringstream ss;
printMnemonic(ss);
}
std::string
-FpRegImmOp::generateDisassembly(Addr pc, const SymbolTable *symtab) const
+FpRegImmOp::generateDisassembly(
+ Addr pc, const Loader::SymbolTable *symtab) const
{
std::stringstream ss;
printMnemonic(ss);
}
std::string
-FpRegRegImmOp::generateDisassembly(Addr pc, const SymbolTable *symtab) const
+FpRegRegImmOp::generateDisassembly(
+ Addr pc, const Loader::SymbolTable *symtab) const
{
std::stringstream ss;
printMnemonic(ss);
}
std::string
-FpRegRegRegOp::generateDisassembly(Addr pc, const SymbolTable *symtab) const
+FpRegRegRegOp::generateDisassembly(
+ Addr pc, const Loader::SymbolTable *symtab) const
{
std::stringstream ss;
printMnemonic(ss);
}
std::string
-FpRegRegRegCondOp::generateDisassembly(Addr pc, const SymbolTable *symtab)
+FpRegRegRegCondOp::generateDisassembly(
+ Addr pc, const Loader::SymbolTable *symtab)
const
{
std::stringstream ss;
}
std::string
-FpRegRegRegRegOp::generateDisassembly(Addr pc, const SymbolTable *symtab) const
+FpRegRegRegRegOp::generateDisassembly(
+ Addr pc, const Loader::SymbolTable *symtab) const
{
std::stringstream ss;
printMnemonic(ss);
}
std::string
-FpRegRegRegImmOp::generateDisassembly(Addr pc, const SymbolTable *symtab) const
+FpRegRegRegImmOp::generateDisassembly(
+ Addr pc, const Loader::SymbolTable *symtab) const
{
std::stringstream ss;
printMnemonic(ss);
{}
std::string generateDisassembly(
- Addr pc, const SymbolTable *symtab) const override;
+ Addr pc, const Loader::SymbolTable *symtab) const override;
};
class FpCondSelOp : public FpOp
{}
std::string generateDisassembly(
- Addr pc, const SymbolTable *symtab) const override;
+ Addr pc, const Loader::SymbolTable *symtab) const override;
};
class FpRegRegOp : public FpOp
}
std::string generateDisassembly(
- Addr pc, const SymbolTable *symtab) const override;
+ Addr pc, const Loader::SymbolTable *symtab) const override;
};
class FpRegImmOp : public FpOp
}
std::string generateDisassembly(
- Addr pc, const SymbolTable *symtab) const override;
+ Addr pc, const Loader::SymbolTable *symtab) const override;
};
class FpRegRegImmOp : public FpOp
}
std::string generateDisassembly(
- Addr pc, const SymbolTable *symtab) const override;
+ Addr pc, const Loader::SymbolTable *symtab) const override;
};
class FpRegRegRegOp : public FpOp
}
std::string generateDisassembly(
- Addr pc, const SymbolTable *symtab) const override;
+ Addr pc, const Loader::SymbolTable *symtab) const override;
};
class FpRegRegRegCondOp : public FpOp
}
std::string generateDisassembly(
- Addr pc, const SymbolTable *symtab) const override;
+ Addr pc, const Loader::SymbolTable *symtab) const override;
};
class FpRegRegRegRegOp : public FpOp
}
std::string generateDisassembly(
- Addr pc, const SymbolTable *symtab) const override;
+ Addr pc, const Loader::SymbolTable *symtab) const override;
};
class FpRegRegRegImmOp : public FpOp
}
std::string generateDisassembly(
- Addr pc, const SymbolTable *symtab) const override;
+ Addr pc, const Loader::SymbolTable *symtab) const override;
};
}
}
std::string
- generateDisassembly(Addr pc, const SymbolTable *symtab) const
+ generateDisassembly(Addr pc, const Loader::SymbolTable *symtab) const
{
// TODO: add suffix to transfer register
std::stringstream ss;
}
std::string
- generateDisassembly(Addr pc, const SymbolTable *symtab) const
+ generateDisassembly(Addr pc, const Loader::SymbolTable *symtab) const
{
// TODO: add suffix to transfer and base registers
std::stringstream ss;
Fault execute(ExecContext *, Trace::InstRecord *) const;
std::string
- generateDisassembly(Addr pc, const SymbolTable *symtab) const
+ generateDisassembly(Addr pc, const Loader::SymbolTable *symtab) const
{
std::stringstream ss;
ccprintf(ss, "%s", macroOp->disassemble(pc, symtab));
Fault execute(ExecContext *, Trace::InstRecord *) const;
std::string
- generateDisassembly(Addr pc, const SymbolTable *symtab) const
+ generateDisassembly(Addr pc, const Loader::SymbolTable *symtab) const
{
std::stringstream ss;
ccprintf(ss, "%s", macroOp->disassemble(pc, symtab));
}
std::string
- generateDisassembly(Addr pc, const SymbolTable *symtab) const
+ generateDisassembly(Addr pc, const Loader::SymbolTable *symtab) const
{
std::stringstream ss;
printMnemonic(ss, "", false);
}
std::string
- generateDisassembly(Addr pc, const SymbolTable *symtab) const
+ generateDisassembly(Addr pc, const Loader::SymbolTable *symtab) const
{
std::stringstream ss;
printMnemonic(ss, "", false);
Fault execute(ExecContext *, Trace::InstRecord *) const;
std::string
- generateDisassembly(Addr pc, const SymbolTable *symtab) const
+ generateDisassembly(Addr pc, const Loader::SymbolTable *symtab) const
{
std::stringstream ss;
ccprintf(ss, "%s", macroOp->disassemble(pc, symtab));
Fault execute(ExecContext *, Trace::InstRecord *) const;
std::string
- generateDisassembly(Addr pc, const SymbolTable *symtab) const
+ generateDisassembly(Addr pc, const Loader::SymbolTable *symtab) const
{
std::stringstream ss;
ccprintf(ss, "%s", macroOp->disassemble(pc, symtab));
// it is helpful.
if (params()->early_kernel_symbols) {
kernelObj->loadGlobalSymbols(kernelSymtab, 0, 0, _loadAddrMask);
- kernelObj->loadGlobalSymbols(debugSymbolTable, 0, 0, _loadAddrMask);
+ kernelObj->loadGlobalSymbols(
+ Loader::debugSymbolTable, 0, 0, _loadAddrMask);
}
// Setup boot data structure
inform("Loading DTB file: %s at address %#x\n", params()->dtb_filename,
params()->atags_addr + _loadAddrOffset);
- DtbFile *dtb_file = new DtbFile(params()->dtb_filename);
+ auto *dtb_file = new ::Loader::DtbFile(params()->dtb_filename);
if (!dtb_file->addBootCmdLine(
commandLine.c_str(), commandLine.size())) {
FsWorkload::startup();
if (enableContextSwitchStatsDump) {
- if (getArch() == ObjectFile::Arm64)
+ if (getArch() == Loader::Arm64)
dumpStats = addKernelFuncEvent<DumpStats64>("__switch_to");
else
dumpStats = addKernelFuncEvent<DumpStats>("__switch_to");
"__const_udelay", "__const_udelay", 1000, 107374);
}
- if (getArch() == ObjectFile::Arm64) {
+ if (getArch() == Loader::Arm64) {
debugPrintk = addKernelFuncEvent<
DebugPrintk<SkipFuncLinux64>>("dprintk");
} else {
{
public:
Process *
- load(ProcessParams *params, ObjectFile *obj_file) override
+ load(ProcessParams *params, ::Loader::ObjectFile *obj_file) override
{
auto arch = obj_file->getArch();
auto opsys = obj_file->getOpSys();
- if (arch != ObjectFile::Arm && arch != ObjectFile::Thumb &&
- arch != ObjectFile::Arm64) {
+ if (arch != ::Loader::Arm && arch != ::Loader::Thumb &&
+ arch != ::Loader::Arm64) {
return nullptr;
}
- if (opsys == ObjectFile::UnknownOpSys) {
+ if (opsys == ::Loader::UnknownOpSys) {
warn("Unknown operating system; assuming Linux.");
- opsys = ObjectFile::Linux;
+ opsys = ::Loader::Linux;
}
- if (opsys == ObjectFile::LinuxArmOABI) {
+ if (opsys == ::Loader::LinuxArmOABI) {
fatal("gem5 does not support ARM OABI binaries. Please recompile "
"with an EABI compiler.");
}
- if (opsys != ObjectFile::Linux)
+ if (opsys != ::Loader::Linux)
return nullptr;
- if (arch == ObjectFile::Arm64)
+ if (arch == ::Loader::Arm64)
return new ArmLinuxProcess64(params, obj_file, arch);
else
return new ArmLinuxProcess32(params, obj_file, arch);
};
ArmLinuxProcess32::ArmLinuxProcess32(ProcessParams * params,
- ObjectFile *objFile, ObjectFile::Arch _arch) :
+ ::Loader::ObjectFile *objFile, ::Loader::Arch _arch) :
ArmProcess32(params, objFile, _arch)
{}
ArmLinuxProcess64::ArmLinuxProcess64(ProcessParams * params,
- ObjectFile *objFile, ObjectFile::Arch _arch) :
+ ::Loader::ObjectFile *objFile, ::Loader::Arch _arch) :
ArmProcess64(params, objFile, _arch)
{}
class ArmLinuxProcess32 : public ArmProcess32, public ArmLinuxProcessBits
{
public:
- ArmLinuxProcess32(ProcessParams * params, ObjectFile *objFile,
- ObjectFile::Arch _arch);
+ ArmLinuxProcess32(ProcessParams * params, ::Loader::ObjectFile *objFile,
+ ::Loader::Arch _arch);
void initState() override;
class ArmLinuxProcess64 : public ArmProcess64, public ArmLinuxProcessBits
{
public:
- ArmLinuxProcess64(ProcessParams * params, ObjectFile *objFile,
- ObjectFile::Arch _arch);
+ ArmLinuxProcess64(ProcessParams * params, ::Loader::ObjectFile *objFile,
+ ::Loader::Arch _arch);
void initState() override;
void syscall(ThreadContext *tc, Fault *fault) override;
using namespace std;
using namespace ArmISA;
-ArmProcess::ArmProcess(ProcessParams *params, ObjectFile *objFile,
- ObjectFile::Arch _arch)
+ArmProcess::ArmProcess(ProcessParams *params, ::Loader::ObjectFile *objFile,
+ ::Loader::Arch _arch)
: Process(params,
new EmulationPageTable(params->name, params->pid, PageBytes),
objFile),
fatal_if(params->useArchPT, "Arch page tables not implemented.");
}
-ArmProcess32::ArmProcess32(ProcessParams *params, ObjectFile *objFile,
- ObjectFile::Arch _arch)
+ArmProcess32::ArmProcess32(ProcessParams *params,
+ ::Loader::ObjectFile *objFile, ::Loader::Arch _arch)
: ArmProcess(params, objFile, _arch)
{
Addr brk_point = roundUp(image.maxAddr(), PageBytes);
mmap_end);
}
-ArmProcess64::ArmProcess64(ProcessParams *params, ObjectFile *objFile,
- ObjectFile::Arch _arch)
+ArmProcess64::ArmProcess64(
+ ProcessParams *params, ::Loader::ObjectFile *objFile,
+ ::Loader::Arch _arch)
: ArmProcess(params, objFile, _arch)
{
Addr brk_point = roundUp(image.maxAddr(), PageBytes);
//Setup the auxilliary vectors. These will already have endian conversion.
//Auxilliary vectors are loaded only for elf formatted executables.
- ElfObject * elfObject = dynamic_cast<ElfObject *>(objFile);
+ auto *elfObject = dynamic_cast<::Loader::ElfObject *>(objFile);
if (elfObject) {
- if (objFile->getOpSys() == ObjectFile::Linux) {
+ if (objFile->getOpSys() == ::Loader::Linux) {
IntType features = armHwcap<IntType>();
//Bits which describe the system hardware capabilities
}
PCState pc;
- pc.thumb(arch == ObjectFile::Thumb);
+ pc.thumb(arch == ::Loader::Thumb);
pc.nextThumb(pc.thumb());
- pc.aarch64(arch == ObjectFile::Arm64);
+ pc.aarch64(arch == ::Loader::Arm64);
pc.nextAArch64(pc.aarch64());
pc.set(getStartPC() & ~mask(1));
tc->pcState(pc);
#include "sim/process.hh"
#include "sim/syscall_abi.hh"
-class ObjectFile;
-
class ArmProcess : public Process
{
protected:
- ObjectFile::Arch arch;
- ArmProcess(ProcessParams * params, ObjectFile *objFile,
- ObjectFile::Arch _arch);
+ ::Loader::Arch arch;
+ ArmProcess(ProcessParams * params, ::Loader::ObjectFile *objFile,
+ ::Loader::Arch _arch);
template<class IntType>
void argsInit(int pageSize, ArmISA::IntRegIndex spIndex);
class ArmProcess32 : public ArmProcess
{
protected:
- ArmProcess32(ProcessParams * params, ObjectFile *objFile,
- ObjectFile::Arch _arch);
+ ArmProcess32(ProcessParams * params, ::Loader::ObjectFile *objFile,
+ ::Loader::Arch _arch);
void initState() override;
class ArmProcess64 : public ArmProcess
{
protected:
- ArmProcess64(ProcessParams * params, ObjectFile *objFile,
- ObjectFile::Arch _arch);
+ ArmProcess64(ProcessParams * params, ::Loader::ObjectFile *objFile,
+ ::Loader::Arch _arch);
void initState() override;
readSymbol(ThreadContext *tc, const std::string name)
{
PortProxy &vp = tc->getVirtProxy();
- const SymbolTable *symtab = tc->getSystemPtr()->workload->symtab(tc);
+ const auto *symtab = tc->getSystemPtr()->workload->symtab(tc);
Addr addr;
if (!symtab->findAddress(name, addr))
workload->getEntry(), _resetAddr);
}
- bool wl_is_64 = (workload->getArch() == ObjectFile::Arm64);
+ bool wl_is_64 = (workload->getArch() == Loader::Arm64);
if (wl_is_64 != _highestELIs64) {
warn("Highest ARM exception-level set to AArch%d but the workload "
"is for AArch%d. Assuming you wanted these to match.",
void printReg(std::ostream &os, RegId reg) const;
std::string generateDisassembly(
- Addr pc, const SymbolTable *symtab) const override;
+ Addr pc, const Loader::SymbolTable *symtab) const override;
public:
void
//Ouputs to decoder.cc
output decoder {{
- void MipsStaticInst::printReg(std::ostream &os, RegId reg) const
+ void
+ MipsStaticInst::printReg(std::ostream &os, RegId reg) const
{
if (reg.isIntReg()) {
ccprintf(os, "r%d", reg.index());
- }
- else {
+ } else {
ccprintf(os, "f%d", reg.index());
}
}
- std::string MipsStaticInst::generateDisassembly(Addr pc, const SymbolTable *symtab) const
+ std::string
+ MipsStaticInst::generateDisassembly(
+ Addr pc, const Loader::SymbolTable *symtab) const
{
std::stringstream ss;
mutable Addr cachedPC;
/// Cached symbol table pointer from last disassembly
- mutable const SymbolTable *cachedSymtab;
+ mutable const Loader::SymbolTable *cachedSymtab;
/// Constructor
PCDependentDisassembly(const char *mnem, MachInst _machInst,
}
const std::string &
- disassemble(Addr pc, const SymbolTable *symtab) const;
+ disassemble(Addr pc, const Loader::SymbolTable *symtab) const;
};
/**
using StaticInst::branchTarget;
std::string generateDisassembly(
- Addr pc, const SymbolTable *symtab) const override;
+ Addr pc, const Loader::SymbolTable *symtab) const override;
};
/**
using StaticInst::branchTarget;
std::string generateDisassembly(
- Addr pc, const SymbolTable *symtab) const override;
+ Addr pc, const Loader::SymbolTable *symtab) const override;
};
}};
}
const std::string &
- PCDependentDisassembly::disassemble(Addr pc,
- const SymbolTable *symtab) const
+ PCDependentDisassembly::disassemble(
+ Addr pc, const Loader::SymbolTable *symtab) const
{
if (!cachedDisassembly ||
pc != cachedPC || symtab != cachedSymtab)
}
std::string
- Branch::generateDisassembly(Addr pc, const SymbolTable *symtab) const
+ Branch::generateDisassembly(
+ Addr pc, const Loader::SymbolTable *symtab) const
{
std::stringstream ss;
}
std::string
- Jump::generateDisassembly(Addr pc, const SymbolTable *symtab) const
+ Jump::generateDisassembly(Addr pc, const Loader::SymbolTable *symtab) const
{
std::stringstream ss;
//Outputs to decoder.hh
output header {{
-
- class CP0Control : public MipsStaticInst
- {
- protected:
-
- /// Constructor
- CP0Control(const char *mnem, MachInst _machInst, OpClass __opClass) :
- MipsStaticInst(mnem, _machInst, __opClass)
- {
- }
-
- std::string generateDisassembly(
- Addr pc, const SymbolTable *symtab) const override;
- };
- class CP0TLB : public MipsStaticInst
- {
- protected:
-
- /// Constructor
- CP0TLB(const char *mnem, MachInst _machInst, OpClass __opClass) :
- MipsStaticInst(mnem, _machInst, __opClass)
- {
- }
-
- std::string generateDisassembly(
- Addr pc, const SymbolTable *symtab) const override;
- };
-
-
- class CP1Control : public MipsStaticInst
- {
- protected:
-
- /// Constructor
- CP1Control(const char *mnem, MachInst _machInst, OpClass __opClass) :
- MipsStaticInst(mnem, _machInst, __opClass)
- {
- }
-
- std::string generateDisassembly(
- Addr pc, const SymbolTable *symtab) const override;
- };
-
+ class CP0Control : public MipsStaticInst
+ {
+ protected:
+ using MipsStaticInst::MipsStaticInst;
+
+ std::string generateDisassembly(
+ Addr pc, const Loader::SymbolTable *symtab) const override;
+ };
+ class CP0TLB : public MipsStaticInst
+ {
+ protected:
+ using MipsStaticInst::MipsStaticInst;
+
+ std::string generateDisassembly(
+ Addr pc, const Loader::SymbolTable *symtab) const override;
+ };
+
+
+ class CP1Control : public MipsStaticInst
+ {
+ protected:
+ using MipsStaticInst::MipsStaticInst;
+
+ std::string generateDisassembly(
+ Addr pc, const Loader::SymbolTable *symtab) const override;
+ };
}};
// Basic instruction class execute method template.
def template CP0Execute {{
- Fault %(class_name)s::execute(
- ExecContext *xc, Trace::InstRecord *traceData) const
- {
- Fault fault = NoFault;
- %(op_decl)s;
- %(op_rd)s;
-
- if (isCoprocessorEnabled(xc, 0)) {
- %(code)s;
-
- if(fault == NoFault)
- {
- %(op_wb)s;
- }
- } else {
- fault = std::make_shared<CoprocessorUnusableFault>(0);
- }
- return fault;
+ Fault %(class_name)s::execute(
+ ExecContext *xc, Trace::InstRecord *traceData) const
+ {
+ Fault fault = NoFault;
+ %(op_decl)s;
+ %(op_rd)s;
+
+ if (isCoprocessorEnabled(xc, 0)) {
+ %(code)s;
+
+ if(fault == NoFault)
+ {
+ %(op_wb)s;
+ }
+ } else {
+ fault = std::make_shared<CoprocessorUnusableFault>(0);
}
+ return fault;
+ }
}};
def template CP1Execute {{
- Fault %(class_name)s::execute(
- ExecContext *xc, Trace::InstRecord *traceData) const
- {
- Fault fault = NoFault;
- %(op_decl)s;
- %(op_rd)s;
-
- if (isCoprocessorEnabled(xc, 1)) {
- %(code)s;
- } else {
- fault = std::make_shared<CoprocessorUnusableFault>(1);
- }
+ Fault %(class_name)s::execute(
+ ExecContext *xc, Trace::InstRecord *traceData) const
+ {
+ Fault fault = NoFault;
+ %(op_decl)s;
+ %(op_rd)s;
+
+ if (isCoprocessorEnabled(xc, 1)) {
+ %(code)s;
+ } else {
+ fault = std::make_shared<CoprocessorUnusableFault>(1);
+ }
- if(fault == NoFault)
- {
- %(op_wb)s;
- }
- return fault;
+ if(fault == NoFault)
+ {
+ %(op_wb)s;
}
+ return fault;
+ }
}};
// Basic instruction class execute method template.
def template ControlTLBExecute {{
- Fault %(class_name)s::execute(
- ExecContext *xc, Trace::InstRecord *traceData) const
- {
- Fault fault = NoFault;
- %(op_decl)s;
- %(op_rd)s;
-
- if (FullSystem) {
- if (isCoprocessor0Enabled(xc)) {
- if(isMMUTLB(xc)){
- %(code)s;
- } else {
- fault = std::make_shared<ReservedInstructionFault>();
- }
+ Fault %(class_name)s::execute(
+ ExecContext *xc, Trace::InstRecord *traceData) const
+ {
+ Fault fault = NoFault;
+ %(op_decl)s;
+ %(op_rd)s;
+
+ if (FullSystem) {
+ if (isCoprocessor0Enabled(xc)) {
+ if(isMMUTLB(xc)){
+ %(code)s;
} else {
- fault = std::make_shared<CoprocessorUnusableFault>(0);
+ fault = std::make_shared<ReservedInstructionFault>();
}
- } else { // Syscall Emulation Mode - No TLB Instructions
- fault = std::make_shared<ReservedInstructionFault>();
+ } else {
+ fault = std::make_shared<CoprocessorUnusableFault>(0);
}
+ } else { // Syscall Emulation Mode - No TLB Instructions
+ fault = std::make_shared<ReservedInstructionFault>();
+ }
- if (fault == NoFault) {
- %(op_wb)s;
- }
- return fault;
+ if (fault == NoFault) {
+ %(op_wb)s;
}
+ return fault;
+ }
}};
//Outputs to decoder.cc
output decoder {{
- std::string CP0Control::generateDisassembly(Addr pc, const SymbolTable *symtab) const
- {
- std::stringstream ss;
- ccprintf(ss, "%-10s r%d, %d, %d", mnemonic, RT, RD, SEL);
- return ss.str();
- }
- std::string CP0TLB::generateDisassembly(Addr pc, const SymbolTable *symtab) const
- {
- std::stringstream ss;
- ccprintf(ss, "%-10s r%d, %d, %d", mnemonic, RT, RD, SEL);
- return ss.str();
- }
- std::string CP1Control::generateDisassembly(Addr pc, const SymbolTable *symtab) const
- {
- std::stringstream ss;
- ccprintf(ss, "%-10s r%d, f%d", mnemonic, RT, FS);
- return ss.str();
- }
-
+ std::string
+ CP0Control::generateDisassembly(
+ Addr pc, const Loader::SymbolTable *symtab) const
+ {
+ std::stringstream ss;
+ ccprintf(ss, "%-10s r%d, %d, %d", mnemonic, RT, RD, SEL);
+ return ss.str();
+ }
+ std::string
+ CP0TLB::generateDisassembly(
+ Addr pc, const Loader::SymbolTable *symtab) const
+ {
+ std::stringstream ss;
+ ccprintf(ss, "%-10s r%d, %d, %d", mnemonic, RT, RD, SEL);
+ return ss.str();
+ }
+ std::string
+ CP1Control::generateDisassembly(
+ Addr pc, const Loader::SymbolTable *symtab) const
+ {
+ std::stringstream ss;
+ ccprintf(ss, "%-10s r%d, f%d", mnemonic, RT, FS);
+ return ss.str();
+ }
}};
output header {{
//
output header {{
- /**
- * Base class for FP operations.
- */
- class FPOp : public MipsStaticInst
- {
- protected:
-
- /// Constructor
- FPOp(const char *mnem, MachInst _machInst, OpClass __opClass) : MipsStaticInst(mnem, _machInst, __opClass)
- {
- }
-
- //needs function to check for fpEnable or not
- };
-
- class FPCompareOp : public FPOp
- {
- protected:
- FPCompareOp(const char *mnem, MachInst _machInst, OpClass __opClass) : FPOp(mnem, _machInst, __opClass)
- {
- }
-
- std::string generateDisassembly(
- Addr pc, const SymbolTable *symtab) const override;
- };
+ /**
+ * Base class for FP operations.
+ */
+ class FPOp : public MipsStaticInst
+ {
+ protected:
+ using MipsStaticInst::MipsStaticInst;
+
+ //needs function to check for fpEnable or not
+ };
+
+ class FPCompareOp : public FPOp
+ {
+ protected:
+ using FPOp::FPOp;
+
+ std::string generateDisassembly(
+ Addr pc, const Loader::SymbolTable *symtab) const override;
+ };
}};
output decoder {{
- std::string FPCompareOp::generateDisassembly(Addr pc, const SymbolTable *symtab) const
- {
- std::stringstream ss;
+ std::string
+ FPCompareOp::generateDisassembly(
+ Addr pc, const Loader::SymbolTable *symtab) const
+ {
+ std::stringstream ss;
- ccprintf(ss, "%-10s ", mnemonic);
+ ccprintf(ss, "%-10s ", mnemonic);
- ccprintf(ss,"%d",CC);
+ ccprintf(ss,"%d",CC);
- if(_numSrcRegs > 0) {
- ss << ", ";
- printReg(ss, _srcRegIdx[0]);
- }
-
- if(_numSrcRegs > 1) {
- ss << ", ";
- printReg(ss, _srcRegIdx[1]);
- }
+ if (_numSrcRegs > 0) {
+ ss << ", ";
+ printReg(ss, _srcRegIdx[0]);
+ }
- return ss.str();
+ if (_numSrcRegs > 1) {
+ ss << ", ";
+ printReg(ss, _srcRegIdx[1]);
}
+
+ return ss.str();
+ }
}};
output header {{
- void fpResetCauseBits(ExecContext *cpu);
-
+ void fpResetCauseBits(ExecContext *cpu);
}};
output exec {{
- inline Fault checkFpEnableFault(ExecContext *xc)
- {
- //@TODO: Implement correct CP0 checks to see if the CP1
- // unit is enable or not
- if (!isCoprocessorEnabled(xc, 1))
- return std::make_shared<CoprocessorUnusableFault>(1);
-
- return NoFault;
- }
-
- //If any operand is Nan return the appropriate QNaN
- template <class T>
- bool
- fpNanOperands(FPOp *inst, ExecContext *xc, const T &src_type,
- Trace::InstRecord *traceData)
- {
- uint64_t mips_nan = 0;
- assert(sizeof(T) == 4);
-
- for (int i = 0; i < inst->numSrcRegs(); i++) {
- uint64_t src_bits = xc->readFloatRegOperandBits(inst, 0);
-
- if (isNan(&src_bits, 32) ) {
- mips_nan = MIPS32_QNAN;
- xc->setFloatRegOperandBits(inst, 0, mips_nan);
- if (traceData) { traceData->setData(mips_nan); }
- return true;
- }
+ inline Fault
+ checkFpEnableFault(ExecContext *xc)
+ {
+ //@TODO: Implement correct CP0 checks to see if the CP1
+ // unit is enable or not
+ if (!isCoprocessorEnabled(xc, 1))
+ return std::make_shared<CoprocessorUnusableFault>(1);
+
+ return NoFault;
+ }
+
+ //If any operand is Nan return the appropriate QNaN
+ template <class T>
+ bool
+ fpNanOperands(FPOp *inst, ExecContext *xc, const T &src_type,
+ Trace::InstRecord *traceData)
+ {
+ uint64_t mips_nan = 0;
+ assert(sizeof(T) == 4);
+
+ for (int i = 0; i < inst->numSrcRegs(); i++) {
+ uint64_t src_bits = xc->readFloatRegOperandBits(inst, 0);
+
+ if (isNan(&src_bits, 32) ) {
+ mips_nan = MIPS32_QNAN;
+ xc->setFloatRegOperandBits(inst, 0, mips_nan);
+ if (traceData) { traceData->setData(mips_nan); }
+ return true;
}
- return false;
}
+ return false;
+ }
- template <class T>
- bool
- fpInvalidOp(FPOp *inst, ExecContext *cpu, const T dest_val,
- Trace::InstRecord *traceData)
- {
- uint64_t mips_nan = 0;
- T src_op = dest_val;
- assert(sizeof(T) == 4);
+ template <class T>
+ bool
+ fpInvalidOp(FPOp *inst, ExecContext *cpu, const T dest_val,
+ Trace::InstRecord *traceData)
+ {
+ uint64_t mips_nan = 0;
+ T src_op = dest_val;
+ assert(sizeof(T) == 4);
- if (isNan(&src_op, 32)) {
- mips_nan = MIPS32_QNAN;
+ if (isNan(&src_op, 32)) {
+ mips_nan = MIPS32_QNAN;
- //Set value to QNAN
- cpu->setFloatRegOperandBits(inst, 0, mips_nan);
+ //Set value to QNAN
+ cpu->setFloatRegOperandBits(inst, 0, mips_nan);
- //Read FCSR from FloatRegFile
- uint32_t fcsr_bits =
- cpu->tcBase()->readFloatReg(FLOATREG_FCSR);
-
- uint32_t new_fcsr = genInvalidVector(fcsr_bits);
+ //Read FCSR from FloatRegFile
+ uint32_t fcsr_bits =
+ cpu->tcBase()->readFloatReg(FLOATREG_FCSR);
- //Write FCSR from FloatRegFile
- cpu->tcBase()->setFloatReg(FLOATREG_FCSR, new_fcsr);
+ uint32_t new_fcsr = genInvalidVector(fcsr_bits);
- if (traceData) { traceData->setData(mips_nan); }
- return true;
- }
+ //Write FCSR from FloatRegFile
+ cpu->tcBase()->setFloatReg(FLOATREG_FCSR, new_fcsr);
- return false;
+ if (traceData) { traceData->setData(mips_nan); }
+ return true;
}
- void
- fpResetCauseBits(ExecContext *cpu)
- {
- //Read FCSR from FloatRegFile
- uint32_t fcsr = cpu->tcBase()->readFloatReg(FLOATREG_FCSR);
+ return false;
+ }
- // TODO: Use utility function here
- fcsr = bits(fcsr, 31, 18) << 18 | bits(fcsr, 11, 0);
+ void
+ fpResetCauseBits(ExecContext *cpu)
+ {
+ //Read FCSR from FloatRegFile
+ uint32_t fcsr = cpu->tcBase()->readFloatReg(FLOATREG_FCSR);
- //Write FCSR from FloatRegFile
- cpu->tcBase()->setFloatReg(FLOATREG_FCSR, fcsr);
- }
+ // TODO: Use utility function here
+ fcsr = bits(fcsr, 31, 18) << 18 | bits(fcsr, 11, 0);
+
+ //Write FCSR from FloatRegFile
+ cpu->tcBase()->setFloatReg(FLOATREG_FCSR, fcsr);
+ }
}};
def template FloatingPointExecute {{
- Fault %(class_name)s::execute(
- ExecContext *xc, Trace::InstRecord *traceData) const
- {
- Fault fault = NoFault;
-
- %(fp_enable_check)s;
-
-
- //When is the right time to reset cause bits?
- //start of every instruction or every cycle?
- if (FullSystem)
- fpResetCauseBits(xc);
- %(op_decl)s;
- %(op_rd)s;
-
- //Check if any FP operand is a NaN value
- if (!fpNanOperands((FPOp*)this, xc, Fd, traceData)) {
- %(code)s;
-
- //Change this code for Full-System/Sycall Emulation
- //separation
- //----
- //Should Full System-Mode throw a fault here?
- //----
- //Check for IEEE 754 FP Exceptions
- //fault = fpNanOperands((FPOp*)this, xc, Fd, traceData);
- bool invalid_op = false;
- if (FullSystem) {
- invalid_op =
- fpInvalidOp((FPOp*)this, xc, Fd, traceData);
- }
- if (!invalid_op && fault == NoFault) {
- %(op_wb)s;
- }
- }
-
- return fault;
+ Fault %(class_name)s::execute(
+ ExecContext *xc, Trace::InstRecord *traceData) const
+ {
+ Fault fault = NoFault;
+
+ %(fp_enable_check)s;
+
+ //When is the right time to reset cause bits?
+ //start of every instruction or every cycle?
+ if (FullSystem)
+ fpResetCauseBits(xc);
+ %(op_decl)s;
+ %(op_rd)s;
+
+ //Check if any FP operand is a NaN value
+ if (!fpNanOperands((FPOp*)this, xc, Fd, traceData)) {
+ %(code)s;
+
+ //Change this code for Full-System/Sycall Emulation
+ //separation
+ //----
+ //Should Full System-Mode throw a fault here?
+ //----
+ //Check for IEEE 754 FP Exceptions
+ //fault = fpNanOperands((FPOp*)this, xc, Fd, traceData);
+ bool invalid_op = false;
+ if (FullSystem) {
+ invalid_op =
+ fpInvalidOp((FPOp*)this, xc, Fd, traceData);
+ }
+ if (!invalid_op && fault == NoFault) {
+ %(op_wb)s;
+ }
}
+
+ return fault;
+ }
}};
// Primary format for float point operate instructions:
def format FloatOp(code, *flags) {{
- iop = InstObjParams(name, Name, 'FPOp', code, flags)
- header_output = BasicDeclare.subst(iop)
- decoder_output = BasicConstructor.subst(iop)
- decode_block = BasicDecode.subst(iop)
- exec_output = FloatingPointExecute.subst(iop)
+ iop = InstObjParams(name, Name, 'FPOp', code, flags)
+ header_output = BasicDeclare.subst(iop)
+ decoder_output = BasicConstructor.subst(iop)
+ decode_block = BasicDecode.subst(iop)
+ exec_output = FloatingPointExecute.subst(iop)
}};
def format FloatCompareOp(cond_code, *flags) {{
}};
def format FloatAccOp(code, *flags) {{
- iop = InstObjParams(name, Name, 'FPOp', code, flags)
- header_output = BasicDeclare.subst(iop)
- decoder_output = BasicConstructor.subst(iop)
- decode_block = BasicDecode.subst(iop)
- exec_output = BasicExecute.subst(iop)
+ iop = InstObjParams(name, Name, 'FPOp', code, flags)
+ header_output = BasicDeclare.subst(iop)
+ decoder_output = BasicConstructor.subst(iop)
+ decode_block = BasicDecode.subst(iop)
+ exec_output = BasicExecute.subst(iop)
}};
// Primary format for float64 operate instructions:
def format Float64Op(code, *flags) {{
- iop = InstObjParams(name, Name, 'MipsStaticInst', code, flags)
- header_output = BasicDeclare.subst(iop)
- decoder_output = BasicConstructor.subst(iop)
- decode_block = BasicDecode.subst(iop)
- exec_output = BasicExecute.subst(iop)
+ iop = InstObjParams(name, Name, 'MipsStaticInst', code, flags)
+ header_output = BasicDeclare.subst(iop)
+ decoder_output = BasicConstructor.subst(iop)
+ decode_block = BasicDecode.subst(iop)
+ exec_output = BasicExecute.subst(iop)
}};
def format FloatPSCompareOp(cond_code1, cond_code2, *flags) {{
output header {{
#include <iostream>
using namespace std;
- /**
- * Base class for integer operations.
- */
- class IntOp : public MipsStaticInst
+ /**
+ * Base class for integer operations.
+ */
+ class IntOp : public MipsStaticInst
+ {
+ protected:
+ using MipsStaticInst::MipsStaticInst;
+
+ std::string generateDisassembly(
+ Addr pc, const Loader::SymbolTable *symtab) const override;
+ };
+
+
+ class HiLoOp: public IntOp
+ {
+ protected:
+ using IntOp::IntOp;
+
+ std::string generateDisassembly(
+ Addr pc, const Loader::SymbolTable *symtab) const override;
+ };
+
+ class HiLoRsSelOp: public HiLoOp
+ {
+ protected:
+ using HiLoOp::HiLoOp;
+
+ std::string generateDisassembly(
+ Addr pc, const Loader::SymbolTable *symtab) const override;
+ };
+
+ class HiLoRdSelOp: public HiLoOp
+ {
+ protected:
+ using HiLoOp::HiLoOp;
+
+ std::string generateDisassembly(
+ Addr pc, const Loader::SymbolTable *symtab) const override;
+ };
+
+ class HiLoRdSelValOp: public HiLoOp
+ {
+ protected:
+ using HiLoOp::HiLoOp;
+
+ std::string generateDisassembly(
+ Addr pc, const Loader::SymbolTable *symtab) const override;
+ };
+
+ class IntImmOp : public MipsStaticInst
+ {
+ protected:
+ int16_t imm;
+ int32_t sextImm;
+ uint32_t zextImm;
+
+ IntImmOp(const char *mnem, MachInst _machInst, OpClass __opClass) :
+ MipsStaticInst(mnem, _machInst, __opClass), imm(INTIMM),
+ sextImm(INTIMM), zextImm(0x0000FFFF & INTIMM)
{
- protected:
-
- /// Constructor
- IntOp(const char *mnem, MachInst _machInst, OpClass __opClass) :
- MipsStaticInst(mnem, _machInst, __opClass)
- {
- }
-
- std::string generateDisassembly(
- Addr pc, const SymbolTable *symtab) const override;
- };
-
-
- class HiLoOp: public IntOp
- {
- protected:
-
- /// Constructor
- HiLoOp(const char *mnem, MachInst _machInst, OpClass __opClass) :
- IntOp(mnem, _machInst, __opClass)
- {
- }
-
- std::string generateDisassembly(
- Addr pc, const SymbolTable *symtab) const override;
- };
-
- class HiLoRsSelOp: public HiLoOp
- {
- protected:
-
- /// Constructor
- HiLoRsSelOp(const char *mnem, MachInst _machInst, OpClass __opClass) :
- HiLoOp(mnem, _machInst, __opClass)
- {
- }
-
- std::string generateDisassembly(
- Addr pc, const SymbolTable *symtab) const override;
- };
-
- class HiLoRdSelOp: public HiLoOp
- {
- protected:
-
- /// Constructor
- HiLoRdSelOp(const char *mnem, MachInst _machInst, OpClass __opClass) :
- HiLoOp(mnem, _machInst, __opClass)
- {
- }
-
- std::string generateDisassembly(
- Addr pc, const SymbolTable *symtab) const override;
- };
-
- class HiLoRdSelValOp: public HiLoOp
- {
- protected:
-
- /// Constructor
- HiLoRdSelValOp(const char *mnem, MachInst _machInst, OpClass __opClass) :
- HiLoOp(mnem, _machInst, __opClass)
- {
- }
-
- std::string generateDisassembly(
- Addr pc, const SymbolTable *symtab) const override;
- };
+ // If Bit 15 is 1 then sign extend.
+ int32_t temp = sextImm & 0x00008000;
+ if (temp > 0 && strcmp(mnemonic,"lui") != 0) {
+ sextImm |= 0xFFFF0000;
+ }
+ }
- class IntImmOp : public MipsStaticInst
- {
- protected:
-
- int16_t imm;
- int32_t sextImm;
- uint32_t zextImm;
-
- /// Constructor
- IntImmOp(const char *mnem, MachInst _machInst, OpClass __opClass) :
- MipsStaticInst(mnem, _machInst, __opClass),imm(INTIMM),
- sextImm(INTIMM),zextImm(0x0000FFFF & INTIMM)
- {
- //If Bit 15 is 1 then Sign Extend
- int32_t temp = sextImm & 0x00008000;
- if (temp > 0 && strcmp(mnemonic,"lui") != 0) {
- sextImm |= 0xFFFF0000;
- }
- }
-
- std::string generateDisassembly(
- Addr pc, const SymbolTable *symtab) const override;
- };
+ std::string generateDisassembly(
+ Addr pc, const Loader::SymbolTable *symtab) const override;
+ };
}};
// HiLo instruction class execute method template.
def template HiLoExecute {{
- Fault %(class_name)s::execute(
- ExecContext *xc, Trace::InstRecord *traceData) const
- {
- Fault fault = NoFault;
-
- %(fp_enable_check)s;
- %(op_decl)s;
- %(op_rd)s;
- %(code)s;
-
- if(fault == NoFault)
- {
- %(op_wb)s;
- }
- return fault;
+ Fault
+ %(class_name)s::execute(
+ ExecContext *xc, Trace::InstRecord *traceData) const
+ {
+ Fault fault = NoFault;
+
+ %(fp_enable_check)s;
+ %(op_decl)s;
+ %(op_rd)s;
+ %(code)s;
+
+ if(fault == NoFault) {
+ %(op_wb)s;
}
+ return fault;
+ }
}};
// HiLoRsSel instruction class execute method template.
def template HiLoRsSelExecute {{
- Fault %(class_name)s::execute(
- ExecContext *xc, Trace::InstRecord *traceData) const
- {
- Fault fault = NoFault;
-
- %(op_decl)s;
-
- if( ACSRC > 0 && !isDspEnabled(xc) )
- {
- fault = std::make_shared<DspStateDisabledFault>();
- }
- else
- {
- %(op_rd)s;
- %(code)s;
- }
-
- if(fault == NoFault)
- {
- %(op_wb)s;
- }
- return fault;
+ Fault
+ %(class_name)s::execute(
+ ExecContext *xc, Trace::InstRecord *traceData) const
+ {
+ Fault fault = NoFault;
+
+ %(op_decl)s;
+
+ if (ACSRC > 0 && !isDspEnabled(xc)) {
+ fault = std::make_shared<DspStateDisabledFault>();
+ } else {
+ %(op_rd)s;
+ %(code)s;
+ }
+
+ if (fault == NoFault) {
+ %(op_wb)s;
}
+ return fault;
+ }
}};
// HiLoRdSel instruction class execute method template.
def template HiLoRdSelExecute {{
- Fault %(class_name)s::execute(
- ExecContext *xc, Trace::InstRecord *traceData) const
- {
- Fault fault = NoFault;
-
- %(op_decl)s;
-
- if( ACDST > 0 && !isDspEnabled(xc) )
- {
- fault = std::make_shared<DspStateDisabledFault>();
- }
- else
- {
- %(op_rd)s;
- %(code)s;
- }
-
- if(fault == NoFault)
- {
- %(op_wb)s;
- }
- return fault;
+ Fault
+ %(class_name)s::execute(
+ ExecContext *xc, Trace::InstRecord *traceData) const
+ {
+ Fault fault = NoFault;
+
+ %(op_decl)s;
+
+ if (ACDST > 0 && !isDspEnabled(xc)) {
+ fault = std::make_shared<DspStateDisabledFault>();
+ } else {
+ %(op_rd)s;
+ %(code)s;
+ }
+
+ if (fault == NoFault) {
+ %(op_wb)s;
}
+ return fault;
+ }
}};
//Outputs to decoder.cc
output decoder {{
- std::string IntOp::generateDisassembly(Addr pc, const SymbolTable *symtab) const
- {
- std::stringstream ss;
+ std::string
+ IntOp::generateDisassembly(
+ Addr pc, const Loader::SymbolTable *symtab) const
+ {
+ std::stringstream ss;
+
+ ccprintf(ss, "%-10s ", mnemonic);
+
+ // just print the first dest... if there's a second one,
+ // it's generally implicit
+ if (_numDestRegs > 0) {
+ printReg(ss, _destRegIdx[0]);
+ ss << ", ";
+ }
- ccprintf(ss, "%-10s ", mnemonic);
+ // just print the first two source regs... if there's
+ // a third one, it's a read-modify-write dest (Rc),
+ // e.g. for CMOVxx
+ if (_numSrcRegs > 0) {
+ printReg(ss, _srcRegIdx[0]);
+ }
- // just print the first dest... if there's a second one,
- // it's generally implicit
- if (_numDestRegs > 0) {
- printReg(ss, _destRegIdx[0]);
- ss << ", ";
- }
+ if (_numSrcRegs > 1) {
+ ss << ", ";
+ printReg(ss, _srcRegIdx[1]);
+ }
- // just print the first two source regs... if there's
- // a third one, it's a read-modify-write dest (Rc),
- // e.g. for CMOVxx
- if (_numSrcRegs > 0) {
- printReg(ss, _srcRegIdx[0]);
- }
+ return ss.str();
+ }
- if (_numSrcRegs > 1) {
- ss << ", ";
- printReg(ss, _srcRegIdx[1]);
- }
+ std::string
+ HiLoOp::generateDisassembly(
+ Addr pc, const Loader::SymbolTable *symtab) const
+ {
+ std::stringstream ss;
+
+ ccprintf(ss, "%-10s ", mnemonic);
- return ss.str();
+ // Destination Registers are implicit for HI/LO ops
+ if (_numSrcRegs > 0) {
+ printReg(ss, _srcRegIdx[0]);
}
- std::string HiLoOp::generateDisassembly(Addr pc, const SymbolTable *symtab) const
- {
- std::stringstream ss;
+ if (_numSrcRegs > 1) {
+ ss << ", ";
+ printReg(ss, _srcRegIdx[1]);
+ }
- ccprintf(ss, "%-10s ", mnemonic);
+ return ss.str();
+ }
- //Destination Registers are implicit for HI/LO ops
- if (_numSrcRegs > 0) {
- printReg(ss, _srcRegIdx[0]);
- }
+ std::string
+ HiLoRsSelOp::generateDisassembly(
+ Addr pc, const Loader::SymbolTable *symtab) const
+ {
+ std::stringstream ss;
- if (_numSrcRegs > 1) {
- ss << ", ";
- printReg(ss, _srcRegIdx[1]);
- }
+ ccprintf(ss, "%-10s ", mnemonic);
- return ss.str();
+ if (_numDestRegs > 0 && _destRegIdx[0].index() < 32) {
+ printReg(ss, _destRegIdx[0]);
+ } else if (_numSrcRegs > 0 && _srcRegIdx[0].index() < 32) {
+ printReg(ss, _srcRegIdx[0]);
}
- std::string HiLoRsSelOp::generateDisassembly(Addr pc, const SymbolTable *symtab) const
- {
- std::stringstream ss;
+ return ss.str();
+ }
- ccprintf(ss, "%-10s ", mnemonic);
+ std::string
+ HiLoRdSelOp::generateDisassembly(
+ Addr pc, const Loader::SymbolTable *symtab) const
+ {
+ std::stringstream ss;
- if (_numDestRegs > 0 && _destRegIdx[0].index() < 32) {
- printReg(ss, _destRegIdx[0]);
- } else if (_numSrcRegs > 0 && _srcRegIdx[0].index() < 32) {
- printReg(ss, _srcRegIdx[0]);
- }
+ ccprintf(ss, "%-10s ", mnemonic);
- return ss.str();
+ if (_numDestRegs > 0 && _destRegIdx[0].index() < 32) {
+ printReg(ss, _destRegIdx[0]);
+ } else if (_numSrcRegs > 0 && _srcRegIdx[0].index() < 32) {
+ printReg(ss, _srcRegIdx[0]);
}
- std::string HiLoRdSelOp::generateDisassembly(Addr pc, const SymbolTable *symtab) const
- {
- std::stringstream ss;
+ return ss.str();
+ }
- ccprintf(ss, "%-10s ", mnemonic);
+ std::string
+ HiLoRdSelValOp::generateDisassembly(
+ Addr pc, const Loader::SymbolTable *symtab) const
+ {
+ std::stringstream ss;
- if (_numDestRegs > 0 && _destRegIdx[0].index() < 32) {
- printReg(ss, _destRegIdx[0]);
- } else if (_numSrcRegs > 0 && _srcRegIdx[0].index() < 32) {
- printReg(ss, _srcRegIdx[0]);
- }
+ ccprintf(ss, "%-10s ", mnemonic);
- return ss.str();
+ if (_numDestRegs > 0 && _destRegIdx[0].index() < 32) {
+ printReg(ss, _destRegIdx[0]);
+ } else if (_numSrcRegs > 0 && _srcRegIdx[0].index() < 32) {
+ printReg(ss, _srcRegIdx[0]);
}
- std::string HiLoRdSelValOp::generateDisassembly(Addr pc, const SymbolTable *symtab) const
- {
- std::stringstream ss;
+ return ss.str();
+ }
- ccprintf(ss, "%-10s ", mnemonic);
+ std::string
+ IntImmOp::generateDisassembly(
+ Addr pc, const Loader::SymbolTable *symtab) const
+ {
+ std::stringstream ss;
- if (_numDestRegs > 0 && _destRegIdx[0].index() < 32) {
- printReg(ss, _destRegIdx[0]);
- } else if (_numSrcRegs > 0 && _srcRegIdx[0].index() < 32) {
- printReg(ss, _srcRegIdx[0]);
- }
+ ccprintf(ss, "%-10s ", mnemonic);
- return ss.str();
+ if (_numDestRegs > 0) {
+ printReg(ss, _destRegIdx[0]);
}
- std::string IntImmOp::generateDisassembly(Addr pc, const SymbolTable *symtab) const
- {
- std::stringstream ss;
-
- ccprintf(ss, "%-10s ", mnemonic);
-
- if (_numDestRegs > 0) {
- printReg(ss, _destRegIdx[0]);
- }
+ ss << ", ";
+ if (_numSrcRegs > 0) {
+ printReg(ss, _srcRegIdx[0]);
ss << ", ";
+ }
- if (_numSrcRegs > 0) {
- printReg(ss, _srcRegIdx[0]);
- ss << ", ";
- }
-
- if(strcmp(mnemonic,"lui") == 0)
- ccprintf(ss, "0x%x ", sextImm);
- else
- ss << (int) sextImm;
+ if(strcmp(mnemonic,"lui") == 0)
+ ccprintf(ss, "0x%x ", sextImm);
+ else
+ ss << (int) sextImm;
- return ss.str();
- }
+ return ss.str();
+ }
}};
/// Displacement for EA calculation (signed).
int32_t disp;
- /// Constructor
Memory(const char *mnem, MachInst _machInst, OpClass __opClass)
: MipsStaticInst(mnem, _machInst, __opClass),
disp(sext<16>(OFFSET))
}
std::string generateDisassembly(
- Addr pc, const SymbolTable *symtab) const override;
+ Addr pc, const Loader::SymbolTable *symtab) const override;
};
/**
class MemoryNoDisp : public Memory
{
protected:
- /// Constructor
- MemoryNoDisp(const char *mnem, ExtMachInst _machInst, OpClass __opClass)
- : Memory(mnem, _machInst, __opClass)
- {
- }
+ using Memory::Memory;
std::string generateDisassembly(
- Addr pc, const SymbolTable *symtab) const override;
+ Addr pc, const Loader::SymbolTable *symtab) const override;
};
}};
output decoder {{
std::string
- Memory::generateDisassembly(Addr pc, const SymbolTable *symtab) const
+ Memory::generateDisassembly(
+ Addr pc, const Loader::SymbolTable *symtab) const
{
return csprintf("%-10s %c%d, %d(r%d)", mnemonic,
flags[IsFloating] ? 'f' : 'r', RT, disp, RS);
}
std::string
- MemoryNoDisp::generateDisassembly(Addr pc, const SymbolTable *symtab) const
+ MemoryNoDisp::generateDisassembly(
+ Addr pc, const Loader::SymbolTable *symtab) const
{
return csprintf("%-10s %c%d, r%d(r%d)", mnemonic,
flags[IsFloating] ? 'f' : 'r',
//
output header {{
- /**
- * Base class for MIPS MT ASE operations.
- */
- class MTOp : public MipsStaticInst
- {
- protected:
-
- /// Constructor
- MTOp(const char *mnem, MachInst _machInst, OpClass __opClass) :
- MipsStaticInst(mnem, _machInst, __opClass), user_mode(false)
- {
- }
+ /**
+ * Base class for MIPS MT ASE operations.
+ */
+ class MTOp : public MipsStaticInst
+ {
+ protected:
+ using MipsStaticInst::MipsStaticInst;
- std::string generateDisassembly(
- Addr pc, const SymbolTable *symtab) const override;
+ std::string generateDisassembly(
+ Addr pc, const Loader::SymbolTable *symtab) const override;
- bool user_mode;
- };
+ bool user_mode = false;
+ };
- class MTUserModeOp : public MTOp
+ class MTUserModeOp : public MTOp
+ {
+ protected:
+ MTUserModeOp(const char *mnem, MachInst _machInst, OpClass __opClass) :
+ MTOp(mnem, _machInst, __opClass)
{
- protected:
-
- /// Constructor
- MTUserModeOp(const char *mnem, MachInst _machInst, OpClass __opClass) :
- MTOp(mnem, _machInst, __opClass)
- {
- user_mode = true;
- }
- };
+ user_mode = true;
+ }
+ };
}};
output decoder {{
- std::string MTOp::generateDisassembly(Addr pc, const SymbolTable *symtab) const
+ std::string
+ MTOp::generateDisassembly(Addr pc, const Loader::SymbolTable *symtab) const
{
std::stringstream ss;
~Nop() { }
std::string generateDisassembly(
- Addr pc, const SymbolTable *symtab) const override;
+ Addr pc, const Loader::SymbolTable *symtab) const override;
Fault execute(ExecContext *, Trace::InstRecord *) const override;
};
}};
output decoder {{
- std::string Nop::generateDisassembly(Addr pc,
- const SymbolTable *symtab) const
+ std::string
+ Nop::generateDisassembly(Addr pc, const Loader::SymbolTable *symtab) const
{
return csprintf("%-10s %s", "nop", originalDisassembly);
}
//
output header {{
- /**
- * Base class for integer operations.
- */
- class TlbOp : public MipsStaticInst
- {
- protected:
+ /**
+ * Base class for integer operations.
+ */
+ class TlbOp : public MipsStaticInst
+ {
+ protected:
+ using MipsStaticInst::MipsStaticInst;
- /// Constructor
- TlbOp(const char *mnem, MachInst _machInst, OpClass __opClass) : MipsStaticInst(mnem, _machInst, __opClass)
- {
- }
-
- std::string generateDisassembly(
- Addr pc, const SymbolTable *symtab) const override;
- };
+ std::string generateDisassembly(
+ Addr pc, const Loader::SymbolTable *symtab) const override;
+ };
}};
output decoder {{
- std::string TlbOp::generateDisassembly(Addr pc, const SymbolTable *symtab) const
- {
- return "Disassembly of integer instruction\n";
- }
+ std::string
+ TlbOp::generateDisassembly(
+ Addr pc, const Loader::SymbolTable *symtab) const
+ {
+ return "Disassembly of integer instruction\n";
+ }
}};
def template TlbOpExecute {{
- Fault %(class_name)s::execute(
- ExecContext *xc, Trace::InstRecord *traceData) const
- {
- //Write the resulting state to the execution context
- %(op_wb)s;
+ Fault %(class_name)s::execute(
+ ExecContext *xc, Trace::InstRecord *traceData) const
+ {
+ //Write the resulting state to the execution context
+ %(op_wb)s;
- //Call into the trap handler with the appropriate fault
- return No_Fault;
- }
+ //Call into the trap handler with the appropriate fault
+ return No_Fault;
+ }
}};
// Primary format for integer operate instructions:
def format TlbOp(code, *opt_flags) {{
- orig_code = code
- cblk = code
- iop = InstObjParams(name, Name, 'MipsStaticInst', cblk, opt_flags)
- header_output = BasicDeclare.subst(iop)
- decoder_output = BasicConstructor.subst(iop)
- decode_block = BasicDecodeWithMnemonic.subst(iop)
- exec_output = TlbOpExecute.subst(iop)
+ orig_code = code
+ cblk = code
+ iop = InstObjParams(name, Name, 'MipsStaticInst', cblk, opt_flags)
+ header_output = BasicDeclare.subst(iop)
+ decoder_output = BasicConstructor.subst(iop)
+ decode_block = BasicDecodeWithMnemonic.subst(iop)
+ exec_output = TlbOpExecute.subst(iop)
}};
//
output header {{
- /**
- * Base class for integer operations.
- */
- class Trap : public MipsStaticInst
- {
- protected:
+ /**
+ * Base class for integer operations.
+ */
+ class Trap : public MipsStaticInst
+ {
+ protected:
+ using MipsStaticInst::MipsStaticInst;
- /// Constructor
- Trap(const char *mnem, MachInst _machInst, OpClass __opClass) : MipsStaticInst(mnem, _machInst, __opClass)
- {
- }
+ std::string generateDisassembly(
+ Addr pc, const Loader::SymbolTable *symtab) const override;
+ };
+ class TrapImm : public MipsStaticInst
+ {
+ protected:
+ int16_t imm;
- std::string generateDisassembly(
- Addr pc, const SymbolTable *symtab) const override;
- };
- class TrapImm : public MipsStaticInst
- {
- protected:
-
- int16_t imm;
-
- /// Constructor
- TrapImm(const char *mnem, MachInst _machInst, OpClass __opClass) :
- MipsStaticInst(mnem, _machInst, __opClass),imm(INTIMM)
- {
- }
-
- std::string generateDisassembly(
- Addr pc, const SymbolTable *symtab) const override;
- };
+ TrapImm(const char *mnem, MachInst _machInst, OpClass __opClass) :
+ MipsStaticInst(mnem, _machInst, __opClass), imm(INTIMM)
+ {}
+ std::string generateDisassembly(
+ Addr pc, const Loader::SymbolTable *symtab) const override;
+ };
}};
output decoder {{
- std::string Trap::generateDisassembly(Addr pc, const SymbolTable *symtab) const
- {
- return "Disassembly of trap instruction\n";
- }
- std::string TrapImm::generateDisassembly(Addr pc, const SymbolTable *symtab) const
- {
- return "Disassembly of trap instruction\n";
- }
+ std::string
+ Trap::generateDisassembly(
+ Addr pc, const Loader::SymbolTable *symtab) const
+ {
+ return "Disassembly of trap instruction\n";
+ }
+ std::string
+ TrapImm::generateDisassembly(
+ Addr pc, const Loader::SymbolTable *symtab) const
+ {
+ return "Disassembly of trap instruction\n";
+ }
}};
def template TrapExecute {{
- //Edit This Template When Traps Are Implemented
- Fault %(class_name)s::execute(
- ExecContext *xc, Trace::InstRecord *traceData) const
- {
- //Write the resulting state to the execution context
- %(op_wb)s;
+ // Edit This Template When Traps Are Implemented
+ Fault %(class_name)s::execute(
+ ExecContext *xc, Trace::InstRecord *traceData) const
+ {
+ //Write the resulting state to the execution context
+ %(op_wb)s;
- //Call into the trap handler with the appropriate fault
- return No_Fault;
- }
+ //Call into the trap handler with the appropriate fault
+ return No_Fault;
+ }
}};
def format Trap(code, *flags) {{
+ code ='bool cond;\n' + code
+ code += 'if (cond) {\n'
+ code += 'fault = std::make_shared<TrapFault>();\n};'
- code ='bool cond;\n' + code
- code += 'if (cond) {\n'
- code += 'fault = std::make_shared<TrapFault>();\n};'
-
- iop = InstObjParams(name, Name, 'MipsStaticInst', code, flags)
- header_output = BasicDeclare.subst(iop)
- decoder_output = BasicConstructor.subst(iop)
- decode_block = BasicDecode.subst(iop)
- exec_output = BasicExecute.subst(iop)
+ iop = InstObjParams(name, Name, 'MipsStaticInst', code, flags)
+ header_output = BasicDeclare.subst(iop)
+ decoder_output = BasicConstructor.subst(iop)
+ decode_block = BasicDecode.subst(iop)
+ exec_output = BasicExecute.subst(iop)
}};
def format TrapImm(code, *flags) {{
-
- code ='bool cond;\n' + code
- code += 'if (cond) {\n'
- code += 'fault = std::make_shared<TrapFault>();\n};'
- iop = InstObjParams(name, Name, 'MipsStaticInst', code, flags)
- header_output = BasicDeclare.subst(iop)
- decoder_output = BasicConstructor.subst(iop)
- decode_block = BasicDecode.subst(iop)
- exec_output = BasicExecute.subst(iop)
+ code ='bool cond;\n' + code
+ code += 'if (cond) {\n'
+ code += 'fault = std::make_shared<TrapFault>();\n};'
+ iop = InstObjParams(name, Name, 'MipsStaticInst', code, flags)
+ header_output = BasicDeclare.subst(iop)
+ decoder_output = BasicConstructor.subst(iop)
+ decode_block = BasicDecode.subst(iop)
+ exec_output = BasicExecute.subst(iop)
}};
Fault execute(ExecContext *, Trace::InstRecord *) const override;
std::string generateDisassembly(
- Addr pc, const SymbolTable *symtab) const override;
+ Addr pc, const Loader::SymbolTable *symtab) const override;
};
class CP0Unimplemented : public MipsStaticInst
{
Fault execute(ExecContext *, Trace::InstRecord *) const override;
std::string generateDisassembly(
- Addr pc, const SymbolTable *symtab) const override;
+ Addr pc, const Loader::SymbolTable *symtab) const override;
};
class CP1Unimplemented : public MipsStaticInst
{
Fault execute(ExecContext *, Trace::InstRecord *) const override;
std::string generateDisassembly(
- Addr pc, const SymbolTable *symtab) const override;
+ Addr pc, const Loader::SymbolTable *symtab) const override;
};
class CP2Unimplemented : public MipsStaticInst
{
Fault execute(ExecContext *, Trace::InstRecord *) const override;
std::string generateDisassembly(
- Addr pc, const SymbolTable *symtab) const override;
+ Addr pc, const Loader::SymbolTable *symtab) const override;
};
/**
Fault execute(ExecContext *, Trace::InstRecord *) const override;
std::string generateDisassembly(
- Addr pc, const SymbolTable *symtab) const override;
+ Addr pc, const Loader::SymbolTable *symtab) const override;
};
}};
output decoder {{
std::string
- FailUnimplemented::generateDisassembly(Addr pc,
- const SymbolTable *symtab) const
+ FailUnimplemented::generateDisassembly(
+ Addr pc, const Loader::SymbolTable *symtab) const
{
return csprintf("%-10s (unimplemented)", mnemonic);
}
std::string
- CP0Unimplemented::generateDisassembly(Addr pc,
- const SymbolTable *symtab) const
+ CP0Unimplemented::generateDisassembly(
+ Addr pc, const Loader::SymbolTable *symtab) const
{
return csprintf("%-10s (unimplemented)", mnemonic);
}
std::string
- CP1Unimplemented::generateDisassembly(Addr pc,
- const SymbolTable *symtab) const
+ CP1Unimplemented::generateDisassembly(
+ Addr pc, const Loader::SymbolTable *symtab) const
{
return csprintf("%-10s (unimplemented)", mnemonic);
}
std::string
- CP2Unimplemented::generateDisassembly(Addr pc,
- const SymbolTable *symtab) const
+ CP2Unimplemented::generateDisassembly(
+ Addr pc, const Loader::SymbolTable *symtab) const
{
return csprintf("%-10s (unimplemented)", mnemonic);
}
std::string
- WarnUnimplemented::generateDisassembly(Addr pc,
- const SymbolTable *symtab) const
+ WarnUnimplemented::generateDisassembly(
+ Addr pc, const Loader::SymbolTable *symtab) const
{
return csprintf("%-10s (unimplemented)", mnemonic);
}
Fault execute(ExecContext *, Trace::InstRecord *) const override;
std::string generateDisassembly(
- Addr pc, const SymbolTable *symtab) const override;
+ Addr pc, const Loader::SymbolTable *symtab) const override;
};
}};
output decoder {{
std::string
- Unknown::generateDisassembly(Addr pc, const SymbolTable *symtab) const
+ Unknown::generateDisassembly(
+ Addr pc, const Loader::SymbolTable *symtab) const
{
return csprintf("%-10s (inst 0x%x, opcode 0x%x, binary:%s)",
"unknown", machInst, OPCODE, inst2string(machInst));
{
public:
Process *
- load(ProcessParams *params, ObjectFile *obj_file) override
+ load(ProcessParams *params, ::Loader::ObjectFile *obj_file) override
{
- if (obj_file->getArch() != ObjectFile::Mips)
+ if (obj_file->getArch() != ::Loader::Mips)
return nullptr;
auto opsys = obj_file->getOpSys();
- if (opsys == ObjectFile::UnknownOpSys) {
+ if (opsys == ::Loader::UnknownOpSys) {
warn("Unknown operating system; assuming Linux.");
- opsys = ObjectFile::Linux;
+ opsys = ::Loader::Linux;
}
- if (opsys != ObjectFile::Linux)
+ if (opsys != ::Loader::Linux)
return nullptr;
return new MipsLinuxProcess(params, obj_file);
};
MipsLinuxProcess::MipsLinuxProcess(ProcessParams * params,
- ObjectFile *objFile) :
+ ::Loader::ObjectFile *objFile) :
MipsProcess(params, objFile)
{}
{
public:
/// Constructor.
- MipsLinuxProcess(ProcessParams * params, ObjectFile *objFile);
+ MipsLinuxProcess(ProcessParams * params, ::Loader::ObjectFile *objFile);
/// The target system's hostname.
static const char *hostname;
using namespace std;
using namespace MipsISA;
-MipsProcess::MipsProcess(ProcessParams *params, ObjectFile *objFile)
+MipsProcess::MipsProcess(ProcessParams *params, ::Loader::ObjectFile *objFile)
: Process(params,
new EmulationPageTable(params->name, params->pid, PageBytes),
objFile)
std::vector<AuxVector<IntType>> auxv;
- ElfObject * elfObject = dynamic_cast<ElfObject *>(objFile);
+ auto *elfObject = dynamic_cast<::Loader::ElfObject *>(objFile);
if (elfObject)
{
// Set the system page size
#include "sim/process.hh"
#include "sim/syscall_abi.hh"
+namespace Loader
+{
class ObjectFile;
+} // namespace Loader
class MipsProcess : public Process
{
protected:
- MipsProcess(ProcessParams * params, ObjectFile *objFile);
+ MipsProcess(ProcessParams * params, ::Loader::ObjectFile *objFile);
void initState();
using namespace PowerISA;
const std::string &
-PCDependentDisassembly::disassemble(Addr pc, const SymbolTable *symtab) const
+PCDependentDisassembly::disassemble(
+ Addr pc, const Loader::SymbolTable *symtab) const
{
if (!cachedDisassembly ||
pc != cachedPC || symtab != cachedSymtab)
}
std::string
-BranchPCRel::generateDisassembly(Addr pc, const SymbolTable *symtab) const
+BranchPCRel::generateDisassembly(
+ Addr pc, const Loader::SymbolTable *symtab) const
{
std::stringstream ss;
}
std::string
-BranchNonPCRel::generateDisassembly(Addr pc, const SymbolTable *symtab) const
+BranchNonPCRel::generateDisassembly(
+ Addr pc, const Loader::SymbolTable *symtab) const
{
std::stringstream ss;
}
std::string
-BranchPCRelCond::generateDisassembly(Addr pc, const SymbolTable *symtab) const
+BranchPCRelCond::generateDisassembly(
+ Addr pc, const Loader::SymbolTable *symtab) const
{
std::stringstream ss;
}
std::string
-BranchNonPCRelCond::generateDisassembly(Addr pc,
- const SymbolTable *symtab) const
+BranchNonPCRelCond::generateDisassembly(
+ Addr pc, const Loader::SymbolTable *symtab) const
{
std::stringstream ss;
}
std::string
-BranchRegCond::generateDisassembly(Addr pc,
- const SymbolTable *symtab) const
+BranchRegCond::generateDisassembly(
+ Addr pc, const Loader::SymbolTable *symtab) const
{
std::stringstream ss;
/// Cached program counter from last disassembly
mutable Addr cachedPC;
/// Cached symbol table pointer from last disassembly
- mutable const SymbolTable *cachedSymtab;
+ mutable const Loader::SymbolTable *cachedSymtab;
/// Constructor
PCDependentDisassembly(const char *mnem, ExtMachInst _machInst,
}
const std::string &
- disassemble(Addr pc, const SymbolTable *symtab) const;
+ disassemble(Addr pc, const Loader::SymbolTable *symtab) const;
};
/**
using StaticInst::branchTarget;
std::string generateDisassembly(
- Addr pc, const SymbolTable *symtab) const override;
+ Addr pc, const Loader::SymbolTable *symtab) const override;
};
/**
using StaticInst::branchTarget;
std::string generateDisassembly(
- Addr pc, const SymbolTable *symtab) const override;
+ Addr pc, const Loader::SymbolTable *symtab) const override;
};
/**
using StaticInst::branchTarget;
std::string generateDisassembly(
- Addr pc, const SymbolTable *symtab) const override;
+ Addr pc, const Loader::SymbolTable *symtab) const override;
};
/**
using StaticInst::branchTarget;
std::string generateDisassembly(
- Addr pc, const SymbolTable *symtab) const override;
+ Addr pc, const Loader::SymbolTable *symtab) const override;
};
/**
using StaticInst::branchTarget;
std::string generateDisassembly(
- Addr pc, const SymbolTable *symtab) const override;
+ Addr pc, const Loader::SymbolTable *symtab) const override;
};
} // namespace PowerISA
using namespace PowerISA;
std::string
-CondLogicOp::generateDisassembly(Addr pc, const SymbolTable *symtab) const
+CondLogicOp::generateDisassembly(
+ Addr pc, const Loader::SymbolTable *symtab) const
{
std::stringstream ss;
}
std::string
-CondMoveOp::generateDisassembly(Addr pc, const SymbolTable *symtab) const
+CondMoveOp::generateDisassembly(
+ Addr pc, const Loader::SymbolTable *symtab) const
{
std::stringstream ss;
}
std::string generateDisassembly(
- Addr pc, const SymbolTable *symtab) const override;
+ Addr pc, const Loader::SymbolTable *symtab) const override;
};
/**
}
std::string generateDisassembly(
- Addr pc, const SymbolTable *symtab) const override;
+ Addr pc, const Loader::SymbolTable *symtab) const override;
};
} // namespace PowerISA
using namespace PowerISA;
std::string
-FloatOp::generateDisassembly(Addr pc, const SymbolTable *symtab) const
+FloatOp::generateDisassembly(Addr pc, const Loader::SymbolTable *symtab) const
{
std::stringstream ss;
}
std::string generateDisassembly(
- Addr pc, const SymbolTable *symtab) const override;
+ Addr pc, const Loader::SymbolTable *symtab) const override;
};
} // namespace PowerISA
using namespace PowerISA;
string
-IntOp::generateDisassembly(Addr pc, const SymbolTable *symtab) const
+IntOp::generateDisassembly(Addr pc, const Loader::SymbolTable *symtab) const
{
stringstream ss;
bool printDest = true;
string
-IntImmOp::generateDisassembly(Addr pc, const SymbolTable *symtab) const
+IntImmOp::generateDisassembly(Addr pc, const Loader::SymbolTable *symtab) const
{
stringstream ss;
string
-IntShiftOp::generateDisassembly(Addr pc, const SymbolTable *symtab) const
+IntShiftOp::generateDisassembly(
+ Addr pc, const Loader::SymbolTable *symtab) const
{
stringstream ss;
string
-IntRotateOp::generateDisassembly(Addr pc, const SymbolTable *symtab) const
+IntRotateOp::generateDisassembly(
+ Addr pc, const Loader::SymbolTable *symtab) const
{
stringstream ss;
}
std::string generateDisassembly(
- Addr pc, const SymbolTable *symtab) const override;
+ Addr pc, const Loader::SymbolTable *symtab) const override;
};
}
std::string generateDisassembly(
- Addr pc, const SymbolTable *symtab) const override;
+ Addr pc, const Loader::SymbolTable *symtab) const override;
};
}
std::string generateDisassembly(
- Addr pc, const SymbolTable *symtab) const override;
+ Addr pc, const Loader::SymbolTable *symtab) const override;
};
}
std::string generateDisassembly(
- Addr pc, const SymbolTable *symtab) const override;
+ Addr pc, const Loader::SymbolTable *symtab) const override;
};
} // namespace PowerISA
using namespace PowerISA;
std::string
-MemOp::generateDisassembly(Addr pc, const SymbolTable *symtab) const
+MemOp::generateDisassembly(Addr pc, const Loader::SymbolTable *symtab) const
{
return csprintf("%-10s", mnemonic);
}
std::string
-MemDispOp::generateDisassembly(Addr pc, const SymbolTable *symtab) const
+MemDispOp::generateDisassembly(
+ Addr pc, const Loader::SymbolTable *symtab) const
{
std::stringstream ss;
}
std::string generateDisassembly(
- Addr pc, const SymbolTable *symtab) const override;
+ Addr pc, const Loader::SymbolTable *symtab) const override;
};
}
std::string generateDisassembly(
- Addr pc, const SymbolTable *symtab) const override;
+ Addr pc, const Loader::SymbolTable *symtab) const override;
};
} // namespace PowerISA
using namespace PowerISA;
std::string
-MiscOp::generateDisassembly(Addr pc, const SymbolTable *symtab) const
+MiscOp::generateDisassembly(Addr pc, const Loader::SymbolTable *symtab) const
{
std::stringstream ss;
class MiscOp : public PowerStaticInst
{
protected:
-
- /// Constructor
- MiscOp(const char *mnem, MachInst _machInst, OpClass __opClass)
- : PowerStaticInst(mnem, _machInst, __opClass)
- {
- }
+ using PowerStaticInst::PowerStaticInst;
std::string generateDisassembly(
- Addr pc, const SymbolTable *symtab) const override;
+ Addr pc, const Loader::SymbolTable *symtab) const override;
};
} // namespace PowerISA
}
std::string
-PowerStaticInst::generateDisassembly(Addr pc,
- const SymbolTable *symtab) const
+PowerStaticInst::generateDisassembly(
+ Addr pc, const Loader::SymbolTable *symtab) const
{
std::stringstream ss;
printReg(std::ostream &os, RegId reg) const;
std::string generateDisassembly(
- Addr pc, const SymbolTable *symtab) const override;
+ Addr pc, const Loader::SymbolTable *symtab) const override;
void
advancePC(PowerISA::PCState &pcState) const override
Fault execute(ExecContext *, Trace::InstRecord *) const override;
std::string generateDisassembly(
- Addr pc, const SymbolTable *symtab) const override;
+ Addr pc, const Loader::SymbolTable *symtab) const override;
};
/**
Fault execute(ExecContext *, Trace::InstRecord *) const override;
std::string generateDisassembly(
- Addr pc, const SymbolTable *symtab) const override;
+ Addr pc, const Loader::SymbolTable *symtab) const override;
};
}};
output decoder {{
std::string
- FailUnimplemented::generateDisassembly(Addr pc,
- const SymbolTable *symtab) const
+ FailUnimplemented::generateDisassembly(
+ Addr pc, const Loader::SymbolTable *symtab) const
{
return csprintf("%-10s (unimplemented)", mnemonic);
}
std::string
- WarnUnimplemented::generateDisassembly(Addr pc,
- const SymbolTable *symtab) const
+ WarnUnimplemented::generateDisassembly(
+ Addr pc, const Loader::SymbolTable *symtab) const
{
return csprintf("%-10s (unimplemented)", mnemonic);
}
Fault execute(ExecContext *, Trace::InstRecord *) const override;
std::string generateDisassembly(
- Addr pc, const SymbolTable *symtab) const override;
+ Addr pc, const Loader::SymbolTable *symtab) const override;
};
}};
output decoder {{
std::string
- Unknown::generateDisassembly(Addr pc, const SymbolTable *symtab) const
+ Unknown::generateDisassembly(
+ Addr pc, const Loader::SymbolTable *symtab) const
{
return csprintf("%-10s (inst 0x%x, opcode 0x%x, binary:%s)",
"unknown", machInst, OPCODE, inst2string(machInst));
{
public:
Process *
- load(ProcessParams *params, ObjectFile *obj_file) override
+ load(ProcessParams *params, ::Loader::ObjectFile *obj_file) override
{
- if (obj_file->getArch() != ObjectFile::Power)
+ if (obj_file->getArch() != ::Loader::Power)
return nullptr;
auto opsys = obj_file->getOpSys();
- if (opsys == ObjectFile::UnknownOpSys) {
+ if (opsys == ::Loader::UnknownOpSys) {
warn("Unknown operating system; assuming Linux.");
- opsys = ObjectFile::Linux;
+ opsys = ::Loader::Linux;
}
- if (opsys != ObjectFile::Linux)
+ if (opsys != ::Loader::Linux)
return nullptr;
return new PowerLinuxProcess(params, obj_file);
};
PowerLinuxProcess::PowerLinuxProcess(ProcessParams * params,
- ObjectFile *objFile) :
+ ::Loader::ObjectFile *objFile) :
PowerProcess(params, objFile)
{}
class PowerLinuxProcess : public PowerProcess
{
public:
- PowerLinuxProcess(ProcessParams * params, ObjectFile *objFile);
+ PowerLinuxProcess(ProcessParams * params, ::Loader::ObjectFile *objFile);
void initState() override;
using namespace std;
using namespace PowerISA;
-PowerProcess::PowerProcess(ProcessParams *params, ObjectFile *objFile)
+PowerProcess::PowerProcess(
+ ProcessParams *params, ::Loader::ObjectFile *objFile)
: Process(params,
new EmulationPageTable(params->name, params->pid, PageBytes),
objFile)
//Setup the auxilliary vectors. These will already have endian conversion.
//Auxilliary vectors are loaded only for elf formatted executables.
- ElfObject * elfObject = dynamic_cast<ElfObject *>(objFile);
+ auto *elfObject = dynamic_cast<::Loader::ElfObject *>(objFile);
if (elfObject) {
uint32_t features = 0;
#include "sim/process.hh"
#include "sim/syscall_abi.hh"
+namespace Loader
+{
class ObjectFile;
+} // namespace Loader;
class PowerProcess : public Process
{
protected:
- PowerProcess(ProcessParams * params, ObjectFile *objFile);
+ PowerProcess(ProcessParams * params, ::Loader::ObjectFile *objFile);
void initState() override;
{
BareMetal::BareMetal(Params *p) : RiscvISA::FsWorkload(p),
- bootloader(createObjectFile(p->bootloader)),
- bootloaderSymtab(new SymbolTable)
+ bootloader(Loader::createObjectFile(p->bootloader)),
+ bootloaderSymtab(new Loader::SymbolTable)
{
fatal_if(!bootloader, "Could not load bootloader file %s.", p->bootloader);
_resetVect = bootloader->entryPoint();
class BareMetal : public RiscvISA::FsWorkload
{
protected:
- ObjectFile *bootloader;
- SymbolTable *bootloaderSymtab;
+ Loader::ObjectFile *bootloader;
+ Loader::SymbolTable *bootloaderSymtab;
public:
typedef RiscvBareMetalParams Params;
void initState() override;
- ObjectFile::Arch
- getArch() const override
- {
- return bootloader->getArch();
- }
- const SymbolTable *
+ Loader::Arch getArch() const override { return bootloader->getArch(); }
+ const Loader::SymbolTable *
symtab(ThreadContext *tc) override
{
return bootloaderSymtab;
{
// memfence micro instruction
-string MemFenceMicro::generateDisassembly(Addr pc,
- const SymbolTable *symtab) const
+string
+MemFenceMicro::generateDisassembly(
+ Addr pc, const Loader::SymbolTable *symtab) const
{
stringstream ss;
ss << csprintf("0x%08x", machInst) << ' ' << mnemonic;
}
// load-reserved
-string LoadReserved::generateDisassembly(Addr pc,
- const SymbolTable *symtab) const
+string
+LoadReserved::generateDisassembly(
+ Addr pc, const Loader::SymbolTable *symtab) const
{
stringstream ss;
ss << mnemonic;
return ss.str();
}
-string LoadReservedMicro::generateDisassembly(Addr pc,
- const SymbolTable *symtab) const
+string
+LoadReservedMicro::generateDisassembly(
+ Addr pc, const Loader::SymbolTable *symtab) const
{
stringstream ss;
ss << mnemonic << ' ' << registerName(_destRegIdx[0]) << ", ("
}
// store-conditional
-string StoreCond::generateDisassembly(Addr pc,
- const SymbolTable *symtab) const
+string
+StoreCond::generateDisassembly(
+ Addr pc, const Loader::SymbolTable *symtab) const
{
stringstream ss;
ss << mnemonic;
return ss.str();
}
-string StoreCondMicro::generateDisassembly(Addr pc,
- const SymbolTable *symtab) const
+string
+StoreCondMicro::generateDisassembly(
+ Addr pc, const Loader::SymbolTable *symtab) const
{
stringstream ss;
ss << mnemonic << ' ' << registerName(_destRegIdx[0]) << ", "
}
// AMOs
-string AtomicMemOp::generateDisassembly(Addr pc,
- const SymbolTable *symtab) const
+string
+AtomicMemOp::generateDisassembly(
+ Addr pc, const Loader::SymbolTable *symtab) const
{
stringstream ss;
ss << mnemonic;
return ss.str();
}
-string AtomicMemOpMicro::generateDisassembly(Addr pc,
- const SymbolTable *symtab) const
+string
+AtomicMemOpMicro::generateDisassembly(
+ Addr pc, const Loader::SymbolTable *symtab) const
{
stringstream ss;
ss << mnemonic << ' ' << registerName(_destRegIdx[0]) << ", "
Fault execute(ExecContext *, Trace::InstRecord *) const override;
std::string generateDisassembly(
- Addr pc, const SymbolTable *symtab) const override;
+ Addr pc, const Loader::SymbolTable *symtab) const override;
};
// load-reserved
using RiscvMacroInst::RiscvMacroInst;
std::string generateDisassembly(
- Addr pc, const SymbolTable *symtab) const override;
+ Addr pc, const Loader::SymbolTable *symtab) const override;
};
class LoadReservedMicro : public RiscvMicroInst
using RiscvMicroInst::RiscvMicroInst;
std::string generateDisassembly(
- Addr pc, const SymbolTable *symtab) const override;
+ Addr pc, const Loader::SymbolTable *symtab) const override;
};
// store-cond
using RiscvMacroInst::RiscvMacroInst;
std::string generateDisassembly(
- Addr pc, const SymbolTable *symtab) const override;
+ Addr pc, const Loader::SymbolTable *symtab) const override;
};
class StoreCondMicro : public RiscvMicroInst
using RiscvMicroInst::RiscvMicroInst;
std::string generateDisassembly(
- Addr pc, const SymbolTable *symtab) const override;
+ Addr pc, const Loader::SymbolTable *symtab) const override;
};
// AMOs
using RiscvMacroInst::RiscvMacroInst;
std::string generateDisassembly(
- Addr pc, const SymbolTable *symtab) const override;
+ Addr pc, const Loader::SymbolTable *symtab) const override;
};
class AtomicMemOpMicro : public RiscvMicroInst
using RiscvMicroInst::RiscvMicroInst;
std::string generateDisassembly(
- Addr pc, const SymbolTable *symtab) const override;
+ Addr pc, const Loader::SymbolTable *symtab) const override;
};
/**
{
std::string
-CompRegOp::generateDisassembly(Addr pc, const SymbolTable *symtab) const
+CompRegOp::generateDisassembly(
+ Addr pc, const Loader::SymbolTable *symtab) const
{
std::stringstream ss;
ss << mnemonic << ' ' << registerName(_destRegIdx[0]) << ", " <<
using RiscvStaticInst::RiscvStaticInst;
std::string generateDisassembly(
- Addr pc, const SymbolTable *symtab) const override;
+ Addr pc, const Loader::SymbolTable *symtab) const override;
};
}
{
string
-Load::generateDisassembly(Addr pc, const SymbolTable *symtab) const
+Load::generateDisassembly(Addr pc, const Loader::SymbolTable *symtab) const
{
stringstream ss;
ss << mnemonic << ' ' << registerName(_destRegIdx[0]) << ", " <<
}
string
-Store::generateDisassembly(Addr pc, const SymbolTable *symtab) const
+Store::generateDisassembly(Addr pc, const Loader::SymbolTable *symtab) const
{
stringstream ss;
ss << mnemonic << ' ' << registerName(_srcRegIdx[1]) << ", " <<
using MemInst::MemInst;
std::string generateDisassembly(
- Addr pc, const SymbolTable *symtab) const override;
+ Addr pc, const Loader::SymbolTable *symtab) const override;
};
class Store : public MemInst
using MemInst::MemInst;
std::string generateDisassembly(
- Addr pc, const SymbolTable *symtab) const override;
+ Addr pc, const Loader::SymbolTable *symtab) const override;
};
}
using RiscvStaticInst::RiscvStaticInst;
std::string generateDisassembly(
- Addr pc, const SymbolTable *symtab) const override
+ Addr pc, const Loader::SymbolTable *symtab) const override
{
return mnemonic;
}
}
-#endif // __ARCH_RISCV_INSTS_PSEUDO_HH__
\ No newline at end of file
+#endif // __ARCH_RISCV_INSTS_PSEUDO_HH__
{
string
-RegOp::generateDisassembly(Addr pc, const SymbolTable *symtab) const
+RegOp::generateDisassembly(Addr pc, const Loader::SymbolTable *symtab) const
{
stringstream ss;
ss << mnemonic << ' ' << registerName(_destRegIdx[0]) << ", " <<
}
string
-CSROp::generateDisassembly(Addr pc, const SymbolTable *symtab) const
+CSROp::generateDisassembly(Addr pc, const Loader::SymbolTable *symtab) const
{
stringstream ss;
ss << mnemonic << ' ' << registerName(_destRegIdx[0]) << ", ";
using RiscvStaticInst::RiscvStaticInst;
std::string generateDisassembly(
- Addr pc, const SymbolTable *symtab) const override;
+ Addr pc, const Loader::SymbolTable *symtab) const override;
};
/**
using RiscvStaticInst::RiscvStaticInst;
std::string
- generateDisassembly(Addr pc, const SymbolTable *symtab) const override
+ generateDisassembly(
+ Addr pc, const Loader::SymbolTable *symtab) const override
{
return mnemonic;
}
{}
std::string generateDisassembly(
- Addr pc, const SymbolTable *symtab) const override;
+ Addr pc, const Loader::SymbolTable *symtab) const override;
};
}
}
std::string
- generateDisassembly(Addr pc, const SymbolTable *symtab) const override
+ generateDisassembly(
+ Addr pc, const Loader::SymbolTable *symtab) const override
{
return csprintf("unknown opcode %#02x", OPCODE);
}
/// Constructor.
%(class_name)s(MachInst machInst);
Fault execute(ExecContext *, Trace::InstRecord *) const override;
- std::string generateDisassembly(Addr pc,
- const SymbolTable *symtab) const override;
+ std::string generateDisassembly(
+ Addr pc, const Loader::SymbolTable *symtab) const override;
};
}};
}
std::string
- %(class_name)s::generateDisassembly(Addr pc,
- const SymbolTable *symtab) const
+ %(class_name)s::generateDisassembly(
+ Addr pc, const Loader::SymbolTable *symtab) const
{
std::vector<RegId> indices = {%(regs)s};
std::stringstream ss;
%(class_name)s(MachInst machInst);
Fault execute(ExecContext *, Trace::InstRecord *) const override;
std::string generateDisassembly(Addr pc,
- const SymbolTable *symtab) const override;
+ const Loader::SymbolTable *symtab) const override;
};
}};
std::string
%(class_name)s::generateDisassembly(Addr pc,
- const SymbolTable *symtab) const
+ const Loader::SymbolTable *symtab) const
{
std::vector<RegId> indices = {%(regs)s};
std::stringstream ss;
std::string
%(class_name)s::generateDisassembly(Addr pc,
- const SymbolTable *symtab) const
+ const Loader::SymbolTable *symtab) const
{
std::vector<RegId> indices = {%(regs)s};
std::stringstream ss;
std::string
%(class_name)s::generateDisassembly(Addr pc,
- const SymbolTable *symtab) const
+ const Loader::SymbolTable *symtab) const
{
std::stringstream ss;
ss << mnemonic;
Fault execute(ExecContext *, Trace::InstRecord *) const override;
std::string
- generateDisassembly(Addr pc, const SymbolTable *symtab) const override;
+ generateDisassembly(
+ Addr pc, const Loader::SymbolTable *symtab) const override;
RiscvISA::PCState
branchTarget(const RiscvISA::PCState &branchPC) const override;
}
std::string
- %(class_name)s::generateDisassembly(Addr pc,
- const SymbolTable *symtab) const
+ %(class_name)s::generateDisassembly(
+ Addr pc, const Loader::SymbolTable *symtab) const
{
std::vector<RegId> indices = {%(regs)s};
std::stringstream ss;
Fault execute(ExecContext *, Trace::InstRecord *) const override;
std::string
- generateDisassembly(Addr pc, const SymbolTable *symtab) const override;
+ generateDisassembly(
+ Addr pc, const Loader::SymbolTable *symtab) const override;
RiscvISA::PCState
branchTarget(ThreadContext *tc) const override;
}
std::string
- %(class_name)s::generateDisassembly(Addr pc,
- const SymbolTable *symtab) const
+ %(class_name)s::generateDisassembly(
+ Addr pc, const Loader::SymbolTable *symtab) const
{
std::vector<RegId> indices = {%(regs)s};
std::stringstream ss;
{
public:
Process *
- load(ProcessParams *params, ObjectFile *obj_file) override
+ load(ProcessParams *params, ::Loader::ObjectFile *obj_file) override
{
auto arch = obj_file->getArch();
auto opsys = obj_file->getOpSys();
- if (arch != ObjectFile::Riscv64 && arch != ObjectFile::Riscv32)
+ if (arch != ::Loader::Riscv64 && arch != ::Loader::Riscv32)
return nullptr;
- if (opsys == ObjectFile::UnknownOpSys) {
+ if (opsys == ::Loader::UnknownOpSys) {
warn("Unknown operating system; assuming Linux.");
- opsys = ObjectFile::Linux;
+ opsys = ::Loader::Linux;
}
- if (opsys != ObjectFile::Linux)
+ if (opsys != ::Loader::Linux)
return nullptr;
- if (arch == ObjectFile::Riscv64)
+ if (arch == ::Loader::Riscv64)
return new RiscvLinuxProcess64(params, obj_file);
else
return new RiscvLinuxProcess32(params, obj_file);
};
RiscvLinuxProcess64::RiscvLinuxProcess64(ProcessParams * params,
- ObjectFile *objFile) : RiscvProcess64(params, objFile)
+ ::Loader::ObjectFile *objFile) : RiscvProcess64(params, objFile)
{}
void
}
RiscvLinuxProcess32::RiscvLinuxProcess32(ProcessParams * params,
- ObjectFile *objFile) : RiscvProcess32(params, objFile)
+ ::Loader::ObjectFile *objFile) : RiscvProcess32(params, objFile)
{}
void
{
public:
/// Constructor.
- RiscvLinuxProcess64(ProcessParams * params, ObjectFile *objFile);
+ RiscvLinuxProcess64(ProcessParams * params, ::Loader::ObjectFile *objFile);
/// The target system's hostname.
static const char *hostname;
{
public:
/// Constructor.
- RiscvLinuxProcess32(ProcessParams * params, ObjectFile *objFile);
+ RiscvLinuxProcess32(ProcessParams * params, ::Loader::ObjectFile *objFile);
/// The target system's hostname.
static const char *hostname;
using namespace std;
using namespace RiscvISA;
-RiscvProcess::RiscvProcess(ProcessParams *params, ObjectFile *objFile) :
+RiscvProcess::RiscvProcess(ProcessParams *params,
+ ::Loader::ObjectFile *objFile) :
Process(params,
new EmulationPageTable(params->name, params->pid, PageBytes),
objFile)
fatal_if(params->useArchPT, "Arch page tables not implemented.");
}
-RiscvProcess64::RiscvProcess64(ProcessParams *params, ObjectFile *objFile) :
+RiscvProcess64::RiscvProcess64(ProcessParams *params,
+ ::Loader::ObjectFile *objFile) :
RiscvProcess(params, objFile)
{
const Addr stack_base = 0x7FFFFFFFFFFFFFFFL;
max_stack_size, next_thread_stack_base, mmap_end);
}
-RiscvProcess32::RiscvProcess32(ProcessParams *params, ObjectFile *objFile) :
+RiscvProcess32::RiscvProcess32(ProcessParams *params,
+ ::Loader::ObjectFile *objFile) :
RiscvProcess(params, objFile)
{
const Addr stack_base = 0x7FFFFFFF;
const int RandomBytes = 16;
const int addrSize = sizeof(IntType);
- ElfObject* elfObject = dynamic_cast<ElfObject*>(objFile);
+ auto *elfObject = dynamic_cast<::Loader::ElfObject*>(objFile);
memState->setStackMin(memState->getStackBase());
// Determine stack size and populate auxv
#include "sim/process.hh"
#include "sim/syscall_abi.hh"
+namespace Loader
+{
class ObjectFile;
+} // namespace Loader
+
class System;
class RiscvProcess : public Process
{
protected:
- RiscvProcess(ProcessParams * params, ObjectFile *objFile);
+ RiscvProcess(ProcessParams * params, ::Loader::ObjectFile *objFile);
template<class IntType>
void argsInit(int pageSize);
class RiscvProcess64 : public RiscvProcess
{
protected:
- RiscvProcess64(ProcessParams * params, ObjectFile *objFile);
+ RiscvProcess64(ProcessParams * params, ::Loader::ObjectFile *objFile);
void initState() override;
};
class RiscvProcess32 : public RiscvProcess
{
protected:
- RiscvProcess32(ProcessParams * params, ObjectFile *objFile);
+ RiscvProcess32(ProcessParams * params, ::Loader::ObjectFile *objFile);
void initState() override;
};
class FsWorkload : public Workload
{
protected:
- SymbolTable defaultSymtab;
+ Loader::SymbolTable defaultSymtab;
public:
FsWorkload(SparcFsWorkloadParams *params) : Workload(params) {}
getREDVector(0x001, pc, npc);
return pc;
}
- ObjectFile::Arch getArch() const override { return ObjectFile::SPARC64; }
+ Loader::Arch getArch() const override { return Loader::SPARC64; }
- const SymbolTable *
+ const Loader::SymbolTable *
symtab(ThreadContext *tc) override
{
return &defaultSymtab;
{
std::string
-BlockMemMicro::generateDisassembly(Addr pc, const SymbolTable *symtab) const
+BlockMemMicro::generateDisassembly(
+ Addr pc, const Loader::SymbolTable *symtab) const
{
std::stringstream response;
bool load = flags[IsLoad];
}
std::string
-BlockMemImmMicro::generateDisassembly(Addr pc, const SymbolTable *symtab) const
+BlockMemImmMicro::generateDisassembly(
+ Addr pc, const Loader::SymbolTable *symtab) const
{
std::stringstream response;
bool load = flags[IsLoad];
{}
std::string generateDisassembly(
- Addr pc, const SymbolTable *symtab) const override;
+ Addr pc, const Loader::SymbolTable *symtab) const override;
const int8_t offset;
};
{}
std::string generateDisassembly(
- Addr pc, const SymbolTable *symtab) const override;
+ Addr pc, const Loader::SymbolTable *symtab) const override;
const int32_t imm;
};
template class BranchNBits<30>;
std::string
-Branch::generateDisassembly(Addr pc, const SymbolTable *symtab) const
+Branch::generateDisassembly(Addr pc, const Loader::SymbolTable *symtab) const
{
std::stringstream response;
}
std::string
-BranchImm13::generateDisassembly(Addr pc, const SymbolTable *symtab) const
+BranchImm13::generateDisassembly(
+ Addr pc, const Loader::SymbolTable *symtab) const
{
std::stringstream response;
}
std::string
-BranchDisp::generateDisassembly(Addr pc, const SymbolTable *symtab) const
+BranchDisp::generateDisassembly(
+ Addr pc, const Loader::SymbolTable *symtab) const
{
std::stringstream response;
std::string symbol;
using SparcStaticInst::SparcStaticInst;
std::string generateDisassembly(
- Addr pc, const SymbolTable *symtab) const override;
+ Addr pc, const Loader::SymbolTable *symtab) const override;
};
/**
{}
std::string generateDisassembly(
- Addr pc, const SymbolTable *symtab) const override;
+ Addr pc, const Loader::SymbolTable *symtab) const override;
int32_t disp;
};
{}
std::string generateDisassembly(
- Addr pc, const SymbolTable *symtab) const override;
+ Addr pc, const Loader::SymbolTable *symtab) const override;
int32_t imm;
};
bool
IntOp::printPseudoOps(std::ostream &os, Addr pc,
- const SymbolTable *symbab) const
+ const Loader::SymbolTable *symbab) const
{
if (!std::strcmp(mnemonic, "or") && _srcRegIdx[0].index() == 0) {
printMnemonic(os, "mov");
bool
IntOpImm::printPseudoOps(std::ostream &os, Addr pc,
- const SymbolTable *symbab) const
+ const Loader::SymbolTable *symbab) const
{
if (!std::strcmp(mnemonic, "or")) {
if (_numSrcRegs > 0 && _srcRegIdx[0].index() == 0) {
}
std::string
-IntOp::generateDisassembly(Addr pc, const SymbolTable *symtab) const
+IntOp::generateDisassembly(Addr pc, const Loader::SymbolTable *symtab) const
{
std::stringstream response;
}
std::string
-IntOpImm::generateDisassembly(Addr pc, const SymbolTable *symtab) const
+IntOpImm::generateDisassembly(Addr pc, const Loader::SymbolTable *symtab) const
{
std::stringstream response;
}
std::string
-SetHi::generateDisassembly(Addr pc, const SymbolTable *symtab) const
+SetHi::generateDisassembly(Addr pc, const Loader::SymbolTable *symtab) const
{
std::stringstream response;
using SparcStaticInst::SparcStaticInst;
std::string generateDisassembly(
- Addr pc, const SymbolTable *symtab) const override;
+ Addr pc, const Loader::SymbolTable *symtab) const override;
virtual bool printPseudoOps(std::ostream &os, Addr pc,
- const SymbolTable *symtab) const;
+ const Loader::SymbolTable *symtab) const;
};
/**
int64_t imm;
std::string generateDisassembly(
- Addr pc, const SymbolTable *symtab) const override;
+ Addr pc, const Loader::SymbolTable *symtab) const override;
bool printPseudoOps(std::ostream &os, Addr pc,
- const SymbolTable *symtab) const override;
+ const Loader::SymbolTable *symtab) const override;
};
/**
{}
std::string generateDisassembly(
- Addr pc, const SymbolTable *symtab) const override;
+ Addr pc, const Loader::SymbolTable *symtab) const override;
};
}
{
std::string
-Mem::generateDisassembly(Addr pc, const SymbolTable *symtab) const
+Mem::generateDisassembly(Addr pc, const Loader::SymbolTable *symtab) const
{
std::stringstream response;
bool load = flags[IsLoad];
}
std::string
-MemImm::generateDisassembly(Addr pc, const SymbolTable *symtab) const
+MemImm::generateDisassembly(Addr pc, const Loader::SymbolTable *symtab) const
{
std::stringstream response;
bool load = flags[IsLoad];
using SparcStaticInst::SparcStaticInst;
std::string generateDisassembly(
- Addr pc, const SymbolTable *symtab) const override;
+ Addr pc, const Loader::SymbolTable *symtab) const override;
};
/**
{}
std::string generateDisassembly(
- Addr pc, const SymbolTable *symtab) const override;
+ Addr pc, const Loader::SymbolTable *symtab) const override;
const int32_t imm;
};
{
std::string
-SparcMacroInst::generateDisassembly(Addr pc, const SymbolTable *symtab) const
+SparcMacroInst::generateDisassembly(
+ Addr pc, const Loader::SymbolTable *symtab) const
{
std::stringstream response;
printMnemonic(response, mnemonic);
}
std::string generateDisassembly(
- Addr pc, const SymbolTable *symtab) const override;
+ Addr pc, const Loader::SymbolTable *symtab) const override;
StaticInstPtr *microops;
}
std::string generateDisassembly(Addr pc,
- const SymbolTable *symtab) const override;
+ const Loader::SymbolTable *symtab) const override;
};
}};
output decoder {{
- std::string Nop::generateDisassembly(Addr pc,
- const SymbolTable *symtab) const
+ std::string
+ Nop::generateDisassembly(
+ Addr pc, const Loader::SymbolTable *symtab) const
{
std::stringstream response;
printMnemonic(response, mnemonic);
}
std::string
- generateDisassembly(Addr pc, const SymbolTable *symtab) const override
+ generateDisassembly(
+ Addr pc, const Loader::SymbolTable *symtab) const override
{
std::stringstream response;
printMnemonic(response, mnemonic);
{
std::string
-Priv::generateDisassembly(Addr pc, const SymbolTable *symtab) const
+Priv::generateDisassembly(Addr pc, const Loader::SymbolTable *symtab) const
{
std::stringstream response;
}
std::string
-RdPriv::generateDisassembly(Addr pc, const SymbolTable *symtab) const
+RdPriv::generateDisassembly(Addr pc, const Loader::SymbolTable *symtab) const
{
std::stringstream response;
}
std::string
-WrPriv::generateDisassembly(Addr pc, const SymbolTable *symtab) const
+WrPriv::generateDisassembly(Addr pc, const Loader::SymbolTable *symtab) const
{
std::stringstream response;
}
std::string
-WrPrivImm::generateDisassembly(Addr pc, const SymbolTable *symtab) const
+WrPrivImm::generateDisassembly(
+ Addr pc, const Loader::SymbolTable *symtab) const
{
std::stringstream response;
protected:
using SparcStaticInst::SparcStaticInst;
std::string generateDisassembly(
- Addr pc, const SymbolTable *symtab) const override;
+ Addr pc, const Loader::SymbolTable *symtab) const override;
};
class PrivReg : public Priv
protected:
using PrivReg::PrivReg;
std::string generateDisassembly(
- Addr pc, const SymbolTable *symtab) const override;
+ Addr pc, const Loader::SymbolTable *symtab) const override;
};
// This class is for instructions that explicitly write control
protected:
using PrivReg::PrivReg;
std::string generateDisassembly(
- Addr pc, const SymbolTable *symtab) const override;
+ Addr pc, const Loader::SymbolTable *symtab) const override;
};
/**
{}
std::string generateDisassembly(
- Addr pc, const SymbolTable *symtab) const override;
+ Addr pc, const Loader::SymbolTable *symtab) const override;
char const *regName;
};
}
std::string
-SparcStaticInst::generateDisassembly(Addr pc, const SymbolTable *symtab) const
+SparcStaticInst::generateDisassembly(
+ Addr pc, const Loader::SymbolTable *symtab) const
{
std::stringstream ss;
using StaticInst::StaticInst;
std::string generateDisassembly(
- Addr pc, const SymbolTable *symtab) const override;
+ Addr pc, const Loader::SymbolTable *symtab) const override;
static void printMnemonic(std::ostream &os, const char *mnemonic);
static void printReg(std::ostream &os, RegId reg);
{
std::string
-Trap::generateDisassembly(Addr pc, const SymbolTable *symtab) const
+Trap::generateDisassembly(Addr pc, const Loader::SymbolTable *symtab) const
{
std::stringstream response;
{}
std::string generateDisassembly(
- Addr pc, const SymbolTable *symtab) const override;
+ Addr pc, const Loader::SymbolTable *symtab) const override;
int trapNum;
};
using SparcStaticInst::SparcStaticInst;
std::string
- generateDisassembly(Addr pc, const SymbolTable *symtab) const override
+ generateDisassembly(
+ Addr pc, const Loader::SymbolTable *symtab) const override
{
return mnemonic;
}
}
std::string
- generateDisassembly(Addr pc, const SymbolTable *symtab) const override
+ generateDisassembly(
+ Addr pc, const Loader::SymbolTable *symtab) const override
{
return csprintf("%-10s (unimplemented)", mnemonic);
}
}
std::string
- generateDisassembly(Addr pc, const SymbolTable *symtab) const override
+ generateDisassembly(
+ Addr pc, const Loader::SymbolTable *symtab) const override
{
return csprintf("%-10s (unimplemented)", mnemonic);
}
}
std::string
- generateDisassembly(Addr pc, const SymbolTable *symtab) const override
+ generateDisassembly(
+ Addr pc, const Loader::SymbolTable *symtab) const override
{
return "Unknown instruction";
}
{
public:
Process *
- load(ProcessParams *params, ObjectFile *obj_file) override
+ load(ProcessParams *params, ::Loader::ObjectFile *obj_file) override
{
auto arch = obj_file->getArch();
auto opsys = obj_file->getOpSys();
- if (arch != ObjectFile::SPARC64 && arch != ObjectFile::SPARC32)
+ if (arch != ::Loader::SPARC64 && arch != ::Loader::SPARC32)
return nullptr;
- if (opsys == ObjectFile::UnknownOpSys) {
+ if (opsys == ::Loader::UnknownOpSys) {
warn("Unknown operating system; assuming Linux.");
- opsys = ObjectFile::Linux;
+ opsys = ::Loader::Linux;
}
- if (opsys != ObjectFile::Linux)
+ if (opsys != ::Loader::Linux)
return nullptr;
- if (arch == ObjectFile::SPARC64)
+ if (arch == ::Loader::SPARC64)
return new Sparc64LinuxProcess(params, obj_file);
else
return new Sparc32LinuxProcess(params, obj_file);
} // anonymous namespace
Sparc32LinuxProcess::Sparc32LinuxProcess(ProcessParams * params,
- ObjectFile *objFile)
+ ::Loader::ObjectFile *objFile)
: Sparc32Process(params, objFile)
{}
}
Sparc64LinuxProcess::Sparc64LinuxProcess(ProcessParams * params,
- ObjectFile *objFile)
+ ::Loader::ObjectFile *objFile)
: Sparc64Process(params, objFile)
{}
{
public:
/// Constructor.
- Sparc32LinuxProcess(ProcessParams * params, ObjectFile *objFile);
+ Sparc32LinuxProcess(ProcessParams * params, ::Loader::ObjectFile *objFile);
void syscall(ThreadContext *tc, Fault *fault) override;
{
public:
/// Constructor.
- Sparc64LinuxProcess(ProcessParams * params, ObjectFile *objFile);
+ Sparc64LinuxProcess(ProcessParams * params, ::Loader::ObjectFile *objFile);
void syscall(ThreadContext *tc, Fault *fault) override;
INTREG_O0, INTREG_O1, INTREG_O2, INTREG_O3, INTREG_O4, INTREG_O5
};
-SparcProcess::SparcProcess(ProcessParams *params, ObjectFile *objFile,
- Addr _StackBias)
+SparcProcess::SparcProcess(ProcessParams *params,
+ ::Loader::ObjectFile *objFile, Addr _StackBias)
: Process(params,
new EmulationPageTable(params->name, params->pid, PageBytes),
objFile),
// Setup the auxilliary vectors. These will already have endian conversion.
// Auxilliary vectors are loaded only for elf formatted executables.
- ElfObject * elfObject = dynamic_cast<ElfObject *>(objFile);
+ auto *elfObject = dynamic_cast<::Loader::ElfObject *>(objFile);
if (elfObject) {
// Bits which describe the system hardware capabilities
auxv.emplace_back(M5_AT_HWCAP, hwcap);
// The locations of the fill and spill handlers
Addr fillStart, spillStart;
- SparcProcess(ProcessParams * params, ObjectFile *objFile,
+ SparcProcess(ProcessParams * params, ::Loader::ObjectFile *objFile,
Addr _StackBias);
void initState() override;
{
protected:
- Sparc32Process(ProcessParams * params, ObjectFile *objFile)
+ Sparc32Process(ProcessParams * params, ::Loader::ObjectFile *objFile)
: SparcProcess(params, objFile, 0)
{
Addr brk_point = image.maxAddr();
{
protected:
- Sparc64Process(ProcessParams * params, ObjectFile *objFile)
+ Sparc64Process(ProcessParams * params, ::Loader::ObjectFile *objFile)
: SparcProcess(params, objFile, 2047)
{
Addr brk_point = image.maxAddr();
{
public:
Process *
- load(ProcessParams *params, ObjectFile *obj_file) override
+ load(ProcessParams *params, ::Loader::ObjectFile *obj_file) override
{
auto arch = obj_file->getArch();
auto opsys = obj_file->getOpSys();
- if (arch != ObjectFile::SPARC64 && arch != ObjectFile::SPARC32)
+ if (arch != ::Loader::SPARC64 && arch != ::Loader::SPARC32)
return nullptr;
- if (opsys != ObjectFile::Solaris)
+ if (opsys != ::Loader::Solaris)
return nullptr;
return new SparcSolarisProcess(params, obj_file);
{ 255, "umount2" }
};
-SparcSolarisProcess::SparcSolarisProcess(ProcessParams * params,
- ObjectFile *objFile)
- : Sparc64Process(params, objFile)
+SparcSolarisProcess::SparcSolarisProcess(ProcessParams *params,
+ ::Loader::ObjectFile *objFile) :
+ Sparc64Process(params, objFile)
{}
void
{
public:
/// Constructor.
- SparcSolarisProcess(ProcessParams * params, ObjectFile *objFile);
+ SparcSolarisProcess(ProcessParams * params, ::Loader::ObjectFile *objFile);
/// The target system's hostname.
static const char *hostname;
} else {
panic("Tried to %s unmapped address %#x.\nPC: %#x, Instr: %s",
modeStr, addr, tc->pcState().pc(),
- inst->disassemble(tc->pcState().pc(), debugSymbolTable));
+ inst->disassemble(tc->pcState().pc(),
+ Loader::debugSymbolTable));
}
}
}
fatal_if(!kernelObj, "No kernel to load.");
- fatal_if(kernelObj->getArch() == ObjectFile::I386,
+ fatal_if(kernelObj->getArch() == Loader::I386,
"Loading a 32 bit x86 kernel is not supported.");
ThreadContext *tc = system->threadContexts[0];
}
std::string
- generateDisassembly(Addr pc, const SymbolTable *symtab) const
+ generateDisassembly(Addr pc, const Loader::SymbolTable *symtab) const
{
return mnemonic;
}
}
*/
- std::string FpOp::generateDisassembly(Addr pc,
- const SymbolTable *symtab) const
+ std::string
+ FpOp::generateDisassembly(
+ Addr pc, const Loader::SymbolTable *symtab) const
{
std::stringstream response;
bool subtract = false) const;
bool checkCondition(uint64_t flags) const;*/
- std::string generateDisassembly(Addr pc,
- const SymbolTable *symtab) const;
+ std::string generateDisassembly(
+ Addr pc, const Loader::SymbolTable *symtab) const;
};
}
namespace X86ISA
{
- std::string LdStOp::generateDisassembly(Addr pc,
- const SymbolTable *symtab) const
+ std::string
+ LdStOp::generateDisassembly(
+ Addr pc, const Loader::SymbolTable *symtab) const
{
std::stringstream response;
return response.str();
}
- std::string LdStSplitOp::generateDisassembly(Addr pc,
- const SymbolTable *symtab) const
+ std::string
+ LdStSplitOp::generateDisassembly(
+ Addr pc, const Loader::SymbolTable *symtab) const
{
std::stringstream response;
{
}
- std::string generateDisassembly(Addr pc,
- const SymbolTable *symtab) const;
+ std::string generateDisassembly(
+ Addr pc, const Loader::SymbolTable *symtab) const;
};
/**
{
}
- std::string generateDisassembly(Addr pc,
- const SymbolTable *symtab) const;
+ std::string generateDisassembly(
+ Addr pc, const Loader::SymbolTable *symtab) const;
};
}
namespace X86ISA
{
- std::string MediaOpReg::generateDisassembly(Addr pc,
- const SymbolTable *symtab) const
+ std::string
+ MediaOpReg::generateDisassembly(
+ Addr pc, const Loader::SymbolTable *symtab) const
{
std::stringstream response;
return response.str();
}
- std::string MediaOpImm::generateDisassembly(Addr pc,
- const SymbolTable *symtab) const
+ std::string
+ MediaOpImm::generateDisassembly(
+ Addr pc, const Loader::SymbolTable *symtab) const
{
std::stringstream response;
{}
std::string generateDisassembly(Addr pc,
- const SymbolTable *symtab) const;
+ const Loader::SymbolTable *symtab) const;
};
class MediaOpImm : public MediaOpBase
{}
std::string generateDisassembly(Addr pc,
- const SymbolTable *symtab) const;
+ const Loader::SymbolTable *symtab) const;
};
}
}
}
- std::string generateDisassembly(Addr pc,
- const SymbolTable *symtab) const
+ std::string
+ generateDisassembly(Addr pc, const Loader::SymbolTable *symtab) const
{
std::stringstream ss;
return flags;
}
- std::string RegOp::generateDisassembly(Addr pc,
- const SymbolTable *symtab) const
+ std::string
+ RegOp::generateDisassembly(
+ Addr pc, const Loader::SymbolTable *symtab) const
{
std::stringstream response;
return response.str();
}
- std::string RegOpImm::generateDisassembly(Addr pc,
- const SymbolTable *symtab) const
+ std::string
+ RegOpImm::generateDisassembly(
+ Addr pc, const Loader::SymbolTable *symtab) const
{
std::stringstream response;
{
}
- std::string generateDisassembly(Addr pc,
- const SymbolTable *symtab) const;
+ std::string generateDisassembly(
+ Addr pc, const Loader::SymbolTable *symtab) const;
};
class RegOpImm : public RegOpBase
{
}
- std::string generateDisassembly(Addr pc,
- const SymbolTable *symtab) const;
+ std::string generateDisassembly(
+ Addr pc, const Loader::SymbolTable *symtab) const;
};
}
os << "]";
}
- std::string X86StaticInst::generateDisassembly(Addr pc,
- const SymbolTable *symtab) const
+ std::string
+ X86StaticInst::generateDisassembly(
+ Addr pc, const Loader::SymbolTable *symtab) const
{
std::stringstream ss;
{
}
- std::string generateDisassembly(Addr pc,
- const SymbolTable *symtab) const;
+ std::string generateDisassembly(
+ Addr pc, const Loader::SymbolTable *symtab) const;
void printMnemonic(std::ostream &os, const char * mnemonic) const;
void printMnemonic(std::ostream &os, const char * instMnemonic,
}
std::string generateDisassembly(Addr pc,
- const SymbolTable *symtab) const;
+ const Loader::SymbolTable *symtab) const;
};
}};
output decoder {{
- std::string CPUIDInst::generateDisassembly(Addr PC,
- const SymbolTable *symtab) const
+ std::string
+ CPUIDInst::generateDisassembly(
+ Addr PC, const Loader::SymbolTable *symtab) const
{
std::stringstream response;
{ }
std::string generateDisassembly(Addr pc,
- const SymbolTable *symtab) const;
+ const Loader::SymbolTable *symtab) const;
};
}};
output decoder {{
- std::string MonitorInst::generateDisassembly(Addr PC,
- const SymbolTable *symtab) const
+ std::string
+ MonitorInst::generateDisassembly(
+ Addr PC, const Loader::SymbolTable *symtab) const
{
std::stringstream response;
}
std::string generateDisassembly(Addr pc,
- const SymbolTable *symtab) const;
+ const Loader::SymbolTable *symtab) const;
};
}};
output decoder {{
- std::string MwaitInst::generateDisassembly(Addr PC,
- const SymbolTable *symtab) const
+ std::string
+ MwaitInst::generateDisassembly(
+ Addr PC, const Loader::SymbolTable *symtab) const
{
std::stringstream response;
}
std::string generateDisassembly(Addr pc,
- const SymbolTable *symtab) const;
+ const Loader::SymbolTable *symtab) const;
};
}};
output decoder {{
std::string NopInst::generateDisassembly(Addr PC,
- const SymbolTable *symtab) const
+ const Loader::SymbolTable *symtab) const
{
std::stringstream response;
}
std::string generateDisassembly(Addr pc,
- const SymbolTable *symtab) const;
+ const Loader::SymbolTable *symtab) const;
};
}};
output decoder {{
- std::string SyscallInst::generateDisassembly(Addr PC,
- const SymbolTable *symtab) const
+ std::string
+ SyscallInst::generateDisassembly(
+ Addr PC, const Loader::SymbolTable *symtab) const
{
std::stringstream response;
Fault execute(ExecContext *, Trace::InstRecord *) const;
std::string
- generateDisassembly(Addr pc, const SymbolTable *symtab) const;
+ generateDisassembly(Addr pc, const Loader::SymbolTable *symtab) const;
};
/**
{
private:
/// Have we warned on this instruction yet?
- mutable bool warned;
+ mutable bool warned = false;
public:
/// Constructor
WarnUnimplemented(const char *_mnemonic, ExtMachInst _machInst)
- : X86ISA::X86StaticInst(_mnemonic, _machInst, No_OpClass), warned(false)
+ : X86ISA::X86StaticInst(_mnemonic, _machInst, No_OpClass)
{
// don't call execute() (which panics) if we're on a
// speculative path
Fault execute(ExecContext *, Trace::InstRecord *) const;
std::string
- generateDisassembly(Addr pc, const SymbolTable *symtab) const;
+ generateDisassembly(Addr pc, const Loader::SymbolTable *symtab) const;
};
}};
output decoder {{
std::string
- FailUnimplemented::generateDisassembly(Addr pc,
- const SymbolTable *symtab) const
+ FailUnimplemented::generateDisassembly(
+ Addr pc, const Loader::SymbolTable *symtab) const
{
return csprintf("%-10s (unimplemented)", mnemonic);
}
std::string
- WarnUnimplemented::generateDisassembly(Addr pc,
- const SymbolTable *symtab) const
+ WarnUnimplemented::generateDisassembly(
+ Addr pc, const Loader::SymbolTable *symtab) const
{
return csprintf("%-10s (unimplemented)", mnemonic);
}
//
output header {{
- /**
- * Class for Unknown/Illegal instructions
- */
- class Unknown : public X86ISA::X86StaticInst
- {
- public:
+ /**
+ * Class for Unknown/Illegal instructions
+ */
+ class Unknown : public X86ISA::X86StaticInst
+ {
+ public:
- // Constructor
- Unknown(ExtMachInst _machInst) :
- X86ISA::X86StaticInst("unknown", _machInst, No_OpClass)
- {
- }
+ // Constructor
+ Unknown(ExtMachInst _machInst) :
+ X86ISA::X86StaticInst("unknown", _machInst, No_OpClass)
+ {
+ }
- Fault execute(ExecContext *, Trace::InstRecord *) const;
+ Fault execute(ExecContext *, Trace::InstRecord *) const;
- std::string generateDisassembly(Addr pc,
- const SymbolTable *symtab) const;
+ std::string generateDisassembly(
+ Addr pc, const Loader::SymbolTable *symtab) const;
- };
+ };
}};
output decoder {{
- std::string Unknown::generateDisassembly(Addr pc,
- const SymbolTable *symtab) const
- {
- return "Unknown instruction";
- }
+ std::string
+ Unknown::generateDisassembly(
+ Addr pc, const Loader::SymbolTable *symtab) const
+ {
+ return "Unknown instruction";
+ }
}};
output exec {{
- Fault Unknown::execute(ExecContext *xc,
- Trace::InstRecord *traceData) const
- {
- return std::make_shared<InvalidOpcode>();
- }
+ Fault
+ Unknown::execute(ExecContext *xc, Trace::InstRecord *traceData) const
+ {
+ return std::make_shared<InvalidOpcode>();
+ }
}};
def format Unknown() {{
- decode_block = 'return new Unknown(machInst);\n'
+ decode_block = 'return new Unknown(machInst);\n'
}};
// Execute method for macroops.
def template MacroExecPanic {{
- Fault execute(ExecContext *, Trace::InstRecord *) const
- {
- panic("Tried to execute macroop directly!");
- return NoFault;
- }
+ Fault execute(ExecContext *, Trace::InstRecord *) const
+ {
+ panic("Tried to execute macroop directly!");
+ return NoFault;
+ }
}};
output header {{
+ // Base class for combinationally generated macroops
+ class Macroop : public X86ISA::MacroopBase
+ {
+ public:
+ Macroop(const char *mnem, ExtMachInst _machInst,
+ uint32_t _numMicroops, X86ISA::EmulEnv _env)
+ : MacroopBase(mnem, _machInst, _numMicroops, _env)
+ {}
- // Base class for combinationally generated macroops
- class Macroop : public X86ISA::MacroopBase
+ Fault
+ execute(ExecContext *, Trace::InstRecord *) const
{
- public:
- Macroop(const char *mnem, ExtMachInst _machInst,
- uint32_t _numMicroops, X86ISA::EmulEnv _env)
- : MacroopBase(mnem, _machInst, _numMicroops, _env)
- {}
-
- Fault
- execute(ExecContext *, Trace::InstRecord *) const
- {
- panic("Tried to execute macroop directly!");
- }
- };
+ panic("Tried to execute macroop directly!");
+ }
+ };
}};
//////////////////////////////////////////////////////////////////////////////
// Basic instruction class declaration template.
def template MacroDeclare {{
- namespace X86Macroop
+ namespace X86Macroop
+ {
+ /**
+ * Static instruction class for "%(mnemonic)s".
+ */
+ class %(class_name)s : public %(base_class)s
{
- /**
- * Static instruction class for "%(mnemonic)s".
- */
- class %(class_name)s : public %(base_class)s
- {
- private:
- %(declareLabels)s
- public:
- // Constructor.
- %(class_name)s(ExtMachInst machInst, X86ISA::EmulEnv _env);
+ private:
+ %(declareLabels)s
+ public:
+ // Constructor.
+ %(class_name)s(ExtMachInst machInst, X86ISA::EmulEnv _env);
- std::string
- generateDisassembly(Addr pc, const SymbolTable *symtab) const;
- };
- }
+ std::string generateDisassembly(
+ Addr pc, const Loader::SymbolTable *symtab) const;
+ };
+ }
}};
def template MacroDisassembly {{
std::string
- X86Macroop::%(class_name)s::generateDisassembly(Addr pc,
- const SymbolTable *symtab) const
+ X86Macroop::%(class_name)s::generateDisassembly(
+ Addr pc, const Loader::SymbolTable *symtab) const
{
std::stringstream out;
out << mnemonic << "\t";
}
std::string
- generateDisassembly(Addr pc, const SymbolTable *symtab) const
+ generateDisassembly(Addr pc, const Loader::SymbolTable *symtab) const
{
std::stringstream response;
RegIndex foldOBit;
std::string generateDisassembly(Addr pc,
- const SymbolTable *symtab) const;
+ const Loader::SymbolTable *symtab) const;
public:
%(class_name)s(ExtMachInst _machInst,
}};
def template MicroLimmOpDisassembly {{
- std::string %(class_name)s::generateDisassembly(Addr pc,
- const SymbolTable *symtab) const
+ std::string
+ %(class_name)s::generateDisassembly(
+ Addr pc, const Loader::SymbolTable *symtab) const
{
std::stringstream response;
uint16_t _target, uint8_t _cc);
std::string generateDisassembly(Addr pc,
- const SymbolTable *symtab) const;
+ const Loader::SymbolTable *symtab) const;
};
}};
}};
output decoder {{
- std::string SeqOpBase::generateDisassembly(Addr pc,
- const SymbolTable *symtab) const
+ std::string
+ SeqOpBase::generateDisassembly(
+ Addr pc, const Loader::SymbolTable *symtab) const
{
std::stringstream response;
uint64_t setFlags, Fault _fault, uint8_t _cc);
std::string generateDisassembly(Addr pc,
- const SymbolTable *symtab) const;
+ const Loader::SymbolTable *symtab) const;
};
class MicroHalt : public X86ISA::X86MicroopBase
Fault execute(ExecContext *, Trace::InstRecord *) const;
std::string generateDisassembly(Addr pc,
- const SymbolTable *symtab) const;
+ const Loader::SymbolTable *symtab) const;
};
}};
}};
output decoder {{
- std::string MicroFaultBase::generateDisassembly(Addr pc,
- const SymbolTable *symtab) const
+ std::string
+ MicroFaultBase::generateDisassembly(
+ Addr pc, const Loader::SymbolTable *symtab) const
{
std::stringstream response;
return response.str();
}
- std::string MicroHalt::generateDisassembly(Addr pc,
- const SymbolTable *symtab) const
+ std::string
+ MicroHalt::generateDisassembly(
+ Addr pc, const Loader::SymbolTable *symtab) const
{
std::stringstream response;
{
public:
Process *
- load(ProcessParams *params, ObjectFile *obj_file) override
+ load(ProcessParams *params, ::Loader::ObjectFile *obj_file) override
{
auto arch = obj_file->getArch();
auto opsys = obj_file->getOpSys();
- if (arch != ObjectFile::X86_64 && arch != ObjectFile::I386)
+ if (arch != ::Loader::X86_64 && arch != ::Loader::I386)
return nullptr;
- if (opsys == ObjectFile::UnknownOpSys) {
+ if (opsys == ::Loader::UnknownOpSys) {
warn("Unknown operating system; assuming Linux.");
- opsys = ObjectFile::Linux;
+ opsys = ::Loader::Linux;
}
- if (opsys != ObjectFile::Linux)
+ if (opsys != ::Loader::Linux)
return nullptr;
- if (arch == ObjectFile::X86_64)
+ if (arch == ::Loader::X86_64)
return new X86_64LinuxProcess(params, obj_file);
else
return new I386LinuxProcess(params, obj_file);
LongModePTE<29, 21>,
LongModePTE<20, 12> > ArchPageTable;
-X86Process::X86Process(ProcessParams *params, ObjectFile *objFile) :
+X86Process::X86Process(ProcessParams *params, ::Loader::ObjectFile *objFile) :
Process(params, params->useArchPT ?
static_cast<EmulationPageTable *>(
- new ArchPageTable(params->name, params->pid,
- params->system, PageBytes)) :
+ new ArchPageTable(params->name, params->pid,
+ params->system, PageBytes)) :
new EmulationPageTable(params->name, params->pid,
PageBytes),
objFile)
*process = *this;
}
-X86_64Process::X86_64Process(ProcessParams *params, ObjectFile *objFile) :
+X86_64Process::X86_64Process(ProcessParams *params,
+ ::Loader::ObjectFile *objFile) :
X86Process(params, objFile)
{
vsyscallPage.base = 0xffffffffff600000ULL;
}
-I386Process::I386Process(ProcessParams *params, ObjectFile *objFile) :
+I386Process::I386Process(ProcessParams *params,
+ ::Loader::ObjectFile *objFile) :
X86Process(params, objFile)
{
if (kvmInSE)
// conversion. Auxiliary vectors are loaded only for elf formatted
// executables; the auxv is responsible for passing information from
// the OS to the interpreter.
- ElfObject * elfObject = dynamic_cast<ElfObject *>(objFile);
+ auto *elfObject = dynamic_cast<::Loader::ElfObject *>(objFile);
if (elfObject) {
uint64_t features =
X86_OnboardFPU |
Addr _gdtStart;
Addr _gdtSize;
- X86Process(ProcessParams * params, ObjectFile *objFile);
+ X86Process(ProcessParams *params, ::Loader::ObjectFile *objFile);
template<class IntType>
void argsInit(int pageSize,
VSyscallPage vsyscallPage;
public:
- X86_64Process(ProcessParams *params, ObjectFile *objFile);
+ X86_64Process(ProcessParams *params, ::Loader::ObjectFile *objFile);
void argsInit(int pageSize);
void initState() override;
VSyscallPage vsyscallPage;
public:
- I386Process(ProcessParams *params, ObjectFile *objFile);
+ I386Process(ProcessParams *params, ::Loader::ObjectFile *objFile);
void argsInit(int pageSize);
void initState() override;
readSymbol(ThreadContext *tc, const std::string name)
{
PortProxy &vp = tc->getVirtProxy();
- const SymbolTable *symtab = tc->getSystemPtr()->workload->symtab(tc);
+ const auto *symtab = tc->getSystemPtr()->workload->symtab(tc);
Addr addr;
if (!symtab->findAddress(name, addr))
StackTrace::dump()
{
StringWrap name(tc->getCpuPtr()->name());
- const SymbolTable *symtab = tc->getSystemPtr()->workload->symtab(tc);
+ const auto *symtab = tc->getSystemPtr()->workload->symtab(tc);
DPRINTFN("------ Stack ------\n");
i = p->user_apps.begin();
while (i != p->user_apps.end()) {
- ObjectFile *of = createObjectFile(*i);
+ auto *of = createObjectFile(*i);
string sf;
if (!of)
fatal("Couldn't load symbols from file: %s\n", *i);
sf = *i;
sf.erase(0, sf.rfind('/') + 1);;
DPRINTFN("file %s short: %s\n", *i, sf);
- userApp[sf] = new SymbolTable;
+ userApp[sf] = new Loader::SymbolTable;
bool result1 = of->loadGlobalSymbols(userApp[sf]);
bool result2 = of->loadLocalSymbols(userApp[sf]);
if (!result1 || !result2)
Addr junk;
char sm[50];
if (!TheISA::inUserMode(tc))
- debugSymbolTable->findNearestSymbol(
+ Loader::debugSymbolTable->findNearestSymbol(
tc->readIntReg(ReturnAddressReg), st, junk);
tc->getVirtProxy().readString(sm, sm_string, 50);
Addr sym_addr = 0;
if (!TheISA::inUserMode(tc)) {
- debugSymbolTable->findNearestSymbol(next_pc, sym, sym_addr);
+ Loader::debugSymbolTable->findNearestSymbol(next_pc, sym, sym_addr);
} else {
Linux::ThreadInfo ti(tc);
string app = ti.curTaskName();
std::string st;
Addr junk;
if (!TheISA::inUserMode(tc))
- debugSymbolTable->findNearestSymbol(
+ Loader::debugSymbolTable->findNearestSymbol(
tc->readIntReg(ReturnAddressReg), st, junk);
System *sys = tc->getSystemPtr();
StringWrap name(sys->name());
static CPA *_cpa;
- std::map<std::string, SymbolTable*> userApp;
+ std::map<std::string, Loader::SymbolTable*> userApp;
public:
static CPA *cpa() { return _cpa; }
#include "libfdt.h"
#include "sim/byteswap.hh"
+namespace Loader
+{
+
DtbFile::DtbFile(const std::string &filename) :
ImageFile(ImageFileDataPtr(new ImageFileData(filename)))
{
else
return {{ "data", 0, fileData, length }};
}
+
+} // namespace Loader
#include "base/loader/image_file.hh"
+namespace Loader
+{
+
/** @file
* This implements an image file format to support loading
* and modifying flattened device tree blobs for use with
MemoryImage buildImage() const override;
};
+} // namespace Loader
+
#endif //__BASE_LOADER_DTB_FILE_HH__
#include "gelf.h"
#include "sim/byteswap.hh"
+namespace Loader
+{
+
ObjectFile *
ElfObjectFormat::load(ImageFileDataPtr ifd)
{
// Patch segments with the bias_addr.
image.offset(bias_addr);
}
+
+} // namespace Loader
#include "base/loader/object_file.hh"
#include "gelf.h"
+namespace Loader
+{
+
class ElfObjectFormat : public ObjectFileFormat
{
public:
*/
void setInterpDir(const std::string &dirname);
+} // namespace Loader
+
#endif // __BASE_LOADER_ELF_OBJECT_HH__
#include "base/loader/image_file_data.hh"
#include "base/loader/memory_image.hh"
+namespace Loader
+{
+
class ImageFile
{
protected:
virtual MemoryImage buildImage() const = 0;
};
+} // namespace Loader
+
#endif // __BASE_LOADER_IMAGE_FILE_HH__
#include "base/logging.hh"
+namespace Loader
+{
+
static bool
hasGzipMagic(int fd)
{
{
munmap((void *)_data, _len);
}
+
+} // namespace Loader
#include <memory>
#include <string>
+namespace Loader
+{
+
class ImageFileData
{
private:
typedef std::shared_ptr<ImageFileData> ImageFileDataPtr;
+} // namespace Loader
+
#endif // __BASE_LOADER_IMAGE_FILE_DATA_HH__
#include "base/loader/image_file_data.hh"
#include "base/loader/small_image_file.test.hh"
+using namespace Loader;
+
TEST(ImageFileDataTest, SimpleImage)
{
/*
#include "base/loader/memory_image.hh"
#include "mem/port_proxy.hh"
+namespace Loader
+{
+
bool
MemoryImage::writeSegment(const Segment &seg, const PortProxy &proxy) const
{
seg.base = mapper(seg.base);
return *this;
}
+
+} // namespace Loader
class PortProxy;
+namespace Loader
+{
+
class MemoryImage
{
public:
return os;
}
+} // namespace Loader
#endif // __BASE_LOADER_MEMORY_IMAGE_HH__
#include <vector>
#include "base/loader/raw_image.hh"
-#include "base/loader/symtab.hh"
-#include "mem/port_proxy.hh"
-using namespace std;
+namespace Loader
+{
ObjectFile::ObjectFile(ImageFileDataPtr ifd) : ImageFile(ifd) {}
-namespace {
+namespace
+{
typedef std::vector<ObjectFileFormat *> ObjectFileFormatList;
return nullptr;
}
+
+} // namespace Loader
#include "base/logging.hh"
#include "base/types.hh"
-class SymbolTable;
-
-class ObjectFile : public ImageFile
+namespace Loader
{
- public:
- enum Arch {
- UnknownArch,
- SPARC64,
- SPARC32,
- Mips,
- X86_64,
- I386,
- Arm64,
- Arm,
- Thumb,
- Power,
- Riscv64,
- Riscv32
- };
+enum Arch {
+ UnknownArch,
+ SPARC64,
+ SPARC32,
+ Mips,
+ X86_64,
+ I386,
+ Arm64,
+ Arm,
+ Thumb,
+ Power,
+ Riscv64,
+ Riscv32
+};
- enum OpSys {
- UnknownOpSys,
- Tru64,
- Linux,
- Solaris,
- LinuxArmOABI,
- FreeBSD
- };
+enum OpSys {
+ UnknownOpSys,
+ Tru64,
+ Linux,
+ Solaris,
+ LinuxArmOABI,
+ FreeBSD
+};
+
+class SymbolTable;
+class ObjectFile : public ImageFile
+{
protected:
Arch arch = UnknownArch;
OpSys opSys = UnknownOpSys;
ObjectFile *createObjectFile(const std::string &fname, bool raw=false);
+} // namespace Loader
+
#endif // __BASE_LOADER_OBJECT_FILE_HH__
#include "base/loader/object_file.hh"
+namespace Loader
+{
+
class RawImage: public ObjectFile
{
public:
}
};
-
+} // namespace Loader
#endif // __BASE_LOADER_RAW_IMAGE_HH__
using namespace std;
+namespace Loader
+{
+
SymbolTable *debugSymbolTable = NULL;
void
insert(addr, symbol);
}
}
+
+} // namespace Loader
#include "base/types.hh"
#include "sim/serialize.hh"
+namespace Loader
+{
+
class SymbolTable
{
public:
/// global one has worked well enough.
extern SymbolTable *debugSymbolTable;
+} // namespace Loader
+
#endif // __SYMTAB_HH__
void
BaseCPU::traceFunctionsInternal(Addr pc)
{
- if (!debugSymbolTable)
+ if (!Loader::debugSymbolTable)
return;
// if pc enters different function, print new function symbol and
// update saved range. Otherwise do nothing.
if (pc < currentFunctionStart || pc >= currentFunctionEnd) {
string sym_str;
- bool found = debugSymbolTable->findNearestSymbol(pc, sym_str,
- currentFunctionStart,
- currentFunctionEnd);
+ bool found = Loader::debugSymbolTable->findNearestSymbol(
+ pc, sym_str, currentFunctionStart, currentFunctionEnd);
if (!found) {
// no symbol found: use addr as label
std::string sym_str;
Addr sym_addr;
Addr cur_pc = pc.instAddr();
- if (debugSymbolTable && Debug::ExecSymbol &&
+ if (Loader::debugSymbolTable && Debug::ExecSymbol &&
(!FullSystem || !inUserMode(thread)) &&
- debugSymbolTable->findNearestSymbol(cur_pc, sym_str, sym_addr)) {
+ Loader::debugSymbolTable->findNearestSymbol(
+ cur_pc, sym_str, sym_addr)) {
if (cur_pc != sym_addr)
sym_str += csprintf("+%d",cur_pc - sym_addr);
outs << "@" << sym_str;
//
outs << setw(26) << left;
- outs << inst->disassemble(cur_pc, debugSymbolTable);
+ outs << inst->disassemble(cur_pc, Loader::debugSymbolTable);
if (ran) {
outs << " : ";
{ }
void
-ProfileNode::dump(const string &symbol, uint64_t id, const SymbolTable *symtab,
- ostream &os) const
+ProfileNode::dump(const string &symbol, uint64_t id,
+ const Loader::SymbolTable *symtab, ostream &os) const
{
ccprintf(os, "%#x %s %d ", id, symbol, count);
ChildList::const_iterator i, end = children.end();
i->second->clear();
}
-FunctionProfile::FunctionProfile(const SymbolTable *_symtab)
+FunctionProfile::FunctionProfile(const Loader::SymbolTable *_symtab)
: reset(0), symtab(_symtab)
{
reset = new MakeCallback<FunctionProfile, &FunctionProfile::clear>(this);
ProfileNode();
void dump(const std::string &symbol, uint64_t id,
- const SymbolTable *symtab, std::ostream &os) const;
+ const Loader::SymbolTable *symtab, std::ostream &os) const;
void clear();
};
{
private:
Callback *reset;
- const SymbolTable *symtab;
+ const Loader::SymbolTable *symtab;
ProfileNode top;
std::map<Addr, Counter> pc_count;
TheISA::StackTrace trace;
public:
- FunctionProfile(const SymbolTable *symtab);
+ FunctionProfile(const Loader::SymbolTable *symtab);
~FunctionProfile();
ProfileNode *consume(ThreadContext *tc, const StaticInstPtr &inst);
}
std::string
- generateDisassembly(Addr pc, const SymbolTable *symtab) const override
+ generateDisassembly(Addr pc,
+ const Loader::SymbolTable *symtab) const override
{
return mnemonic;
}
}
const string &
-StaticInst::disassemble(Addr pc, const SymbolTable *symtab) const
+StaticInst::disassemble(Addr pc, const Loader::SymbolTable *symtab) const
{
if (!cachedDisassembly)
cachedDisassembly = new string(generateDisassembly(pc, symtab));
class ExecContext;
+namespace Loader
+{
class SymbolTable;
+} // namespace Loader
-namespace Trace {
- class InstRecord;
-}
+namespace Trace
+{
+class InstRecord;
+} // namespace Trace
/**
* Base, ISA-independent static instruction class.
* Internal function to generate disassembly string.
*/
virtual std::string
- generateDisassembly(Addr pc, const SymbolTable *symtab) const = 0;
+ generateDisassembly(Addr pc, const Loader::SymbolTable *symtab) const = 0;
/// Constructor.
/// It's important to initialize everything here to a sane
* should not be cached, this function should be overridden directly.
*/
virtual const std::string &disassemble(Addr pc,
- const SymbolTable *symtab = 0) const;
+ const Loader::SymbolTable *symtab=nullptr) const;
/**
* Print a separator separated list of this instruction's set flag
{
System *system = tc->getSystemPtr();
const ByteOrder bo = system->getGuestByteOrder();
- const SymbolTable *symtab = system->workload->symtab(tc);
+ const auto *symtab = system->workload->symtab(tc);
PortProxy &proxy = tc->getVirtProxy();
Addr addr_lb = 0, addr_lb_len = 0, addr_first = 0, addr_next = 0;
if (file == "")
return;
- auto *object = createObjectFile(file, true);
+ auto *object = Loader::createObjectFile(file, true);
fatal_if(!object, "%s: Could not load %s.", name(), file);
- panic_if(!object->loadGlobalSymbols(debugSymbolTable),
+ panic_if(!object->loadGlobalSymbols(Loader::debugSymbolTable),
"%s: Could not load symbols from %s.", name(), file);
- MemoryImage image = object->buildImage();
+ Loader::MemoryImage image = object->buildImage();
AddrRange image_range(image.minAddr(), image.maxAddr());
if (!range.contains(image_range.start())) {
{
py::module m = m_native.def_submodule("loader");
- m.def("setInterpDir", &setInterpDir);
+ m.def("setInterpDir", &Loader::setInterpDir);
}
void
KernelWorkload::KernelWorkload(const Params &p) : Workload(&p), _params(p),
_loadAddrMask(p.load_addr_mask), _loadAddrOffset(p.load_addr_offset),
- kernelSymtab(new SymbolTable), commandLine(p.command_line)
+ kernelSymtab(new Loader::SymbolTable), commandLine(p.command_line)
{
- if (!debugSymbolTable)
- debugSymbolTable = new SymbolTable;
+ if (!Loader::debugSymbolTable)
+ Loader::debugSymbolTable = new Loader::SymbolTable;
- kernelObj = createObjectFile(params().object_file);
+ kernelObj = Loader::createObjectFile(params().object_file);
inform("kernel located at: %s", params().object_file);
fatal_if(!kernelObj,
fatal_if(!kernelObj->loadLocalSymbols(kernelSymtab),
"Could not load kernel local symbols.");
- fatal_if(!kernelObj->loadGlobalSymbols(debugSymbolTable),
+ fatal_if(!kernelObj->loadGlobalSymbols(Loader::debugSymbolTable),
"Could not load kernel symbols.");
- fatal_if(!kernelObj->loadLocalSymbols(debugSymbolTable),
+ fatal_if(!kernelObj->loadLocalSymbols(Loader::debugSymbolTable),
"Could not load kernel local symbols.");
// Loading only needs to happen once and after memory system is
for (int ker_idx = 0; ker_idx < p.extras.size(); ker_idx++) {
const std::string &obj_name = p.extras[ker_idx];
const bool raw = extras_addrs[ker_idx] != MaxAddr;
- ObjectFile *obj = createObjectFile(obj_name, raw);
+ auto *obj = Loader::createObjectFile(obj_name, raw);
fatal_if(!obj, "Failed to build additional kernel object '%s'.\n",
obj_name);
extras.push_back(obj);
#include <vector>
#include "base/loader/object_file.hh"
+#include "base/loader/symtab.hh"
#include "base/types.hh"
#include "params/KernelWorkload.hh"
#include "sim/workload.hh"
-class SymbolTable;
class System;
class KernelWorkload : public Workload
protected:
const Params &_params;
- MemoryImage image;
+ Loader::MemoryImage image;
/** Mask that should be anded for binary/symbol loading.
* This allows one two different OS requirements for the same ISA to be
Addr _start, _end;
- std::vector<ObjectFile *> extras;
+ std::vector<Loader::ObjectFile *> extras;
- ObjectFile *kernelObj = nullptr;
- SymbolTable *kernelSymtab = nullptr;
+ Loader::ObjectFile *kernelObj = nullptr;
+ Loader::SymbolTable *kernelSymtab = nullptr;
const std::string commandLine;
~KernelWorkload();
Addr getEntry() const override { return kernelObj->entryPoint(); }
- ObjectFile::Arch getArch() const override { return kernelObj->getArch(); }
- const SymbolTable *
+ Loader::Arch
+ getArch() const override
+ {
+ return kernelObj->getArch();
+ }
+
+ const Loader::SymbolTable *
symtab(ThreadContext *tc) override
{
return kernelSymtab;
}
Process *
-Process::tryLoaders(ProcessParams *params, ObjectFile *obj_file)
+Process::tryLoaders(ProcessParams *params, ::Loader::ObjectFile *obj_file)
{
for (auto &loader: process_loaders()) {
Process *p = loader->load(params, obj_file);
}
Process::Process(ProcessParams *params, EmulationPageTable *pTable,
- ObjectFile *obj_file)
+ ::Loader::ObjectFile *obj_file)
: SimObject(params), system(params->system),
useArchPT(params->useArchPT),
kvmInSE(params->kvmInSE),
image = objFile->buildImage();
- if (!debugSymbolTable) {
- debugSymbolTable = new SymbolTable();
- if (!objFile->loadGlobalSymbols(debugSymbolTable) ||
- !objFile->loadLocalSymbols(debugSymbolTable) ||
- !objFile->loadWeakSymbols(debugSymbolTable)) {
- delete debugSymbolTable;
- debugSymbolTable = nullptr;
+ if (!::Loader::debugSymbolTable) {
+ ::Loader::debugSymbolTable = new ::Loader::SymbolTable();
+ if (!objFile->loadGlobalSymbols(::Loader::debugSymbolTable) ||
+ !objFile->loadLocalSymbols(::Loader::debugSymbolTable) ||
+ !objFile->loadWeakSymbols(::Loader::debugSymbolTable)) {
+ delete ::Loader::debugSymbolTable;
+ ::Loader::debugSymbolTable = nullptr;
}
}
}
void
Process::updateBias()
{
- ObjectFile *interp = objFile->getInterpreter();
+ auto *interp = objFile->getInterpreter();
if (!interp || !interp->relocatable())
return;
interp->updateBias(ld_bias);
}
-ObjectFile *
+Loader::ObjectFile *
Process::getInterpreter()
{
return objFile->getInterpreter();
Addr
Process::getBias()
{
- ObjectFile *interp = getInterpreter();
+ auto *interp = getInterpreter();
return interp ? interp->bias() : objFile->bias();
}
Addr
Process::getStartPC()
{
- ObjectFile *interp = getInterpreter();
+ auto *interp = getInterpreter();
return interp ? interp->entryPoint() : objFile->entryPoint();
}
executable = cmd[0];
}
- ObjectFile *obj_file = createObjectFile(executable);
+ auto *obj_file = Loader::createObjectFile(executable);
fatal_if(!obj_file, "Cannot load object file %s.", executable);
Process *process = Process::tryLoaders(this, obj_file);
#include "sim/mem_state.hh"
#include "sim/sim_object.hh"
+namespace Loader
+{
+class ObjectFile;
+} // namespace Loader
+
struct ProcessParams;
class EmulatedDriver;
-class ObjectFile;
class EmulationPageTable;
class SyscallDesc;
class SyscallReturn;
{
public:
Process(ProcessParams *params, EmulationPageTable *pTable,
- ObjectFile *obj_file);
+ ::Loader::ObjectFile *obj_file);
void serialize(CheckpointOut &cp) const override;
void unserialize(CheckpointIn &cp) override;
void updateBias();
Addr getBias();
Addr getStartPC();
- ObjectFile *getInterpreter();
+ ::Loader::ObjectFile *getInterpreter();
// override of virtual SimObject method: register statistics
void regStats() override;
* error like file IO errors, etc., those should fail non-silently
* with a panic or fail as normal.
*/
- virtual Process *load(ProcessParams *params, ObjectFile *obj_file) = 0;
+ virtual Process *load(ProcessParams *params,
+ ::Loader::ObjectFile *obj_file) = 0;
};
// Try all the Loader instance's "load" methods one by one until one is
// successful. If none are, complain and fail.
- static Process *tryLoaders(ProcessParams *params, ObjectFile *obj_file);
+ static Process *tryLoaders(ProcessParams *params,
+ ::Loader::ObjectFile *obj_file);
- ObjectFile *objFile;
- MemoryImage image;
- MemoryImage interpImage;
+ ::Loader::ObjectFile *objFile;
+ ::Loader::MemoryImage image;
+ ::Loader::MemoryImage interpImage;
std::vector<std::string> argv;
std::vector<std::string> envp;
std::string executable;
DPRINTF(Loader, "Loaded symbol: %s @ %#llx\n", symbol, addr);
tc->getSystemPtr()->workload->insertSymbol(addr, symbol);
- debugSymbolTable->insert(addr,symbol);
+ Loader::debugSymbolTable->insert(addr, symbol);
}
uint64_t
if (p->interpImage.contains(tc->pcState().instAddr())) {
std::shared_ptr<FDEntry> fdep = (*p->fds)[tgt_fd];
auto ffdp = std::dynamic_pointer_cast<FileFDEntry>(fdep);
- ObjectFile *lib = createObjectFile(p->checkPathRedirect(
+ auto *lib = Loader::createObjectFile(p->checkPathRedirect(
ffdp->getFileName()));
DPRINTF_SYSCALL(Verbose, "Loading symbols from %s\n",
ffdp->getFileName());
if (lib) {
- lib->loadAllSymbols(debugSymbolTable,
+ lib->loadAllSymbols(Loader::debugSymbolTable,
lib->buildImage().minAddr(), start);
}
}
class BaseRemoteGDB;
class KvmVM;
-class ObjectFile;
class ThreadContext;
class System : public SimObject, public PCEventScope
System *system = nullptr;
virtual Addr getEntry() const = 0;
- virtual ObjectFile::Arch getArch() const = 0;
+ virtual Loader::Arch getArch() const = 0;
- virtual const SymbolTable *symtab(ThreadContext *tc) = 0;
+ virtual const Loader::SymbolTable *symtab(ThreadContext *tc) = 0;
virtual bool insertSymbol(Addr address, const std::string &symbol) = 0;
/** @{ */
*/
template <class T, typename... Args>
T *
- addFuncEvent(const SymbolTable *symtab, const char *lbl,
+ addFuncEvent(const Loader::SymbolTable *symtab, const char *lbl,
const std::string &desc, Args... args)
{
Addr addr M5_VAR_USED = 0; // initialize only to avoid compiler warning
template <class T>
T *
- addFuncEvent(const SymbolTable *symtab, const char *lbl)
+ addFuncEvent(const Loader::SymbolTable *symtab, const char *lbl)
{
return addFuncEvent<T>(symtab, lbl, lbl);
}
template <class T, typename... Args>
T *
- addFuncEventOrPanic(const SymbolTable *symtab, const char *lbl,
+ addFuncEventOrPanic(const Loader::SymbolTable *symtab, const char *lbl,
Args... args)
{
T *e = addFuncEvent<T>(symtab, lbl, std::forward<Args>(args)...);
if (argc != 2 && argc != 3)
panic("usage: %s <filename> <symbol>\n", argv[0]);
- ObjectFile *obj = createObjectFile(argv[1]);
+ auto *obj = Loader::createObjectFile(argv[1]);
if (!obj)
panic("file not found\n");
- SymbolTable symtab;
+ Loader::SymbolTable symtab;
obj->loadGlobalSymbols(&symtab);
obj->loadLocalSymbols(&symtab);
if (argc == 2) {
- SymbolTable::ATable::const_iterator i = symtab.getAddrTable().begin();
- SymbolTable::ATable::const_iterator end = symtab.getAddrTable().end();
+ Loader::SymbolTable::ATable::const_iterator i =
+ symtab.getAddrTable().begin();
+ Loader::SymbolTable::ATable::const_iterator end =
+ symtab.getAddrTable().end();
while (i != end) {
cprintf("%#x %s\n", i->first, i->second);
++i;
int
main(int argc, char *argv[])
{
- SymbolTable symtab;
+ Loader::SymbolTable symtab;
if (argc != 3)
usage(argv[0]);