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);
115 panic(
"Copy Misc. Regs Not Implemented Yet\n");
164 static inline uint8_t
169 it.bottom2 = psr.it1;
208 static inline uint32_t
210 uint32_t opc1, uint32_t
opc2)
212 return (isRead << 0) |
222 uint32_t &crn, uint32_t &opc1, uint32_t &
opc2)
224 isRead = (iss >> 0) & 0x1;
225 crm = (iss >> 1) & 0xF;
227 crn = (iss >> 10) & 0xF;
228 opc1 = (iss >> 14) & 0x7;
229 opc2 = (iss >> 17) & 0x7;
232 static inline uint32_t
236 return (isRead << 0) |
243 static inline uint32_t
258 HDCR hdcr, HSTR hstr, HCPTR hcptr, uint32_t iss);
261 HDCR hdcr, HSTR hstr, HCPTR hcptr, uint32_t iss);
264 HCR hcr, uint32_t iss);
269 bool isRead, CPTR cptr, HCR hcr,
bool * isVfpNeon);
298 CPSR cpsr, SCR scr, NSACR nsacr,
299 bool checkSecurity =
true);
static ExceptionLevel currEL(ThreadContext *tc)
PCState buildRetPC(const PCState &curPC, const PCState &callPC)
virtual MiscReg readMiscRegNoEffect(int misc_reg) const =0
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)
If you want a reference counting pointer to a mutable object, create it like this: ...
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)
static bool inPrivilegedMode(CPSR cpsr)
int decodePhysAddrRange64(uint8_t pa_enc)
Returns the n.
bool ELIs64(ThreadContext *tc, ExceptionLevel el)
bool isBigEndian64(ThreadContext *tc)
void zeroRegisters(TC *tc)
Function to insure ISA semantics about 0 registers.
uint8_t encodePhysAddrRange64(int pa_size)
Returns the encoding corresponding to the specified n.
static OperatingMode currOpMode(ThreadContext *tc)
void startupCPU(ThreadContext *tc, int cpuId)
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)
void advancePC(PCState &pc, const StaticInstPtr &inst)
virtual void activate()=0
Set the status to Active.
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)
bool msrMrs64TrapToMon(const MiscRegIndex miscReg, CPTR cptr, ExceptionLevel el, bool *isVfpNeon)
void skipFunction(ThreadContext *tc)
bool decodeMrsMsrBankedReg(uint8_t sysM, bool r, bool &isIntReg, int ®Idx, CPSR cpsr, SCR scr, NSACR nsacr, bool checkSecurity)
bool msrMrs64TrapToSup(const MiscRegIndex miscReg, ExceptionLevel el, CPACR cpacr)
virtual MiscReg readMiscReg(int misc_reg)=0
bool longDescFormatInUse(ThreadContext *tc)
uint64_t getExecutingAsid(ThreadContext *tc)
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)
void initCPU(ThreadContext *tc, int cpuId)
Addr purifyTaggedAddr(Addr addr, ThreadContext *tc, ExceptionLevel el, TTBCR tcr)
Removes the tag from tagged addresses if that mode is enabled.
bool mcrMrc15TrapToHyp(const MiscRegIndex miscReg, HCR hcr, CPSR cpsr, SCR scr, HDCR hdcr, HSTR hstr, HCPTR hcptr, uint32_t iss)
bool inAArch64(ThreadContext *tc)
uint32_t getMPIDR(ArmSystem *arm_sys, ThreadContext *tc)
bool msrMrs64TrapToHyp(const MiscRegIndex miscReg, ExceptionLevel el, bool isRead, CPTR cptr, HCR hcr, bool *isVfpNeon)
bool inSecureState(ThreadContext *tc)
static uint32_t msrMrs64IssBuild(bool isRead, uint32_t op0, uint32_t op1, uint32_t crn, uint32_t crm, uint32_t op2, IntRegIndex rt)
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)