45 #ifndef __ARCH_ARM_UTILITY_HH__ 46 #define __ARCH_ARM_UTILITY_HH__ 90 case COND_LE:
return (n ^ v || z);
94 panic(
"Unhandled predicate condition: %d\n", code);
103 panic(
"Copy Misc. Regs Not Implemented Yet\n");
210 static inline uint8_t
215 it.bottom2 = psr.it1;
230 TCR tcr,
bool isInstr);
265 static inline uint32_t
267 uint32_t opc1, uint32_t
opc2)
269 return (isRead << 0) |
279 uint32_t &crn, uint32_t &opc1, uint32_t &
opc2)
281 isRead = (iss >> 0) & 0x1;
282 crm = (iss >> 1) & 0xF;
284 crn = (iss >> 10) & 0xF;
285 opc1 = (iss >> 14) & 0x7;
286 opc2 = (iss >> 17) & 0x7;
289 static inline uint32_t
293 return (isRead << 0) |
300 static inline uint32_t
318 HDCR hdcr, HSTR hstr, HCPTR hcptr, uint32_t iss);
321 HCR hcr, uint32_t iss);
348 CPSR cpsr, SCR scr, NSACR nsacr,
349 bool checkSecurity =
true);
#define panic(...)
This implements a cprintf based panic() function.
static ExceptionLevel currEL(ThreadContext *tc)
bool IsSecureEL2Enabled(ThreadContext *tc)
bool HaveVirtHostExt(ThreadContext *tc)
PCState buildRetPC(const PCState &curPC, const PCState &callPC)
static uint8_t itState(CPSR psr)
static uint32_t mcrrMrrcIssBuild(bool isRead, uint32_t crm, IntRegIndex rt, IntRegIndex rt2, uint32_t opc1)
bool mcrMrc14TrapToHyp(const MiscRegIndex miscReg, HCR hcr, CPSR cpsr, SCR scr, HDCR hdcr, HSTR hstr, HCPTR hcptr, uint32_t iss)
Addr purifyTaggedAddr(Addr addr, ThreadContext *tc, ExceptionLevel el, TCR tcr, bool isInstr)
Removes the tag from tagged addresses if that mode is enabled.
RegVal readMPIDR(ArmSystem *arm_sys, ThreadContext *tc)
This helper function is either returing the value of MPIDR_EL1 (by calling getMPIDR), or it is issuing a read to VMPIDR_EL2 (as it happens in virtualized systems)
ThreadContext is the external interface to all thread state for anything outside of the CPU...
bool testPredicate(uint32_t nz, uint32_t c, uint32_t v, ConditionCode code)
RegVal getMPIDR(ArmSystem *arm_sys, ThreadContext *tc)
This helper function is returing the value of MPIDR_EL1.
static bool inPrivilegedMode(CPSR cpsr)
int decodePhysAddrRange64(uint8_t pa_enc)
Returns the n.
bool HaveSecureEL2Ext(ThreadContext *tc)
bool ELIs64(ThreadContext *tc, ExceptionLevel el)
bool isBigEndian64(ThreadContext *tc)
uint8_t encodePhysAddrRange64(int pa_size)
Returns the encoding corresponding to the specified n.
static OperatingMode currOpMode(ThreadContext *tc)
int computeAddrTop(ThreadContext *tc, bool selbit, bool isInstr, TCR tcr, ExceptionLevel el)
ByteOrder byteOrder(ThreadContext *tc)
ExceptionLevel s1TranslationRegime(ThreadContext *tc, ExceptionLevel el)
bool mcrMrc15TrapToHyp(const MiscRegIndex miscReg, ThreadContext *tc, uint32_t iss)
uint64_t getArgument(ThreadContext *tc, int &number, uint16_t size, bool fp)
bool mcrrMrrc15TrapToHyp(const MiscRegIndex miscReg, CPSR cpsr, SCR scr, HSTR hstr, HCR hcr, uint32_t iss)
static int decodeMrsMsrBankedIntRegIndex(uint8_t sysM, bool r)
bool SPAlignmentCheckEnabled(ThreadContext *tc)
static ExceptionLevel opModeToEL(OperatingMode mode)
bool ELIs32(ThreadContext *tc, ExceptionLevel el)
void advancePC(PCState &pc, const StaticInstPtr &inst)
std::pair< bool, bool > ELUsingAArch32K(ThreadContext *tc, ExceptionLevel el)
This function checks whether selected EL provided as an argument is using the AArch32 ISA...
Defines global host-dependent types: Counter, Tick, and (indirectly) {int,uint}{8,16,32,64}_t.
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.
Addr roundPage(Addr addr)
static void copyMiscRegs(ThreadContext *src, ThreadContext *dest)
Addr truncPage(Addr addr)
static bool inUserMode(CPSR cpsr)
void sendEvent(ThreadContext *tc)
Send an event (SEV) to a specific PE if there isn't already a pending event.
void skipFunction(ThreadContext *tc)
bool decodeMrsMsrBankedReg(uint8_t sysM, bool r, bool &isIntReg, int ®Idx, CPSR cpsr, SCR scr, NSACR nsacr, bool checkSecurity)
virtual RegVal readMiscRegNoEffect(RegIndex misc_reg) const =0
bool longDescFormatInUse(ThreadContext *tc)
uint64_t getExecutingAsid(ThreadContext *tc)
virtual void advancePC(TheISA::PCState &pcState) const =0
GenericISA::SimplePCState< MachInst > PCState
static void mcrMrcIssExtract(uint32_t iss, bool &isRead, uint32_t &crm, IntRegIndex &rt, uint32_t &crn, uint32_t &opc1, uint32_t &opc2)
bool inAArch64(ThreadContext *tc)
bool inSecureState(ThreadContext *tc)
bool ELIsInHost(ThreadContext *tc, ExceptionLevel el)
Returns true if the current exception level el is executing a Host OS or an application of a Host OS ...
static uint32_t msrMrs64IssBuild(bool isRead, uint32_t op0, uint32_t op1, uint32_t crn, uint32_t crm, uint32_t op2, IntRegIndex rt)
bool EL2Enabled(ThreadContext *tc)
static uint32_t mcrMrcIssBuild(bool isRead, uint32_t crm, IntRegIndex rt, uint32_t crn, uint32_t opc1, uint32_t opc2)
void copyRegs(ThreadContext *src, ThreadContext *dest)
bool badMode32(ThreadContext *tc, OperatingMode mode)
badMode is checking if the execution mode provided as an argument is valid and implemented for AArch3...
virtual RegVal readMiscReg(RegIndex misc_reg)=0
bool badMode(ThreadContext *tc, OperatingMode mode)
badMode is checking if the execution mode provided as an argument is valid and implemented.