const bool have_virtualization = ArmSystem::haveVirtualization(tc);
const bool have_security = ArmSystem::haveSecurity(tc);
const bool is_secure = inSecureState(tc);
- const ExceptionLevel cur_el = opModeToEL(currOpMode(tc));
+ const ExceptionLevel cur_el = currEL(tc);
if (cur_el == EL0 && ELIs64(tc, EL1))
return checkFPAdvSIMDEnabled64(tc, cpsr, cpacr);
CPSR cpsr = Cpsr;
CPSR spsr = Spsr;
- ExceptionLevel curr_el = opModeToEL((OperatingMode) (uint8_t) cpsr.mode);
+ ExceptionLevel curr_el = currEL(cpsr);
switch (curr_el) {
case EL3:
newPc = xc->tcBase()->readMiscReg(MISCREG_ELR_EL3);
NextAArch64 = !new_cpsr.width;
NextItState = itState(new_cpsr);
NPC = purifyTaggedAddr(newPc, xc->tcBase(),
- opModeToEL((OperatingMode) (uint8_t) new_cpsr.mode));
+ currEL(new_cpsr));
LLSCLock = 0; // Clear exclusive monitor
SevMailbox = 1; //Set Event Register
auto tc = xc->tcBase();
if (badMode32(tc, static_cast<OperatingMode>(regMode))) {
- return undefinedFault32(tc, opModeToEL(currOpMode(tc)));
+ return undefinedFault32(tc, currEL(tc));
}
CPSR cpsr = Cpsr;
bool secure = ArmSystem::haveSecurity(tc) && !scr.ns;
- switch (opModeToEL((OperatingMode) (uint8_t) cpsr.mode)) {
+ switch (currEL(cpsr)) {
case EL0:
return secure ? miscRegInfo[reg][MISCREG_USR_S_RD] :
miscRegInfo[reg][MISCREG_USR_NS_RD];
// Check for SP_EL0 access while SPSEL == 0
if ((reg == MISCREG_SP_EL0) && (tc->readMiscReg(MISCREG_SPSEL) == 0))
return false;
- ExceptionLevel el = opModeToEL((OperatingMode) (uint8_t) cpsr.mode);
+ ExceptionLevel el = currEL(cpsr);
if (reg == MISCREG_DAIF) {
SCTLR sctlr = tc->readMiscReg(MISCREG_SCTLR_EL1);
if (el == EL0 && !sctlr.uma)
const PMEVTYPER_t filter(this->filter);
const SCR scr(pmu.isa->readMiscRegNoEffect(MISCREG_SCR));
const CPSR cpsr(pmu.isa->readMiscRegNoEffect(MISCREG_CPSR));
- const ExceptionLevel el(opModeToEL((OperatingMode)(uint8_t)cpsr.mode));
+ const ExceptionLevel el(currEL(cpsr));
const bool secure(inSecureState(scr, cpsr));
switch (el) {
case S1CTran:
case S1S2NsTran:
case HypMode:
- return opModeToEL((OperatingMode)(uint8_t)cpsr.mode);
+ return currEL(cpsr);
default:
panic("Unknown translation mode!\n");
RegVal
readMPIDR(ArmSystem *arm_sys, ThreadContext *tc)
{
- CPSR cpsr = tc->readMiscReg(MISCREG_CPSR);
- const ExceptionLevel current_el =
- opModeToEL((OperatingMode) (uint8_t) cpsr.mode);
+ const ExceptionLevel current_el = currEL(tc);
const bool is_secure = isSecureBelowEL3(tc);
bool
isBigEndian64(ThreadContext *tc)
{
- switch (opModeToEL(currOpMode(tc))) {
+ switch (currEL(tc)) {
case EL3:
return ((SCTLR) tc->readMiscReg(MISCREG_SCTLR_EL3)).ee;
case EL2:
bool
SPAlignmentCheckEnabled(ThreadContext* tc)
{
- switch (opModeToEL(currOpMode(tc))) {
+ switch (currEL(tc)) {
case EL3:
return ((SCTLR) tc->readMiscReg(MISCREG_SCTLR_EL3)).sa;
case EL2: