58 using namespace Linux;
62 bootLoaders(), bootldr(nullptr),
63 _haveSecurity(p->have_security),
64 _haveLPAE(p->have_lpae),
65 _haveVirtualization(p->have_virtualization),
66 _haveCrypto(p->have_crypto),
67 _genericTimer(nullptr),
69 _resetAddr(p->auto_reset_addr ?
70 (kernelEntry & loadAddrMask) + loadAddrOffset :
72 _highestELIs64(p->highest_el_is_64),
73 _physAddrRange64(p->phys_addr_range_64),
74 _haveLargeAsid64(p->have_large_asid_64),
75 _haveSVE(p->have_sve),
77 _haveLSE(p->have_lse),
78 _havePAN(p->have_pan),
79 semihosting(p->semihosting),
80 multiProc(p->multi_proc)
91 for (
const auto &bl : p->boot_loader) {
92 std::unique_ptr<ObjectFile> obj;
95 fatal_if(!obj,
"Could not read bootloader: %s\n", bl);
107 fatal(
"Can't find a matching boot loader / kernel combination!");
113 "Bootloader entry point %#x overriding reset address %#x",
118 warn(
"Highest ARM exception-level set to AArch32 but bootloader " 119 "is for AArch64. Assuming you wanted these to match.\n");
122 warn(
"Highest ARM exception-level set to AArch64 but bootloader " 123 "is for AArch32. Assuming you wanted these to match.\n");
162 fatal(
"flags_addr must be set with bootloader\n");
164 if (!p->gic_cpu_addr && is_gic_v2)
165 fatal(
"gic_cpu_addr must be set with bootloader\n");
167 for (
int i = 0;
i < threadContexts.size();
i++) {
172 threadContexts[
i]->setIntReg(4,
params()->gic_cpu_addr);
173 threadContexts[
i]->setIntReg(5,
params()->flags_addr);
175 inform(
"Using kernel entry physical address at %#x\n",
218 if (bl->getArch() == obj->
getArch())
261 warn(
"Unimplemented Exception Level\n");
298 uint32_t
op, uint64_t param)
306 uint32_t
op, uint32_t param)
313 ArmSystemParams::create()
329 GenericArmSystemParams::create()
ObjectFile * getBootLoader(ObjectFile *const obj)
Get a boot loader that matches the kernel.
virtual System * getSystemPtr()=0
const uint8_t _physAddrRange64
Supported physical address range in bits if the highest implemented exception level is 64 bits (ARMv8...
virtual void initState()
Initialise the system.
#define fatal(...)
This implements a cprintf based fatal() function.
Addr physAddrMask() const
Returns the physical address mask.
bool haveSecurity() const
Returns true if this system implements the Security Extensions.
bool write(const PortProxy &proxy) const
ObjectFile * createObjectFile(const std::string &fname, bool raw)
bool highestELIs64() const
Returns true if the register width of the highest implemented exception level is 64 bits (ARMv8) ...
bool FullSystem
The FullSystem variable can be used to determine the current mode of simulation.
const Addr _resetAddr
Reset address (ARMv8)
static uint64_t callSemihosting64(ThreadContext *tc, uint32_t op, uint64_t param)
Make a Semihosting call from aarch64.
SymbolTable * debugSymbolTable
Global unified debugging symbol table (for target).
Overload hash function for BasicBlockRange type.
ThreadContext is the external interface to all thread state for anything outside of the CPU...
ObjectFile * bootldr
Pointer to the bootloader object.
static bool haveEL(ThreadContext *tc, ExceptionLevel el)
Return true if the system implements a specific exception level.
PortProxy physProxy
Port to physical memory used for writing object files into ram at boot.
void initState() override
initState() is called on each SimObject when not restoring from a checkpoint.
virtual MemoryImage buildImage() const =0
std::vector< std::unique_ptr< ObjectFile > > bootLoaders
Bootloaders.
bool _highestELIs64
True if the register width of the highest implemented exception level is 64 bits (ARMv8) ...
Addr loadAddrMask
Mask that should be anded for binary/symbol loading.
static ArmSystem * getArmSystem(System *sys)
Casts the provided System object into a valid ArmSystem, it fails otherwise.
BaseGic * getGIC() const
Get a pointer to the system's GIC.
uint32_t call32(ThreadContext *tc, uint32_t op, uint32_t param)
Perform an Arm Semihosting call from aarch32 code.
static uint32_t callSemihosting32(ThreadContext *tc, uint32_t op, uint32_t param)
Make a Semihosting call from aarch32.
#define warn_if(cond,...)
Conditional warning macro that checks the supplied condition and only prints a warning if the conditi...
std::vector< ThreadContext * > threadContexts
Addr kernelEntry
Entry point in the kernel to start at.
#define fatal_if(cond,...)
Conditional fatal macro that checks the supplied condition and only causes a fatal error if the condi...
Linux::DebugPrintkEvent * debugPrintkEvent
PC based event to skip the dprink() call and emulate its functionality.
bool haveVirtualization() const
Returns true if this system implements the virtualization Extensions.
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.
ObjectFile * kernel
Object pointer for the kernel code.
uint8_t physAddrRange() const
Returns the supported physical address range in bits.
ExceptionLevel highestEL() const
Returns the highest implemented exception level.
ArmSemihosting *const semihosting
True if the Semihosting interface is enabled.
Implementation of a GICv2.
virtual void initState()
Initialise the system.
TranslatingPortProxy Object Declaration for FS.
Addr loadAddrOffset
Offset that should be used for binary/symbol loading.
bool haveLargeAsid64() const
Returns true if ASID is 16 bits in AArch64 (ARMv8)
bool haveSemihosting() const
Is Arm Semihosting support enabled?
const Params * params() const
Addr resetAddr() const
Returns the reset address if the highest implemented exception level is 64 bits (ARMv8) ...
virtual bool loadGlobalSymbols(SymbolTable *symtab, Addr base=0, Addr offset=0, Addr mask=MaxAddr)
uint64_t call64(ThreadContext *tc, uint32_t op, uint64_t param)
Perform an Arm Semihosting call from aarch64 code.
bool haveLPAE() const
Returns true if this system implements the Large Physical Address Extension.
virtual bool supportsVersion(GicVersion version)=0
Check if version supported.