CPSR cpsr = tc->readMiscRegNoEffect(MISCREG_CPSR);
// if HCR.TGE is set to 1, take to Hyp mode through Hyp Trap vector
- toHyp |= !inSecureState(scr, cpsr) && hcr.tge && (cpsr.el == EL0);
+ toHyp |= !inSecureState(scr, cpsr) && hcr.tge && (currEL(tc) == EL0);
return toHyp;
}
CPSR cpsr = tc->readMiscRegNoEffect(MISCREG_CPSR);
// if HCR.TGE is set to 1, take to Hyp mode through Hyp Trap vector
- toHyp |= !inSecureState(scr, cpsr) && hcr.tge && (cpsr.el == EL0);
+ toHyp |= !inSecureState(scr, cpsr) && hcr.tge && (currEL(tc) == EL0);
return toHyp;
}
ArmStaticInst::checkFPAdvSIMDEnabled64(ThreadContext *tc,
CPSR cpsr, CPACR cpacr) const
{
- const ExceptionLevel el = (ExceptionLevel) (uint8_t)cpsr.el;
+ const ExceptionLevel el = currEL(tc);
if ((el == EL0 && cpacr.fpen != 0x3) ||
(el == EL1 && !(cpacr.fpen & 0x1)))
return advSIMDFPAccessTrap64(EL1);
bool isWfe) const
{
Fault fault = NoFault;
- if (cpsr.el == EL0) {
+ ExceptionLevel curr_el = currEL(tc);
+
+ if (curr_el == EL0) {
fault = checkForWFxTrap32(tc, EL1, isWfe);
}
if ((fault == NoFault) &&
ArmSystem::haveEL(tc, EL2) && !inSecureState(scr, cpsr) &&
- ((cpsr.el == EL0) || (cpsr.el == EL1))) {
+ ((curr_el == EL0) || (curr_el == EL1))) {
fault = checkForWFxTrap32(tc, EL2, isWfe);
}
if ((fault == NoFault) &&
- ArmSystem::haveEL(tc, EL3) && cpsr.el != EL3) {
+ ArmSystem::haveEL(tc, EL3) && curr_el != EL3) {
fault = checkForWFxTrap32(tc, EL3, isWfe);
}
ArmStaticInst::checkSETENDEnabled(ThreadContext *tc, CPSR cpsr) const
{
bool setend_disabled(false);
- ExceptionLevel pstateEL = (ExceptionLevel)(uint8_t)(cpsr.el);
+ ExceptionLevel pstate_el = currEL(tc);
- if (pstateEL == EL2) {
+ if (pstate_el == EL2) {
setend_disabled = ((SCTLR)tc->readMiscRegNoEffect(MISCREG_HSCTLR)).sed;
} else {
// Please note: in the armarm pseudocode there is a distinction
setend_disabled = ((SCTLR)tc->readMiscRegNoEffect(banked_sctlr)).sed;
}
- return setend_disabled ? undefinedFault32(tc, pstateEL) :
+ return setend_disabled ? undefinedFault32(tc, pstate_el) :
NoFault;
}
/*
- * Copyright (c) 2009, 2012-2013, 2016 ARM Limited
+ * Copyright (c) 2009, 2012-2013, 2016, 2019 ARM Limited
* All rights reserved.
*
* The license below extends only to copyright in the software and shall
SCR scr;
HCR hcr;
hcr = tc->readMiscReg(MISCREG_HCR);
- ExceptionLevel el = (ExceptionLevel) ((uint32_t) cpsr.el);
+ ExceptionLevel el = currEL(tc);
bool cpsr_mask_bit, scr_routing_bit, scr_fwaw_bit, hcr_mask_override_bit;
if (!highest_el_is_64)