}
bool
-isBigEndian64(ThreadContext *tc)
+isBigEndian64(const ThreadContext *tc)
{
switch (currEL(tc)) {
case EL3:
- return ((SCTLR) tc->readMiscReg(MISCREG_SCTLR_EL3)).ee;
+ return ((SCTLR) tc->readMiscRegNoEffect(MISCREG_SCTLR_EL3)).ee;
case EL2:
- return ((SCTLR) tc->readMiscReg(MISCREG_SCTLR_EL2)).ee;
+ return ((SCTLR) tc->readMiscRegNoEffect(MISCREG_SCTLR_EL2)).ee;
case EL1:
- return ((SCTLR) tc->readMiscReg(MISCREG_SCTLR_EL1)).ee;
+ return ((SCTLR) tc->readMiscRegNoEffect(MISCREG_SCTLR_EL1)).ee;
case EL0:
- return ((SCTLR) tc->readMiscReg(MISCREG_SCTLR_EL1)).e0e;
+ return ((SCTLR) tc->readMiscRegNoEffect(MISCREG_SCTLR_EL1)).e0e;
default:
panic("Invalid exception level");
break;
bool inAArch64(ThreadContext *tc);
static inline OperatingMode
-currOpMode(ThreadContext *tc)
+currOpMode(const ThreadContext *tc)
{
- CPSR cpsr = tc->readMiscReg(MISCREG_CPSR);
+ CPSR cpsr = tc->readMiscRegNoEffect(MISCREG_CPSR);
return (OperatingMode) (uint8_t) cpsr.mode;
}
static inline ExceptionLevel
-currEL(ThreadContext *tc)
+currEL(const ThreadContext *tc)
{
return opModeToEL(currOpMode(tc));
}
*/
bool ELIsInHost(ThreadContext *tc, ExceptionLevel el);
-bool isBigEndian64(ThreadContext *tc);
+bool isBigEndian64(const ThreadContext *tc);
/**
* badMode is checking if the execution mode provided as an argument is
*/
uint8_t encodePhysAddrRange64(int pa_size);
-inline ByteOrder byteOrder(ThreadContext *tc)
+inline ByteOrder byteOrder(const ThreadContext *tc)
{
return isBigEndian64(tc) ? BigEndianByteOrder : LittleEndianByteOrder;
};